From 1c03ed220c5b68b523a39cd23e3811b6c58bb58a Mon Sep 17 00:00:00 2001 From: Mattia-gh-action Date: Tue, 25 May 2021 15:15:27 +0000 Subject: [PATCH] Automated package and docs --- dist/diglettk.js | 2901 +------------------------ docs/documentation/MPRManager.html | 18 +- docs/documentation/global.html | 2 +- docs/documentation/mprManager.js.html | 69 +- docs/documentation/mprView.js.html | 1 - docs/examples/diglettk.js | 2901 +------------------------ 6 files changed, 22 insertions(+), 5870 deletions(-) diff --git a/dist/diglettk.js b/dist/diglettk.js index 68e084a..c53563a 100644 --- a/dist/diglettk.js +++ b/dist/diglettk.js @@ -1,2900 +1 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["diglettk"] = factory(); - else - root["diglettk"] = factory(); -})(window, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./src/index.js"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./node_modules/blueimp-md5/js/md5.js": -/*!********************************************!*\ - !*** ./node_modules/blueimp-md5/js/md5.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/* global define */\n\n/* eslint-disable strict */\n\n;(function ($) {\n 'use strict'\n\n /**\n * Add integers, wrapping at 2^32.\n * This uses 16-bit operations internally to work around bugs in interpreters.\n *\n * @param {number} x First integer\n * @param {number} y Second integer\n * @returns {number} Sum\n */\n function safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff)\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16)\n return (msw << 16) | (lsw & 0xffff)\n }\n\n /**\n * Bitwise rotate a 32-bit number to the left.\n *\n * @param {number} num 32-bit number\n * @param {number} cnt Rotation count\n * @returns {number} Rotated number\n */\n function bitRotateLeft(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }\n\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} q q\n * @param {number} a a\n * @param {number} b b\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b)\n }\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} a a\n * @param {number} b b\n * @param {number} c c\n * @param {number} d d\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5ff(a, b, c, d, x, s, t) {\n return md5cmn((b & c) | (~b & d), a, b, x, s, t)\n }\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} a a\n * @param {number} b b\n * @param {number} c c\n * @param {number} d d\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5gg(a, b, c, d, x, s, t) {\n return md5cmn((b & d) | (c & ~d), a, b, x, s, t)\n }\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} a a\n * @param {number} b b\n * @param {number} c c\n * @param {number} d d\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t)\n }\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} a a\n * @param {number} b b\n * @param {number} c c\n * @param {number} d d\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t)\n }\n\n /**\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n *\n * @param {Array} x Array of little-endian words\n * @param {number} len Bit length\n * @returns {Array} MD5 Array\n */\n function binlMD5(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << len % 32\n x[(((len + 64) >>> 9) << 4) + 14] = len\n\n var i\n var olda\n var oldb\n var oldc\n var oldd\n var a = 1732584193\n var b = -271733879\n var c = -1732584194\n var d = 271733878\n\n for (i = 0; i < x.length; i += 16) {\n olda = a\n oldb = b\n oldc = c\n oldd = d\n\n a = md5ff(a, b, c, d, x[i], 7, -680876936)\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586)\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819)\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330)\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897)\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426)\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341)\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983)\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416)\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417)\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063)\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162)\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682)\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101)\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290)\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329)\n\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510)\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632)\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713)\n b = md5gg(b, c, d, a, x[i], 20, -373897302)\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691)\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083)\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335)\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848)\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438)\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690)\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961)\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501)\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467)\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784)\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473)\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734)\n\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558)\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463)\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562)\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556)\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060)\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353)\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632)\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640)\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174)\n d = md5hh(d, a, b, c, x[i], 11, -358537222)\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979)\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189)\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487)\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835)\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520)\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651)\n\n a = md5ii(a, b, c, d, x[i], 6, -198630844)\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415)\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905)\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055)\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571)\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606)\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523)\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799)\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359)\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744)\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380)\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649)\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070)\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379)\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259)\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551)\n\n a = safeAdd(a, olda)\n b = safeAdd(b, oldb)\n c = safeAdd(c, oldc)\n d = safeAdd(d, oldd)\n }\n return [a, b, c, d]\n }\n\n /**\n * Convert an array of little-endian words to a string\n *\n * @param {Array} input MD5 Array\n * @returns {string} MD5 string\n */\n function binl2rstr(input) {\n var i\n var output = ''\n var length32 = input.length * 32\n for (i = 0; i < length32; i += 8) {\n output += String.fromCharCode((input[i >> 5] >>> i % 32) & 0xff)\n }\n return output\n }\n\n /**\n * Convert a raw string to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n *\n * @param {string} input Raw input string\n * @returns {Array} Array of little-endian words\n */\n function rstr2binl(input) {\n var i\n var output = []\n output[(input.length >> 2) - 1] = undefined\n for (i = 0; i < output.length; i += 1) {\n output[i] = 0\n }\n var length8 = input.length * 8\n for (i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << i % 32\n }\n return output\n }\n\n /**\n * Calculate the MD5 of a raw string\n *\n * @param {string} s Input string\n * @returns {string} Raw MD5 string\n */\n function rstrMD5(s) {\n return binl2rstr(binlMD5(rstr2binl(s), s.length * 8))\n }\n\n /**\n * Calculates the HMAC-MD5 of a key and some data (raw strings)\n *\n * @param {string} key HMAC key\n * @param {string} data Raw input string\n * @returns {string} Raw MD5 string\n */\n function rstrHMACMD5(key, data) {\n var i\n var bkey = rstr2binl(key)\n var ipad = []\n var opad = []\n var hash\n ipad[15] = opad[15] = undefined\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8)\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636\n opad[i] = bkey[i] ^ 0x5c5c5c5c\n }\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128))\n }\n\n /**\n * Convert a raw string to a hex string\n *\n * @param {string} input Raw input string\n * @returns {string} Hex encoded string\n */\n function rstr2hex(input) {\n var hexTab = '0123456789abcdef'\n var output = ''\n var x\n var i\n for (i = 0; i < input.length; i += 1) {\n x = input.charCodeAt(i)\n output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f)\n }\n return output\n }\n\n /**\n * Encode a string as UTF-8\n *\n * @param {string} input Input string\n * @returns {string} UTF8 string\n */\n function str2rstrUTF8(input) {\n return unescape(encodeURIComponent(input))\n }\n\n /**\n * Encodes input string as raw MD5 string\n *\n * @param {string} s Input string\n * @returns {string} Raw MD5 string\n */\n function rawMD5(s) {\n return rstrMD5(str2rstrUTF8(s))\n }\n /**\n * Encodes input string as Hex encoded string\n *\n * @param {string} s Input string\n * @returns {string} Hex encoded string\n */\n function hexMD5(s) {\n return rstr2hex(rawMD5(s))\n }\n /**\n * Calculates the raw HMAC-MD5 for the given key and data\n *\n * @param {string} k HMAC key\n * @param {string} d Input string\n * @returns {string} Raw MD5 string\n */\n function rawHMACMD5(k, d) {\n return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d))\n }\n /**\n * Calculates the Hex encoded HMAC-MD5 for the given key and data\n *\n * @param {string} k HMAC key\n * @param {string} d Input string\n * @returns {string} Raw MD5 string\n */\n function hexHMACMD5(k, d) {\n return rstr2hex(rawHMACMD5(k, d))\n }\n\n /**\n * Calculates MD5 value for a given string.\n * If a key is provided, calculates the HMAC-MD5 value.\n * Returns a Hex encoded string unless the raw argument is given.\n *\n * @param {string} string Input string\n * @param {string} [key] HMAC key\n * @param {boolean} [raw] Raw output switch\n * @returns {string} MD5 output\n */\n function md5(string, key, raw) {\n if (!key) {\n if (!raw) {\n return hexMD5(string)\n }\n return rawMD5(string)\n }\n if (!raw) {\n return hexHMACMD5(key, string)\n }\n return rawHMACMD5(key, string)\n }\n\n if (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n return md5\n }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))\n } else {}\n})(this)\n\n\n//# sourceURL=webpack://diglettk/./node_modules/blueimp-md5/js/md5.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/common.js": -/*!**********************************************!*\ - !*** ./node_modules/gl-matrix/esm/common.js ***! - \**********************************************/ -/*! exports provided: EPSILON, ARRAY_TYPE, RANDOM, setMatrixArrayType, toRadian, equals */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EPSILON\", function() { return EPSILON; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ARRAY_TYPE\", function() { return ARRAY_TYPE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RANDOM\", function() { return RANDOM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setMatrixArrayType\", function() { return setMatrixArrayType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadian\", function() { return toRadian; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/**\r\n * Common utilities\r\n * @module glMatrix\r\n */\n// Configuration Constants\nvar EPSILON = 0.000001;\nvar ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nvar RANDOM = Math.random;\n/**\r\n * Sets the type of array used when creating new vectors and matrices\r\n *\r\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\r\n */\n\nfunction setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\r\n * Convert Degree To Radian\r\n *\r\n * @param {Number} a Angle in Degrees\r\n */\n\nfunction toRadian(a) {\n return a * degree;\n}\n/**\r\n * Tests whether or not the arguments have approximately the same value, within an absolute\r\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\r\n * than or equal to 1.0, and a relative tolerance is used for larger values)\r\n *\r\n * @param {Number} a The first number to test.\r\n * @param {Number} b The second number to test.\r\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/common.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/index.js": -/*!*********************************************!*\ - !*** ./node_modules/gl-matrix/esm/index.js ***! - \*********************************************/ -/*! exports provided: glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"glMatrix\", function() { return _common_js__WEBPACK_IMPORTED_MODULE_0__; });\n/* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat2.js */ \"./node_modules/gl-matrix/esm/mat2.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat2\", function() { return _mat2_js__WEBPACK_IMPORTED_MODULE_1__; });\n/* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mat2d.js */ \"./node_modules/gl-matrix/esm/mat2d.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat2d\", function() { return _mat2d_js__WEBPACK_IMPORTED_MODULE_2__; });\n/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mat3.js */ \"./node_modules/gl-matrix/esm/mat3.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat3\", function() { return _mat3_js__WEBPACK_IMPORTED_MODULE_3__; });\n/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mat4.js */ \"./node_modules/gl-matrix/esm/mat4.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat4\", function() { return _mat4_js__WEBPACK_IMPORTED_MODULE_4__; });\n/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./quat.js */ \"./node_modules/gl-matrix/esm/quat.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"quat\", function() { return _quat_js__WEBPACK_IMPORTED_MODULE_5__; });\n/* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./quat2.js */ \"./node_modules/gl-matrix/esm/quat2.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"quat2\", function() { return _quat2_js__WEBPACK_IMPORTED_MODULE_6__; });\n/* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vec2.js */ \"./node_modules/gl-matrix/esm/vec2.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"vec2\", function() { return _vec2_js__WEBPACK_IMPORTED_MODULE_7__; });\n/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./vec3.js */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"vec3\", function() { return _vec3_js__WEBPACK_IMPORTED_MODULE_8__; });\n/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./vec4.js */ \"./node_modules/gl-matrix/esm/vec4.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"vec4\", function() { return _vec4_js__WEBPACK_IMPORTED_MODULE_9__; });\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/mat2.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/mat2.js ***! - \********************************************/ -/*! exports provided: create, clone, copy, identity, fromValues, set, transpose, invert, adjoint, determinant, multiply, rotate, scale, fromRotation, fromScaling, str, frob, LDU, add, subtract, exactEquals, equals, multiplyScalar, multiplyScalarAndAdd, mul, sub */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose\", function() { return transpose; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"adjoint\", function() { return adjoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LDU\", function() { return LDU; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 2x2 Matrix\r\n * @module mat2\r\n */\n\n/**\r\n * Creates a new identity mat2\r\n *\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2} a matrix to clone\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Copy the values from one mat2 to another\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set a mat2 to the identity matrix\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @returns {mat2} out\r\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Create a new mat2 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out A new 2x2 matrix\r\n */\n\nfunction fromValues(m00, m01, m10, m11) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Set the components of a mat2 to the given values\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out\r\n */\n\nfunction set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Transpose the values of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nfunction invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3]; // Calculate the determinant\n\n var det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nfunction adjoint(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nfunction determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n/**\r\n * Multiplies two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nfunction multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n/**\r\n * Rotates a mat2 by the given angle\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nfunction rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n/**\r\n * Scales the mat2 by the dimensions in the given vec2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2} out\r\n **/\n\nfunction scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nfunction fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2} out\r\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2\r\n *\r\n * @param {ReadonlyMat2} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nfunction str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @param {ReadonlyMat2} L the lower triangular matrix\r\n * @param {ReadonlyMat2} D the diagonal matrix\r\n * @param {ReadonlyMat2} U the upper triangular matrix\r\n * @param {ReadonlyMat2} a the input matrix to factorize\r\n */\n\nfunction LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n/**\r\n * Adds two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2} out\r\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2} out the receiving vector\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2} out\r\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Alias for {@link mat2.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link mat2.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/mat2.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/mat2d.js": -/*!*********************************************!*\ - !*** ./node_modules/gl-matrix/esm/mat2d.js ***! - \*********************************************/ -/*! exports provided: create, clone, copy, identity, fromValues, set, invert, determinant, multiply, rotate, scale, translate, fromRotation, fromScaling, fromTranslation, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 2x3 Matrix\r\n * @module mat2d\r\n * @description\r\n * A mat2d contains six elements defined as:\r\n *
\r\n * [a, b,\r\n *  c, d,\r\n *  tx, ty]\r\n * 
\r\n * This is a short form for the 3x3 matrix:\r\n *
\r\n * [a, b, 0,\r\n *  c, d, 0,\r\n *  tx, ty, 1]\r\n * 
\r\n * The last column is ignored so the array is shorter and operations are faster.\r\n */\n\n/**\r\n * Creates a new identity mat2d\r\n *\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](6);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2d initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2d} a matrix to clone\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Copy the values from one mat2d to another\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Set a mat2d to the identity matrix\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @returns {mat2d} out\r\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Create a new mat2d with the given values\r\n *\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} A new mat2d\r\n */\n\nfunction fromValues(a, b, c, d, tx, ty) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Set the components of a mat2d to the given values\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} out\r\n */\n\nfunction set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Inverts a mat2d\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nfunction invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nfunction determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n/**\r\n * Multiplies two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nfunction multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n/**\r\n * Rotates a mat2d by the given angle\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nfunction rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Scales the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nfunction scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Translates the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nfunction translate(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nfunction fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.scale(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2d} out\r\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.translate(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat2d} out\r\n */\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nfunction str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);\n}\n/**\r\n * Adds two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2d} out\r\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n/**\r\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2d} out the receiving vector\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2d} out\r\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5));\n}\n/**\r\n * Alias for {@link mat2d.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link mat2d.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/mat2d.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/mat3.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/mat3.js ***! - \********************************************/ -/*! exports provided: create, fromMat4, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, rotate, scale, fromTranslation, fromRotation, fromScaling, fromMat2d, fromQuat, normalFromMat4, projection, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat4\", function() { return fromMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose\", function() { return transpose; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"adjoint\", function() { return adjoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat2d\", function() { return fromMat2d; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromQuat\", function() { return fromQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalFromMat4\", function() { return normalFromMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"projection\", function() { return projection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 3x3 Matrix\r\n * @module mat3\r\n */\n\n/**\r\n * Creates a new identity mat3\r\n *\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](9);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the upper-left 3x3 values into the given mat3.\r\n *\r\n * @param {mat3} out the receiving 3x3 matrix\r\n * @param {ReadonlyMat4} a the source 4x4 matrix\r\n * @returns {mat3} out\r\n */\n\nfunction fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\r\n * Creates a new mat3 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat3} a matrix to clone\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Copy the values from one mat3 to another\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Create a new mat3 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} A new mat3\r\n */\n\nfunction fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set the components of a mat3 to the given values\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} out\r\n */\n\nfunction set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set a mat3 to the identity matrix\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @returns {mat3} out\r\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nfunction invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nfunction adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nfunction determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\r\n * Multiplies two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nfunction multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\r\n * Translate a mat3 by the given vector\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to translate\r\n * @param {ReadonlyVec2} v vector to translate by\r\n * @returns {mat3} out\r\n */\n\nfunction translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\r\n * Rotates a mat3 by the given angle\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nfunction rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\r\n * Scales the mat3 by the dimensions in the given vec2\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat3} out\r\n **/\n\nfunction scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat3} out\r\n */\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nfunction fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat3} out\r\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the values from a mat2d into a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to copy\r\n * @returns {mat3} out\r\n **/\n\nfunction fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\r\n * Calculates a 3x3 matrix from the given quaternion\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nfunction fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nfunction normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\r\n * Generates a 2D projection matrix with the given bounds\r\n *\r\n * @param {mat3} out mat3 frustum matrix will be written into\r\n * @param {number} width Width of your gl context\r\n * @param {number} height Height of gl context\r\n * @returns {mat3} out\r\n */\n\nfunction projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat3\r\n *\r\n * @param {ReadonlyMat3} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nfunction str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\r\n * Adds two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat3} out\r\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\r\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat3} out the receiving vector\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat3} out\r\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\r\n * Alias for {@link mat3.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link mat3.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/mat3.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/mat4.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/mat4.js ***! - \********************************************/ -/*! exports provided: create, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, scale, rotate, rotateX, rotateY, rotateZ, fromTranslation, fromScaling, fromRotation, fromXRotation, fromYRotation, fromZRotation, fromRotationTranslation, fromQuat2, getTranslation, getScaling, getRotation, fromRotationTranslationScale, fromRotationTranslationScaleOrigin, fromQuat, frustum, perspective, perspectiveFromFieldOfView, ortho, lookAt, targetTo, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose\", function() { return transpose; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"adjoint\", function() { return adjoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromXRotation\", function() { return fromXRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromYRotation\", function() { return fromYRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromZRotation\", function() { return fromZRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslation\", function() { return fromRotationTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromQuat2\", function() { return fromQuat2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTranslation\", function() { return getTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScaling\", function() { return getScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRotation\", function() { return getRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslationScale\", function() { return fromRotationTranslationScale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslationScaleOrigin\", function() { return fromRotationTranslationScaleOrigin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromQuat\", function() { return fromQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frustum\", function() { return frustum; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perspective\", function() { return perspective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perspectiveFromFieldOfView\", function() { return perspectiveFromFieldOfView; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ortho\", function() { return ortho; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lookAt\", function() { return lookAt; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"targetTo\", function() { return targetTo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\r\n * @module mat4\r\n */\n\n/**\r\n * Creates a new identity mat4\r\n *\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](16);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat4} a matrix to clone\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Copy the values from one mat4 to another\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Create a new mat4 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} A new mat4\r\n */\n\nfunction fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set the components of a mat4 to the given values\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} out\r\n */\n\nfunction set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set a mat4 to the identity matrix\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @returns {mat4} out\r\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nfunction invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nfunction adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\r\n * Calculates the determinant of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nfunction determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\r\n * Multiplies two mat4s\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nfunction multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\r\n * Translate a mat4 by the given vector\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {mat4} out\r\n */\n\nfunction translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\r\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\r\n * @returns {mat4} out\r\n **/\n\nfunction scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Rotates a mat4 by the given angle around the given axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nfunction rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the X axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nfunction rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Y axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nfunction rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Z axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nfunction rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Scaling vector\r\n * @returns {mat4} out\r\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nfunction fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nfunction fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nfunction fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nfunction fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nfunction fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 from a dual quat.\r\n *\r\n * @param {mat4} out Matrix\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @returns {mat4} mat4 receiving operation result\r\n */\n\nfunction fromQuat2(out, a) {\n var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nfunction getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion paramter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nfunction getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @param {quat} out Quaternion to receive the rotation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {quat} out\r\n */\n\nfunction getRotation(out, mat) {\n var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @returns {mat4} out\r\n */\n\nfunction fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\r\n * @returns {mat4} out\r\n */\n\nfunction fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat4} out\r\n */\n\nfunction fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a frustum matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Number} left Left bound of the frustum\r\n * @param {Number} right Right bound of the frustum\r\n * @param {Number} bottom Bottom bound of the frustum\r\n * @param {Number} top Top bound of the frustum\r\n * @param {Number} near Near bound of the frustum\r\n * @param {Number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nfunction frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} fovy Vertical field of view in radians\r\n * @param {number} aspect Aspect ratio. typically viewport width/height\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum, can be null or Infinity\r\n * @returns {mat4} out\r\n */\n\nfunction perspective(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nfunction perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\r\n * Generates a orthogonal projection matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} left Left bound of the frustum\r\n * @param {number} right Right bound of the frustum\r\n * @param {number} bottom Bottom bound of the frustum\r\n * @param {number} top Top bound of the frustum\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nfunction ortho(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nfunction lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a matrix that makes something look at something else.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nfunction targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat4\r\n *\r\n * @param {ReadonlyMat4} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nfunction str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\r\n * Adds two mat4's\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat4} out\r\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat4} out the receiving vector\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat4} out\r\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\r\n * Alias for {@link mat4.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link mat4.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/mat4.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/quat.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/quat.js ***! - \********************************************/ -/*! exports provided: create, identity, setAxisAngle, getAxisAngle, getAngle, multiply, rotateX, rotateY, rotateZ, calculateW, exp, ln, pow, slerp, random, invert, conjugate, fromMat3, fromEuler, str, clone, fromValues, copy, set, add, mul, scale, dot, lerp, length, len, squaredLength, sqrLen, normalize, exactEquals, equals, rotationTo, sqlerp, setAxes */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setAxisAngle\", function() { return setAxisAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAxisAngle\", function() { return getAxisAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAngle\", function() { return getAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"calculateW\", function() { return calculateW; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exp\", function() { return exp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ln\", function() { return ln; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pow\", function() { return pow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"slerp\", function() { return slerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"conjugate\", function() { return conjugate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat3\", function() { return fromMat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromEuler\", function() { return fromEuler; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotationTo\", function() { return rotationTo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqlerp\", function() { return sqlerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setAxes\", function() { return setAxes; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat3.js */ \"./node_modules/gl-matrix/esm/mat3.js\");\n/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vec3.js */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./vec4.js */ \"./node_modules/gl-matrix/esm/vec4.js\");\n\n\n\n\n/**\r\n * Quaternion\r\n * @module quat\r\n */\n\n/**\r\n * Creates a new identity quat\r\n *\r\n * @returns {quat} a new quaternion\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\r\n * Set a quat to the identity quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nfunction identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyVec3} axis the axis around which to rotate\r\n * @param {Number} rad the angle in radians\r\n * @returns {quat} out\r\n **/\n\nfunction setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @param {vec3} out_axis Vector receiving the axis of rotation\r\n * @param {ReadonlyQuat} q Quaternion to be decomposed\r\n * @return {Number} Angle, in radians, of the rotation\r\n */\n\nfunction getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\r\n * Gets the angular distance between two unit quaternions\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\n\nfunction getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\r\n * Multiplies two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n */\n\nfunction multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the X axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nfunction rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nfunction rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nfunction rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate W component of\r\n * @returns {quat} out\r\n */\n\nfunction calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\r\n * Calculate the exponential of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nfunction exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nfunction ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\r\n * Calculate the scalar power of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @param {Number} b amount to scale the quaternion by\r\n * @returns {quat} out\r\n */\n\nfunction pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\r\n * Performs a spherical linear interpolation between two quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nfunction slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\r\n * Generates a random unit quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nfunction random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]();\n var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]();\n var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\r\n * Calculates the inverse of a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate inverse of\r\n * @returns {quat} out\r\n */\n\nfunction invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate conjugate of\r\n * @returns {quat} out\r\n */\n\nfunction conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyMat3} m rotation matrix\r\n * @returns {quat} out\r\n * @function\r\n */\n\nfunction fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {x} Angle to rotate around X axis in degrees.\r\n * @param {y} Angle to rotate around Y axis in degrees.\r\n * @param {z} Angle to rotate around Z axis in degrees.\r\n * @returns {quat} out\r\n * @function\r\n */\n\nfunction fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\r\n * Returns a string representation of a quatenion\r\n *\r\n * @param {ReadonlyQuat} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nfunction str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat} a quaternion to clone\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nvar clone = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"clone\"];\n/**\r\n * Creates a new quat initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nvar fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"fromValues\"];\n/**\r\n * Copy the values from one quat to another\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the source quaternion\r\n * @returns {quat} out\r\n * @function\r\n */\n\nvar copy = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"copy\"];\n/**\r\n * Set the components of a quat to the given values\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} out\r\n * @function\r\n */\n\nvar set = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"set\"];\n/**\r\n * Adds two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n * @function\r\n */\n\nvar add = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"add\"];\n/**\r\n * Alias for {@link quat.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Scales a quat by a scalar number\r\n *\r\n * @param {quat} out the receiving vector\r\n * @param {ReadonlyQuat} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {quat} out\r\n * @function\r\n */\n\nvar scale = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"scale\"];\n/**\r\n * Calculates the dot product of two quat's\r\n *\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nvar dot = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"dot\"];\n/**\r\n * Performs a linear interpolation between two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n * @function\r\n */\n\nvar lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"lerp\"];\n/**\r\n * Calculates the length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nvar length = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"length\"];\n/**\r\n * Alias for {@link quat.length}\r\n * @function\r\n */\n\nvar len = length;\n/**\r\n * Calculates the squared length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nvar squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"squaredLength\"];\n/**\r\n * Alias for {@link quat.squaredLength}\r\n * @function\r\n */\n\nvar sqrLen = squaredLength;\n/**\r\n * Normalize a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quaternion to normalize\r\n * @returns {quat} out\r\n * @function\r\n */\n\nvar normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"normalize\"];\n/**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat} a The first quaternion.\r\n * @param {ReadonlyQuat} b The second quaternion.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nvar exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"exactEquals\"];\n/**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat} a The first vector.\r\n * @param {ReadonlyQuat} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nvar equals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"equals\"];\n/**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n *\r\n * @param {quat} out the receiving quaternion.\r\n * @param {ReadonlyVec3} a the initial vector\r\n * @param {ReadonlyVec3} b the destination vector\r\n * @returns {quat} out\r\n */\n\nvar rotationTo = function () {\n var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"create\"]();\n var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"fromValues\"](1, 0, 0);\n var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"fromValues\"](0, 1, 0);\n return function (out, a, b) {\n var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"dot\"](a, b);\n\n if (dot < -0.999999) {\n _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](tmpvec3, xUnitVec3, a);\n if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"len\"](tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](tmpvec3, yUnitVec3, a);\n _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"normalize\"](tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\r\n * Performs a spherical linear interpolation with two control points\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {ReadonlyQuat} c the third operand\r\n * @param {ReadonlyQuat} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nvar sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n *\r\n * @param {ReadonlyVec3} view the vector representing the viewing direction\r\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\r\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\r\n * @returns {quat} out\r\n */\n\nvar setAxes = function () {\n var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_1__[\"create\"]();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/quat.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/quat2.js": -/*!*********************************************!*\ - !*** ./node_modules/gl-matrix/esm/quat2.js ***! - \*********************************************/ -/*! exports provided: create, clone, fromValues, fromRotationTranslationValues, fromRotationTranslation, fromTranslation, fromRotation, fromMat4, copy, identity, set, getReal, getDual, setReal, setDual, getTranslation, translate, rotateX, rotateY, rotateZ, rotateByQuatAppend, rotateByQuatPrepend, rotateAroundAxis, add, multiply, mul, scale, dot, lerp, invert, conjugate, length, len, squaredLength, sqrLen, normalize, str, exactEquals, equals */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslationValues\", function() { return fromRotationTranslationValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslation\", function() { return fromRotationTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat4\", function() { return fromMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getReal\", function() { return getReal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDual\", function() { return getDual; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setReal\", function() { return setReal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setDual\", function() { return setDual; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTranslation\", function() { return getTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateByQuatAppend\", function() { return rotateByQuatAppend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateByQuatPrepend\", function() { return rotateByQuatPrepend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateAroundAxis\", function() { return rotateAroundAxis; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"conjugate\", function() { return conjugate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quat.js */ \"./node_modules/gl-matrix/esm/quat.js\");\n/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mat4.js */ \"./node_modules/gl-matrix/esm/mat4.js\");\n\n\n\n/**\r\n * Dual Quaternion
\r\n * Format: [real, dual]
\r\n * Quaternion format: XYZW
\r\n * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
\r\n * @module quat2\r\n */\n\n/**\r\n * Creates a new identity dual quat\r\n *\r\n * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]\r\n */\n\nfunction create() {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n dq[0] = 0;\n dq[1] = 0;\n dq[2] = 0;\n dq[4] = 0;\n dq[5] = 0;\n dq[6] = 0;\n dq[7] = 0;\n }\n\n dq[3] = 1;\n return dq;\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to clone\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nfunction clone(a) {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n dq[0] = a[0];\n dq[1] = a[1];\n dq[2] = a[2];\n dq[3] = a[3];\n dq[4] = a[4];\n dq[5] = a[5];\n dq[6] = a[6];\n dq[7] = a[7];\n return dq;\n}\n/**\r\n * Creates a new dual quat initialized with the given values\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nfunction fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n dq[4] = x2;\n dq[5] = y2;\n dq[6] = z2;\n dq[7] = w2;\n return dq;\n}\n/**\r\n * Creates a new dual quat from the given values (quat and translation)\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component (translation)\r\n * @param {Number} y2 Y component (translation)\r\n * @param {Number} z2 Z component (translation)\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nfunction fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n var ax = x2 * 0.5,\n ay = y2 * 0.5,\n az = z2 * 0.5;\n dq[4] = ax * w1 + ay * z1 - az * y1;\n dq[5] = ay * w1 + az * x1 - ax * z1;\n dq[6] = az * w1 + ax * y1 - ay * x1;\n dq[7] = -ax * x1 - ay * y1 - az * z1;\n return dq;\n}\n/**\r\n * Creates a dual quat from a quaternion and a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q a normalized quaternion\r\n * @param {ReadonlyVec3} t tranlation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nfunction fromRotationTranslation(out, q, t) {\n var ax = t[0] * 0.5,\n ay = t[1] * 0.5,\n az = t[2] * 0.5,\n bx = q[0],\n by = q[1],\n bz = q[2],\n bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Creates a dual quat from a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyVec3} t translation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nfunction fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a dual quat from a quaternion\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q the quaternion\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nfunction fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a new dual quat from a matrix (4x4)\r\n *\r\n * @param {quat2} out the dual quaternion\r\n * @param {ReadonlyMat4} a the matrix\r\n * @returns {quat2} dual quat receiving operation result\r\n * @function\r\n */\n\nfunction fromMat4(out, a) {\n //TODO Optimize this\n var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"create\"]();\n _mat4_js__WEBPACK_IMPORTED_MODULE_2__[\"getRotation\"](outer, a);\n var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n _mat4_js__WEBPACK_IMPORTED_MODULE_2__[\"getTranslation\"](t, a);\n fromRotationTranslation(out, outer, t);\n return out;\n}\n/**\r\n * Copy the values from one dual quat to another\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the source dual quaternion\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Set a dual quat to the identity dual quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @returns {quat2} out\r\n */\n\nfunction identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Set the components of a dual quat to the given values\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nfunction set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n}\n/**\r\n * Gets the real part of a dual quat\r\n * @param {quat} out real part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} real part\r\n */\n\nvar getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"copy\"];\n/**\r\n * Gets the dual part of a dual quat\r\n * @param {quat} out dual part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} dual part\r\n */\n\nfunction getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n}\n/**\r\n * Set the real component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the real part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nvar setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"copy\"];\n/**\r\n * Set the dual component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the dual part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nfunction setDual(out, q) {\n out[4] = q[0];\n out[5] = q[1];\n out[6] = q[2];\n out[7] = q[3];\n return out;\n}\n/**\r\n * Gets the translation of a normalized dual quat\r\n * @param {vec3} out translation\r\n * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed\r\n * @return {vec3} translation\r\n */\n\nfunction getTranslation(out, a) {\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n}\n/**\r\n * Translates a dual quat by the given vector\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {quat2} out\r\n */\n\nfunction translate(out, a, v) {\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3],\n bx1 = v[0] * 0.5,\n by1 = v[1] * 0.5,\n bz1 = v[2] * 0.5,\n ax2 = a[4],\n ay2 = a[5],\n az2 = a[6],\n aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n}\n/**\r\n * Rotates a dual quat around the X axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nfunction rotateX(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"rotateX\"](out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Y axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nfunction rotateY(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"rotateY\"](out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Z axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nfunction rotateZ(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"rotateZ\"](out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (a * q)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @returns {quat2} out\r\n */\n\nfunction rotateByQuatAppend(out, a, q) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (q * a)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @returns {quat2} out\r\n */\n\nfunction rotateByQuatPrepend(out, q, a) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n bx = a[0],\n by = a[1],\n bz = a[2],\n bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around a given axis. Does the normalisation automatically\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @param {Number} rad how far the rotation should be\r\n * @returns {quat2} out\r\n */\n\nfunction rotateAroundAxis(out, a, axis, rad) {\n //Special case for rad = 0\n if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return copy(out, a);\n }\n\n var axisLength = Math.hypot(axis[0], axis[1], axis[2]);\n rad = rad * 0.5;\n var s = Math.sin(rad);\n var bx = s * axis[0] / axisLength;\n var by = s * axis[1] / axisLength;\n var bz = s * axis[2] / axisLength;\n var bw = Math.cos(rad);\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Adds two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n}\n/**\r\n * Multiplies two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n */\n\nfunction multiply(out, a, b) {\n var ax0 = a[0],\n ay0 = a[1],\n az0 = a[2],\n aw0 = a[3],\n bx1 = b[4],\n by1 = b[5],\n bz1 = b[6],\n bw1 = b[7],\n ax1 = a[4],\n ay1 = a[5],\n az1 = a[6],\n aw1 = a[7],\n bx0 = b[0],\n by0 = b[1],\n bz0 = b[2],\n bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n}\n/**\r\n * Alias for {@link quat2.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Scales a dual quat by a scalar number\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the dual quat to scale\r\n * @param {Number} b amount to scale the dual quat by\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n}\n/**\r\n * Calculates the dot product of two dual quat's (The dot product of the real parts)\r\n *\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nvar dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"dot\"];\n/**\r\n * Performs a linear interpolation between two dual quats's\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat2} out\r\n */\n\nfunction lerp(out, a, b, t) {\n var mt = 1 - t;\n if (dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n}\n/**\r\n * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quat to calculate inverse of\r\n * @returns {quat2} out\r\n */\n\nfunction invert(out, a) {\n var sqlen = squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n}\n/**\r\n * Calculates the conjugate of a dual quat\r\n * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat2} a quat to calculate conjugate of\r\n * @returns {quat2} out\r\n */\n\nfunction conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Calculates the length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate length of\r\n * @returns {Number} length of a\r\n * @function\r\n */\n\nvar length = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"length\"];\n/**\r\n * Alias for {@link quat2.length}\r\n * @function\r\n */\n\nvar len = length;\n/**\r\n * Calculates the squared length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nvar squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"squaredLength\"];\n/**\r\n * Alias for {@link quat2.squaredLength}\r\n * @function\r\n */\n\nvar sqrLen = squaredLength;\n/**\r\n * Normalize a dual quat\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quaternion to normalize\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nfunction normalize(out, a) {\n var magnitude = squaredLength(a);\n\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n var a0 = a[0] / magnitude;\n var a1 = a[1] / magnitude;\n var a2 = a[2] / magnitude;\n var a3 = a[3] / magnitude;\n var b0 = a[4];\n var b1 = a[5];\n var b2 = a[6];\n var b3 = a[7];\n var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n\n return out;\n}\n/**\r\n * Returns a string representation of a dual quatenion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to represent as a string\r\n * @returns {String} string representation of the dual quat\r\n */\n\nfunction str(a) {\n return \"quat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \")\";\n}\n/**\r\n * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quaternion.\r\n * @param {ReadonlyQuat2} b the second dual quaternion.\r\n * @returns {Boolean} true if the dual quaternions are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n}\n/**\r\n * Returns whether or not the dual quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quat.\r\n * @param {ReadonlyQuat2} b the second dual quat.\r\n * @returns {Boolean} true if the dual quats are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a7), Math.abs(b7));\n}\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/quat2.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/vec2.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/vec2.js ***! - \********************************************/ -/*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat2, transformMat2d, transformMat3, transformMat4, rotate, angle, zero, str, exactEquals, equals, len, sub, mul, div, dist, sqrDist, sqrLen, forEach */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"divide\", function() { return divide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAndAdd\", function() { return scaleAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredDistance\", function() { return squaredDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negate\", function() { return negate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat2\", function() { return transformMat2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat2d\", function() { return transformMat2d; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat3\", function() { return transformMat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat4\", function() { return transformMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angle\", function() { return angle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zero\", function() { return zero; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"div\", function() { return div; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dist\", function() { return dist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrDist\", function() { return sqrDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEach\", function() { return forEach; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 2 Dimensional Vector\r\n * @module vec2\r\n */\n\n/**\r\n * Creates a new, empty vec2\r\n *\r\n * @returns {vec2} a new 2D vector\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](2);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec2} a vector to clone\r\n * @returns {vec2} a new 2D vector\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} a new 2D vector\r\n */\n\nfunction fromValues(x, y) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Copy the values from one vec2 to another\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the source vector\r\n * @returns {vec2} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Set the components of a vec2 to the given values\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} out\r\n */\n\nfunction set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Adds two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\r\n * Multiplies two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\r\n * Divides two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to ceil\r\n * @returns {vec2} out\r\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to floor\r\n * @returns {vec2} out\r\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\r\n * Math.round the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to round\r\n * @returns {vec2} out\r\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\r\n * Scales a vec2 by a scalar number\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec2} out\r\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\r\n * Adds two vec2's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec2} out\r\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\r\n * Calculates the length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nfunction length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nfunction squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\r\n * Negates the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to negate\r\n * @returns {vec2} out\r\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to invert\r\n * @returns {vec2} out\r\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\r\n * Normalize a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to normalize\r\n * @returns {vec2} out\r\n */\n\nfunction normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\r\n * Computes the cross product of two vec2's\r\n * Note that the cross product must by definition produce a 3D vector\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec2} out\r\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec2} out\r\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0;\n var r = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nfunction transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2d\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2d} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nfunction transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat3\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat3} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nfunction transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat4\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\r\n * Rotate a 2D vector\r\n * @param {vec2} out The receiving vec2\r\n * @param {ReadonlyVec2} a The vec2 point to rotate\r\n * @param {ReadonlyVec2} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec2} out\r\n */\n\nfunction rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\r\n * Get the angle between two 2D vectors\r\n * @param {ReadonlyVec2} a The first operand\r\n * @param {ReadonlyVec2} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nfunction angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec2 to zero\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @returns {vec2} out\r\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec2} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nfunction str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\r\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\r\n * Alias for {@link vec2.length}\r\n * @function\r\n */\n\nvar len = length;\n/**\r\n * Alias for {@link vec2.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n/**\r\n * Alias for {@link vec2.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link vec2.divide}\r\n * @function\r\n */\n\nvar div = divide;\n/**\r\n * Alias for {@link vec2.distance}\r\n * @function\r\n */\n\nvar dist = distance;\n/**\r\n * Alias for {@link vec2.squaredDistance}\r\n * @function\r\n */\n\nvar sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec2.squaredLength}\r\n * @function\r\n */\n\nvar sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec2s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/vec2.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/vec3.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/vec3.js ***! - \********************************************/ -/*! exports provided: create, clone, length, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, squaredLength, negate, inverse, normalize, dot, cross, lerp, hermite, bezier, random, transformMat4, transformMat3, transformQuat, rotateX, rotateY, rotateZ, angle, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"divide\", function() { return divide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAndAdd\", function() { return scaleAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredDistance\", function() { return squaredDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negate\", function() { return negate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hermite\", function() { return hermite; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bezier\", function() { return bezier; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat4\", function() { return transformMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat3\", function() { return transformMat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformQuat\", function() { return transformQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angle\", function() { return angle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zero\", function() { return zero; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"div\", function() { return div; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dist\", function() { return dist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrDist\", function() { return sqrDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEach\", function() { return forEach; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 3 Dimensional Vector\r\n * @module vec3\r\n */\n\n/**\r\n * Creates a new, empty vec3\r\n *\r\n * @returns {vec3} a new 3D vector\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec3} a vector to clone\r\n * @returns {vec3} a new 3D vector\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Calculates the length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nfunction length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Creates a new vec3 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} a new 3D vector\r\n */\n\nfunction fromValues(x, y, z) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Copy the values from one vec3 to another\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the source vector\r\n * @returns {vec3} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Set the components of a vec3 to the given values\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} out\r\n */\n\nfunction set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Adds two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\r\n * Multiplies two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\r\n * Divides two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to ceil\r\n * @returns {vec3} out\r\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to floor\r\n * @returns {vec3} out\r\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\r\n * Math.round the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to round\r\n * @returns {vec3} out\r\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\r\n * Scales a vec3 by a scalar number\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec3} out\r\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec3} out\r\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Calculates the squared length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nfunction squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Negates the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to negate\r\n * @returns {vec3} out\r\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to invert\r\n * @returns {vec3} out\r\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\r\n * Normalize a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to normalize\r\n * @returns {vec3} out\r\n */\n\nfunction normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\r\n * Computes the cross product of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\r\n * Performs a hermite interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nfunction hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Performs a bezier interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nfunction bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec3} out\r\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0;\n var r = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2.0 * Math.PI;\n var z = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat3.\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nfunction transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec3} out\r\n */\n\nfunction transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\r\n * Rotate a 3D vector around the x-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nfunction rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the y-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nfunction rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the z-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nfunction rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Get the angle between two 3D vectors\r\n * @param {ReadonlyVec3} a The first operand\r\n * @param {ReadonlyVec3} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nfunction angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec3 to zero\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @returns {vec3} out\r\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec3} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nfunction str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\r\n * Alias for {@link vec3.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n/**\r\n * Alias for {@link vec3.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link vec3.divide}\r\n * @function\r\n */\n\nvar div = divide;\n/**\r\n * Alias for {@link vec3.distance}\r\n * @function\r\n */\n\nvar dist = distance;\n/**\r\n * Alias for {@link vec3.squaredDistance}\r\n * @function\r\n */\n\nvar sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec3.length}\r\n * @function\r\n */\n\nvar len = length;\n/**\r\n * Alias for {@link vec3.squaredLength}\r\n * @function\r\n */\n\nvar sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec3s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/vec3.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/vec4.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/vec4.js ***! - \********************************************/ -/*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat4, transformQuat, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"divide\", function() { return divide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAndAdd\", function() { return scaleAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredDistance\", function() { return squaredDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negate\", function() { return negate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat4\", function() { return transformMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformQuat\", function() { return transformQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zero\", function() { return zero; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"div\", function() { return div; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dist\", function() { return dist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrDist\", function() { return sqrDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEach\", function() { return forEach; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 4 Dimensional Vector\r\n * @module vec4\r\n */\n\n/**\r\n * Creates a new, empty vec4\r\n *\r\n * @returns {vec4} a new 4D vector\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec4} a vector to clone\r\n * @returns {vec4} a new 4D vector\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} a new 4D vector\r\n */\n\nfunction fromValues(x, y, z, w) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Copy the values from one vec4 to another\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the source vector\r\n * @returns {vec4} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to the given values\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} out\r\n */\n\nfunction set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Adds two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Multiplies two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\r\n * Divides two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to ceil\r\n * @returns {vec4} out\r\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to floor\r\n * @returns {vec4} out\r\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\r\n * Math.round the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to round\r\n * @returns {vec4} out\r\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\r\n * Scales a vec4 by a scalar number\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec4} out\r\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two vec4's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec4} out\r\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Calculates the length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nfunction length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nfunction squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Negates the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to negate\r\n * @returns {vec4} out\r\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to invert\r\n * @returns {vec4} out\r\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\r\n * Normalize a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to normalize\r\n * @returns {vec4} out\r\n */\n\nfunction normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n *\r\n * @param {ReadonlyVec4} result the receiving vector\r\n * @param {ReadonlyVec4} U the first vector\r\n * @param {ReadonlyVec4} V the second vector\r\n * @param {ReadonlyVec4} W the third vector\r\n * @returns {vec4} result\r\n */\n\nfunction cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec4} out\r\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec4} out\r\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\r\n * Transforms the vec4 with a mat4.\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec4} out\r\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\r\n * Transforms the vec4 with a quat\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec4} out\r\n */\n\nfunction transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to zero\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @returns {vec4} out\r\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec4} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nfunction str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Alias for {@link vec4.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n/**\r\n * Alias for {@link vec4.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link vec4.divide}\r\n * @function\r\n */\n\nvar div = divide;\n/**\r\n * Alias for {@link vec4.distance}\r\n * @function\r\n */\n\nvar dist = distance;\n/**\r\n * Alias for {@link vec4.squaredDistance}\r\n * @function\r\n */\n\nvar sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec4.length}\r\n * @function\r\n */\n\nvar len = length;\n/**\r\n * Alias for {@link vec4.squaredLength}\r\n * @function\r\n */\n\nvar sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec4s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/vec4.js?"); - -/***/ }), - -/***/ "./node_modules/regenerator-runtime/runtime.js": -/*!*****************************************************!*\ - !*** ./node_modules/regenerator-runtime/runtime.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n true ? module.exports : undefined\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n\n\n//# sourceURL=webpack://diglettk/./node_modules/regenerator-runtime/runtime.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/index.js": -/*!******************************************!*\ - !*** ./node_modules/seedrandom/index.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = __webpack_require__(/*! ./lib/alea */ \"./node_modules/seedrandom/lib/alea.js\");\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = __webpack_require__(/*! ./lib/xor128 */ \"./node_modules/seedrandom/lib/xor128.js\");\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = __webpack_require__(/*! ./lib/xorwow */ \"./node_modules/seedrandom/lib/xorwow.js\");\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = __webpack_require__(/*! ./lib/xorshift7 */ \"./node_modules/seedrandom/lib/xorshift7.js\");\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = __webpack_require__(/*! ./lib/xor4096 */ \"./node_modules/seedrandom/lib/xor4096.js\");\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = __webpack_require__(/*! ./lib/tychei */ \"./node_modules/seedrandom/lib/tychei.js\");\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = __webpack_require__(/*! ./seedrandom */ \"./node_modules/seedrandom/seedrandom.js\");\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/index.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/lib/alea.js": -/*!*********************************************!*\ - !*** ./node_modules/seedrandom/lib/alea.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = String(data);\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (__webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\")) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n true && module, // present in node.js\n __webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") // present with an AMD loader\n);\n\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/lib/alea.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/lib/tychei.js": -/*!***********************************************!*\ - !*** ./node_modules/seedrandom/lib/tychei.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (__webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\")) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n true && module, // present in node.js\n __webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") // present with an AMD loader\n);\n\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/lib/tychei.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/lib/xor128.js": -/*!***********************************************!*\ - !*** ./node_modules/seedrandom/lib/xor128.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (__webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\")) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n true && module, // present in node.js\n __webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") // present with an AMD loader\n);\n\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/lib/xor128.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/lib/xor4096.js": -/*!************************************************!*\ - !*** ./node_modules/seedrandom/lib/xor4096.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (__webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\")) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n true && module, // present in node.js\n __webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") // present with an AMD loader\n);\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/lib/xor4096.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/lib/xorshift7.js": -/*!**************************************************!*\ - !*** ./node_modules/seedrandom/lib/xorshift7.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (__webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\")) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n true && module, // present in node.js\n __webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") // present with an AMD loader\n);\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/lib/xorshift7.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/lib/xorwow.js": -/*!***********************************************!*\ - !*** ./node_modules/seedrandom/lib/xorwow.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (__webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\")) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n true && module, // present in node.js\n __webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") // present with an AMD loader\n);\n\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/lib/xorwow.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/seedrandom.js": -/*!***********************************************!*\ - !*** ./node_modules/seedrandom/seedrandom.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*\nCopyright 2019 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (global, pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\n\nvar width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ( true && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = __webpack_require__(/*! crypto */ 0);\n } catch (ex) {}\n} else if (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return seedrandom; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {}\n\n\n// End anonymous scope, and pass initial values.\n})(\n // global: `self` in browsers (including strict mode and web workers),\n // otherwise `this` in Node and other environments\n (typeof self !== 'undefined') ? self : this,\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/seedrandom.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/CellArray/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/CellArray/index.js ***! - \********************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction extractCellSizes(cellArray) {\n var currentIdx = 0;\n return cellArray.filter(function (value, index) {\n if (index === currentIdx) {\n currentIdx += value + 1;\n return true;\n }\n\n return false;\n });\n}\n\nfunction getNumberOfCells(cellArray) {\n return extractCellSizes(cellArray).length;\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n extractCellSizes: extractCellSizes,\n getNumberOfCells: getNumberOfCells\n}; // ----------------------------------------------------------------------------\n// vtkCellArray methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCellArray(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCellArray');\n\n publicAPI.getNumberOfCells = function (recompute) {\n if (model.numberOfCells !== undefined && !recompute) {\n return model.numberOfCells;\n }\n\n model.cellSizes = extractCellSizes(model.values);\n model.numberOfCells = model.cellSizes.length;\n return model.numberOfCells;\n };\n\n publicAPI.getCellSizes = function (recompute) {\n if (model.cellSizes !== undefined && !recompute) {\n return model.cellSizes;\n }\n\n model.cellSizes = extractCellSizes(model.values);\n return model.cellSizes;\n };\n\n var superSetData = publicAPI.setData;\n\n publicAPI.setData = function (typedArray) {\n superSetData(typedArray, 1);\n model.numberOfCells = undefined;\n model.cellSizes = undefined;\n };\n /**\n * Returns the point indexes at the given location as a subarray.\n */\n\n\n publicAPI.getCell = function (loc) {\n var cellLoc = loc;\n var numberOfPoints = model.values[cellLoc++];\n return model.values.subarray(cellLoc, cellLoc + numberOfPoints);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nfunction defaultValues(initialValues) {\n return _objectSpread({\n empty: true,\n numberOfComponents: 1,\n dataType: vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__[\"VtkDataTypes\"].UNSIGNED_INT\n }, initialValues);\n} // ----------------------------------------------------------------------------\n\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, defaultValues(initialValues));\n vtkCellArray(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkCellArray'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/CellArray/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js ***! - \************************************************************************/ -/*! exports provided: DataTypeByteSize, VtkDataTypes, DefaultDataType, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DataTypeByteSize\", function() { return DataTypeByteSize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VtkDataTypes\", function() { return VtkDataTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DefaultDataType\", function() { return DefaultDataType; });\nvar DataTypeByteSize = {\n Int8Array: 1,\n Uint8Array: 1,\n Uint8ClampedArray: 1,\n Int16Array: 2,\n Uint16Array: 2,\n Int32Array: 4,\n Uint32Array: 4,\n Float32Array: 4,\n Float64Array: 8\n};\nvar VtkDataTypes = {\n VOID: '',\n // not sure to know what that should be\n CHAR: 'Int8Array',\n SIGNED_CHAR: 'Int8Array',\n UNSIGNED_CHAR: 'Uint8Array',\n SHORT: 'Int16Array',\n UNSIGNED_SHORT: 'Uint16Array',\n INT: 'Int32Array',\n UNSIGNED_INT: 'Uint32Array',\n FLOAT: 'Float32Array',\n DOUBLE: 'Float64Array'\n};\nvar DefaultDataType = VtkDataTypes.FLOAT;\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n DefaultDataType: DefaultDataType,\n DataTypeByteSize: DataTypeByteSize,\n VtkDataTypes: VtkDataTypes\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js ***! - \********************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\nvar DefaultDataType = vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].DefaultDataType;\nvar TUPLE_HOLDER = []; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction createRangeHelper() {\n var min = Number.MAX_VALUE;\n var max = -Number.MAX_VALUE;\n var count = 0;\n var sum = 0;\n return {\n add: function add(value) {\n if (min > value) {\n min = value;\n }\n\n if (max < value) {\n max = value;\n }\n\n count++;\n sum += value;\n },\n get: function get() {\n return {\n min: min,\n max: max,\n count: count,\n sum: sum,\n mean: sum / count\n };\n },\n getRange: function getRange() {\n return {\n min: min,\n max: max\n };\n }\n };\n}\n\nfunction computeRange(values) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var numberOfComponents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var helper = createRangeHelper();\n var size = values.length;\n var value = 0;\n\n if (component < 0 && numberOfComponents > 1) {\n // Compute magnitude\n for (var i = 0; i < size; i += numberOfComponents) {\n value = 0;\n\n for (var j = 0; j < numberOfComponents; j++) {\n value += values[i + j] * values[i + j];\n }\n\n value = Math.pow(value, 0.5);\n helper.add(value);\n }\n\n return helper.getRange();\n }\n\n var offset = component < 0 ? 0 : component;\n\n for (var _i = offset; _i < size; _i += numberOfComponents) {\n helper.add(values[_i]);\n }\n\n return helper.getRange();\n}\n\nfunction ensureRangeSize(rangeArray) {\n var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var ranges = rangeArray || []; // Pad ranges with null value to get the\n\n while (ranges.length <= size) {\n ranges.push(null);\n }\n\n return ranges;\n}\n\nfunction getDataType(typedArray) {\n // Expects toString() to return \"[object ...Array]\"\n return Object.prototype.toString.call(typedArray).slice(8, -1);\n}\n\nfunction getMaxNorm(normArray) {\n var numComps = normArray.getNumberOfComponents();\n var maxNorm = 0.0;\n\n for (var i = 0; i < normArray.getNumberOfTuples(); ++i) {\n var norm = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"norm\"](normArray.getTuple(i), numComps);\n\n if (norm > maxNorm) {\n maxNorm = norm;\n }\n }\n\n return maxNorm;\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n computeRange: computeRange,\n createRangeHelper: createRangeHelper,\n getDataType: getDataType,\n getMaxNorm: getMaxNorm\n}; // ----------------------------------------------------------------------------\n// vtkDataArray methods\n// ----------------------------------------------------------------------------\n\nfunction vtkDataArray(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkDataArray');\n\n function dataChange() {\n model.ranges = null;\n publicAPI.modified();\n }\n\n publicAPI.getElementComponentSize = function () {\n return model.values.BYTES_PER_ELEMENT;\n }; // Description:\n // Return the data component at the location specified by tupleIdx and\n // compIdx.\n\n\n publicAPI.getComponent = function (tupleIdx) {\n var compIdx = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return model.values[tupleIdx * model.numberOfComponents + compIdx];\n }; // Description:\n // Set the data component at the location specified by tupleIdx and compIdx\n // to value.\n // Note that i is less than NumberOfTuples and j is less than\n // NumberOfComponents. Make sure enough memory has been allocated\n // (use SetNumberOfTuples() and SetNumberOfComponents()).\n\n\n publicAPI.setComponent = function (tupleIdx, compIdx, value) {\n if (value !== model.values[tupleIdx * model.numberOfComponents + compIdx]) {\n model.values[tupleIdx * model.numberOfComponents + compIdx] = value;\n dataChange();\n }\n };\n\n publicAPI.getData = function () {\n return model.values;\n };\n\n publicAPI.getRange = function () {\n var componentIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;\n var rangeIdx = componentIndex < 0 ? model.numberOfComponents : componentIndex;\n var range = null;\n\n if (!model.ranges) {\n model.ranges = ensureRangeSize(model.ranges, model.numberOfComponents);\n }\n\n range = model.ranges[rangeIdx];\n\n if (range) {\n model.rangeTuple[0] = range.min;\n model.rangeTuple[1] = range.max;\n return model.rangeTuple;\n } // Need to compute ranges...\n\n\n range = computeRange(model.values, componentIndex, model.numberOfComponents);\n model.ranges[rangeIdx] = range;\n model.rangeTuple[0] = range.min;\n model.rangeTuple[1] = range.max;\n return model.rangeTuple;\n };\n\n publicAPI.setRange = function (rangeValue, componentIndex) {\n if (!model.ranges) {\n model.ranges = ensureRangeSize(model.ranges, model.numberOfComponents);\n }\n\n var range = {\n min: rangeValue.min,\n max: rangeValue.max\n };\n model.ranges[componentIndex] = range;\n model.rangeTuple[0] = range.min;\n model.rangeTuple[1] = range.max;\n return model.rangeTuple;\n };\n\n publicAPI.setTuple = function (idx, tuple) {\n var offset = idx * model.numberOfComponents;\n\n for (var i = 0; i < model.numberOfComponents; i++) {\n model.values[offset + i] = tuple[i];\n }\n };\n\n publicAPI.getTuple = function (idx) {\n var tupleToFill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TUPLE_HOLDER;\n var numberOfComponents = model.numberOfComponents || 1;\n\n if (tupleToFill.length !== numberOfComponents) {\n tupleToFill.length = numberOfComponents;\n }\n\n var offset = idx * numberOfComponents; // Check most common component sizes first\n // to avoid doing a for loop if possible\n\n if (numberOfComponents === 1) {\n tupleToFill[0] = model.values[offset];\n } else if (numberOfComponents === 2) {\n tupleToFill[0] = model.values[offset];\n tupleToFill[1] = model.values[offset + 1];\n } else if (numberOfComponents === 3) {\n tupleToFill[0] = model.values[offset];\n tupleToFill[1] = model.values[offset + 1];\n tupleToFill[2] = model.values[offset + 2];\n } else if (numberOfComponents === 4) {\n tupleToFill[0] = model.values[offset];\n tupleToFill[1] = model.values[offset + 1];\n tupleToFill[2] = model.values[offset + 2];\n tupleToFill[3] = model.values[offset + 3];\n } else {\n for (var i = 0; i < numberOfComponents; i++) {\n tupleToFill[i] = model.values[offset + i];\n }\n }\n\n return tupleToFill;\n };\n\n publicAPI.getTupleLocation = function () {\n var idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n return idx * model.numberOfComponents;\n };\n\n publicAPI.getNumberOfComponents = function () {\n return model.numberOfComponents;\n };\n\n publicAPI.getNumberOfValues = function () {\n return model.values.length;\n };\n\n publicAPI.getNumberOfTuples = function () {\n return model.values.length / model.numberOfComponents;\n };\n\n publicAPI.getDataType = function () {\n return model.dataType;\n };\n /* eslint-disable no-use-before-define */\n\n\n publicAPI.newClone = function () {\n return newInstance({\n empty: true,\n name: model.name,\n dataType: model.dataType,\n numberOfComponents: model.numberOfComponents\n });\n };\n /* eslint-enable no-use-before-define */\n\n\n publicAPI.getName = function () {\n if (!model.name) {\n publicAPI.modified();\n model.name = \"vtkDataArray\".concat(publicAPI.getMTime());\n }\n\n return model.name;\n };\n\n publicAPI.setData = function (typedArray, numberOfComponents) {\n model.values = typedArray;\n model.size = typedArray.length;\n model.dataType = getDataType(typedArray);\n\n if (numberOfComponents) {\n model.numberOfComponents = numberOfComponents;\n }\n\n if (model.size % model.numberOfComponents !== 0) {\n model.numberOfComponents = 1;\n }\n\n dataChange();\n }; // Override serialization support\n\n\n publicAPI.getState = function () {\n var jsonArchive = _objectSpread(_objectSpread({}, model), {}, {\n vtkClass: publicAPI.getClassName()\n }); // Convert typed array to regular array\n\n\n jsonArchive.values = Array.from(jsonArchive.values);\n delete jsonArchive.buffer; // Clean any empty data\n\n Object.keys(jsonArchive).forEach(function (keyName) {\n if (!jsonArchive[keyName]) {\n delete jsonArchive[keyName];\n }\n }); // Sort resulting object by key name\n\n var sortedObj = {};\n Object.keys(jsonArchive).sort().forEach(function (name) {\n sortedObj[name] = jsonArchive[name];\n }); // Remove mtime\n\n if (sortedObj.mtime) {\n delete sortedObj.mtime;\n }\n\n return sortedObj;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n name: '',\n numberOfComponents: 1,\n size: 0,\n dataType: DefaultDataType,\n rangeTuple: [0, 0] // values: null,\n // ranges: null,\n\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n\n if (!model.empty && !model.values && !model.size) {\n throw new TypeError('Cannot create vtkDataArray object without: size > 0, values');\n }\n\n if (!model.values) {\n model.values = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newTypedArray\"](model.dataType, model.size);\n } else if (Array.isArray(model.values)) {\n model.values = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newTypedArrayFrom\"](model.dataType, model.values);\n }\n\n if (model.values) {\n model.size = model.values.length;\n model.dataType = getDataType(model.values);\n } // Object methods\n\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"set\"](publicAPI, model, ['name', 'numberOfComponents']); // Object specific methods\n\n vtkDataArray(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkDataArray'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread(_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC), vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/LookupTable/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/LookupTable/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_ScalarsToColors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/ScalarsToColors */ \"./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/ScalarsToColors/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n// Add module-level functions or api that you want to expose statically via\n// the next section...\n// ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\nvar BELOW_RANGE_COLOR_INDEX = 0;\nvar ABOVE_RANGE_COLOR_INDEX = 1;\nvar NAN_COLOR_INDEX = 2; // ----------------------------------------------------------------------------\n// vtkMyClass methods\n// ----------------------------------------------------------------------------\n\nfunction vtkLookupTable(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkLookupTable'); //----------------------------------------------------------------------------\n // Description:\n // Return true if all of the values defining the mapping have an opacity\n // equal to 1. Default implementation return true.\n\n publicAPI.isOpaque = function () {\n if (model.opaqueFlagBuildTime.getMTime() < publicAPI.getMTime()) {\n var opaque = true;\n\n if (model.nanColor[3] < 1.0) {\n opaque = 0;\n }\n\n if (model.useBelowRangeColor && model.belowRangeColor[3] < 1.0) {\n opaque = 0;\n }\n\n if (model.useAboveRangeColor && model.aboveRangeColor[3] < 1.0) {\n opaque = 0;\n }\n\n for (var i = 3; i < model.table.length && opaque; i += 4) {\n if (model.table[i] < 255) {\n opaque = false;\n }\n }\n\n model.opaqueFlag = opaque;\n model.opaqueFlagBuildTime.modified();\n }\n\n return model.opaqueFlag;\n };\n\n publicAPI.usingLogScale = function () {\n return false;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfAvailableColors = function () {\n return model.table.length;\n }; //----------------------------------------------------------------------------\n // Apply shift/scale to the scalar value v and return the index.\n\n\n publicAPI.linearIndexLookup = function (v, p) {\n var dIndex = 0;\n\n if (v < p.range[0]) {\n dIndex = p.maxIndex + BELOW_RANGE_COLOR_INDEX + 1.5;\n } else if (v > p.range[1]) {\n dIndex = p.maxIndex + ABOVE_RANGE_COLOR_INDEX + 1.5;\n } else {\n dIndex = (v + p.shift) * p.scale; // This conditional is needed because when v is very close to\n // p.Range[1], it may map above p.MaxIndex in the linear mapping\n // above.\n\n dIndex = dIndex < p.maxIndex ? dIndex : p.maxIndex;\n }\n\n return Math.floor(dIndex);\n };\n\n publicAPI.linearLookup = function (v, table, p) {\n var index = 0;\n\n if (vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"isNan\"](v)) {\n index = Math.floor(p.maxIndex + 1.5 + NAN_COLOR_INDEX);\n } else {\n index = publicAPI.linearIndexLookup(v, p);\n }\n\n var offset = 4 * index;\n return [table[offset], table[offset + 1], table[offset + 2], table[offset + 3]];\n };\n\n publicAPI.indexedLookupFunction = function (v, table, p) {\n var index = publicAPI.getAnnotatedValueIndexInternal(v);\n\n if (index === -1) {\n index = model.numberOfColors + NAN_COLOR_INDEX;\n }\n\n var offset = 4 * index;\n return [table[offset], table[offset + 1], table[offset + 2], table[offset + 3]];\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.lookupShiftAndScale = function (range, p) {\n p.shift = -range[0];\n p.scale = Number.MAX_VALUE;\n\n if (range[1] > range[0]) {\n p.scale = (p.maxIndex + 1) / (range[1] - range[0]);\n }\n }; // Public API methods\n\n\n publicAPI.mapScalarsThroughTable = function (input, output, outFormat, inputOffset) {\n var lookupFunc = publicAPI.linearLookup;\n\n if (model.indexedLookup) {\n lookupFunc = publicAPI.indexedLookupFunction;\n }\n\n var trange = publicAPI.getMappingRange();\n var p = {\n maxIndex: publicAPI.getNumberOfColors() - 1,\n range: trange,\n shift: 0.0,\n scale: 0.0\n };\n publicAPI.lookupShiftAndScale(trange, p);\n var alpha = publicAPI.getAlpha();\n var length = input.getNumberOfTuples();\n var inIncr = input.getNumberOfComponents();\n var outputV = output.getData();\n var inputV = input.getData();\n\n if (alpha >= 1.0) {\n if (outFormat === vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_3__[\"ScalarMappingTarget\"].RGBA) {\n for (var i = 0; i < length; i++) {\n var cptr = lookupFunc(inputV[i * inIncr + inputOffset], model.table, p);\n outputV[i * 4] = cptr[0];\n outputV[i * 4 + 1] = cptr[1];\n outputV[i * 4 + 2] = cptr[2];\n outputV[i * 4 + 3] = cptr[3];\n }\n }\n } else {\n /* eslint-disable no-lonely-if */\n if (outFormat === vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_3__[\"ScalarMappingTarget\"].RGBA) {\n for (var _i = 0; _i < length; _i++) {\n var _cptr = lookupFunc(inputV[_i * inIncr + inputOffset], model.table, p);\n\n outputV[_i * 4] = _cptr[0];\n outputV[_i * 4 + 1] = _cptr[1];\n outputV[_i * 4 + 2] = _cptr[2];\n outputV[_i * 4 + 3] = Math.floor(_cptr[3] * alpha + 0.5);\n }\n }\n } // alpha blending\n\n };\n\n publicAPI.forceBuild = function () {\n var hinc = 0.0;\n var sinc = 0.0;\n var vinc = 0.0;\n var ainc = 0.0;\n var maxIndex = model.numberOfColors - 1;\n\n if (maxIndex) {\n hinc = (model.hueRange[1] - model.hueRange[0]) / maxIndex;\n sinc = (model.saturationRange[1] - model.saturationRange[0]) / maxIndex;\n vinc = (model.valueRange[1] - model.valueRange[0]) / maxIndex;\n ainc = (model.alphaRange[1] - model.alphaRange[0]) / maxIndex;\n }\n\n var hsv = [];\n var rgba = [];\n\n for (var i = 0; i <= maxIndex; i++) {\n hsv[0] = model.hueRange[0] + i * hinc;\n hsv[1] = model.saturationRange[0] + i * sinc;\n hsv[2] = model.valueRange[0] + i * vinc;\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"hsv2rgb\"](hsv, rgba);\n rgba[3] = model.alphaRange[0] + i * ainc; // case VTK_RAMP_LINEAR:\n\n model.table[i * 4] = rgba[0] * 255.0 + 0.5;\n model.table[i * 4 + 1] = rgba[1] * 255.0 + 0.5;\n model.table[i * 4 + 2] = rgba[2] * 255.0 + 0.5;\n model.table[i * 4 + 3] = rgba[3] * 255.0 + 0.5;\n }\n\n publicAPI.buildSpecialColors();\n model.buildTime.modified();\n };\n\n publicAPI.setTable = function (table) {\n if (table.getNumberOfComponents() !== 4) {\n vtkErrorMacro('Expected 4 components for RGBA colors');\n return;\n }\n\n if (table.getDataType() !== vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__[\"VtkDataTypes\"].UNSIGNED_CHAR) {\n vtkErrorMacro('Expected unsigned char values for RGBA colors');\n return;\n }\n\n model.numberOfColors = table.getNumberOfTuples();\n var data = table.getData();\n\n for (var i = 0; i < data.length; i++) {\n model.table[i] = data[i];\n }\n\n publicAPI.buildSpecialColors();\n model.insertTime.modified();\n publicAPI.modified();\n };\n\n publicAPI.buildSpecialColors = function () {\n // Add \"special\" colors (NaN, below range, above range) to table here.\n var numberOfColors = model.numberOfColors;\n var tptr = model.table;\n var base = (numberOfColors + BELOW_RANGE_COLOR_INDEX) * 4; // Below range color\n\n if (model.useBelowRangeColor || numberOfColors === 0) {\n tptr[base] = model.belowRangeColor[0] * 255.0 + 0.5;\n tptr[base + 1] = model.belowRangeColor[1] * 255.0 + 0.5;\n tptr[base + 2] = model.belowRangeColor[2] * 255.0 + 0.5;\n tptr[base + 3] = model.belowRangeColor[3] * 255.0 + 0.5;\n } else {\n // Duplicate the first color in the table.\n tptr[base] = tptr[0];\n tptr[base + 1] = tptr[1];\n tptr[base + 2] = tptr[2];\n tptr[base + 3] = tptr[3];\n } // Above range color\n\n\n base = (numberOfColors + ABOVE_RANGE_COLOR_INDEX) * 4;\n\n if (model.useAboveRangeColor || numberOfColors === 0) {\n tptr[base] = model.aboveRangeColor[0] * 255.0 + 0.5;\n tptr[base + 1] = model.aboveRangeColor[1] * 255.0 + 0.5;\n tptr[base + 2] = model.aboveRangeColor[2] * 255.0 + 0.5;\n tptr[base + 3] = model.aboveRangeColor[3] * 255.0 + 0.5;\n } else {\n // Duplicate the last color in the table.\n tptr[base] = tptr[4 * (numberOfColors - 1) + 0];\n tptr[base + 1] = tptr[4 * (numberOfColors - 1) + 1];\n tptr[base + 2] = tptr[4 * (numberOfColors - 1) + 2];\n tptr[base + 3] = tptr[4 * (numberOfColors - 1) + 3];\n } // Always use NanColor\n\n\n base = (numberOfColors + NAN_COLOR_INDEX) * 4;\n tptr[base] = model.nanColor[0] * 255.0 + 0.5;\n tptr[base + 1] = model.nanColor[1] * 255.0 + 0.5;\n tptr[base + 2] = model.nanColor[2] * 255.0 + 0.5;\n tptr[base + 3] = model.nanColor[3] * 255.0 + 0.5;\n };\n\n publicAPI.build = function () {\n if (model.table.length < 1 || publicAPI.getMTime() > model.buildTime.getMTime() && model.insertTime.getMTime() <= model.buildTime.getMTime()) {\n publicAPI.forceBuild();\n }\n };\n\n if (model.table.length > 0) {\n // ensure insertTime is more recently modified than buildTime if\n // a table is provided via the constructor\n model.insertTime.modified();\n }\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n numberOfColors: 256,\n // table: null,\n hueRange: [0.0, 0.66667],\n saturationRange: [1.0, 1.0],\n valueRange: [1.0, 1.0],\n alphaRange: [1.0, 1.0],\n nanColor: [0.5, 0.0, 0.0, 1.0],\n belowRangeColor: [0.0, 0.0, 0.0, 1.0],\n aboveRangeColor: [1.0, 1.0, 1.0, 1.0],\n useAboveRangeColor: false,\n useBelowRangeColor: false,\n alpha: 1.0 // buildTime: null,\n // opaqueFlagBuildTime: null,\n // insertTime: null,\n\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Common_Core_ScalarsToColors__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues); // Internal objects initialization\n\n if (!model.table) {\n model.table = [];\n }\n\n model.buildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.buildTime);\n model.opaqueFlagBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.opaqueFlagBuildTime, {\n mtime: 0\n });\n model.insertTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.insertTime, {\n mtime: 0\n }); // Create get-only macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['buildTime']); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['numberOfColors', 'useAboveRangeColor', 'useBelowRangeColor']); // Create set macros for array (needs to know size)\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setArray(publicAPI, model, ['alphaRange', 'hueRange', 'saturationRange', 'valueRange'], 2);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setArray(publicAPI, model, ['nanColor', 'belowRangeColor', 'aboveRangeColor'], 4); // Create get macros for array\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['hueRange', 'saturationRange', 'valueRange', 'alphaRange', 'nanColor', 'belowRangeColor', 'aboveRangeColor']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkLookupTable(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkLookupTable'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/LookupTable/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/Math/index.js": -/*!***************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/Math/index.js ***! - \***************************************************************/ -/*! exports provided: Pi, radiansFromDegrees, degreesFromRadians, round, floor, ceil, min, max, arrayMin, arrayMax, arrayRange, ceilLog2, factorial, nearestPowerOfTwo, isPowerOfTwo, binomial, beginCombination, nextCombination, randomSeed, getSeed, random, gaussian, add, subtract, multiplyScalar, multiplyScalar2D, multiplyAccumulate, multiplyAccumulate2D, dot, outer, cross, norm, normalize, perpendiculars, projectVector, dot2D, projectVector2D, distance2BetweenPoints, angleBetweenVectors, signedAngleBetweenVectors, gaussianAmplitude, gaussianWeight, outer2D, norm2D, normalize2D, determinant2x2, LUFactor3x3, LUSolve3x3, linearSolve3x3, multiply3x3_vect3, multiply3x3_mat3, multiplyMatrix, transpose3x3, invert3x3, identity3x3, determinant3x3, quaternionToMatrix3x3, areEquals, areMatricesEqual, roundNumber, roundVector, jacobiN, matrix3x3ToQuaternion, multiplyQuaternion, orthogonalize3x3, diagonalize3x3, singularValueDecomposition3x3, luFactorLinearSystem, luSolveLinearSystem, solveLinearSystem, invertMatrix, estimateMatrixCondition, jacobi, solveHomogeneousLeastSquares, solveLeastSquares, hex2float, rgb2hsv, hsv2rgb, lab2xyz, xyz2lab, xyz2rgb, rgb2xyz, rgb2lab, lab2rgb, uninitializeBounds, areBoundsInitialized, computeBoundsFromPoints, clampValue, clampVector, clampAndNormalizeValue, getScalarTypeFittingRange, getAdjustedScalarRange, extentIsWithinOtherExtent, boundsIsWithinOtherBounds, pointIsWithinBounds, solve3PointCircle, inf, negInf, isInf, isFinite, isNaN, isNan, createUninitializedBounds, getMajorAxisIndex, floatToHex2, floatRGB2HexCode, float2CssRGBA, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Pi\", function() { return Pi; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"radiansFromDegrees\", function() { return radiansFromDegrees; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"degreesFromRadians\", function() { return degreesFromRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arrayMin\", function() { return arrayMin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arrayMax\", function() { return arrayMax; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arrayRange\", function() { return arrayRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceilLog2\", function() { return ceilLog2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"factorial\", function() { return factorial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"nearestPowerOfTwo\", function() { return nearestPowerOfTwo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPowerOfTwo\", function() { return isPowerOfTwo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"binomial\", function() { return binomial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"beginCombination\", function() { return beginCombination; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"nextCombination\", function() { return nextCombination; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"randomSeed\", function() { return randomSeed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSeed\", function() { return getSeed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gaussian\", function() { return gaussian; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar2D\", function() { return multiplyScalar2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyAccumulate\", function() { return multiplyAccumulate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyAccumulate2D\", function() { return multiplyAccumulate2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"outer\", function() { return outer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"norm\", function() { return norm; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perpendiculars\", function() { return perpendiculars; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"projectVector\", function() { return projectVector; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot2D\", function() { return dot2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"projectVector2D\", function() { return projectVector2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance2BetweenPoints\", function() { return distance2BetweenPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angleBetweenVectors\", function() { return angleBetweenVectors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"signedAngleBetweenVectors\", function() { return signedAngleBetweenVectors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gaussianAmplitude\", function() { return gaussianAmplitude; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gaussianWeight\", function() { return gaussianWeight; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"outer2D\", function() { return outer2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"norm2D\", function() { return norm2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize2D\", function() { return normalize2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant2x2\", function() { return determinant2x2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LUFactor3x3\", function() { return LUFactor3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LUSolve3x3\", function() { return LUSolve3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"linearSolve3x3\", function() { return linearSolve3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply3x3_vect3\", function() { return multiply3x3_vect3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply3x3_mat3\", function() { return multiply3x3_mat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyMatrix\", function() { return multiplyMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose3x3\", function() { return transpose3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert3x3\", function() { return invert3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity3x3\", function() { return identity3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant3x3\", function() { return determinant3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"quaternionToMatrix3x3\", function() { return quaternionToMatrix3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"areEquals\", function() { return areEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"areMatricesEqual\", function() { return areMatricesEqual; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"roundNumber\", function() { return roundNumber; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"roundVector\", function() { return roundVector; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"jacobiN\", function() { return jacobiN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"matrix3x3ToQuaternion\", function() { return matrix3x3ToQuaternion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyQuaternion\", function() { return multiplyQuaternion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"orthogonalize3x3\", function() { return orthogonalize3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"diagonalize3x3\", function() { return diagonalize3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"singularValueDecomposition3x3\", function() { return singularValueDecomposition3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"luFactorLinearSystem\", function() { return luFactorLinearSystem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"luSolveLinearSystem\", function() { return luSolveLinearSystem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"solveLinearSystem\", function() { return solveLinearSystem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invertMatrix\", function() { return invertMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"estimateMatrixCondition\", function() { return estimateMatrixCondition; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"jacobi\", function() { return jacobi; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"solveHomogeneousLeastSquares\", function() { return solveHomogeneousLeastSquares; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"solveLeastSquares\", function() { return solveLeastSquares; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hex2float\", function() { return hex2float; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgb2hsv\", function() { return rgb2hsv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hsv2rgb\", function() { return hsv2rgb; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lab2xyz\", function() { return lab2xyz; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"xyz2lab\", function() { return xyz2lab; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"xyz2rgb\", function() { return xyz2rgb; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgb2xyz\", function() { return rgb2xyz; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgb2lab\", function() { return rgb2lab; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lab2rgb\", function() { return lab2rgb; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"uninitializeBounds\", function() { return uninitializeBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"areBoundsInitialized\", function() { return areBoundsInitialized; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computeBoundsFromPoints\", function() { return computeBoundsFromPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clampValue\", function() { return clampValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clampVector\", function() { return clampVector; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clampAndNormalizeValue\", function() { return clampAndNormalizeValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScalarTypeFittingRange\", function() { return getScalarTypeFittingRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAdjustedScalarRange\", function() { return getAdjustedScalarRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extentIsWithinOtherExtent\", function() { return extentIsWithinOtherExtent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"boundsIsWithinOtherBounds\", function() { return boundsIsWithinOtherBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pointIsWithinBounds\", function() { return pointIsWithinBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"solve3PointCircle\", function() { return solve3PointCircle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inf\", function() { return inf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negInf\", function() { return negInf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isInf\", function() { return isInf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFinite\", function() { return isFinite; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNaN\", function() { return isNaN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNan\", function() { return isNan; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createUninitializedBounds\", function() { return createUninitializedBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMajorAxisIndex\", function() { return getMajorAxisIndex; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floatToHex2\", function() { return floatToHex2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floatRGB2HexCode\", function() { return floatRGB2HexCode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"float2CssRGBA\", function() { return float2CssRGBA; });\n/* harmony import */ var seedrandom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! seedrandom */ \"./node_modules/seedrandom/index.js\");\n/* harmony import */ var seedrandom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(seedrandom__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkErrorMacro,\n vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkWarningMacro; // ----------------------------------------------------------------------------\n\n/* eslint-disable camelcase */\n\n/* eslint-disable no-cond-assign */\n\n/* eslint-disable no-bitwise */\n\n/* eslint-disable no-multi-assign */\n// ----------------------------------------------------------------------------\n\nvar randomSeedValue = 0;\nvar VTK_MAX_ROTATIONS = 20;\nvar VTK_SMALL_NUMBER = 1.0e-12;\n\nfunction notImplemented(method) {\n return function () {\n return vtkErrorMacro(\"vtkMath::\".concat(method, \" - NOT IMPLEMENTED\"));\n };\n}\n\nfunction vtkSwapVectors3(v1, v2) {\n for (var i = 0; i < 3; i++) {\n var tmp = v1[i];\n v1[i] = v2[i];\n v2[i] = tmp;\n }\n}\n\nfunction createArray() {\n var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3;\n var array = [];\n\n while (array.length < size) {\n array.push(0);\n }\n\n return array;\n} // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\n\nvar Pi = function Pi() {\n return Math.PI;\n};\nfunction radiansFromDegrees(deg) {\n return deg / 180 * Math.PI;\n}\nfunction degreesFromRadians(rad) {\n return rad * 180 / Math.PI;\n}\nvar round = Math.round,\n floor = Math.floor,\n ceil = Math.ceil,\n min = Math.min,\n max = Math.max;\n\nfunction arrayMin(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var stride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var minValue = Infinity;\n\n for (var i = offset, len = arr.length; i < len; i += stride) {\n if (arr[i] < minValue) {\n minValue = arr[i];\n }\n }\n\n return minValue;\n}\nfunction arrayMax(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var stride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var maxValue = -Infinity;\n\n for (var i = offset, len = arr.length; i < len; i += stride) {\n if (maxValue < arr[i]) {\n maxValue = arr[i];\n }\n }\n\n return maxValue;\n}\nfunction arrayRange(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var stride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var minValue = Infinity;\n var maxValue = -Infinity;\n\n for (var i = offset, len = arr.length; i < len; i += stride) {\n if (arr[i] < minValue) {\n minValue = arr[i];\n }\n\n if (maxValue < arr[i]) {\n maxValue = arr[i];\n }\n }\n\n return [minValue, maxValue];\n}\nvar ceilLog2 = notImplemented('ceilLog2');\nvar factorial = notImplemented('factorial');\nfunction nearestPowerOfTwo(xi) {\n var v = 1;\n\n while (v < xi) {\n v *= 2;\n }\n\n return v;\n}\nfunction isPowerOfTwo(x) {\n return x === nearestPowerOfTwo(x);\n}\nfunction binomial(m, n) {\n var r = 1;\n\n for (var i = 1; i <= n; ++i) {\n r *= (m - i + 1) / i;\n }\n\n return Math.floor(r);\n}\nfunction beginCombination(m, n) {\n if (m < n) {\n return 0;\n }\n\n var r = createArray(n);\n\n for (var i = 0; i < n; ++i) {\n r[i] = i;\n }\n\n return r;\n}\nfunction nextCombination(m, n, r) {\n var status = 0;\n\n for (var i = n - 1; i >= 0; --i) {\n if (r[i] < m - n + i) {\n var j = r[i] + 1;\n\n while (i < n) {\n r[i++] = j++;\n }\n\n status = 1;\n break;\n }\n }\n\n return status;\n}\nfunction randomSeed(seed) {\n seedrandom__WEBPACK_IMPORTED_MODULE_0___default()(\"\".concat(seed), {\n global: true\n });\n randomSeedValue = seed;\n}\nfunction getSeed() {\n return randomSeedValue;\n}\nfunction random() {\n var minValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var maxValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var delta = maxValue - minValue;\n return minValue + delta * Math.random();\n}\nvar gaussian = notImplemented('gaussian'); // Vect3 operations\n\nfunction add(a, b, out) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\nfunction subtract(a, b, out) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\nfunction multiplyScalar(vec, scalar) {\n vec[0] *= scalar;\n vec[1] *= scalar;\n vec[2] *= scalar;\n return vec;\n}\nfunction multiplyScalar2D(vec, scalar) {\n vec[0] *= scalar;\n vec[1] *= scalar;\n return vec;\n}\nfunction multiplyAccumulate(a, b, scalar, out) {\n out[0] = a[0] + b[0] * scalar;\n out[1] = a[1] + b[1] * scalar;\n out[2] = a[2] + b[2] * scalar;\n return out;\n}\nfunction multiplyAccumulate2D(a, b, scalar, out) {\n out[0] = a[0] + b[0] * scalar;\n out[1] = a[1] + b[1] * scalar;\n return out;\n}\nfunction dot(x, y) {\n return x[0] * y[0] + x[1] * y[1] + x[2] * y[2];\n}\nfunction outer(x, y, out_3x3) {\n for (var i = 0; i < 3; i++) {\n for (var j = 0; j < 3; j++) {\n out_3x3[i][j] = x[i] * y[j];\n }\n }\n}\nfunction cross(x, y, out) {\n var Zx = x[1] * y[2] - x[2] * y[1];\n var Zy = x[2] * y[0] - x[0] * y[2];\n var Zz = x[0] * y[1] - x[1] * y[0];\n out[0] = Zx;\n out[1] = Zy;\n out[2] = Zz;\n return out;\n}\nfunction norm(x) {\n var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;\n\n switch (n) {\n case 1:\n return Math.abs(x);\n\n case 2:\n return Math.sqrt(x[0] * x[0] + x[1] * x[1]);\n\n case 3:\n return Math.sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]);\n\n default:\n {\n var sum = 0;\n\n for (var i = 0; i < n; i++) {\n sum += x[i] * x[i];\n }\n\n return Math.sqrt(sum);\n }\n }\n}\nfunction normalize(x) {\n var den = norm(x);\n\n if (den !== 0.0) {\n x[0] /= den;\n x[1] /= den;\n x[2] /= den;\n }\n\n return den;\n}\nfunction perpendiculars(x, y, z, theta) {\n var x2 = x[0] * x[0];\n var y2 = x[1] * x[1];\n var z2 = x[2] * x[2];\n var r = Math.sqrt(x2 + y2 + z2);\n var dx;\n var dy;\n var dz; // transpose the vector to avoid divide-by-zero error\n\n if (x2 > y2 && x2 > z2) {\n dx = 0;\n dy = 1;\n dz = 2;\n } else if (y2 > z2) {\n dx = 1;\n dy = 2;\n dz = 0;\n } else {\n dx = 2;\n dy = 0;\n dz = 1;\n }\n\n var a = x[dx] / r;\n var b = x[dy] / r;\n var c = x[dz] / r;\n var tmp = Math.sqrt(a * a + c * c);\n\n if (theta !== 0) {\n var sintheta = Math.sin(theta);\n var costheta = Math.cos(theta);\n\n if (y) {\n y[dx] = (c * costheta - a * b * sintheta) / tmp;\n y[dy] = sintheta * tmp;\n y[dz] = (-(a * costheta) - b * c * sintheta) / tmp;\n }\n\n if (z) {\n z[dx] = (-(c * sintheta) - a * b * costheta) / tmp;\n z[dy] = costheta * tmp;\n z[dz] = (a * sintheta - b * c * costheta) / tmp;\n }\n } else {\n if (y) {\n y[dx] = c / tmp;\n y[dy] = 0;\n y[dz] = -a / tmp;\n }\n\n if (z) {\n z[dx] = -a * b / tmp;\n z[dy] = tmp;\n z[dz] = -b * c / tmp;\n }\n }\n}\nfunction projectVector(a, b, projection) {\n var bSquared = dot(b, b);\n\n if (bSquared === 0) {\n projection[0] = 0;\n projection[1] = 0;\n projection[2] = 0;\n return false;\n }\n\n var scale = dot(a, b) / bSquared;\n\n for (var i = 0; i < 3; i++) {\n projection[i] = b[i];\n }\n\n multiplyScalar(projection, scale);\n return true;\n}\nfunction dot2D(x, y) {\n return x[0] * y[0] + x[1] * y[1];\n}\nfunction projectVector2D(a, b, projection) {\n var bSquared = dot2D(b, b);\n\n if (bSquared === 0) {\n projection[0] = 0;\n projection[1] = 0;\n return false;\n }\n\n var scale = dot2D(a, b) / bSquared;\n\n for (var i = 0; i < 2; i++) {\n projection[i] = b[i];\n }\n\n multiplyScalar2D(projection, scale);\n return true;\n}\nfunction distance2BetweenPoints(x, y) {\n return (x[0] - y[0]) * (x[0] - y[0]) + (x[1] - y[1]) * (x[1] - y[1]) + (x[2] - y[2]) * (x[2] - y[2]);\n}\nfunction angleBetweenVectors(v1, v2) {\n var crossVect = [0, 0, 0];\n cross(v1, v2, crossVect);\n return Math.atan2(norm(crossVect), dot(v1, v2));\n}\nfunction signedAngleBetweenVectors(v1, v2, vN) {\n var crossVect = [0, 0, 0];\n cross(v1, v2, crossVect);\n var angle = Math.atan2(norm(crossVect), dot(v1, v2));\n return dot(crossVect, vN) >= 0 ? angle : -angle;\n}\nfunction gaussianAmplitude(mean, variance, position) {\n var distanceFromMean = Math.abs(mean - position);\n return 1 / Math.sqrt(2 * Math.PI * variance) * Math.exp(-Math.pow(distanceFromMean, 2) / (2 * variance));\n}\nfunction gaussianWeight(mean, variance, position) {\n var distanceFromMean = Math.abs(mean - position);\n return Math.exp(-Math.pow(distanceFromMean, 2) / (2 * variance));\n}\nfunction outer2D(x, y, out_2x2) {\n for (var i = 0; i < 2; i++) {\n for (var j = 0; j < 2; j++) {\n out_2x2[i][j] = x[i] * y[j];\n }\n }\n}\nfunction norm2D(x2D) {\n return Math.sqrt(x2D[0] * x2D[0] + x2D[1] * x2D[1]);\n}\nfunction normalize2D(x) {\n var den = norm2D(x);\n\n if (den !== 0.0) {\n x[0] /= den;\n x[1] /= den;\n }\n\n return den;\n}\nfunction determinant2x2() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (args.length === 2) {\n return args[0][0] * args[1][1] - args[1][0] * args[0][1];\n }\n\n if (args.length === 4) {\n return args[0] * args[3] - args[1] * args[2];\n }\n\n return Number.NaN;\n}\nfunction LUFactor3x3(mat_3x3, index_3) {\n var maxI;\n var tmp;\n var largest;\n var scale = [0, 0, 0]; // Loop over rows to get implicit scaling information\n\n for (var i = 0; i < 3; i++) {\n largest = Math.abs(mat_3x3[i][0]);\n\n if ((tmp = Math.abs(mat_3x3[i][1])) > largest) {\n largest = tmp;\n }\n\n if ((tmp = Math.abs(mat_3x3[i][2])) > largest) {\n largest = tmp;\n }\n\n scale[i] = 1 / largest;\n } // Loop over all columns using Crout's method\n // first column\n\n\n largest = scale[0] * Math.abs(mat_3x3[0][0]);\n maxI = 0;\n\n if ((tmp = scale[1] * Math.abs(mat_3x3[1][0])) >= largest) {\n largest = tmp;\n maxI = 1;\n }\n\n if ((tmp = scale[2] * Math.abs(mat_3x3[2][0])) >= largest) {\n maxI = 2;\n }\n\n if (maxI !== 0) {\n vtkSwapVectors3(mat_3x3[maxI], mat_3x3[0]);\n scale[maxI] = scale[0];\n }\n\n index_3[0] = maxI;\n mat_3x3[1][0] /= mat_3x3[0][0];\n mat_3x3[2][0] /= mat_3x3[0][0]; // second column\n\n mat_3x3[1][1] -= mat_3x3[1][0] * mat_3x3[0][1];\n mat_3x3[2][1] -= mat_3x3[2][0] * mat_3x3[0][1];\n largest = scale[1] * Math.abs(mat_3x3[1][1]);\n maxI = 1;\n\n if ((tmp = scale[2] * Math.abs(mat_3x3[2][1])) >= largest) {\n maxI = 2;\n vtkSwapVectors3(mat_3x3[2], mat_3x3[1]);\n scale[2] = scale[1];\n }\n\n index_3[1] = maxI;\n mat_3x3[2][1] /= mat_3x3[1][1]; // third column\n\n mat_3x3[1][2] -= mat_3x3[1][0] * mat_3x3[0][2];\n mat_3x3[2][2] -= mat_3x3[2][0] * mat_3x3[0][2] + mat_3x3[2][1] * mat_3x3[1][2];\n index_3[2] = 2;\n}\nfunction LUSolve3x3(mat_3x3, index_3, x_3) {\n // forward substitution\n var sum = x_3[index_3[0]];\n x_3[index_3[0]] = x_3[0];\n x_3[0] = sum;\n sum = x_3[index_3[1]];\n x_3[index_3[1]] = x_3[1];\n x_3[1] = sum - mat_3x3[1][0] * x_3[0];\n sum = x_3[index_3[2]];\n x_3[index_3[2]] = x_3[2];\n x_3[2] = sum - mat_3x3[2][0] * x_3[0] - mat_3x3[2][1] * x_3[1]; // back substitution\n\n x_3[2] /= mat_3x3[2][2];\n x_3[1] = (x_3[1] - mat_3x3[1][2] * x_3[2]) / mat_3x3[1][1];\n x_3[0] = (x_3[0] - mat_3x3[0][1] * x_3[1] - mat_3x3[0][2] * x_3[2]) / mat_3x3[0][0];\n}\nfunction linearSolve3x3(mat_3x3, x_3, y_3) {\n var a1 = mat_3x3[0][0];\n var b1 = mat_3x3[0][1];\n var c1 = mat_3x3[0][2];\n var a2 = mat_3x3[1][0];\n var b2 = mat_3x3[1][1];\n var c2 = mat_3x3[1][2];\n var a3 = mat_3x3[2][0];\n var b3 = mat_3x3[2][1];\n var c3 = mat_3x3[2][2]; // Compute the adjoint\n\n var d1 = +determinant2x2(b2, b3, c2, c3);\n var d2 = -determinant2x2(a2, a3, c2, c3);\n var d3 = +determinant2x2(a2, a3, b2, b3);\n var e1 = -determinant2x2(b1, b3, c1, c3);\n var e2 = +determinant2x2(a1, a3, c1, c3);\n var e3 = -determinant2x2(a1, a3, b1, b3);\n var f1 = +determinant2x2(b1, b2, c1, c2);\n var f2 = -determinant2x2(a1, a2, c1, c2);\n var f3 = +determinant2x2(a1, a2, b1, b2); // Compute the determinant\n\n var det = a1 * d1 + b1 * d2 + c1 * d3; // Multiply by the adjoint\n\n var v1 = d1 * x_3[0] + e1 * x_3[1] + f1 * x_3[2];\n var v2 = d2 * x_3[0] + e2 * x_3[1] + f2 * x_3[2];\n var v3 = d3 * x_3[0] + e3 * x_3[1] + f3 * x_3[2]; // Divide by the determinant\n\n y_3[0] = v1 / det;\n y_3[1] = v2 / det;\n y_3[2] = v3 / det;\n}\nfunction multiply3x3_vect3(mat_3x3, in_3, out_3) {\n var x = mat_3x3[0][0] * in_3[0] + mat_3x3[0][1] * in_3[1] + mat_3x3[0][2] * in_3[2];\n var y = mat_3x3[1][0] * in_3[0] + mat_3x3[1][1] * in_3[1] + mat_3x3[1][2] * in_3[2];\n var z = mat_3x3[2][0] * in_3[0] + mat_3x3[2][1] * in_3[1] + mat_3x3[2][2] * in_3[2];\n out_3[0] = x;\n out_3[1] = y;\n out_3[2] = z;\n}\nfunction multiply3x3_mat3(a_3x3, b_3x3, out_3x3) {\n var tmp = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\n\n for (var i = 0; i < 3; i++) {\n tmp[0][i] = a_3x3[0][0] * b_3x3[0][i] + a_3x3[0][1] * b_3x3[1][i] + a_3x3[0][2] * b_3x3[2][i];\n tmp[1][i] = a_3x3[1][0] * b_3x3[0][i] + a_3x3[1][1] * b_3x3[1][i] + a_3x3[1][2] * b_3x3[2][i];\n tmp[2][i] = a_3x3[2][0] * b_3x3[0][i] + a_3x3[2][1] * b_3x3[1][i] + a_3x3[2][2] * b_3x3[2][i];\n }\n\n for (var j = 0; j < 3; j++) {\n out_3x3[j][0] = tmp[j][0];\n out_3x3[j][1] = tmp[j][1];\n out_3x3[j][2] = tmp[j][2];\n }\n}\nfunction multiplyMatrix(a, b, rowA, colA, rowB, colB, out_rowXcol) {\n // we need colA == rowB\n if (colA !== rowB) {\n vtkErrorMacro('Number of columns of A must match number of rows of B.');\n } // output matrix is rowA*colB\n // output row\n\n\n for (var i = 0; i < rowA; i++) {\n // output col\n for (var j = 0; j < colB; j++) {\n out_rowXcol[i][j] = 0; // sum for this point\n\n for (var k = 0; k < colA; k++) {\n out_rowXcol[i][j] += a[i][k] * b[k][j];\n }\n }\n }\n}\nfunction transpose3x3(in_3x3, outT_3x3) {\n var tmp;\n tmp = in_3x3[1][0];\n outT_3x3[1][0] = in_3x3[0][1];\n outT_3x3[0][1] = tmp;\n tmp = in_3x3[2][0];\n outT_3x3[2][0] = in_3x3[0][2];\n outT_3x3[0][2] = tmp;\n tmp = in_3x3[2][1];\n outT_3x3[2][1] = in_3x3[1][2];\n outT_3x3[1][2] = tmp;\n outT_3x3[0][0] = in_3x3[0][0];\n outT_3x3[1][1] = in_3x3[1][1];\n outT_3x3[2][2] = in_3x3[2][2];\n}\nfunction invert3x3(in_3x3, outI_3x3) {\n var a1 = in_3x3[0][0];\n var b1 = in_3x3[0][1];\n var c1 = in_3x3[0][2];\n var a2 = in_3x3[1][0];\n var b2 = in_3x3[1][1];\n var c2 = in_3x3[1][2];\n var a3 = in_3x3[2][0];\n var b3 = in_3x3[2][1];\n var c3 = in_3x3[2][2]; // Compute the adjoint\n\n var d1 = +determinant2x2(b2, b3, c2, c3);\n var d2 = -determinant2x2(a2, a3, c2, c3);\n var d3 = +determinant2x2(a2, a3, b2, b3);\n var e1 = -determinant2x2(b1, b3, c1, c3);\n var e2 = +determinant2x2(a1, a3, c1, c3);\n var e3 = -determinant2x2(a1, a3, b1, b3);\n var f1 = +determinant2x2(b1, b2, c1, c2);\n var f2 = -determinant2x2(a1, a2, c1, c2);\n var f3 = +determinant2x2(a1, a2, b1, b2); // Divide by the determinant\n\n var det = a1 * d1 + b1 * d2 + c1 * d3;\n outI_3x3[0][0] = d1 / det;\n outI_3x3[1][0] = d2 / det;\n outI_3x3[2][0] = d3 / det;\n outI_3x3[0][1] = e1 / det;\n outI_3x3[1][1] = e2 / det;\n outI_3x3[2][1] = e3 / det;\n outI_3x3[0][2] = f1 / det;\n outI_3x3[1][2] = f2 / det;\n outI_3x3[2][2] = f3 / det;\n}\nfunction identity3x3(mat_3x3) {\n for (var i = 0; i < 3; i++) {\n mat_3x3[i][0] = mat_3x3[i][1] = mat_3x3[i][2] = 0;\n mat_3x3[i][i] = 1;\n }\n}\nfunction determinant3x3(mat_3x3) {\n return mat_3x3[0][0] * mat_3x3[1][1] * mat_3x3[2][2] + mat_3x3[1][0] * mat_3x3[2][1] * mat_3x3[0][2] + mat_3x3[2][0] * mat_3x3[0][1] * mat_3x3[1][2] - mat_3x3[0][0] * mat_3x3[2][1] * mat_3x3[1][2] - mat_3x3[1][0] * mat_3x3[0][1] * mat_3x3[2][2] - mat_3x3[2][0] * mat_3x3[1][1] * mat_3x3[0][2];\n}\nfunction quaternionToMatrix3x3(quat_4, mat_3x3) {\n var ww = quat_4[0] * quat_4[0];\n var wx = quat_4[0] * quat_4[1];\n var wy = quat_4[0] * quat_4[2];\n var wz = quat_4[0] * quat_4[3];\n var xx = quat_4[1] * quat_4[1];\n var yy = quat_4[2] * quat_4[2];\n var zz = quat_4[3] * quat_4[3];\n var xy = quat_4[1] * quat_4[2];\n var xz = quat_4[1] * quat_4[3];\n var yz = quat_4[2] * quat_4[3];\n var rr = xx + yy + zz; // normalization factor, just in case quaternion was not normalized\n\n var f = 1 / (ww + rr);\n var s = (ww - rr) * f;\n f *= 2;\n mat_3x3[0][0] = xx * f + s;\n mat_3x3[1][0] = (xy + wz) * f;\n mat_3x3[2][0] = (xz - wy) * f;\n mat_3x3[0][1] = (xy - wz) * f;\n mat_3x3[1][1] = yy * f + s;\n mat_3x3[2][1] = (yz + wx) * f;\n mat_3x3[0][2] = (xz + wy) * f;\n mat_3x3[1][2] = (yz - wx) * f;\n mat_3x3[2][2] = zz * f + s;\n}\n/**\n * Returns true if elements of both arrays are equals.\n * @param {Array} a an array of numbers (vector, point, matrix...)\n * @param {Array} b an array of numbers (vector, point, matrix...)\n * @param {Number} eps tolerance\n */\n\nfunction areEquals(a, b) {\n var eps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-6;\n\n if (a.length !== b.length) {\n return false;\n }\n\n function isEqual(element, index) {\n return Math.abs(element - b[index]) <= eps;\n }\n\n return a.every(isEqual);\n}\nvar areMatricesEqual = areEquals;\nfunction roundNumber(num) {\n var digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (!\"\".concat(num).includes('e')) {\n return +\"\".concat(Math.round(\"\".concat(num, \"e+\").concat(digits)), \"e-\").concat(digits);\n }\n\n var arr = \"\".concat(num).split('e');\n var sig = '';\n\n if (+arr[1] + digits > 0) {\n sig = '+';\n }\n\n return +\"\".concat(Math.round(\"\".concat(+arr[0], \"e\").concat(sig).concat(+arr[1] + digits)), \"e-\").concat(digits);\n}\nfunction roundVector(vector) {\n var out = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var digits = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n out[0] = roundNumber(vector[0], digits);\n out[1] = roundNumber(vector[1], digits);\n out[2] = roundNumber(vector[2], digits);\n return out;\n}\nfunction jacobiN(a, n, w, v) {\n var i;\n var j;\n var k;\n var iq;\n var ip;\n var numPos;\n var tresh;\n var theta;\n var t;\n var tau;\n var sm;\n var s;\n var h;\n var g;\n var c;\n var tmp;\n var b = createArray(n);\n var z = createArray(n);\n\n var vtkROTATE = function vtkROTATE(aa, ii, jj, kk, ll) {\n g = aa[ii][jj];\n h = aa[kk][ll];\n aa[ii][jj] = g - s * (h + g * tau);\n aa[kk][ll] = h + s * (g - h * tau);\n }; // initialize\n\n\n for (ip = 0; ip < n; ip++) {\n for (iq = 0; iq < n; iq++) {\n v[ip][iq] = 0.0;\n }\n\n v[ip][ip] = 1.0;\n }\n\n for (ip = 0; ip < n; ip++) {\n b[ip] = w[ip] = a[ip][ip];\n z[ip] = 0.0;\n } // begin rotation sequence\n\n\n for (i = 0; i < VTK_MAX_ROTATIONS; i++) {\n sm = 0.0;\n\n for (ip = 0; ip < n - 1; ip++) {\n for (iq = ip + 1; iq < n; iq++) {\n sm += Math.abs(a[ip][iq]);\n }\n }\n\n if (sm === 0.0) {\n break;\n } // first 3 sweeps\n\n\n if (i < 3) {\n tresh = 0.2 * sm / (n * n);\n } else {\n tresh = 0.0;\n }\n\n for (ip = 0; ip < n - 1; ip++) {\n for (iq = ip + 1; iq < n; iq++) {\n g = 100.0 * Math.abs(a[ip][iq]); // after 4 sweeps\n\n if (i > 3 && Math.abs(w[ip]) + g === Math.abs(w[ip]) && Math.abs(w[iq]) + g === Math.abs(w[iq])) {\n a[ip][iq] = 0.0;\n } else if (Math.abs(a[ip][iq]) > tresh) {\n h = w[iq] - w[ip];\n\n if (Math.abs(h) + g === Math.abs(h)) {\n t = a[ip][iq] / h;\n } else {\n theta = 0.5 * h / a[ip][iq];\n t = 1.0 / (Math.abs(theta) + Math.sqrt(1.0 + theta * theta));\n\n if (theta < 0.0) {\n t = -t;\n }\n }\n\n c = 1.0 / Math.sqrt(1 + t * t);\n s = t * c;\n tau = s / (1.0 + c);\n h = t * a[ip][iq];\n z[ip] -= h;\n z[iq] += h;\n w[ip] -= h;\n w[iq] += h;\n a[ip][iq] = 0.0; // ip already shifted left by 1 unit\n\n for (j = 0; j <= ip - 1; j++) {\n vtkROTATE(a, j, ip, j, iq);\n } // ip and iq already shifted left by 1 unit\n\n\n for (j = ip + 1; j <= iq - 1; j++) {\n vtkROTATE(a, ip, j, j, iq);\n } // iq already shifted left by 1 unit\n\n\n for (j = iq + 1; j < n; j++) {\n vtkROTATE(a, ip, j, iq, j);\n }\n\n for (j = 0; j < n; j++) {\n vtkROTATE(v, j, ip, j, iq);\n }\n }\n }\n }\n\n for (ip = 0; ip < n; ip++) {\n b[ip] += z[ip];\n w[ip] = b[ip];\n z[ip] = 0.0;\n }\n } // this is NEVER called\n\n\n if (i >= VTK_MAX_ROTATIONS) {\n vtkWarningMacro('vtkMath::Jacobi: Error extracting eigenfunctions');\n return 0;\n } // sort eigenfunctions: these changes do not affect accuracy\n\n\n for (j = 0; j < n - 1; j++) {\n // boundary incorrect\n k = j;\n tmp = w[k];\n\n for (i = j + 1; i < n; i++) {\n // boundary incorrect, shifted already\n if (w[i] >= tmp) {\n // why exchange if same?\n k = i;\n tmp = w[k];\n }\n }\n\n if (k !== j) {\n w[k] = w[j];\n w[j] = tmp;\n\n for (i = 0; i < n; i++) {\n tmp = v[i][j];\n v[i][j] = v[i][k];\n v[i][k] = tmp;\n }\n }\n } // ensure eigenvector consistency (i.e., Jacobi can compute vectors that\n // are negative of one another (.707,.707,0) and (-.707,-.707,0). This can\n // reek havoc in hyperstreamline/other stuff. We will select the most\n // positive eigenvector.\n\n\n var ceil_half_n = (n >> 1) + (n & 1);\n\n for (j = 0; j < n; j++) {\n for (numPos = 0, i = 0; i < n; i++) {\n if (v[i][j] >= 0.0) {\n numPos++;\n }\n } // if ( numPos < ceil(double(n)/double(2.0)) )\n\n\n if (numPos < ceil_half_n) {\n for (i = 0; i < n; i++) {\n v[i][j] *= -1.0;\n }\n }\n }\n\n return 1;\n}\nfunction matrix3x3ToQuaternion(mat_3x3, quat_4) {\n var tmp = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]; // on-diagonal elements\n\n tmp[0][0] = mat_3x3[0][0] + mat_3x3[1][1] + mat_3x3[2][2];\n tmp[1][1] = mat_3x3[0][0] - mat_3x3[1][1] - mat_3x3[2][2];\n tmp[2][2] = -mat_3x3[0][0] + mat_3x3[1][1] - mat_3x3[2][2];\n tmp[3][3] = -mat_3x3[0][0] - mat_3x3[1][1] + mat_3x3[2][2]; // off-diagonal elements\n\n tmp[0][1] = tmp[1][0] = mat_3x3[2][1] - mat_3x3[1][2];\n tmp[0][2] = tmp[2][0] = mat_3x3[0][2] - mat_3x3[2][0];\n tmp[0][3] = tmp[3][0] = mat_3x3[1][0] - mat_3x3[0][1];\n tmp[1][2] = tmp[2][1] = mat_3x3[1][0] + mat_3x3[0][1];\n tmp[1][3] = tmp[3][1] = mat_3x3[0][2] + mat_3x3[2][0];\n tmp[2][3] = tmp[3][2] = mat_3x3[2][1] + mat_3x3[1][2];\n var eigenvectors = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]];\n var eigenvalues = [0, 0, 0, 0]; // convert into format that JacobiN can use,\n // then use Jacobi to find eigenvalues and eigenvectors\n\n var NTemp = [0, 0, 0, 0];\n var eigenvectorsTemp = [0, 0, 0, 0];\n\n for (var i = 0; i < 4; i++) {\n NTemp[i] = tmp[i];\n eigenvectorsTemp[i] = eigenvectors[i];\n }\n\n jacobiN(NTemp, 4, eigenvalues, eigenvectorsTemp); // the first eigenvector is the one we want\n\n quat_4[0] = eigenvectors[0][0];\n quat_4[1] = eigenvectors[1][0];\n quat_4[2] = eigenvectors[2][0];\n quat_4[3] = eigenvectors[3][0];\n}\nfunction multiplyQuaternion(quat_1, quat_2, quat_out) {\n var ww = quat_1[0] * quat_2[0];\n var wx = quat_1[0] * quat_2[1];\n var wy = quat_1[0] * quat_2[2];\n var wz = quat_1[0] * quat_2[3];\n var xw = quat_1[1] * quat_2[0];\n var xx = quat_1[1] * quat_2[1];\n var xy = quat_1[1] * quat_2[2];\n var xz = quat_1[1] * quat_2[3];\n var yw = quat_1[2] * quat_2[0];\n var yx = quat_1[2] * quat_2[1];\n var yy = quat_1[2] * quat_2[2];\n var yz = quat_1[2] * quat_2[3];\n var zw = quat_1[3] * quat_2[0];\n var zx = quat_1[3] * quat_2[1];\n var zy = quat_1[3] * quat_2[2];\n var zz = quat_1[3] * quat_2[3];\n quat_out[0] = ww - xx - yy - zz;\n quat_out[1] = wx + xw + yz - zy;\n quat_out[2] = wy - xz + yw + zx;\n quat_out[3] = wz + xy - yx + zw;\n}\nfunction orthogonalize3x3(a_3x3, out_3x3) {\n // copy the matrix\n for (var i = 0; i < 3; i++) {\n out_3x3[0][i] = a_3x3[0][i];\n out_3x3[1][i] = a_3x3[1][i];\n out_3x3[2][i] = a_3x3[2][i];\n } // Pivot the matrix to improve accuracy\n\n\n var scale = createArray(3);\n var index = createArray(3);\n var largest; // Loop over rows to get implicit scaling information\n\n for (var _i = 0; _i < 3; _i++) {\n var _x = Math.abs(out_3x3[_i][0]);\n\n var _x2 = Math.abs(out_3x3[_i][1]);\n\n var _x3 = Math.abs(out_3x3[_i][2]);\n\n largest = _x2 > _x ? _x2 : _x;\n largest = _x3 > largest ? _x3 : largest;\n scale[_i] = 1;\n\n if (largest !== 0) {\n scale[_i] /= largest;\n }\n } // first column\n\n\n var x1 = Math.abs(out_3x3[0][0]) * scale[0];\n var x2 = Math.abs(out_3x3[1][0]) * scale[1];\n var x3 = Math.abs(out_3x3[2][0]) * scale[2];\n index[0] = 0;\n largest = x1;\n\n if (x2 >= largest) {\n largest = x2;\n index[0] = 1;\n }\n\n if (x3 >= largest) {\n index[0] = 2;\n }\n\n if (index[0] !== 0) {\n vtkSwapVectors3(out_3x3[index[0]], out_3x3[0]);\n scale[index[0]] = scale[0];\n } // second column\n\n\n var y2 = Math.abs(out_3x3[1][1]) * scale[1];\n var y3 = Math.abs(out_3x3[2][1]) * scale[2];\n index[1] = 1;\n largest = y2;\n\n if (y3 >= largest) {\n index[1] = 2;\n vtkSwapVectors3(out_3x3[2], out_3x3[1]);\n } // third column\n\n\n index[2] = 2; // A quaternion can only describe a pure rotation, not\n // a rotation with a flip, therefore the flip must be\n // removed before the matrix is converted to a quaternion.\n\n var flip = 0;\n\n if (determinant3x3(out_3x3) < 0) {\n flip = 1;\n\n for (var _i2 = 0; _i2 < 3; _i2++) {\n out_3x3[0][_i2] = -out_3x3[0][_i2];\n out_3x3[1][_i2] = -out_3x3[1][_i2];\n out_3x3[2][_i2] = -out_3x3[2][_i2];\n }\n } // Do orthogonalization using a quaternion intermediate\n // (this, essentially, does the orthogonalization via\n // diagonalization of an appropriately constructed symmetric\n // 4x4 matrix rather than by doing SVD of the 3x3 matrix)\n\n\n var quat = createArray(4);\n matrix3x3ToQuaternion(out_3x3, quat);\n quaternionToMatrix3x3(quat, out_3x3); // Put the flip back into the orthogonalized matrix.\n\n if (flip) {\n for (var _i3 = 0; _i3 < 3; _i3++) {\n out_3x3[0][_i3] = -out_3x3[0][_i3];\n out_3x3[1][_i3] = -out_3x3[1][_i3];\n out_3x3[2][_i3] = -out_3x3[2][_i3];\n }\n } // Undo the pivoting\n\n\n if (index[1] !== 1) {\n vtkSwapVectors3(out_3x3[index[1]], out_3x3[1]);\n }\n\n if (index[0] !== 0) {\n vtkSwapVectors3(out_3x3[index[0]], out_3x3[0]);\n }\n}\nfunction diagonalize3x3(a_3x3, w_3, v_3x3) {\n var i;\n var j;\n var k;\n var maxI;\n var tmp;\n var maxVal; // do the matrix[3][3] to **matrix conversion for Jacobi\n\n var C = [createArray(3), createArray(3), createArray(3)];\n var ATemp = createArray(3);\n var VTemp = createArray(3);\n\n for (i = 0; i < 3; i++) {\n C[i][0] = a_3x3[i][0];\n C[i][1] = a_3x3[i][1];\n C[i][2] = a_3x3[i][2];\n ATemp[i] = C[i];\n VTemp[i] = v_3x3[i];\n } // diagonalize using Jacobi\n\n\n jacobiN(ATemp, 3, w_3, VTemp); // if all the eigenvalues are the same, return identity matrix\n\n if (w_3[0] === w_3[1] && w_3[0] === w_3[2]) {\n identity3x3(v_3x3);\n return;\n } // transpose temporarily, it makes it easier to sort the eigenvectors\n\n\n transpose3x3(v_3x3, v_3x3); // if two eigenvalues are the same, re-orthogonalize to optimally line\n // up the eigenvectors with the x, y, and z axes\n\n for (i = 0; i < 3; i++) {\n // two eigenvalues are the same\n if (w_3[(i + 1) % 3] === w_3[(i + 2) % 3]) {\n // find maximum element of the independent eigenvector\n maxVal = Math.abs(v_3x3[i][0]);\n maxI = 0;\n\n for (j = 1; j < 3; j++) {\n if (maxVal < (tmp = Math.abs(v_3x3[i][j]))) {\n maxVal = tmp;\n maxI = j;\n }\n } // swap the eigenvector into its proper position\n\n\n if (maxI !== i) {\n tmp = w_3[maxI];\n w_3[maxI] = w_3[i];\n w_3[i] = tmp;\n vtkSwapVectors3(v_3x3[i], v_3x3[maxI]);\n } // maximum element of eigenvector should be positive\n\n\n if (v_3x3[maxI][maxI] < 0) {\n v_3x3[maxI][0] = -v_3x3[maxI][0];\n v_3x3[maxI][1] = -v_3x3[maxI][1];\n v_3x3[maxI][2] = -v_3x3[maxI][2];\n } // re-orthogonalize the other two eigenvectors\n\n\n j = (maxI + 1) % 3;\n k = (maxI + 2) % 3;\n v_3x3[j][0] = 0.0;\n v_3x3[j][1] = 0.0;\n v_3x3[j][2] = 0.0;\n v_3x3[j][j] = 1.0;\n cross(v_3x3[maxI], v_3x3[j], v_3x3[k]);\n normalize(v_3x3[k]);\n cross(v_3x3[k], v_3x3[maxI], v_3x3[j]); // transpose vectors back to columns\n\n transpose3x3(v_3x3, v_3x3);\n return;\n }\n } // the three eigenvalues are different, just sort the eigenvectors\n // to align them with the x, y, and z axes\n // find the vector with the largest x element, make that vector\n // the first vector\n\n\n maxVal = Math.abs(v_3x3[0][0]);\n maxI = 0;\n\n for (i = 1; i < 3; i++) {\n if (maxVal < (tmp = Math.abs(v_3x3[i][0]))) {\n maxVal = tmp;\n maxI = i;\n }\n } // swap eigenvalue and eigenvector\n\n\n if (maxI !== 0) {\n tmp = w_3[maxI];\n w_3[maxI] = w_3[0];\n w_3[0] = tmp;\n vtkSwapVectors3(v_3x3[maxI], v_3x3[0]);\n } // do the same for the y element\n\n\n if (Math.abs(v_3x3[1][1]) < Math.abs(v_3x3[2][1])) {\n tmp = w_3[2];\n w_3[2] = w_3[1];\n w_3[1] = tmp;\n vtkSwapVectors3(v_3x3[2], v_3x3[1]);\n } // ensure that the sign of the eigenvectors is correct\n\n\n for (i = 0; i < 2; i++) {\n if (v_3x3[i][i] < 0) {\n v_3x3[i][0] = -v_3x3[i][0];\n v_3x3[i][1] = -v_3x3[i][1];\n v_3x3[i][2] = -v_3x3[i][2];\n }\n } // set sign of final eigenvector to ensure that determinant is positive\n\n\n if (determinant3x3(v_3x3) < 0) {\n v_3x3[2][0] = -v_3x3[2][0];\n v_3x3[2][1] = -v_3x3[2][1];\n v_3x3[2][2] = -v_3x3[2][2];\n } // transpose the eigenvectors back again\n\n\n transpose3x3(v_3x3, v_3x3);\n}\nfunction singularValueDecomposition3x3(a_3x3, u_3x3, w_3, vT_3x3) {\n var i;\n var B = [createArray(3), createArray(3), createArray(3)]; // copy so that A can be used for U or VT without risk\n\n for (i = 0; i < 3; i++) {\n B[0][i] = a_3x3[0][i];\n B[1][i] = a_3x3[1][i];\n B[2][i] = a_3x3[2][i];\n } // temporarily flip if determinant is negative\n\n\n var d = determinant3x3(B);\n\n if (d < 0) {\n for (i = 0; i < 3; i++) {\n B[0][i] = -B[0][i];\n B[1][i] = -B[1][i];\n B[2][i] = -B[2][i];\n }\n } // orthogonalize, diagonalize, etc.\n\n\n orthogonalize3x3(B, u_3x3);\n transpose3x3(B, B);\n multiply3x3_mat3(B, u_3x3, vT_3x3);\n diagonalize3x3(vT_3x3, w_3, vT_3x3);\n multiply3x3_mat3(u_3x3, vT_3x3, u_3x3);\n transpose3x3(vT_3x3, vT_3x3); // re-create the flip\n\n if (d < 0) {\n w_3[0] = -w_3[0];\n w_3[1] = -w_3[1];\n w_3[2] = -w_3[2];\n }\n}\nfunction luFactorLinearSystem(A, index, size) {\n var i;\n var j;\n var k;\n var largest;\n var maxI = 0;\n var sum;\n var temp1;\n var temp2;\n var scale = createArray(size); //\n // Loop over rows to get implicit scaling information\n //\n\n for (i = 0; i < size; i++) {\n for (largest = 0.0, j = 0; j < size; j++) {\n if ((temp2 = Math.abs(A[i][j])) > largest) {\n largest = temp2;\n }\n }\n\n if (largest === 0.0) {\n vtkWarningMacro('Unable to factor linear system');\n return 0;\n }\n\n scale[i] = 1.0 / largest;\n } //\n // Loop over all columns using Crout's method\n //\n\n\n for (j = 0; j < size; j++) {\n for (i = 0; i < j; i++) {\n sum = A[i][j];\n\n for (k = 0; k < i; k++) {\n sum -= A[i][k] * A[k][j];\n }\n\n A[i][j] = sum;\n } //\n // Begin search for largest pivot element\n //\n\n\n for (largest = 0.0, i = j; i < size; i++) {\n sum = A[i][j];\n\n for (k = 0; k < j; k++) {\n sum -= A[i][k] * A[k][j];\n }\n\n A[i][j] = sum;\n\n if ((temp1 = scale[i] * Math.abs(sum)) >= largest) {\n largest = temp1;\n maxI = i;\n }\n } //\n // Check for row interchange\n //\n\n\n if (j !== maxI) {\n for (k = 0; k < size; k++) {\n temp1 = A[maxI][k];\n A[maxI][k] = A[j][k];\n A[j][k] = temp1;\n }\n\n scale[maxI] = scale[j];\n } //\n // Divide by pivot element and perform elimination\n //\n\n\n index[j] = maxI;\n\n if (Math.abs(A[j][j]) <= VTK_SMALL_NUMBER) {\n vtkWarningMacro('Unable to factor linear system');\n return 0;\n }\n\n if (j !== size - 1) {\n temp1 = 1.0 / A[j][j];\n\n for (i = j + 1; i < size; i++) {\n A[i][j] *= temp1;\n }\n }\n }\n\n return 1;\n}\nfunction luSolveLinearSystem(A, index, x, size) {\n var i;\n var j;\n var ii;\n var idx;\n var sum; //\n // Proceed with forward and backsubstitution for L and U\n // matrices. First, forward substitution.\n //\n\n for (ii = -1, i = 0; i < size; i++) {\n idx = index[i];\n sum = x[idx];\n x[idx] = x[i];\n\n if (ii >= 0) {\n for (j = ii; j <= i - 1; j++) {\n sum -= A[i][j] * x[j];\n }\n } else if (sum !== 0.0) {\n ii = i;\n }\n\n x[i] = sum;\n } //\n // Now, back substitution\n //\n\n\n for (i = size - 1; i >= 0; i--) {\n sum = x[i];\n\n for (j = i + 1; j < size; j++) {\n sum -= A[i][j] * x[j];\n }\n\n x[i] = sum / A[i][i];\n }\n}\nfunction solveLinearSystem(A, x, size) {\n // if we solving something simple, just solve it\n if (size === 2) {\n var y = createArray(2);\n var det = determinant2x2(A[0][0], A[0][1], A[1][0], A[1][1]);\n\n if (det === 0.0) {\n // Unable to solve linear system\n return 0;\n }\n\n y[0] = (A[1][1] * x[0] - A[0][1] * x[1]) / det;\n y[1] = (-(A[1][0] * x[0]) + A[0][0] * x[1]) / det;\n x[0] = y[0];\n x[1] = y[1];\n return 1;\n }\n\n if (size === 1) {\n if (A[0][0] === 0.0) {\n // Unable to solve linear system\n return 0;\n }\n\n x[0] /= A[0][0];\n return 1;\n } //\n // System of equations is not trivial, use Crout's method\n //\n // Check on allocation of working vectors\n\n\n var index = createArray(size); // Factor and solve matrix\n\n if (luFactorLinearSystem(A, index, size) === 0) {\n return 0;\n }\n\n luSolveLinearSystem(A, index, x, size);\n return 1;\n}\nfunction invertMatrix(A, AI, size) {\n var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n var column = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;\n var tmp1Size = index || createArray(size);\n var tmp2Size = column || createArray(size); // Factor matrix; then begin solving for inverse one column at a time.\n // Note: tmp1Size returned value is used later, tmp2Size is just working\n // memory whose values are not used in LUSolveLinearSystem\n\n if (luFactorLinearSystem(A, tmp1Size, size, tmp2Size) === 0) {\n return 0;\n }\n\n for (var j = 0; j < size; j++) {\n for (var i = 0; i < size; i++) {\n tmp2Size[i] = 0.0;\n }\n\n tmp2Size[j] = 1.0;\n luSolveLinearSystem(A, tmp1Size, tmp2Size, size);\n\n for (var _i4 = 0; _i4 < size; _i4++) {\n AI[_i4][j] = tmp2Size[_i4];\n }\n }\n\n return 1;\n}\nfunction estimateMatrixCondition(A, size) {\n var minValue = +Number.MAX_VALUE;\n var maxValue = -Number.MAX_VALUE; // find the maximum value\n\n for (var i = 0; i < size; i++) {\n for (var j = i; j < size; j++) {\n if (Math.abs(A[i][j]) > max) {\n maxValue = Math.abs(A[i][j]);\n }\n }\n } // find the minimum diagonal value\n\n\n for (var _i5 = 0; _i5 < size; _i5++) {\n if (Math.abs(A[_i5][_i5]) < min) {\n minValue = Math.abs(A[_i5][_i5]);\n }\n }\n\n if (minValue === 0.0) {\n return Number.MAX_VALUE;\n }\n\n return maxValue / minValue;\n}\nfunction jacobi(a_3x3, w, v) {\n return jacobiN(a_3x3, 3, w, v);\n}\nfunction solveHomogeneousLeastSquares(numberOfSamples, xt, xOrder, mt) {\n // check dimensional consistency\n if (numberOfSamples < xOrder) {\n vtkWarningMacro('Insufficient number of samples. Underdetermined.');\n return 0;\n }\n\n var i;\n var j;\n var k; // set up intermediate variables\n // Allocate matrix to hold X times transpose of X\n\n var XXt = createArray(xOrder); // size x by x\n // Allocate the array of eigenvalues and eigenvectors\n\n var eigenvals = createArray(xOrder);\n var eigenvecs = createArray(xOrder); // Clear the upper triangular region (and btw, allocate the eigenvecs as well)\n\n for (i = 0; i < xOrder; i++) {\n eigenvecs[i] = createArray(xOrder);\n XXt[i] = createArray(xOrder);\n\n for (j = 0; j < xOrder; j++) {\n XXt[i][j] = 0.0;\n }\n } // Calculate XXt upper half only, due to symmetry\n\n\n for (k = 0; k < numberOfSamples; k++) {\n for (i = 0; i < xOrder; i++) {\n for (j = i; j < xOrder; j++) {\n XXt[i][j] += xt[k][i] * xt[k][j];\n }\n }\n } // now fill in the lower half of the XXt matrix\n\n\n for (i = 0; i < xOrder; i++) {\n for (j = 0; j < i; j++) {\n XXt[i][j] = XXt[j][i];\n }\n } // Compute the eigenvectors and eigenvalues\n\n\n jacobiN(XXt, xOrder, eigenvals, eigenvecs); // Smallest eigenval is at the end of the list (xOrder-1), and solution is\n // corresponding eigenvec.\n\n for (i = 0; i < xOrder; i++) {\n mt[i][0] = eigenvecs[i][xOrder - 1];\n }\n\n return 1;\n}\nfunction solveLeastSquares(numberOfSamples, xt, xOrder, yt, yOrder, mt) {\n var checkHomogeneous = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;\n\n // check dimensional consistency\n if (numberOfSamples < xOrder || numberOfSamples < yOrder) {\n vtkWarningMacro('Insufficient number of samples. Underdetermined.');\n return 0;\n }\n\n var homogenFlags = createArray(yOrder);\n var allHomogeneous = 1;\n var hmt;\n var homogRC = 0;\n var i;\n var j;\n var k;\n var someHomogeneous = 0; // Ok, first init some flags check and see if all the systems are homogeneous\n\n if (checkHomogeneous) {\n // If Y' is zero, it's a homogeneous system and can't be solved via\n // the pseudoinverse method. Detect this case, warn the user, and\n // invoke SolveHomogeneousLeastSquares instead. Note that it doesn't\n // really make much sense for yOrder to be greater than one in this case,\n // since that's just yOrder occurrences of a 0 vector on the RHS, but\n // we allow it anyway. N\n // Initialize homogeneous flags on a per-right-hand-side basis\n for (j = 0; j < yOrder; j++) {\n homogenFlags[j] = 1;\n }\n\n for (i = 0; i < numberOfSamples; i++) {\n for (j = 0; j < yOrder; j++) {\n if (Math.abs(yt[i][j]) > VTK_SMALL_NUMBER) {\n allHomogeneous = 0;\n homogenFlags[j] = 0;\n }\n }\n } // If we've got one system, and it's homogeneous, do it and bail out quickly.\n\n\n if (allHomogeneous && yOrder === 1) {\n vtkWarningMacro('Detected homogeneous system (Y=0), calling SolveHomogeneousLeastSquares()');\n return solveHomogeneousLeastSquares(numberOfSamples, xt, xOrder, mt);\n } // Ok, we've got more than one system of equations.\n // Figure out if we need to calculate the homogeneous equation solution for\n // any of them.\n\n\n if (allHomogeneous) {\n someHomogeneous = 1;\n } else {\n for (j = 0; j < yOrder; j++) {\n if (homogenFlags[j]) {\n someHomogeneous = 1;\n }\n }\n }\n } // If necessary, solve the homogeneous problem\n\n\n if (someHomogeneous) {\n // hmt is the homogeneous equation version of mt, the general solution.\n hmt = createArray(xOrder);\n\n for (j = 0; j < xOrder; j++) {\n // Only allocate 1 here, not yOrder, because here we're going to solve\n // just the one homogeneous equation subset of the entire problem\n hmt[j] = [0];\n } // Ok, solve the homogeneous problem\n\n\n homogRC = solveHomogeneousLeastSquares(numberOfSamples, xt, xOrder, hmt);\n } // set up intermediate variables\n\n\n var XXt = createArray(xOrder); // size x by x\n\n var XXtI = createArray(xOrder); // size x by x\n\n var XYt = createArray(xOrder); // size x by y\n\n for (i = 0; i < xOrder; i++) {\n XXt[i] = createArray(xOrder);\n XXtI[i] = createArray(xOrder);\n\n for (j = 0; j < xOrder; j++) {\n XXt[i][j] = 0.0;\n XXtI[i][j] = 0.0;\n }\n\n XYt[i] = createArray(yOrder);\n\n for (j = 0; j < yOrder; j++) {\n XYt[i][j] = 0.0;\n }\n } // first find the pseudoinverse matrix\n\n\n for (k = 0; k < numberOfSamples; k++) {\n for (i = 0; i < xOrder; i++) {\n // first calculate the XXt matrix, only do the upper half (symmetrical)\n for (j = i; j < xOrder; j++) {\n XXt[i][j] += xt[k][i] * xt[k][j];\n } // now calculate the XYt matrix\n\n\n for (j = 0; j < yOrder; j++) {\n XYt[i][j] += xt[k][i] * yt[k][j];\n }\n }\n } // now fill in the lower half of the XXt matrix\n\n\n for (i = 0; i < xOrder; i++) {\n for (j = 0; j < i; j++) {\n XXt[i][j] = XXt[j][i];\n }\n }\n\n var successFlag = invertMatrix(XXt, XXtI, xOrder); // next get the inverse of XXt\n\n if (successFlag) {\n for (i = 0; i < xOrder; i++) {\n for (j = 0; j < yOrder; j++) {\n mt[i][j] = 0.0;\n\n for (k = 0; k < xOrder; k++) {\n mt[i][j] += XXtI[i][k] * XYt[k][j];\n }\n }\n }\n } // Fix up any of the solutions that correspond to the homogeneous equation\n // problem.\n\n\n if (someHomogeneous) {\n for (j = 0; j < yOrder; j++) {\n if (homogenFlags[j]) {\n // Fix this one\n for (i = 0; i < xOrder; i++) {\n mt[i][j] = hmt[i][0];\n }\n }\n }\n }\n\n if (someHomogeneous) {\n return homogRC && successFlag;\n }\n\n return successFlag;\n}\nfunction hex2float(hexStr) {\n var outFloatArray = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0.5, 1];\n\n switch (hexStr.length) {\n case 3:\n // abc => #aabbcc\n outFloatArray[0] = parseInt(hexStr[0], 16) * 17 / 255;\n outFloatArray[1] = parseInt(hexStr[1], 16) * 17 / 255;\n outFloatArray[2] = parseInt(hexStr[2], 16) * 17 / 255;\n return outFloatArray;\n\n case 4:\n // #abc => #aabbcc\n outFloatArray[0] = parseInt(hexStr[1], 16) * 17 / 255;\n outFloatArray[1] = parseInt(hexStr[2], 16) * 17 / 255;\n outFloatArray[2] = parseInt(hexStr[3], 16) * 17 / 255;\n return outFloatArray;\n\n case 6:\n // ab01df => #ab01df\n outFloatArray[0] = parseInt(hexStr.substr(0, 2), 16) / 255;\n outFloatArray[1] = parseInt(hexStr.substr(2, 2), 16) / 255;\n outFloatArray[2] = parseInt(hexStr.substr(4, 2), 16) / 255;\n return outFloatArray;\n\n case 7:\n // #ab01df\n outFloatArray[0] = parseInt(hexStr.substr(1, 2), 16) / 255;\n outFloatArray[1] = parseInt(hexStr.substr(3, 2), 16) / 255;\n outFloatArray[2] = parseInt(hexStr.substr(5, 2), 16) / 255;\n return outFloatArray;\n\n case 9:\n // #ab01df00\n outFloatArray[0] = parseInt(hexStr.substr(1, 2), 16) / 255;\n outFloatArray[1] = parseInt(hexStr.substr(3, 2), 16) / 255;\n outFloatArray[2] = parseInt(hexStr.substr(5, 2), 16) / 255;\n outFloatArray[3] = parseInt(hexStr.substr(7, 2), 16) / 255;\n return outFloatArray;\n\n default:\n return outFloatArray;\n }\n}\nfunction rgb2hsv(rgb, hsv) {\n var h;\n var s;\n\n var _rgb = _slicedToArray(rgb, 3),\n r = _rgb[0],\n g = _rgb[1],\n b = _rgb[2];\n\n var onethird = 1.0 / 3.0;\n var onesixth = 1.0 / 6.0;\n var twothird = 2.0 / 3.0;\n var cmax = r;\n var cmin = r;\n\n if (g > cmax) {\n cmax = g;\n } else if (g < cmin) {\n cmin = g;\n }\n\n if (b > cmax) {\n cmax = b;\n } else if (b < cmin) {\n cmin = b;\n }\n\n var v = cmax;\n\n if (v > 0.0) {\n s = (cmax - cmin) / cmax;\n } else {\n s = 0.0;\n }\n\n if (s > 0) {\n if (r === cmax) {\n h = onesixth * (g - b) / (cmax - cmin);\n } else if (g === cmax) {\n h = onethird + onesixth * (b - r) / (cmax - cmin);\n } else {\n h = twothird + onesixth * (r - g) / (cmax - cmin);\n }\n\n if (h < 0.0) {\n h += 1.0;\n }\n } else {\n h = 0.0;\n } // Set the values back to the array\n\n\n hsv[0] = h;\n hsv[1] = s;\n hsv[2] = v;\n}\nfunction hsv2rgb(hsv, rgb) {\n var _hsv = _slicedToArray(hsv, 3),\n h = _hsv[0],\n s = _hsv[1],\n v = _hsv[2];\n\n var onethird = 1.0 / 3.0;\n var onesixth = 1.0 / 6.0;\n var twothird = 2.0 / 3.0;\n var fivesixth = 5.0 / 6.0;\n var r;\n var g;\n var b; // compute RGB from HSV\n\n if (h > onesixth && h <= onethird) {\n // green/red\n g = 1.0;\n r = (onethird - h) / onesixth;\n b = 0.0;\n } else if (h > onethird && h <= 0.5) {\n // green/blue\n g = 1.0;\n b = (h - onethird) / onesixth;\n r = 0.0;\n } else if (h > 0.5 && h <= twothird) {\n // blue/green\n b = 1.0;\n g = (twothird - h) / onesixth;\n r = 0.0;\n } else if (h > twothird && h <= fivesixth) {\n // blue/red\n b = 1.0;\n r = (h - twothird) / onesixth;\n g = 0.0;\n } else if (h > fivesixth && h <= 1.0) {\n // red/blue\n r = 1.0;\n b = (1.0 - h) / onesixth;\n g = 0.0;\n } else {\n // red/green\n r = 1.0;\n g = h / onesixth;\n b = 0.0;\n } // add Saturation to the equation.\n\n\n r = s * r + (1.0 - s);\n g = s * g + (1.0 - s);\n b = s * b + (1.0 - s);\n r *= v;\n g *= v;\n b *= v; // Assign back to the array\n\n rgb[0] = r;\n rgb[1] = g;\n rgb[2] = b;\n}\nfunction lab2xyz(lab, xyz) {\n // LAB to XYZ\n var _lab = _slicedToArray(lab, 3),\n L = _lab[0],\n a = _lab[1],\n b = _lab[2];\n\n var var_Y = (L + 16) / 116;\n var var_X = a / 500 + var_Y;\n var var_Z = var_Y - b / 200;\n\n if (Math.pow(var_Y, 3) > 0.008856) {\n var_Y = Math.pow(var_Y, 3);\n } else {\n var_Y = (var_Y - 16.0 / 116.0) / 7.787;\n }\n\n if (Math.pow(var_X, 3) > 0.008856) {\n var_X = Math.pow(var_X, 3);\n } else {\n var_X = (var_X - 16.0 / 116.0) / 7.787;\n }\n\n if (Math.pow(var_Z, 3) > 0.008856) {\n var_Z = Math.pow(var_Z, 3);\n } else {\n var_Z = (var_Z - 16.0 / 116.0) / 7.787;\n }\n\n var ref_X = 0.9505;\n var ref_Y = 1.0;\n var ref_Z = 1.089;\n xyz[0] = ref_X * var_X; // ref_X = 0.9505 Observer= 2 deg Illuminant= D65\n\n xyz[1] = ref_Y * var_Y; // ref_Y = 1.000\n\n xyz[2] = ref_Z * var_Z; // ref_Z = 1.089\n}\nfunction xyz2lab(xyz, lab) {\n var _xyz = _slicedToArray(xyz, 3),\n x = _xyz[0],\n y = _xyz[1],\n z = _xyz[2];\n\n var ref_X = 0.9505;\n var ref_Y = 1.0;\n var ref_Z = 1.089;\n var var_X = x / ref_X; // ref_X = 0.9505 Observer= 2 deg, Illuminant= D65\n\n var var_Y = y / ref_Y; // ref_Y = 1.000\n\n var var_Z = z / ref_Z; // ref_Z = 1.089\n\n if (var_X > 0.008856) var_X = Math.pow(var_X, 1.0 / 3.0);else var_X = 7.787 * var_X + 16.0 / 116.0;\n if (var_Y > 0.008856) var_Y = Math.pow(var_Y, 1.0 / 3.0);else var_Y = 7.787 * var_Y + 16.0 / 116.0;\n if (var_Z > 0.008856) var_Z = Math.pow(var_Z, 1.0 / 3.0);else var_Z = 7.787 * var_Z + 16.0 / 116.0;\n lab[0] = 116 * var_Y - 16;\n lab[1] = 500 * (var_X - var_Y);\n lab[2] = 200 * (var_Y - var_Z);\n}\nfunction xyz2rgb(xyz, rgb) {\n var _xyz2 = _slicedToArray(xyz, 3),\n x = _xyz2[0],\n y = _xyz2[1],\n z = _xyz2[2];\n\n var r = x * 3.2406 + y * -1.5372 + z * -0.4986;\n var g = x * -0.9689 + y * 1.8758 + z * 0.0415;\n var b = x * 0.0557 + y * -0.204 + z * 1.057; // The following performs a \"gamma correction\" specified by the sRGB color\n // space. sRGB is defined by a canonical definition of a display monitor and\n // has been standardized by the International Electrotechnical Commission (IEC\n // 61966-2-1). The nonlinearity of the correction is designed to make the\n // colors more perceptually uniform. This color space has been adopted by\n // several applications including Adobe Photoshop and Microsoft Windows color\n // management. OpenGL is agnostic on its RGB color space, but it is reasonable\n // to assume it is close to this one.\n\n if (r > 0.0031308) r = 1.055 * Math.pow(r, 1 / 2.4) - 0.055;else r *= 12.92;\n if (g > 0.0031308) g = 1.055 * Math.pow(g, 1 / 2.4) - 0.055;else g *= 12.92;\n if (b > 0.0031308) b = 1.055 * Math.pow(b, 1 / 2.4) - 0.055;else b *= 12.92; // Clip colors. ideally we would do something that is perceptually closest\n // (since we can see colors outside of the display gamut), but this seems to\n // work well enough.\n\n var maxVal = r;\n if (maxVal < g) maxVal = g;\n if (maxVal < b) maxVal = b;\n\n if (maxVal > 1.0) {\n r /= maxVal;\n g /= maxVal;\n b /= maxVal;\n }\n\n if (r < 0) r = 0;\n if (g < 0) g = 0;\n if (b < 0) b = 0; // Push values back to array\n\n rgb[0] = r;\n rgb[1] = g;\n rgb[2] = b;\n}\nfunction rgb2xyz(rgb, xyz) {\n var _rgb2 = _slicedToArray(rgb, 3),\n r = _rgb2[0],\n g = _rgb2[1],\n b = _rgb2[2]; // The following performs a \"gamma correction\" specified by the sRGB color\n // space. sRGB is defined by a canonical definition of a display monitor and\n // has been standardized by the International Electrotechnical Commission (IEC\n // 61966-2-1). The nonlinearity of the correction is designed to make the\n // colors more perceptually uniform. This color space has been adopted by\n // several applications including Adobe Photoshop and Microsoft Windows color\n // management. OpenGL is agnostic on its RGB color space, but it is reasonable\n // to assume it is close to this one.\n\n\n if (r > 0.04045) r = Math.pow((r + 0.055) / 1.055, 2.4);else r /= 12.92;\n if (g > 0.04045) g = Math.pow((g + 0.055) / 1.055, 2.4);else g /= 12.92;\n if (b > 0.04045) b = Math.pow((b + 0.055) / 1.055, 2.4);else b /= 12.92; // Observer. = 2 deg, Illuminant = D65\n\n xyz[0] = r * 0.4124 + g * 0.3576 + b * 0.1805;\n xyz[1] = r * 0.2126 + g * 0.7152 + b * 0.0722;\n xyz[2] = r * 0.0193 + g * 0.1192 + b * 0.9505;\n}\nfunction rgb2lab(rgb, lab) {\n var xyz = [0, 0, 0];\n rgb2xyz(rgb, xyz);\n xyz2lab(xyz, lab);\n}\nfunction lab2rgb(lab, rgb) {\n var xyz = [0, 0, 0];\n lab2xyz(lab, xyz);\n xyz2rgb(xyz, rgb);\n}\nfunction uninitializeBounds(bounds) {\n bounds[0] = 1.0;\n bounds[1] = -1.0;\n bounds[2] = 1.0;\n bounds[3] = -1.0;\n bounds[4] = 1.0;\n bounds[5] = -1.0;\n}\nfunction areBoundsInitialized(bounds) {\n return !(bounds[1] - bounds[0] < 0.0);\n}\nfunction computeBoundsFromPoints(point1, point2, bounds) {\n bounds[0] = Math.min(point1[0], point2[0]);\n bounds[1] = Math.max(point1[0], point2[0]);\n bounds[2] = Math.min(point1[1], point2[1]);\n bounds[3] = Math.max(point1[1], point2[1]);\n bounds[4] = Math.min(point1[2], point2[2]);\n bounds[5] = Math.max(point1[2], point2[2]);\n}\nfunction clampValue(value, minValue, maxValue) {\n if (value < minValue) {\n return minValue;\n }\n\n if (value > maxValue) {\n return maxValue;\n }\n\n return value;\n}\nfunction clampVector(vector, minVector, maxVector) {\n var out = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];\n out[0] = clampValue(vector[0], minVector[0], maxVector[0]);\n out[1] = clampValue(vector[1], minVector[1], maxVector[1]);\n out[2] = clampValue(vector[2], minVector[2], maxVector[2]);\n return out;\n}\nfunction clampAndNormalizeValue(value, range) {\n var result = 0;\n\n if (range[0] !== range[1]) {\n // clamp\n if (value < range[0]) {\n result = range[0];\n } else if (value > range[1]) {\n result = range[1];\n } else {\n result = value;\n } // normalize\n\n\n result = (result - range[0]) / (range[1] - range[0]);\n }\n\n return result;\n}\nvar getScalarTypeFittingRange = notImplemented('GetScalarTypeFittingRange');\nvar getAdjustedScalarRange = notImplemented('GetAdjustedScalarRange');\nfunction extentIsWithinOtherExtent(extent1, extent2) {\n if (!extent1 || !extent2) {\n return 0;\n }\n\n for (var i = 0; i < 6; i += 2) {\n if (extent1[i] < extent2[i] || extent1[i] > extent2[i + 1] || extent1[i + 1] < extent2[i] || extent1[i + 1] > extent2[i + 1]) {\n return 0;\n }\n }\n\n return 1;\n}\nfunction boundsIsWithinOtherBounds(bounds1_6, bounds2_6, delta_3) {\n if (!bounds1_6 || !bounds2_6) {\n return 0;\n }\n\n for (var i = 0; i < 6; i += 2) {\n if (bounds1_6[i] + delta_3[i / 2] < bounds2_6[i] || bounds1_6[i] - delta_3[i / 2] > bounds2_6[i + 1] || bounds1_6[i + 1] + delta_3[i / 2] < bounds2_6[i] || bounds1_6[i + 1] - delta_3[i / 2] > bounds2_6[i + 1]) {\n return 0;\n }\n }\n\n return 1;\n}\nfunction pointIsWithinBounds(point_3, bounds_6, delta_3) {\n if (!point_3 || !bounds_6 || !delta_3) {\n return 0;\n }\n\n for (var i = 0; i < 3; i++) {\n if (point_3[i] + delta_3[i] < bounds_6[2 * i] || point_3[i] - delta_3[i] > bounds_6[2 * i + 1]) {\n return 0;\n }\n }\n\n return 1;\n}\nfunction solve3PointCircle(p1, p2, p3, center) {\n var v21 = createArray(3);\n var v32 = createArray(3);\n var v13 = createArray(3);\n var v12 = createArray(3);\n var v23 = createArray(3);\n var v31 = createArray(3);\n\n for (var i = 0; i < 3; ++i) {\n v21[i] = p1[i] - p2[i];\n v32[i] = p2[i] - p3[i];\n v13[i] = p3[i] - p1[i];\n v12[i] = -v21[i];\n v23[i] = -v32[i];\n v31[i] = -v13[i];\n }\n\n var norm12 = norm(v12);\n var norm23 = norm(v23);\n var norm13 = norm(v13);\n var crossv21v32 = createArray(3);\n cross(v21, v32, crossv21v32);\n var normCross = norm(crossv21v32);\n var radius = norm12 * norm23 * norm13 / (2 * normCross);\n var normCross22 = 2 * normCross * normCross;\n var alpha = norm23 * norm23 * dot(v21, v31) / normCross22;\n var beta = norm13 * norm13 * dot(v12, v32) / normCross22;\n var gamma = norm12 * norm12 * dot(v13, v23) / normCross22;\n\n for (var _i6 = 0; _i6 < 3; ++_i6) {\n center[_i6] = alpha * p1[_i6] + beta * p2[_i6] + gamma * p3[_i6];\n }\n\n return radius;\n}\nvar inf = Infinity;\nvar negInf = -Infinity;\nvar isInf = function isInf(value) {\n return !Number.isFinite(value);\n};\nvar isFinite = Number.isFinite,\n isNaN = Number.isNaN;\n\nvar isNan = isNaN; // JavaScript - add-on ----------------------\n\nfunction createUninitializedBounds() {\n return [].concat([Number.MAX_VALUE, -Number.MAX_VALUE, // X\n Number.MAX_VALUE, -Number.MAX_VALUE, // Y\n Number.MAX_VALUE, -Number.MAX_VALUE // Z\n ]);\n}\nfunction getMajorAxisIndex(vector) {\n var maxValue = -1;\n var axisIndex = -1;\n\n for (var i = 0; i < vector.length; i++) {\n var value = Math.abs(vector[i]);\n\n if (value > maxValue) {\n axisIndex = i;\n maxValue = value;\n }\n }\n\n return axisIndex;\n}\nfunction floatToHex2(value) {\n var integer = Math.floor(value * 255);\n\n if (integer > 15) {\n return integer.toString(16);\n }\n\n return \"0\".concat(integer.toString(16));\n}\nfunction floatRGB2HexCode(rgbArray) {\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#';\n return \"\".concat(prefix).concat(rgbArray.map(floatToHex2).join(''));\n}\n\nfunction floatToChar(f) {\n return Math.round(f * 255);\n}\n\nfunction float2CssRGBA(rgbArray) {\n if (rgbArray.length === 3) {\n return \"rgb(\".concat(rgbArray.map(floatToChar).join(', '), \")\");\n }\n\n return \"rgba(\".concat(floatToChar(rgbArray[0] || 0), \", \").concat(floatToChar(rgbArray[1] || 0), \", \").concat(floatToChar(rgbArray[2] || 0), \", \").concat(rgbArray[3] || 0, \")\");\n} // ----------------------------------------------------------------------------\n// Only Static API\n// ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n Pi: Pi,\n radiansFromDegrees: radiansFromDegrees,\n degreesFromRadians: degreesFromRadians,\n round: round,\n floor: floor,\n ceil: ceil,\n ceilLog2: ceilLog2,\n min: min,\n max: max,\n arrayMin: arrayMin,\n arrayMax: arrayMax,\n arrayRange: arrayRange,\n isPowerOfTwo: isPowerOfTwo,\n nearestPowerOfTwo: nearestPowerOfTwo,\n factorial: factorial,\n binomial: binomial,\n beginCombination: beginCombination,\n nextCombination: nextCombination,\n randomSeed: randomSeed,\n getSeed: getSeed,\n random: random,\n gaussian: gaussian,\n add: add,\n subtract: subtract,\n multiplyScalar: multiplyScalar,\n multiplyScalar2D: multiplyScalar2D,\n multiplyAccumulate: multiplyAccumulate,\n multiplyAccumulate2D: multiplyAccumulate2D,\n dot: dot,\n outer: outer,\n cross: cross,\n norm: norm,\n normalize: normalize,\n perpendiculars: perpendiculars,\n projectVector: projectVector,\n projectVector2D: projectVector2D,\n distance2BetweenPoints: distance2BetweenPoints,\n angleBetweenVectors: angleBetweenVectors,\n gaussianAmplitude: gaussianAmplitude,\n gaussianWeight: gaussianWeight,\n dot2D: dot2D,\n outer2D: outer2D,\n norm2D: norm2D,\n normalize2D: normalize2D,\n determinant2x2: determinant2x2,\n LUFactor3x3: LUFactor3x3,\n LUSolve3x3: LUSolve3x3,\n linearSolve3x3: linearSolve3x3,\n multiply3x3_vect3: multiply3x3_vect3,\n multiply3x3_mat3: multiply3x3_mat3,\n multiplyMatrix: multiplyMatrix,\n transpose3x3: transpose3x3,\n invert3x3: invert3x3,\n identity3x3: identity3x3,\n determinant3x3: determinant3x3,\n quaternionToMatrix3x3: quaternionToMatrix3x3,\n areEquals: areEquals,\n areMatricesEqual: areMatricesEqual,\n roundNumber: roundNumber,\n roundVector: roundVector,\n matrix3x3ToQuaternion: matrix3x3ToQuaternion,\n multiplyQuaternion: multiplyQuaternion,\n orthogonalize3x3: orthogonalize3x3,\n diagonalize3x3: diagonalize3x3,\n singularValueDecomposition3x3: singularValueDecomposition3x3,\n solveLinearSystem: solveLinearSystem,\n invertMatrix: invertMatrix,\n luFactorLinearSystem: luFactorLinearSystem,\n luSolveLinearSystem: luSolveLinearSystem,\n estimateMatrixCondition: estimateMatrixCondition,\n jacobi: jacobi,\n jacobiN: jacobiN,\n solveHomogeneousLeastSquares: solveHomogeneousLeastSquares,\n solveLeastSquares: solveLeastSquares,\n hex2float: hex2float,\n rgb2hsv: rgb2hsv,\n hsv2rgb: hsv2rgb,\n lab2xyz: lab2xyz,\n xyz2lab: xyz2lab,\n xyz2rgb: xyz2rgb,\n rgb2xyz: rgb2xyz,\n rgb2lab: rgb2lab,\n lab2rgb: lab2rgb,\n uninitializeBounds: uninitializeBounds,\n areBoundsInitialized: areBoundsInitialized,\n computeBoundsFromPoints: computeBoundsFromPoints,\n clampValue: clampValue,\n clampVector: clampVector,\n clampAndNormalizeValue: clampAndNormalizeValue,\n getScalarTypeFittingRange: getScalarTypeFittingRange,\n getAdjustedScalarRange: getAdjustedScalarRange,\n extentIsWithinOtherExtent: extentIsWithinOtherExtent,\n boundsIsWithinOtherBounds: boundsIsWithinOtherBounds,\n pointIsWithinBounds: pointIsWithinBounds,\n solve3PointCircle: solve3PointCircle,\n inf: inf,\n negInf: negInf,\n isInf: isInf,\n isNan: isNaN,\n isNaN: isNaN,\n isFinite: isFinite,\n // JS add-on\n createUninitializedBounds: createUninitializedBounds,\n getMajorAxisIndex: getMajorAxisIndex,\n floatToHex2: floatToHex2,\n floatRGB2HexCode: floatRGB2HexCode,\n float2CssRGBA: float2CssRGBA\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/Math/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js ***! - \************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n // eslint-disable-next-line import/no-cycle\n\n\n\nvar NoOp = function NoOp(v) {\n return v;\n};\n\nvar IDENTITY = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\nvar EPSILON = 1e-6;\n\nvar Transform = /*#__PURE__*/function () {\n function Transform() {\n var useDegree = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n _classCallCheck(this, Transform);\n\n this.matrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n this.tmp = new Float64Array(3);\n this.angleConv = useDegree ? gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"glMatrix\"].toRadian : NoOp;\n }\n\n _createClass(Transform, [{\n key: \"rotateFromDirections\",\n value: function rotateFromDirections(originDirection, targetDirection) {\n var src = new Float64Array(3);\n var dst = new Float64Array(3);\n var transf = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(src, originDirection[0], originDirection[1], originDirection[2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(dst, targetDirection[0], targetDirection[1], targetDirection[2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].normalize(src, src);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].normalize(dst, dst);\n var cosAlpha = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].dot(src, dst);\n\n if (cosAlpha >= 1) {\n return this;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].cross(this.tmp, src, dst);\n\n if (gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].length(this.tmp) < EPSILON) {\n // cross product is 0, so pick arbitrary axis perpendicular\n // to originDirection.\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].cross(this.tmp, [1, 0, 0], originDirection);\n\n if (gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].length(this.tmp) < EPSILON) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].cross(this.tmp, [0, 1, 0], originDirection);\n }\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].fromRotation(transf, Math.acos(cosAlpha), this.tmp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(this.matrix, this.matrix, transf);\n return this;\n }\n }, {\n key: \"rotate\",\n value: function rotate(angle, axis) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set.apply(gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"], [this.tmp].concat(_toConsumableArray(axis)));\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].normalize(this.tmp, this.tmp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(this.matrix, this.matrix, this.angleConv(angle), this.tmp);\n return this;\n }\n }, {\n key: \"rotateX\",\n value: function rotateX(angle) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateX(this.matrix, this.matrix, this.angleConv(angle));\n return this;\n }\n }, {\n key: \"rotateY\",\n value: function rotateY(angle) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateY(this.matrix, this.matrix, this.angleConv(angle));\n return this;\n }\n }, {\n key: \"rotateZ\",\n value: function rotateZ(angle) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateZ(this.matrix, this.matrix, this.angleConv(angle));\n return this;\n }\n }, {\n key: \"translate\",\n value: function translate(x, y, z) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(this.tmp, x, y, z);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(this.matrix, this.matrix, this.tmp);\n return this;\n }\n }, {\n key: \"scale\",\n value: function scale(sx, sy, sz) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(this.tmp, sx, sy, sz);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].scale(this.matrix, this.matrix, this.tmp);\n return this;\n }\n }, {\n key: \"multiply\",\n value: function multiply(mat4x4) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(this.matrix, this.matrix, mat4x4);\n return this;\n }\n }, {\n key: \"identity\",\n value: function identity() {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(this.matrix);\n return this;\n } //-----------\n\n }, {\n key: \"apply\",\n value: function apply(typedArray) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var nbIterations = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;\n\n if (Object(vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"areMatricesEqual\"])(IDENTITY, this.matrix)) {\n // Make sure we can chain apply...\n return this;\n }\n\n var size = nbIterations === -1 ? typedArray.length : offset + nbIterations * 3;\n\n for (var i = offset; i < size; i += 3) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(this.tmp, typedArray[i], typedArray[i + 1], typedArray[i + 2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(this.tmp, this.tmp, this.matrix);\n typedArray[i] = this.tmp[0];\n typedArray[i + 1] = this.tmp[1];\n typedArray[i + 2] = this.tmp[2];\n } // Make sure we can chain apply...\n\n\n return this;\n }\n }, {\n key: \"getMatrix\",\n value: function getMatrix() {\n return this.matrix;\n }\n }, {\n key: \"setMatrix\",\n value: function setMatrix(mat4x4) {\n if (!!mat4x4 && mat4x4.length === 16) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(this.matrix, mat4x4);\n }\n\n return this;\n }\n }]);\n\n return Transform;\n}();\n\nfunction buildFromDegree() {\n return new Transform(true);\n}\n\nfunction buildFromRadian() {\n return new Transform(false);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n buildFromDegree: buildFromDegree,\n buildFromRadian: buildFromRadian\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/Points/index.js": -/*!*****************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/Points/index.js ***! - \*****************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\nvar INVALID_BOUNDS = [1, -1, 1, -1, 1, -1]; // ----------------------------------------------------------------------------\n// vtkPoints methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPoints(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPoints'); // Forwarding methods\n\n publicAPI.getNumberOfPoints = publicAPI.getNumberOfTuples;\n\n publicAPI.setNumberOfPoints = function (nbPoints) {\n var dimension = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;\n\n if (publicAPI.getNumberOfPoints() !== nbPoints) {\n model.size = nbPoints * dimension;\n model.values = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newTypedArray(model.dataType, model.size);\n publicAPI.setNumberOfComponents(dimension);\n publicAPI.modified();\n }\n };\n\n publicAPI.setPoint = function (idx) {\n var offset = idx * model.numberOfComponents;\n\n for (var i = 0; i < model.numberOfComponents; i++) {\n model.values[offset + i] = i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1];\n }\n };\n\n publicAPI.getPoint = publicAPI.getTuple;\n\n publicAPI.getBounds = function () {\n if (publicAPI.getNumberOfComponents() === 3) {\n var _xRange = publicAPI.getRange(0);\n\n model.bounds[0] = _xRange[0];\n model.bounds[1] = _xRange[1];\n\n var _yRange = publicAPI.getRange(1);\n\n model.bounds[2] = _yRange[0];\n model.bounds[3] = _yRange[1];\n var zRange = publicAPI.getRange(2);\n model.bounds[4] = zRange[0];\n model.bounds[5] = zRange[1];\n return model.bounds;\n }\n\n if (publicAPI.getNumberOfComponents() !== 2) {\n vtkErrorMacro(\"getBounds called on an array with components of\\n \".concat(publicAPI.getNumberOfComponents()));\n return INVALID_BOUNDS;\n }\n\n var xRange = publicAPI.getRange(0);\n model.bounds[0] = xRange[0];\n model.bounds[1] = xRange[1];\n var yRange = publicAPI.getRange(1);\n model.bounds[2] = yRange[0];\n model.bounds[3] = yRange[1];\n model.bounds[4] = 0;\n model.bounds[5] = 0;\n return model.bounds;\n }; // Trigger the computation of bounds\n\n\n publicAPI.computeBounds = publicAPI.getBounds; // Initialize\n\n publicAPI.setNumberOfComponents(model.numberOfComponents < 2 ? 3 : model.numberOfComponents);\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n empty: true,\n numberOfComponents: 3,\n dataType: vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__[\"VtkDataTypes\"].FLOAT,\n bounds: [1, -1, 1, -1, 1, -1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtkPoints(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPoints'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/Points/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/Constants.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/Constants.js ***! - \******************************************************************************/ -/*! exports provided: VectorMode, ScalarMappingTarget, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VectorMode\", function() { return VectorMode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ScalarMappingTarget\", function() { return ScalarMappingTarget; });\nvar VectorMode = {\n MAGNITUDE: 0,\n COMPONENT: 1,\n RGBCOLORS: 2\n};\nvar ScalarMappingTarget = {\n LUMINANCE: 1,\n LUMINANCE_ALPHA: 2,\n RGB: 3,\n RGBA: 4\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n VectorMode: VectorMode,\n ScalarMappingTarget: ScalarMappingTarget\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/index.js ***! - \**************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/ScalarsToColors/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n // Need to go inside Constants otherwise dependency loop\n\nvar ScalarMappingTarget = vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ScalarMappingTarget,\n VectorMode = vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].VectorMode;\nvar VtkDataTypes = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"].VtkDataTypes;\nvar ColorMode = vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ColorMode;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n// Add module-level functions or api that you want to expose statically via\n// the next section...\n// ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\nfunction intColorToUChar(c) {\n return c;\n}\n\nfunction floatColorToUChar(c) {\n return Math.floor(c * 255.0 + 0.5);\n} // ----------------------------------------------------------------------------\n// vtkScalarsToColors methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkScalarsToColors(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkScalarsToColors');\n\n publicAPI.setVectorModeToMagnitude = function () {\n return publicAPI.setVectorMode(VectorMode.MAGNITUDE);\n };\n\n publicAPI.setVectorModeToComponent = function () {\n return publicAPI.setVectorMode(VectorMode.COMPONENT);\n };\n\n publicAPI.setVectorModeToRGBColors = function () {\n return publicAPI.setVectorMode(VectorMode.RGBCOLORS);\n };\n\n publicAPI.build = function () {};\n\n publicAPI.isOpaque = function () {\n return true;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.setAnnotations = function (values, annotations) {\n if (values && !annotations || !values && annotations) {\n return;\n }\n\n if (values && annotations && values.length !== annotations.length) {\n vtkErrorMacro('Values and annotations do not have the same number of tuples so ignoring');\n return;\n }\n\n model.annotationArray = [];\n\n if (annotations && values) {\n var num = annotations.length;\n\n for (var i = 0; i < num; i++) {\n model.annotationArray.push({\n value: values[i],\n annotation: String(annotations[i])\n });\n }\n }\n\n publicAPI.updateAnnotatedValueMap();\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.setAnnotation = function (value, annotation) {\n var i = publicAPI.checkForAnnotatedValue(value);\n var modified = false;\n\n if (i >= 0) {\n if (model.annotationArray[i].annotation !== annotation) {\n model.annotationArray[i].annotation = annotation;\n modified = true;\n }\n } else {\n model.annotationArray.push({\n value: value,\n annotation: annotation\n });\n i = model.annotationArray.length - 1;\n modified = true;\n }\n\n if (modified) {\n publicAPI.updateAnnotatedValueMap();\n publicAPI.modified();\n }\n\n return i;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfAnnotatedValues = function () {\n return model.annotationArray.length;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getAnnotatedValue = function (idx) {\n if (idx < 0 || idx >= model.annotationArray.length) {\n return null;\n }\n\n return model.annotationArray[idx].value;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getAnnotation = function (idx) {\n if (model.annotationArray[idx] === undefined) {\n return null;\n }\n\n return model.annotationArray[idx].annotation;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getAnnotatedValueIndex = function (val) {\n return model.annotationArray.length ? publicAPI.checkForAnnotatedValue(val) : -1;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.removeAnnotation = function (value) {\n var i = publicAPI.checkForAnnotatedValue(value);\n var needToRemove = i >= 0;\n\n if (needToRemove) {\n model.annotationArray.splice(i, 1);\n publicAPI.updateAnnotatedValueMap();\n publicAPI.modified();\n }\n\n return needToRemove;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.resetAnnotations = function () {\n model.annotationArray = [];\n model.annotatedValueMap = [];\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getAnnotationColor = function (val, rgba) {\n if (model.indexedLookup) {\n var i = publicAPI.getAnnotatedValueIndex(val);\n publicAPI.getIndexedColor(i, rgba);\n } else {\n publicAPI.getColor(parseFloat(val), rgba);\n rgba[3] = 1.0;\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.checkForAnnotatedValue = function (value) {\n return publicAPI.getAnnotatedValueIndexInternal(value);\n }; //----------------------------------------------------------------------------\n // An unsafe version of vtkScalarsToColors::CheckForAnnotatedValue for\n // internal use (no pointer checks performed)\n\n\n publicAPI.getAnnotatedValueIndexInternal = function (value) {\n if (model.annotatedValueMap[value] !== undefined) {\n var na = model.annotationArray.length;\n return model.annotatedValueMap[value] % na;\n } // Treat as a NaN\n\n\n return -1;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getIndexedColor = function (val, rgba) {\n rgba[0] = 0.0;\n rgba[1] = 0.0;\n rgba[2] = 0.0;\n rgba[3] = 0.0;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.updateAnnotatedValueMap = function () {\n model.annotatedValueMap = [];\n var na = model.annotationArray.length;\n\n for (var i = 0; i < na; i++) {\n model.annotatedValueMap[model.annotationArray[i].value] = i;\n }\n }; // Description:\n // Internal methods that map a data array into a 4-component,\n // unsigned char RGBA array. The color mode determines the behavior\n // of mapping. If ColorMode.DEFAULT is set, then unsigned char\n // data arrays are treated as colors (and converted to RGBA if\n // necessary); If ColorMode.DIRECT_SCALARS is set, then all arrays\n // are treated as colors (integer types are clamped in the range 0-255,\n // floating point arrays are clamped in the range 0.0-1.0. Note 'char' does\n // not have enough values to represent a color so mapping this type is\n // considered an error);\n // otherwise, the data is mapped through this instance\n // of ScalarsToColors. The component argument is used for data\n // arrays with more than one component; it indicates which component\n // to use to do the blending. When the component argument is -1,\n // then the this object uses its own selected technique to change a\n // vector into a scalar to map.\n\n\n publicAPI.mapScalars = function (scalars, colorMode, componentIn) {\n var numberOfComponents = scalars.getNumberOfComponents();\n var newColors = null; // map scalars through lookup table only if needed\n\n if (colorMode === ColorMode.DEFAULT && scalars.getDataType() === VtkDataTypes.UNSIGNED_CHAR || colorMode === ColorMode.DIRECT_SCALARS && scalars) {\n newColors = publicAPI.convertToRGBA(scalars, numberOfComponents, scalars.getNumberOfTuples());\n } else {\n var newscalars = {\n type: 'vtkDataArray',\n name: 'temp',\n numberOfComponents: 4,\n dataType: VtkDataTypes.UNSIGNED_CHAR\n };\n var s = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newTypedArray(newscalars.dataType, 4 * scalars.getNumberOfTuples());\n newscalars.values = s;\n newscalars.size = s.length;\n newColors = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(newscalars);\n var component = componentIn; // If mapper did not specify a component, use the VectorMode\n\n if (component < 0 && numberOfComponents > 1) {\n publicAPI.mapVectorsThroughTable(scalars, newColors, ScalarMappingTarget.RGBA, -1, -1);\n } else {\n if (component < 0) {\n component = 0;\n }\n\n if (component >= numberOfComponents) {\n component = numberOfComponents - 1;\n } // Map the scalars to colors\n\n\n publicAPI.mapScalarsThroughTable(scalars, newColors, ScalarMappingTarget.RGBA, component);\n }\n }\n\n return newColors;\n };\n\n publicAPI.mapVectorsToMagnitude = function (input, output, compsToUse) {\n var length = input.getNumberOfTuples();\n var inIncr = input.getNumberOfComponents();\n var outputV = output.getData();\n var inputV = input.getData();\n\n for (var i = 0; i < length; i++) {\n var sum = 0.0;\n\n for (var j = 0; j < compsToUse; j++) {\n sum += inputV[i * inIncr + j] * inputV[i * inIncr + j];\n }\n\n outputV[i] = Math.sqrt(sum);\n }\n }; //----------------------------------------------------------------------------\n // Map a set of vector values through the table\n\n\n publicAPI.mapVectorsThroughTable = function (input, output, outputFormat, vectorComponentIn, vectorSizeIn) {\n var vectorMode = publicAPI.getVectorMode();\n var vectorSize = vectorSizeIn;\n var vectorComponent = vectorComponentIn;\n var inComponents = input.getNumberOfComponents();\n\n if (vectorMode === VectorMode.COMPONENT) {\n // make sure vectorComponent is within allowed range\n if (vectorComponent === -1) {\n // if set to -1, use default value provided by table\n vectorComponent = publicAPI.getVectorComponent();\n }\n\n if (vectorComponent < 0) {\n vectorComponent = 0;\n }\n\n if (vectorComponent >= inComponents) {\n vectorComponent = inComponents - 1;\n }\n } else {\n // make sure vectorSize is within allowed range\n if (vectorSize === -1) {\n // if set to -1, use default value provided by table\n vectorSize = publicAPI.getVectorSize();\n }\n\n if (vectorSize <= 0) {\n vectorComponent = 0;\n vectorSize = inComponents;\n } else {\n if (vectorComponent < 0) {\n vectorComponent = 0;\n }\n\n if (vectorComponent >= inComponents) {\n vectorComponent = inComponents - 1;\n }\n\n if (vectorComponent + vectorSize > inComponents) {\n vectorSize = inComponents - vectorComponent;\n }\n }\n\n if (vectorMode === VectorMode.MAGNITUDE && (inComponents === 1 || vectorSize === 1)) {\n vectorMode = VectorMode.COMPONENT;\n }\n } // increment input pointer to the first component to map\n\n\n var inputOffset = 0;\n\n if (vectorComponent > 0) {\n inputOffset = vectorComponent;\n } // map according to the current vector mode\n\n\n switch (vectorMode) {\n case VectorMode.COMPONENT:\n {\n publicAPI.mapScalarsThroughTable(input, output, outputFormat, inputOffset);\n break;\n }\n\n default:\n case VectorMode.MAGNITUDE:\n {\n var magValues = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance({\n numberOfComponents: 1,\n values: new Float32Array(input.getNumberOfTuples())\n });\n publicAPI.mapVectorsToMagnitude(input, magValues, vectorSize);\n publicAPI.mapScalarsThroughTable(magValues, output, outputFormat, 0);\n break;\n }\n\n case VectorMode.RGBCOLORS:\n {\n // publicAPI.mapColorsToColors(\n // input, output, inComponents, vectorSize,\n // outputFormat);\n break;\n }\n }\n };\n\n publicAPI.luminanceToRGBA = function (newColors, colors, alpha, convtFun) {\n var a = convtFun(alpha);\n var values = colors.getData();\n var newValues = newColors.getData();\n var size = values.length;\n var component = 0;\n var tuple = 1;\n var count = 0;\n\n for (var i = component; i < size; i += tuple) {\n var l = convtFun(values[i]);\n newValues[count * 4] = l;\n newValues[count * 4 + 1] = l;\n newValues[count * 4 + 2] = l;\n newValues[count * 4 + 3] = a;\n count++;\n }\n };\n\n publicAPI.luminanceAlphaToRGBA = function (newColors, colors, alpha, convtFun) {\n var values = colors.getData();\n var newValues = newColors.getData();\n var size = values.length;\n var component = 0;\n var tuple = 2;\n var count = 0;\n\n for (var i = component; i < size; i += tuple) {\n var l = convtFun(values[i]);\n newValues[count] = l;\n newValues[count + 1] = l;\n newValues[count + 2] = l;\n newValues[count + 3] = convtFun(values[i + 1]) * alpha;\n count += 4;\n }\n };\n\n publicAPI.rGBToRGBA = function (newColors, colors, alpha, convtFun) {\n var a = floatColorToUChar(alpha);\n var values = colors.getData();\n var newValues = newColors.getData();\n var size = values.length;\n var component = 0;\n var tuple = 3;\n var count = 0;\n\n for (var i = component; i < size; i += tuple) {\n newValues[count * 4] = convtFun(values[i]);\n newValues[count * 4 + 1] = convtFun(values[i + 1]);\n newValues[count * 4 + 2] = convtFun(values[i + 2]);\n newValues[count * 4 + 3] = a;\n count++;\n }\n };\n\n publicAPI.rGBAToRGBA = function (newColors, colors, alpha, convtFun) {\n var values = colors.getData();\n var newValues = newColors.getData();\n var size = values.length;\n var component = 0;\n var tuple = 4;\n var count = 0;\n\n for (var i = component; i < size; i += tuple) {\n newValues[count * 4] = convtFun(values[i]);\n newValues[count * 4 + 1] = convtFun(values[i + 1]);\n newValues[count * 4 + 2] = convtFun(values[i + 2]);\n newValues[count * 4 + 3] = convtFun(values[i + 3]) * alpha;\n count++;\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.convertToRGBA = function (colors, numComp, numTuples) {\n var alpha = model.alpha;\n\n if (numComp === 4 && alpha >= 1.0 && colors.getDataType() === VtkDataTypes.UNSIGNED_CHAR) {\n return colors;\n }\n\n var newColors = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance({\n numberOfComponents: 4,\n empty: true,\n size: 4 * numTuples,\n dataType: VtkDataTypes.UNSIGNED_CHAR\n });\n\n if (numTuples <= 0) {\n return newColors;\n }\n\n alpha = alpha > 0 ? alpha : 0;\n alpha = alpha < 1 ? alpha : 1;\n var convtFun = intColorToUChar;\n\n if (colors.getDataType() === VtkDataTypes.FLOAT || colors.getDataType() === VtkDataTypes.DOUBLE) {\n convtFun = floatColorToUChar;\n }\n\n switch (numComp) {\n case 1:\n publicAPI.luminanceToRGBA(newColors, colors, alpha, convtFun);\n break;\n\n case 2:\n publicAPI.luminanceAlphaToRGBA(newColors, colors, convtFun);\n break;\n\n case 3:\n publicAPI.rGBToRGBA(newColors, colors, alpha, convtFun);\n break;\n\n case 4:\n publicAPI.rGBAToRGBA(newColors, colors, alpha, convtFun);\n break;\n\n default:\n vtkErrorMacro('Cannot convert colors');\n return null;\n }\n\n return newColors;\n };\n\n publicAPI.usingLogScale = function () {\n return false;\n };\n\n publicAPI.getNumberOfAvailableColors = function () {\n return 256 * 256 * 256;\n };\n\n publicAPI.setRange = function (min, max) {\n return publicAPI.setMappingRange(min, max);\n };\n\n publicAPI.getRange = function (min, max) {\n return publicAPI.getMappingRange();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n alpha: 1.0,\n vectorComponent: 0,\n vectorSize: -1,\n vectorMode: VectorMode.COMPONENT,\n mappingRange: null,\n annotationArray: null,\n annotatedValueMap: null,\n indexedLookup: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.mappingRange = [0, 255];\n model.annotationArray = [];\n model.annotatedValueMap = []; // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['vectorSize', 'vectorComponent', 'vectorMode', 'alpha', 'indexedLookup']); // Create set macros for array (needs to know size)\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setArray(publicAPI, model, ['mappingRange'], 2); // Create get macros for array\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['mappingRange']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkScalarsToColors(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkScalarsToColors'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js ***! - \***************************************************************************/ -/*! exports provided: equals, isValid, setBounds, reset, addPoint, addBounds, setMinPoint, setMaxPoint, inflate, scale, getCenter, getLength, getLengths, getXRange, getYRange, getZRange, getMaxLength, getDiagonalLength, getMinPoint, getMaxPoint, getCorners, computeCornerPoints, computeScale3, computeLocalBounds, intersectBox, intersectPlane, intersect, intersects, containsPoint, contains, cutWithPlane, STATIC, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return _equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isValid\", function() { return _isValid; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setBounds\", function() { return _setBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reset\", function() { return _reset; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addPoint\", function() { return _addPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addBounds\", function() { return _addBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setMinPoint\", function() { return _setMinPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setMaxPoint\", function() { return _setMaxPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inflate\", function() { return _inflate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return _scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCenter\", function() { return _getCenter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLength\", function() { return _getLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLengths\", function() { return _getLengths; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getXRange\", function() { return _getXRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getYRange\", function() { return _getYRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getZRange\", function() { return _getZRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMaxLength\", function() { return _getMaxLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDiagonalLength\", function() { return _getDiagonalLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMinPoint\", function() { return _getMinPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMaxPoint\", function() { return _getMaxPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCorners\", function() { return _getCorners; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computeCornerPoints\", function() { return _computeCornerPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computeScale3\", function() { return _computeScale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computeLocalBounds\", function() { return _computeLocalBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intersectBox\", function() { return _intersectBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intersectPlane\", function() { return _intersectPlane; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intersect\", function() { return _intersect; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intersects\", function() { return _intersects; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"containsPoint\", function() { return _containsPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"contains\", function() { return contains; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cutWithPlane\", function() { return _cutWithPlane; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Plane */ \"./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\nvar INIT_BOUNDS = [Number.MAX_VALUE, -Number.MAX_VALUE, // X\nNumber.MAX_VALUE, -Number.MAX_VALUE, // Y\nNumber.MAX_VALUE, -Number.MAX_VALUE // Z\n]; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction _equals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n\n\n\nfunction _isValid(bounds) {\n return bounds[0] <= bounds[1] && bounds[2] <= bounds[3] && bounds[4] <= bounds[5];\n}\n\n\n\nfunction _setBounds(bounds, otherBounds) {\n bounds[0] = otherBounds[0];\n bounds[1] = otherBounds[1];\n bounds[2] = otherBounds[2];\n bounds[3] = otherBounds[3];\n bounds[4] = otherBounds[4];\n bounds[5] = otherBounds[5];\n return bounds;\n}\n\n\n\nfunction _reset(bounds) {\n return _setBounds(bounds, INIT_BOUNDS);\n}\n\n\n\nfunction _addPoint(bounds) {\n var _bounds = _slicedToArray(bounds, 6),\n xMin = _bounds[0],\n xMax = _bounds[1],\n yMin = _bounds[2],\n yMax = _bounds[3],\n zMin = _bounds[4],\n zMax = _bounds[5];\n\n bounds[0] = xMin < (arguments.length <= 1 ? undefined : arguments[1]) ? xMin : arguments.length <= 1 ? undefined : arguments[1];\n bounds[1] = xMax > (arguments.length <= 1 ? undefined : arguments[1]) ? xMax : arguments.length <= 1 ? undefined : arguments[1];\n bounds[2] = yMin < (arguments.length <= 2 ? undefined : arguments[2]) ? yMin : arguments.length <= 2 ? undefined : arguments[2];\n bounds[3] = yMax > (arguments.length <= 2 ? undefined : arguments[2]) ? yMax : arguments.length <= 2 ? undefined : arguments[2];\n bounds[4] = zMin < (arguments.length <= 3 ? undefined : arguments[3]) ? zMin : arguments.length <= 3 ? undefined : arguments[3];\n bounds[5] = zMax > (arguments.length <= 3 ? undefined : arguments[3]) ? zMax : arguments.length <= 3 ? undefined : arguments[3];\n}\n\n\n\nfunction _addBounds(bounds, xMin, xMax, yMin, yMax, zMin, zMax) {\n var _bounds2 = _slicedToArray(bounds, 6),\n _xMin = _bounds2[0],\n _xMax = _bounds2[1],\n _yMin = _bounds2[2],\n _yMax = _bounds2[3],\n _zMin = _bounds2[4],\n _zMax = _bounds2[5];\n\n if (zMax === undefined) {\n bounds[0] = Math.min(xMin[0], _xMin);\n bounds[1] = Math.max(xMin[1], _xMax);\n bounds[2] = Math.min(xMin[2], _yMin);\n bounds[3] = Math.max(xMin[3], _yMax);\n bounds[4] = Math.min(xMin[4], _zMin);\n bounds[5] = Math.max(xMin[5], _zMax);\n } else {\n bounds[0] = Math.min(xMin, _xMin);\n bounds[1] = Math.max(xMax, _xMax);\n bounds[2] = Math.min(yMin, _yMin);\n bounds[3] = Math.max(yMax, _yMax);\n bounds[4] = Math.min(zMin, _zMin);\n bounds[5] = Math.max(zMax, _zMax);\n }\n}\n\n\n\nfunction _setMinPoint(bounds, x, y, z) {\n var _bounds3 = _slicedToArray(bounds, 6),\n xMin = _bounds3[0],\n xMax = _bounds3[1],\n yMin = _bounds3[2],\n yMax = _bounds3[3],\n zMin = _bounds3[4],\n zMax = _bounds3[5];\n\n bounds[0] = x;\n bounds[1] = x > xMax ? x : xMax;\n bounds[2] = y;\n bounds[3] = y > yMax ? y : yMax;\n bounds[4] = z;\n bounds[5] = z > zMax ? z : zMax;\n return xMin !== x || yMin !== y || zMin !== z;\n}\n\n\n\nfunction _setMaxPoint(bounds, x, y, z) {\n var _bounds4 = _slicedToArray(bounds, 6),\n xMin = _bounds4[0],\n xMax = _bounds4[1],\n yMin = _bounds4[2],\n yMax = _bounds4[3],\n zMin = _bounds4[4],\n zMax = _bounds4[5];\n\n bounds[0] = x < xMin ? x : xMin;\n bounds[1] = x;\n bounds[2] = y < yMin ? y : yMin;\n bounds[3] = y;\n bounds[4] = z < zMin ? z : zMin;\n bounds[5] = z;\n return xMax !== x || yMax !== y || zMax !== z;\n}\n\n\n\nfunction _inflate(bounds, delta) {\n bounds[0] -= delta;\n bounds[1] += delta;\n bounds[2] -= delta;\n bounds[3] += delta;\n bounds[4] -= delta;\n bounds[5] += delta;\n}\n\n\n\nfunction _scale(bounds, sx, sy, sz) {\n if (!_isValid(bounds)) {\n return false;\n }\n\n if (sx >= 0.0) {\n bounds[0] *= sx;\n bounds[1] *= sx;\n } else {\n bounds[0] = sx * bounds[1];\n bounds[1] = sx * bounds[0];\n }\n\n if (sy >= 0.0) {\n bounds[2] *= sy;\n bounds[3] *= sy;\n } else {\n bounds[2] = sy * bounds[3];\n bounds[3] = sy * bounds[2];\n }\n\n if (sz >= 0.0) {\n bounds[4] *= sz;\n bounds[5] *= sz;\n } else {\n bounds[4] = sz * bounds[5];\n bounds[5] = sz * bounds[4];\n }\n\n return true;\n}\n\n\n\nfunction _getCenter(bounds) {\n return [0.5 * (bounds[0] + bounds[1]), 0.5 * (bounds[2] + bounds[3]), 0.5 * (bounds[4] + bounds[5])];\n}\n\n\n\nfunction _getLength(bounds, index) {\n return bounds[index * 2 + 1] - bounds[index * 2];\n}\n\n\n\nfunction _getLengths(bounds) {\n return [_getLength(bounds, 0), _getLength(bounds, 1), _getLength(bounds, 2)];\n}\n\n\n\nfunction _getXRange(bounds) {\n return bounds.slice(0, 2);\n}\n\n\n\nfunction _getYRange(bounds) {\n return bounds.slice(2, 4);\n}\n\n\n\nfunction _getZRange(bounds) {\n return bounds.slice(4, 6);\n}\n\n\n\nfunction _getMaxLength(bounds) {\n var l = _getLengths(bounds);\n\n if (l[0] > l[1]) {\n if (l[0] > l[2]) {\n return l[0];\n }\n\n return l[2];\n }\n\n if (l[1] > l[2]) {\n return l[1];\n }\n\n return l[2];\n}\n\n\n\nfunction _getDiagonalLength(bounds) {\n if (_isValid(bounds)) {\n var l = _getLengths(bounds);\n\n return Math.sqrt(l[0] * l[0] + l[1] * l[1] + l[2] * l[2]);\n }\n\n return null;\n}\n\n\n\nfunction _getMinPoint(bounds) {\n return [bounds[0], bounds[2], bounds[4]];\n}\n\n\n\nfunction _getMaxPoint(bounds) {\n return [bounds[1], bounds[3], bounds[5]];\n}\n\n\n\nfunction oppositeSign(a, b) {\n return a <= 0 && b >= 0 || a >= 0 && b <= 0;\n}\n\nfunction _getCorners(bounds, corners) {\n var count = 0;\n\n for (var ix = 0; ix < 2; ix++) {\n for (var iy = 2; iy < 4; iy++) {\n for (var iz = 4; iz < 6; iz++) {\n corners[count] = [bounds[ix], bounds[iy], bounds[iz]];\n count++;\n }\n }\n }\n} // Computes the two corners with minimal and miximal coordinates\n\n\n\n\nfunction _computeCornerPoints(bounds, point1, point2) {\n point1[0] = bounds[0];\n point1[1] = bounds[2];\n point1[2] = bounds[4];\n point2[0] = bounds[1];\n point2[1] = bounds[3];\n point2[2] = bounds[5];\n}\n\n\n\nfunction _computeScale(bounds) {\n var scale3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n var center = _getCenter(bounds);\n\n scale3[0] = bounds[1] - center[0];\n scale3[1] = bounds[3] - center[1];\n scale3[2] = bounds[5] - center[2];\n return scale3;\n}\n/**\n * Compute local bounds.\n * Not as fast as vtkPoints.getBounds() if u, v, w form a natural basis.\n * @param {vtkPoints} points\n * @param {array} u first vector\n * @param {array} v second vector\n * @param {array} w third vector\n */\n\n\n\n\nfunction _computeLocalBounds(points, u, v, w) {\n var bounds = [].concat(INIT_BOUNDS);\n var pointsData = points.getData();\n\n for (var i = 0; i < pointsData.length; i += 3) {\n var point = [pointsData[i], pointsData[i + 1], pointsData[i + 2]];\n var du = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](point, u);\n bounds[0] = Math.min(du, bounds[0]);\n bounds[1] = Math.max(du, bounds[1]);\n var dv = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](point, v);\n bounds[2] = Math.min(dv, bounds[2]);\n bounds[3] = Math.max(dv, bounds[3]);\n var dw = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](point, w);\n bounds[4] = Math.min(dw, bounds[4]);\n bounds[5] = Math.max(dw, bounds[5]);\n }\n\n return bounds;\n} // The method returns a non-zero value if the bounding box is hit.\n// Origin[3] starts the ray, dir[3] is the vector components of the ray in the x-y-z\n// directions, coord[3] is the location of hit, and t is the parametric\n// coordinate along line. (Notes: the intersection ray dir[3] is NOT\n// normalized. Valid intersections will only occur between 0<=t<=1.)\n\n\n\n\nfunction _intersectBox(bounds, origin, dir, coord, tolerance) {\n var inside = true;\n var quadrant = [];\n var whichPlane = 0;\n var maxT = [];\n var candidatePlane = [0.0, 0.0, 0.0];\n var RIGHT = 0;\n var LEFT = 1;\n var MIDDLE = 2; // First find closest planes\n\n for (var i = 0; i < 3; i++) {\n if (origin[i] < bounds[2 * i]) {\n quadrant[i] = LEFT;\n candidatePlane[i] = bounds[2 * i];\n inside = false;\n } else if (origin[i] > bounds[2 * i + 1]) {\n quadrant[i] = RIGHT;\n candidatePlane[i] = bounds[2 * i + 1];\n inside = false;\n } else {\n quadrant[i] = MIDDLE;\n }\n } // Check whether origin of ray is inside bbox\n\n\n if (inside) {\n coord[0] = origin[0];\n coord[1] = origin[1];\n coord[2] = origin[2];\n tolerance[0] = 0;\n return 1;\n } // Calculate parametric distance to plane\n\n\n for (var _i2 = 0; _i2 < 3; _i2++) {\n if (quadrant[_i2] !== MIDDLE && dir[_i2] !== 0.0) {\n maxT[_i2] = (candidatePlane[_i2] - origin[_i2]) / dir[_i2];\n } else {\n maxT[_i2] = -1.0;\n }\n } // Find the largest parametric value of intersection\n\n\n for (var _i3 = 0; _i3 < 3; _i3++) {\n if (maxT[whichPlane] < maxT[_i3]) {\n whichPlane = _i3;\n }\n } // Check for valie intersection along line\n\n\n if (maxT[whichPlane] > 1.0 || maxT[whichPlane] < 0.0) {\n return 0;\n }\n\n tolerance[0] = maxT[whichPlane]; // Intersection point along line is okay. Check bbox.\n\n for (var _i4 = 0; _i4 < 3; _i4++) {\n if (whichPlane !== _i4) {\n coord[_i4] = origin[_i4] + maxT[whichPlane] * dir[_i4];\n\n if (coord[_i4] < bounds[2 * _i4] || coord[_i4] > bounds[2 * _i4 + 1]) {\n return 0;\n }\n } else {\n coord[_i4] = candidatePlane[_i4];\n }\n }\n\n return 1;\n} // Plane intersection with box\n// The plane is infinite in extent and defined by an origin and normal.The function indicates\n// whether the plane intersects, not the particulars of intersection points and such\n// The function returns non-zero if the plane and box intersect; zero otherwise.\n\n\n\n\nfunction _intersectPlane(bounds, origin, normal) {\n var p = [];\n var d = 0;\n var sign = 1;\n var firstOne = 1; // Evaluate the eight points. If there is a sign change, there is an intersection\n\n for (var z = 4; z <= 5; ++z) {\n p[2] = bounds[z];\n\n for (var y = 2; y <= 3; ++y) {\n p[1] = bounds[y];\n\n for (var x = 0; x <= 1; ++x) {\n p[0] = bounds[x];\n d = vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_1__[\"default\"].evaluate(normal, origin, p);\n\n if (firstOne) {\n sign = d >= 0 ? 1 : -1;\n firstOne = 0;\n }\n\n if (d === 0.0 || sign > 0 && d < 0.0 || sign < 0 && d > 0.0) {\n return 1;\n }\n }\n }\n }\n\n return 0; // no intersection\n}\n\n\n\nfunction _intersect(bounds, bBounds) {\n if (!(_isValid(bounds) && _isValid(bBounds))) {\n return false;\n }\n\n var newBounds = [0, 0, 0, 0, 0, 0];\n var intersection;\n\n for (var i = 0; i < 3; i++) {\n intersection = false;\n\n if (bBounds[i * 2] >= bounds[i * 2] && bBounds[i * 2] <= bounds[i * 2 + 1]) {\n intersection = true;\n newBounds[i * 2] = bBounds[i * 2];\n } else if (bounds[i * 2] >= bBounds[i * 2] && bounds[i * 2] <= bBounds[i * 2 + 1]) {\n intersection = true;\n newBounds[i * 2] = bounds[i * 2];\n }\n\n if (bBounds[i * 2 + 1] >= bounds[i * 2] && bBounds[i * 2 + 1] <= bounds[i * 2 + 1]) {\n intersection = true;\n newBounds[i * 2 + 1] = bBounds[2 * i + 1];\n } else if (bounds[i * 2 + 1] >= bBounds[i * 2] && bounds[i * 2 + 1] <= bBounds[i * 2 + 1]) {\n intersection = true;\n newBounds[i * 2 + 1] = bounds[i * 2 + 1];\n }\n\n if (!intersection) {\n return false;\n }\n } // OK they did intersect - set the box to be the result\n\n\n bounds[0] = newBounds[0];\n bounds[1] = newBounds[1];\n bounds[2] = newBounds[2];\n bounds[3] = newBounds[3];\n bounds[4] = newBounds[4];\n bounds[5] = newBounds[5];\n return true;\n}\n\n\n\nfunction _intersects(bounds, bBounds) {\n if (!(_isValid(bounds) && _isValid(bBounds))) {\n return false;\n }\n /* eslint-disable no-continue */\n\n\n for (var i = 0; i < 3; i++) {\n if (bBounds[i * 2] >= bounds[i * 2] && bBounds[i * 2] <= bounds[i * 2 + 1]) {\n continue;\n } else if (bounds[i * 2] >= bBounds[i * 2] && bounds[i * 2] <= bBounds[i * 2 + 1]) {\n continue;\n }\n\n if (bBounds[i * 2 + 1] >= bounds[i * 2] && bBounds[i * 2 + 1] <= bounds[i * 2 + 1]) {\n continue;\n } else if (bounds[i * 2 + 1] >= bBounds[i * 2] && bounds[i * 2 + 1] <= bBounds[i * 2 + 1]) {\n continue;\n }\n\n return false;\n }\n /* eslint-enable no-continue */\n\n\n return true;\n}\n\n\n\nfunction _containsPoint(bounds, x, y, z) {\n if (x < bounds[0] || x > bounds[1]) {\n return false;\n }\n\n if (y < bounds[2] || y > bounds[3]) {\n return false;\n }\n\n if (z < bounds[4] || z > bounds[5]) {\n return false;\n }\n\n return true;\n}\n\n\nfunction contains(bounds, otherBounds) {\n // if either box is not valid or they don't intersect\n if (!_intersects(bounds, otherBounds)) {\n return false;\n }\n\n if (!_containsPoint.apply(void 0, [bounds].concat(_toConsumableArray(_getMinPoint(otherBounds))))) {\n return false;\n }\n\n if (!_containsPoint.apply(void 0, [bounds].concat(_toConsumableArray(_getMaxPoint(otherBounds))))) {\n return false;\n }\n\n return true;\n}\n/**\n * Returns true if plane intersects bounding box.\n * If so, the box is cut by the plane\n * @param {array} origin\n * @param {array} normal\n */\n\nfunction _cutWithPlane(bounds, origin, normal) {\n // Index[0..2] represents the order of traversing the corners of a cube\n // in (x,y,z), (y,x,z) and (z,x,y) ordering, respectively\n var index = [[0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 4, 5, 2, 3, 6, 7], [0, 2, 4, 6, 1, 3, 5, 7]]; // stores the signed distance to a plane\n\n var d = [0, 0, 0, 0, 0, 0, 0, 0];\n var idx = 0;\n\n for (var ix = 0; ix < 2; ix++) {\n for (var iy = 2; iy < 4; iy++) {\n for (var iz = 4; iz < 6; iz++) {\n var x = [bounds[ix], bounds[iy], bounds[iz]];\n d[idx++] = vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_1__[\"default\"].evaluate(normal, origin, x);\n }\n }\n }\n\n var dir = 2;\n\n while (dir--) {\n // in each direction, we test if the vertices of two orthogonal faces\n // are on either side of the plane\n if (oppositeSign(d[index[dir][0]], d[index[dir][4]]) && oppositeSign(d[index[dir][1]], d[index[dir][5]]) && oppositeSign(d[index[dir][2]], d[index[dir][6]]) && oppositeSign(d[index[dir][3]], d[index[dir][7]])) {\n break;\n }\n }\n\n if (dir < 0) {\n return false;\n }\n\n var sign = Math.sign(normal[dir]);\n var size = Math.abs((bounds[dir * 2 + 1] - bounds[dir * 2]) * normal[dir]);\n var t = sign > 0 ? 1 : 0;\n /* eslint-disable no-continue */\n\n for (var i = 0; i < 4; i++) {\n if (size === 0) {\n continue; // shouldn't happen\n }\n\n var ti = Math.abs(d[index[dir][i]]) / size;\n\n if (sign > 0 && ti < t) {\n t = ti;\n }\n\n if (sign < 0 && ti > t) {\n t = ti;\n }\n }\n /* eslint-enable no-continue */\n\n\n var bound = (1.0 - t) * bounds[dir * 2] + t * bounds[dir * 2 + 1];\n\n if (sign > 0) {\n bounds[dir * 2] = bound;\n } else {\n bounds[dir * 2 + 1] = bound;\n }\n\n return true;\n} // ----------------------------------------------------------------------------\n// Light Weight class\n// ----------------------------------------------------------------------------\n\n\n\n\nvar BoundingBox = /*#__PURE__*/function () {\n function BoundingBox(refBounds) {\n _classCallCheck(this, BoundingBox);\n\n this.bounds = refBounds;\n\n if (!this.bounds) {\n this.bounds = new Float64Array(6);\n\n _setBounds(this.bounds, INIT_BOUNDS);\n }\n }\n\n _createClass(BoundingBox, [{\n key: \"getBounds\",\n value: function getBounds() {\n return this.bounds;\n }\n }, {\n key: \"equals\",\n value: function equals(otherBounds) {\n return _equals(this.bounds, otherBounds);\n }\n }, {\n key: \"isValid\",\n value: function isValid() {\n return _isValid(this.bounds);\n }\n }, {\n key: \"setBounds\",\n value: function setBounds(otherBounds) {\n return _setBounds(this.bounds, otherBounds);\n }\n }, {\n key: \"reset\",\n value: function reset() {\n return _reset(this.bounds);\n }\n }, {\n key: \"addPoint\",\n value: function addPoint() {\n for (var _len = arguments.length, xyz = new Array(_len), _key = 0; _key < _len; _key++) {\n xyz[_key] = arguments[_key];\n }\n\n return _addPoint(this.bounds, xyz);\n }\n }, {\n key: \"addBounds\",\n value: function addBounds(xMin, xMax, yMin, yMax, zMin, zMax) {\n return _addBounds(this.bounds, xMin, xMax, yMin, yMax, zMin, zMax);\n }\n }, {\n key: \"setMinPoint\",\n value: function setMinPoint(x, y, z) {\n return _setMinPoint(this.bounds, x, y, z);\n }\n }, {\n key: \"setMaxPoint\",\n value: function setMaxPoint(x, y, z) {\n return _setMaxPoint(this.bounds, x, y, z);\n }\n }, {\n key: \"inflate\",\n value: function inflate(delta) {\n return _inflate(this.bounds, delta);\n }\n }, {\n key: \"scale\",\n value: function scale(sx, sy, sz) {\n return _scale(this.bounds, sx, sy, sz);\n }\n }, {\n key: \"getCenter\",\n value: function getCenter() {\n return _getCenter(this.bounds);\n }\n }, {\n key: \"getLength\",\n value: function getLength(index) {\n return _getLength(this.bounds, index);\n }\n }, {\n key: \"getLengths\",\n value: function getLengths() {\n return _getLengths(this.bounds);\n }\n }, {\n key: \"getMaxLength\",\n value: function getMaxLength() {\n return _getMaxLength(this.bounds);\n }\n }, {\n key: \"getDiagonalLength\",\n value: function getDiagonalLength() {\n return _getDiagonalLength(this.bounds);\n }\n }, {\n key: \"getMinPoint\",\n value: function getMinPoint() {\n return _getMinPoint(this.bounds);\n }\n }, {\n key: \"getMaxPoint\",\n value: function getMaxPoint() {\n return _getMaxPoint(this.bounds);\n }\n }, {\n key: \"getXRange\",\n value: function getXRange() {\n return _getXRange(this.bounds);\n }\n }, {\n key: \"getYRange\",\n value: function getYRange() {\n return _getYRange(this.bounds);\n }\n }, {\n key: \"getZRange\",\n value: function getZRange() {\n return _getZRange(this.bounds);\n }\n }, {\n key: \"getCorners\",\n value: function getCorners(corners) {\n return _getCorners(this.bounds, corners);\n }\n }, {\n key: \"computeCornerPoints\",\n value: function computeCornerPoints(point1, point2) {\n return _computeCornerPoints(this.bounds, point1, point2);\n }\n }, {\n key: \"computeLocalBounds\",\n value: function computeLocalBounds(u, v, w) {\n return _computeLocalBounds(this.bounds, u, v, w);\n }\n }, {\n key: \"computeScale3\",\n value: function computeScale3(scale3) {\n return _computeScale(this.bounds, scale3);\n }\n }, {\n key: \"cutWithPlane\",\n value: function cutWithPlane(origin, normal) {\n return _cutWithPlane(this.bounds, origin, normal);\n }\n }, {\n key: \"intersectBox\",\n value: function intersectBox(origin, dir, coord, tolerance) {\n return _intersectBox(this.bounds, origin, dir, coord, tolerance);\n }\n }, {\n key: \"intersectPlane\",\n value: function intersectPlane(origin, normal) {\n return _intersectPlane(this.bounds, origin, normal);\n }\n }, {\n key: \"intersect\",\n value: function intersect(otherBounds) {\n return _intersect(this.bounds, otherBounds);\n }\n }, {\n key: \"intersects\",\n value: function intersects(otherBounds) {\n return _intersects(this.bounds, otherBounds);\n }\n }, {\n key: \"containsPoint\",\n value: function containsPoint(x, y, z) {\n return _containsPoint(this.bounds, x, y, z);\n }\n }, {\n key: \"contains\",\n value: function contains(otherBounds) {\n return _intersects(this.bounds, otherBounds);\n }\n }]);\n\n return BoundingBox;\n}();\n\nfunction newInstance(initialValues) {\n var bounds = initialValues && initialValues.bounds;\n return new BoundingBox(bounds);\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n equals: _equals,\n isValid: _isValid,\n setBounds: _setBounds,\n reset: _reset,\n addPoint: _addPoint,\n addBounds: _addBounds,\n setMinPoint: _setMinPoint,\n setMaxPoint: _setMaxPoint,\n inflate: _inflate,\n scale: _scale,\n getCenter: _getCenter,\n getLength: _getLength,\n getLengths: _getLengths,\n getMaxLength: _getMaxLength,\n getDiagonalLength: _getDiagonalLength,\n getMinPoint: _getMinPoint,\n getMaxPoint: _getMaxPoint,\n getXRange: _getXRange,\n getYRange: _getYRange,\n getZRange: _getZRange,\n getCorners: _getCorners,\n computeCornerPoints: _computeCornerPoints,\n computeLocalBounds: _computeLocalBounds,\n computeScale3: _computeScale,\n cutWithPlane: _cutWithPlane,\n intersectBox: _intersectBox,\n intersectPlane: _intersectPlane,\n intersect: _intersect,\n intersects: _intersects,\n containsPoint: _containsPoint,\n contains: contains,\n INIT_BOUNDS: INIT_BOUNDS\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/Cell/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/Cell/index.js ***! - \********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Points__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Points */ \"./node_modules/vtk.js/Sources/Common/Core/Points/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkCell methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCell(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCell');\n\n publicAPI.initialize = function (points) {\n var pointIdsList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (!pointIdsList) {\n model.points = points;\n model.pointsIds = new Array(points.getNumberOfPoints());\n\n for (var i = points.getNumberOfPoints() - 1; i >= 0; --i) {\n model.pointsIds[i] = i;\n }\n } else {\n model.pointsIds = pointIdsList;\n var triangleData = model.points.getData();\n\n if (triangleData.length !== 3 * model.pointsIds.length) {\n triangleData = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newTypedArray(points.getDataType(), 3 * model.pointsIds.length);\n }\n\n var pointsData = points.getData();\n model.pointsIds.forEach(function (pointId, index) {\n // const start = 3 * pointId;\n // pointsData.set(p.subarray(start, start + 3), 3 * index);\n var pointOffset = 3 * pointId;\n var trianglePointOffset = 3 * index;\n triangleData[trianglePointOffset] = pointsData[pointOffset];\n triangleData[++trianglePointOffset] = pointsData[++pointOffset];\n triangleData[++trianglePointOffset] = pointsData[++pointOffset];\n });\n model.points.setData(triangleData);\n }\n };\n\n publicAPI.getBounds = function () {\n var nbPoints = model.points.getNumberOfPoints();\n var x = [];\n\n if (nbPoints) {\n model.points.getPoint(0, x);\n model.bounds[0] = x[0];\n model.bounds[1] = x[0];\n model.bounds[2] = x[1];\n model.bounds[3] = x[1];\n model.bounds[4] = x[2];\n model.bounds[5] = x[2];\n\n for (var i = 1; i < nbPoints; i++) {\n model.points.getPoint(i, x);\n model.bounds[0] = x[0] < model.bounds[0] ? x[0] : model.bounds[0];\n model.bounds[1] = x[0] > model.bounds[1] ? x[0] : model.bounds[1];\n model.bounds[2] = x[1] < model.bounds[2] ? x[1] : model.bounds[2];\n model.bounds[3] = x[1] > model.bounds[3] ? x[1] : model.bounds[3];\n model.bounds[4] = x[2] < model.bounds[4] ? x[2] : model.bounds[4];\n model.bounds[5] = x[2] > model.bounds[5] ? x[2] : model.bounds[5];\n }\n } else {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"uninitializeBounds\"](model.bounds);\n }\n\n return model.bounds;\n };\n\n publicAPI.getLength2 = function () {\n publicAPI.getBounds();\n var length = 0.0;\n var diff = 0;\n\n for (var i = 0; i < 3; i++) {\n diff = model.bounds[2 * i + 1] - model.bounds[2 * i];\n length += diff * diff;\n }\n\n return length;\n };\n\n publicAPI.getParametricDistance = function (pcoords) {\n var pDist;\n var pDistMax = 0.0;\n\n for (var i = 0; i < 3; i++) {\n if (pcoords[i] < 0.0) {\n pDist = -pcoords[i];\n } else if (pcoords[i] > 1.0) {\n pDist = pcoords[i] - 1.0;\n } else {\n // inside the cell in the parametric direction\n pDist = 0.0;\n }\n\n if (pDist > pDistMax) {\n pDistMax = pDist;\n }\n }\n\n return pDistMax;\n };\n\n publicAPI.getNumberOfPoints = function () {\n return model.points.getNumberOfPoints();\n };\n\n publicAPI.deepCopy = function (cell) {\n cell.initialize(model.points, model.pointsIds);\n };\n\n publicAPI.getCellDimension = function () {}; // virtual\n\n\n publicAPI.intersectWithLine = function (p1, p2, tol, t, x, pcoords, subId) {}; // virtual\n\n\n publicAPI.evaluatePosition = function (x, closestPoint, subId, pcoords, dist2, weights) {}; // virtual\n\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bounds: [-1, -1, -1, -1, -1, -1],\n pointsIds: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n\n if (!model.points) {\n model.points = vtk_js_Sources_Common_Core_Points__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['points', 'pointsIds']);\n vtkCell(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkCell'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/Cell/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/CellLinks/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/CellLinks/index.js ***! - \*************************************************************************/ -/*! exports provided: InitLink, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InitLink\", function() { return InitLink; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Cell */ \"./node_modules/vtk.js/Sources/Common/DataModel/Cell/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nvar InitLink = {\n ncells: 0,\n cells: null\n};\n\nfunction resize(model, sz) {\n var newSize = sz;\n\n if (sz >= model.array.length) {\n newSize += model.array.length;\n }\n\n while (newSize > model.array.length) {\n model.array.push({\n ncells: 0,\n cells: null\n });\n }\n\n model.array.length = newSize;\n} // ----------------------------------------------------------------------------\n// vtkCellLinks methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkCellLinks(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCellLinks');\n /**\n * Build the link list array. All subclasses of vtkAbstractCellLinks\n * must support this method.\n */\n\n publicAPI.buildLinks = function (data) {\n var numPts = data.getPoints().getNumberOfPoints();\n var numCells = data.getNumberOfCells(); // fill out lists with number of references to cells\n\n var linkLoc = new Uint32Array(numPts); // Use fast path if polydata\n\n if (data.isA('vtkPolyData')) {\n // traverse data to determine number of uses of each point\n for (var cellId = 0; cellId < numCells; ++cellId) {\n var _data$getCellPoints = data.getCellPoints(cellId),\n cellPointIds = _data$getCellPoints.cellPointIds;\n\n cellPointIds.forEach(function (cellPointId) {\n publicAPI.incrementLinkCount(cellPointId);\n });\n } // now allocate storage for the links\n\n\n publicAPI.allocateLinks(numPts);\n model.maxId = numPts - 1;\n\n var _loop = function _loop(_cellId) {\n var _data$getCellPoints2 = data.getCellPoints(_cellId),\n cellPointIds = _data$getCellPoints2.cellPointIds;\n\n cellPointIds.forEach(function (cellPointId) {\n publicAPI.insertCellReference(cellPointId, linkLoc[cellPointId]++, _cellId);\n });\n };\n\n for (var _cellId = 0; _cellId < numCells; ++_cellId) {\n _loop(_cellId);\n }\n } // any other type of dataset\n else {\n // traverse data to determine number of uses of each point\n for (var _cellId2 = 0; _cellId2 < numCells; _cellId2++) {\n // TODO: Currently not supported: const cell = data.getCell(cellId);\n var cell = vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n cell.getPointsIds().forEach(function (cellPointId) {\n publicAPI.incrementLinkCount(cellPointId);\n });\n } // now allocate storage for the links\n\n\n publicAPI.allocateLinks(numPts);\n model.maxId = numPts - 1;\n\n var _loop2 = function _loop2(_cellId3) {\n // TODO: Currently not supported: const cell = data.getCell(cellId);\n var cell = vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n cell.getPointsIds().forEach(function (cellPointId) {\n publicAPI.insertCellReference(cellPointId, linkLoc[cellPointId]++, _cellId3);\n });\n };\n\n for (var _cellId3 = 0; _cellId3 < numCells; ++_cellId3) {\n _loop2(_cellId3);\n }\n } // end else\n\n };\n /**\n * Build the link list array with a provided connectivity array.\n */\n // publicAPI.buildLinks = (data, connectivity) => {};\n\n /**\n * Allocate the specified number of links (i.e., number of points) that\n * will be built.\n */\n\n\n publicAPI.allocate = function (numLinks) {\n var ext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n model.array = Array(numLinks).fill().map(function () {\n return {\n ncells: 0,\n cells: null\n };\n });\n model.extend = ext;\n model.maxId = -1;\n };\n\n publicAPI.initialize = function () {\n model.array = null;\n };\n /**\n * Get a link structure given a point id.\n */\n\n\n publicAPI.getLink = function (ptId) {\n return model.array[ptId];\n };\n /**\n * Get the number of cells using the point specified by ptId.\n */\n\n\n publicAPI.getNcells = function (ptId) {\n return model.array[ptId].ncells;\n };\n /**\n * Return a list of cell ids using the point.\n */\n\n\n publicAPI.getCells = function (ptId) {\n return model.array[ptId].cells;\n };\n /**\n * Insert a new point into the cell-links data structure. The size parameter\n * is the initial size of the list.\n */\n\n\n publicAPI.insertNextPoint = function (numLinks) {\n model.array.push({\n ncells: numLinks,\n cells: Array(numLinks)\n });\n ++model.maxId;\n };\n /**\n * Insert a cell id into the list of cells (at the end) using the cell id\n * provided. (Make sure to extend the link list (if necessary) using the\n * method resizeCellList().)\n */\n\n\n publicAPI.insertNextCellReference = function (ptId, cellId) {\n model.array[ptId].cells[model.array[ptId].ncells++] = cellId;\n };\n /**\n * Delete point (and storage) by destroying links to using cells.\n */\n\n\n publicAPI.deletePoint = function (ptId) {\n model.array[ptId].ncells = 0;\n model.array[ptId].cells = null;\n };\n /**\n * Delete the reference to the cell (cellId) from the point (ptId). This\n * removes the reference to the cellId from the cell list, but does not\n * resize the list (recover memory with resizeCellList(), if necessary).\n */\n\n\n publicAPI.removeCellReference = function (cellId, ptId) {\n model.array[ptId].cells = model.array[ptId].cells.filter(function (cell) {\n return cell !== cellId;\n });\n model.array[ptId].ncells = model.array[ptId].cells.length;\n };\n /**\n * Add the reference to the cell (cellId) from the point (ptId). This\n * adds a reference to the cellId from the cell list, but does not resize\n * the list (extend memory with resizeCellList(), if necessary).\n */\n\n\n publicAPI.addCellReference = function (cellId, ptId) {\n model.array[ptId].cells[model.array[ptId].ncells++] = cellId;\n };\n /**\n * Change the length of a point's link list (i.e., list of cells using a\n * point) by the size specified.\n */\n\n\n publicAPI.resizeCellList = function (ptId, size) {\n model.array[ptId].cells.length = size;\n };\n /**\n * Reclaim any unused memory.\n */\n\n\n publicAPI.squeeze = function () {\n resize(model, model.maxId + 1);\n };\n /**\n * Reset to a state of no entries without freeing the memory.\n */\n\n\n publicAPI.reset = function () {\n model.maxId = -1;\n };\n /**\n * Standard DeepCopy method. Since this object contains no reference\n * to other objects, there is no ShallowCopy.\n */\n\n\n publicAPI.deepCopy = function (src) {\n model.array = _toConsumableArray(src.array);\n model.extend = src.extend;\n model.maxId = src.maxId;\n };\n /**\n * Increment the count of the number of cells using the point.\n */\n\n\n publicAPI.incrementLinkCount = function (ptId) {\n ++model.array[ptId].ncells;\n };\n\n publicAPI.allocateLinks = function (n) {\n for (var i = 0; i < n; ++i) {\n model.array[i].cells = new Array(model.array[i].ncells);\n }\n };\n /**\n * Insert a cell id into the list of cells using the point.\n */\n\n\n publicAPI.insertCellReference = function (ptId, pos, cellId) {\n model.array[ptId].cells[pos] = cellId;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n array: null,\n // pointer to data\n maxId: 0,\n // maximum index inserted thus far\n extend: 0 // grow array by this point\n\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtkCellLinks(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkCellLinks'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/CellLinks/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/Constants.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/Constants.js ***! - \*****************************************************************************/ -/*! exports provided: CellType, CellTypesStrings, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CellType\", function() { return CellType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CellTypesStrings\", function() { return CellTypesStrings; });\nvar CellType = {\n // Linear cells\n VTK_EMPTY_CELL: 0,\n VTK_VERTEX: 1,\n VTK_POLY_VERTEX: 2,\n VTK_LINE: 3,\n VTK_POLY_LINE: 4,\n VTK_TRIANGLE: 5,\n VTK_TRIANGLE_STRIP: 6,\n VTK_POLYGON: 7,\n VTK_PIXEL: 8,\n VTK_QUAD: 9,\n VTK_TETRA: 10,\n VTK_VOXEL: 11,\n VTK_HEXAHEDRON: 12,\n VTK_WEDGE: 13,\n VTK_PYRAMID: 14,\n VTK_PENTAGONAL_PRISM: 15,\n VTK_HEXAGONAL_PRISM: 16,\n // Quadratic, isoparametric cells\n VTK_QUADRATIC_EDGE: 21,\n VTK_QUADRATIC_TRIANGLE: 22,\n VTK_QUADRATIC_QUAD: 23,\n VTK_QUADRATIC_POLYGON: 36,\n VTK_QUADRATIC_TETRA: 24,\n VTK_QUADRATIC_HEXAHEDRON: 25,\n VTK_QUADRATIC_WEDGE: 26,\n VTK_QUADRATIC_PYRAMID: 27,\n VTK_BIQUADRATIC_QUAD: 28,\n VTK_TRIQUADRATIC_HEXAHEDRON: 29,\n VTK_QUADRATIC_LINEAR_QUAD: 30,\n VTK_QUADRATIC_LINEAR_WEDGE: 31,\n VTK_BIQUADRATIC_QUADRATIC_WEDGE: 32,\n VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON: 33,\n VTK_BIQUADRATIC_TRIANGLE: 34,\n // Cubic, isoparametric cell\n VTK_CUBIC_LINE: 35,\n // Special class of cells formed by convex group of points\n VTK_CONVEX_POINT_SET: 41,\n // Polyhedron cell (consisting of polygonal faces)\n VTK_POLYHEDRON: 42,\n // Higher order cells in parametric form\n VTK_PARAMETRIC_CURVE: 51,\n VTK_PARAMETRIC_SURFACE: 52,\n VTK_PARAMETRIC_TRI_SURFACE: 53,\n VTK_PARAMETRIC_QUAD_SURFACE: 54,\n VTK_PARAMETRIC_TETRA_REGION: 55,\n VTK_PARAMETRIC_HEX_REGION: 56,\n // Higher order cells\n VTK_HIGHER_ORDER_EDGE: 60,\n VTK_HIGHER_ORDER_TRIANGLE: 61,\n VTK_HIGHER_ORDER_QUAD: 62,\n VTK_HIGHER_ORDER_POLYGON: 63,\n VTK_HIGHER_ORDER_TETRAHEDRON: 64,\n VTK_HIGHER_ORDER_WEDGE: 65,\n VTK_HIGHER_ORDER_PYRAMID: 66,\n VTK_HIGHER_ORDER_HEXAHEDRON: 67,\n // Arbitrary order Lagrange elements (formulated separated from generic higher order cells)\n VTK_LAGRANGE_CURVE: 68,\n VTK_LAGRANGE_TRIANGLE: 69,\n VTK_LAGRANGE_QUADRILATERAL: 70,\n VTK_LAGRANGE_TETRAHEDRON: 71,\n VTK_LAGRANGE_HEXAHEDRON: 72,\n VTK_LAGRANGE_WEDGE: 73,\n VTK_LAGRANGE_PYRAMID: 74,\n VTK_NUMBER_OF_CELL_TYPES: 75\n}; // This list should contain the cell class names in\n// the same order as in CellType.\n\nvar CellTypesStrings = ['vtkEmptyCell', 'vtkVertex', 'vtkPolyVertex', 'vtkLine', 'vtkPolyLine', 'vtkTriangle', 'vtkTriangleStrip', 'vtkPolygon', 'vtkPixel', 'vtkQuad', 'vtkTetra', 'vtkVoxel', 'vtkHexahedron', 'vtkWedge', 'vtkPyramid', 'vtkPentagonalPrism', 'vtkHexagonalPrism', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'vtkQuadraticEdge', 'vtkQuadraticTriangle', 'vtkQuadraticQuad', 'vtkQuadraticTetra', 'vtkQuadraticHexahedron', 'vtkQuadraticWedge', 'vtkQuadraticPyramid', 'vtkBiQuadraticQuad', 'vtkTriQuadraticHexahedron', 'vtkQuadraticLinearQuad', 'vtkQuadraticLinearWedge', 'vtkBiQuadraticQuadraticWedge', 'vtkBiQuadraticQuadraticHexahedron', 'vtkBiQuadraticTriangle', 'vtkCubicLine', 'vtkQuadraticPolygon', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'vtkConvexPointSet', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'vtkParametricCurve', 'vtkParametricSurface', 'vtkParametricTriSurface', 'vtkParametricQuadSurface', 'vtkParametricTetraRegion', 'vtkParametricHexRegion', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'vtkHigherOrderEdge', 'vtkHigherOrderTriangle', 'vtkHigherOrderQuad', 'vtkHigherOrderPolygon', 'vtkHigherOrderTetrahedron', 'vtkHigherOrderWedge', 'vtkHigherOrderPyramid', 'vtkHigherOrderHexahedron'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n CellType: CellType,\n CellTypesStrings: CellTypesStrings\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/index.js ***! - \*************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/CellTypes/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\n/**\n * Given an int (as defined in vtkCellType.h) identifier for a class\n * return it's classname.\n */\n\nfunction getClassNameFromTypeId(typeId) {\n return typeId < vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellTypesStrings\"].length ? vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellTypesStrings\"][typeId] : 'UnknownClass';\n}\n/**\n * Given a data object classname, return it's int identified (as\n * defined in vtkCellType.h)\n */\n\n\nfunction getTypeIdFromClassName(cellTypeString) {\n return vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellTypesStrings\"].findIndex(cellTypeString);\n}\n/**\n * This convenience method is a fast check to determine if a cell type\n * represents a linear or nonlinear cell. This is generally much more\n * efficient than getting the appropriate vtkCell and checking its IsLinear\n * method.\n */\n\n\nfunction isLinear(type) {\n return type < vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellType\"].VTK_QUADRATIC_EDGE || type === vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellType\"].VTK_CONVEX_POINT_SET || type === vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellType\"].VTK_POLYHEDRON;\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n getClassNameFromTypeId: getClassNameFromTypeId,\n getTypeIdFromClassName: getTypeIdFromClassName,\n isLinear: isLinear\n}; // ----------------------------------------------------------------------------\n// vtkCellTypes methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCellTypes(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCellTypes');\n /**\n * Allocate memory for this array. Delete old storage only if necessary.\n */\n\n publicAPI.allocate = function () {\n var sz = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 512;\n var ext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n model.size = sz > 0 ? sz : 1;\n model.extend = ext > 0 ? ext : 1;\n model.maxId = -1;\n model.typeArray = new Uint8Array(sz);\n model.locationArray = new Uint32Array(sz);\n };\n /**\n * Add a cell at specified id.\n */\n\n\n publicAPI.insertCell = function (cellId, type, loc) {\n model.typeArray[cellId] = type;\n model.locationArray[cellId] = loc;\n\n if (cellId > model.maxId) {\n model.maxId = cellId;\n }\n };\n /**\n * Add a cell to the object in the next available slot.\n */\n\n\n publicAPI.insertNextCell = function (type, loc) {\n publicAPI.insertCell(++model.maxId, type, loc);\n return model.maxId;\n };\n /**\n * Specify a group of cell types. This version is provided to maintain\n * backwards compatibility and does a copy of the cellLocations\n */\n\n\n publicAPI.setCellTypes = function (ncells, cellTypes, cellLocations) {\n model.size = ncells;\n model.typeArray = cellTypes;\n model.locationArray = cellLocations;\n model.maxId = ncells - 1;\n };\n /**\n * Return the location of the cell in the associated vtkCellArray.\n */\n\n\n publicAPI.getCellLocation = function (cellId) {\n return model.locationArray[cellId];\n };\n /**\n * Delete cell by setting to nullptr cell type.\n */\n\n\n publicAPI.deleteCell = function (cellId) {\n model.typeArray[cellId] = vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellType\"].VTK_EMPTY_CELL;\n };\n /**\n * Return the number of types in the list.\n */\n\n\n publicAPI.getNumberOfTypes = function () {\n return model.maxId + 1;\n };\n /**\n * Return true if type specified is contained in list; false otherwise.\n */\n\n\n publicAPI.isType = function (type) {\n var numTypes = publicAPI.getNumberOfTypes();\n\n for (var i = 0; i < numTypes; ++i) {\n if (type === publicAPI.getCellType(i)) {\n return true;\n }\n }\n\n return false;\n };\n /**\n * Add the type specified to the end of the list. Range checking is performed.\n */\n\n\n publicAPI.insertNextType = function (type) {\n return publicAPI.insertNextCell(type, -1);\n };\n /**\n * Return the type of cell.\n */\n\n\n publicAPI.getCellType = function (cellId) {\n return model.typeArray[cellId];\n };\n /**\n * Reclaim any extra memory.\n */\n // TODO: publicAPI.squeeze = () => {};\n\n /**\n * Initialize object without releasing memory.\n */\n\n\n publicAPI.reset = function () {\n model.maxId = -1;\n };\n /**\n * Standard DeepCopy method. Since this object contains no reference\n * to other objects, there is no ShallowCopy.\n */\n\n\n publicAPI.deepCopy = function (src) {\n publicAPI.allocate(src.getSize(), src.getExtend());\n model.typeArray.set(src.getTypeArray());\n model.locationArray.set(src.getLocationArray());\n model.maxId = src.getMaxId();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n // typeArray: null, // pointer to types array\n // locationArray: null; // pointer to array of offsets\n size: 0,\n // allocated size of data\n maxId: -1,\n // maximum index inserted thus far\n extend: 1000 // grow array by this point\n\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['size', 'maxId', 'extend']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['typeArray', 'locationArray']);\n vtkCellTypes(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkCellTypes'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/DataSet/Constants.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/DataSet/Constants.js ***! - \***************************************************************************/ -/*! exports provided: FieldDataTypes, FieldAssociations, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FieldDataTypes\", function() { return FieldDataTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FieldAssociations\", function() { return FieldAssociations; });\n// Specify how data arrays can be used by data objects\nvar FieldDataTypes = {\n UNIFORM: 0,\n // data that does not vary over points/cells/etc.\n DATA_OBJECT_FIELD: 0,\n // to match VTK\n COORDINATE: 1,\n // data that specifies the location of each point\n POINT_DATA: 1,\n // to match VTK\n POINT: 2,\n // data defined at each point, but that does not specify the point location\n POINT_FIELD_DATA: 2,\n // to match VTK\n CELL: 3,\n // data defined at each cell, but that does not specify the cell\n CELL_FIELD_DATA: 3,\n // to match VTK\n VERTEX: 4,\n // data defined at each graph vertex, but that does not specify the graph vertex\n VERTEX_FIELD_DATA: 4,\n // to match VTK\n EDGE: 5,\n // data defined at each graph edge, but that does not specify the graph edge\n EDGE_FIELD_DATA: 5,\n // to match VTK\n ROW: 6,\n // data specifying a table row\n ROW_DATA: 6 // to match VTK\n\n};\nvar FieldAssociations = {\n FIELD_ASSOCIATION_POINTS: 0,\n FIELD_ASSOCIATION_CELLS: 1,\n FIELD_ASSOCIATION_NONE: 2,\n FIELD_ASSOCIATION_POINTS_THEN_CELLS: 3,\n FIELD_ASSOCIATION_VERTICES: 4,\n FIELD_ASSOCIATION_EDGES: 5,\n FIELD_ASSOCIATION_ROWS: 6,\n NUMBER_OF_ASSOCIATIONS: 7\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n FieldDataTypes: FieldDataTypes,\n FieldAssociations: FieldAssociations\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/DataSet/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js ***! - \***********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/vtk */ \"./node_modules/vtk.js/Sources/vtk.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSetAttributes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSetAttributes */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSet_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSet/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSet/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n // import vtkBoundingBox from '../BoundingBox';\n// import * as vtkMath from '../../Core/Math';\n//\n// function getBounds(dataset) {\n// if (dataset.bounds) {\n// return dataset.bounds;\n// }\n// if (dataset.type && dataset[dataset.type]) {\n// const ds = dataset[dataset.type];\n// if (ds.bounds) {\n// return ds.bounds;\n// }\n// if (ds.Points && ds.Points.bounds) {\n// return ds.Points.bounds;\n// }\n// if (ds.Points && ds.Points.values) {\n// const array = ds.Points.values;\n// const bbox = [...vtkBoundingBox.INIT_BOUNDS];\n// const size = array.length;\n// const delta = ds.Points.numberOfComponents ? ds.Points.numberOfComponents : 3;\n// for (let idx = 0; idx < size; idx += delta) {\n// vtkBoundingBox.addPoint(bbox, array[idx * delta], array[(idx * delta) + 1], array[(idx * delta) + 2]);\n// }\n// ds.Points.bounds = bbox;\n// return ds.Points.bounds;\n// }\n// }\n// return vtkMath.createUninitializedBounds();\n// }\n// ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nvar DATASET_FIELDS = ['pointData', 'cellData', 'fieldData']; // ----------------------------------------------------------------------------\n// vtkDataSet methods\n// ----------------------------------------------------------------------------\n\nfunction vtkDataSet(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkDataSet'); // Add dataset attributes\n\n DATASET_FIELDS.forEach(function (fieldName) {\n if (!model[fieldName]) {\n model[fieldName] = vtk_js_Sources_Common_DataModel_DataSetAttributes__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n } else {\n model[fieldName] = Object(vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(model[fieldName]);\n }\n });\n var superShallowCopy = publicAPI.shallowCopy;\n\n publicAPI.shallowCopy = function (other) {\n var debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n superShallowCopy(other, debug);\n DATASET_FIELDS.forEach(function (fieldName) {\n model[fieldName] = vtk_js_Sources_Common_DataModel_DataSetAttributes__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model[fieldName].shallowCopy(other.getReferenceByName(fieldName));\n });\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {// pointData: null,\n // cellData: null,\n // fieldData: null,\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, DATASET_FIELDS); // Object specific methods\n\n vtkDataSet(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkDataSet'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Common_DataModel_DataSet_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/Constants.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/Constants.js ***! - \*************************************************************************************/ -/*! exports provided: AttributeTypes, AttributeLimitTypes, CellGhostTypes, PointGhostTypes, AttributeCopyOperations, ghostArrayName, DesiredOutputPrecision, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AttributeTypes\", function() { return AttributeTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AttributeLimitTypes\", function() { return AttributeLimitTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CellGhostTypes\", function() { return CellGhostTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PointGhostTypes\", function() { return PointGhostTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AttributeCopyOperations\", function() { return AttributeCopyOperations; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ghostArrayName\", function() { return ghostArrayName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DesiredOutputPrecision\", function() { return DesiredOutputPrecision; });\nvar AttributeTypes = {\n SCALARS: 0,\n VECTORS: 1,\n NORMALS: 2,\n TCOORDS: 3,\n TENSORS: 4,\n GLOBALIDS: 5,\n PEDIGREEIDS: 6,\n EDGEFLAG: 7,\n NUM_ATTRIBUTES: 8\n};\nvar AttributeLimitTypes = {\n MAX: 0,\n EXACT: 1,\n NOLIMIT: 2\n};\nvar CellGhostTypes = {\n DUPLICATECELL: 1,\n // the cell is present on multiple processors\n HIGHCONNECTIVITYCELL: 2,\n // the cell has more neighbors than in a regular mesh\n LOWCONNECTIVITYCELL: 4,\n // the cell has less neighbors than in a regular mesh\n REFINEDCELL: 8,\n // other cells are present that refines it.\n EXTERIORCELL: 16,\n // the cell is on the exterior of the data set\n HIDDENCELL: 32 // the cell is needed to maintain connectivity, but the data values should be ignored.\n\n};\nvar PointGhostTypes = {\n DUPLICATEPOINT: 1,\n // the cell is present on multiple processors\n HIDDENPOINT: 2 // the point is needed to maintain connectivity, but the data values should be ignored.\n\n};\nvar AttributeCopyOperations = {\n COPYTUPLE: 0,\n INTERPOLATE: 1,\n PASSDATA: 2,\n ALLCOPY: 3 // all of the above\n\n};\nvar ghostArrayName = 'vtkGhostType';\nvar DesiredOutputPrecision = {\n DEFAULT: 0,\n // use the point type that does not truncate any data\n SINGLE: 1,\n // use Float32Array\n DOUBLE: 2 // use Float64Array\n\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n AttributeCopyOperations: AttributeCopyOperations,\n AttributeLimitTypes: AttributeLimitTypes,\n AttributeTypes: AttributeTypes,\n CellGhostTypes: CellGhostTypes,\n DesiredOutputPrecision: DesiredOutputPrecision,\n PointGhostTypes: PointGhostTypes,\n ghostArrayName: ghostArrayName\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/FieldData.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/FieldData.js ***! - \*************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/vtk */ \"./node_modules/vtk.js/Sources/vtk.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkFieldData methods\n// ----------------------------------------------------------------------------\n\nfunction vtkFieldData(publicAPI, model) {\n model.classHierarchy.push('vtkFieldData');\n var superGetState = publicAPI.getState; // Decode serialized data if any\n\n if (model.arrays) {\n model.arrays = model.arrays.map(function (item) {\n return {\n data: Object(vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(item.data)\n };\n });\n }\n\n publicAPI.initialize = function () {\n publicAPI.initializeFields();\n publicAPI.copyAllOn();\n publicAPI.clearFieldFlags();\n };\n\n publicAPI.initializeFields = function () {\n model.arrays = [];\n model.copyFieldFlags = {};\n publicAPI.modified();\n };\n\n publicAPI.copyStructure = function (other) {\n publicAPI.initializeFields();\n model.copyFieldFlags = other.getCopyFieldFlags().map(function (x) {\n return x;\n }); // Deep-copy\n\n model.arrays = other.arrays().map(function (x) {\n return {\n array: x\n };\n }); // Deep-copy\n // TODO: Copy array information objects (once we support information objects)\n };\n\n publicAPI.getNumberOfArrays = function () {\n return model.arrays.length;\n };\n\n publicAPI.getNumberOfActiveArrays = function () {\n return model.arrays.length;\n };\n\n publicAPI.addArray = function (arr) {\n model.arrays = [].concat(model.arrays, {\n data: arr\n });\n return model.arrays.length - 1;\n };\n\n publicAPI.removeAllArrays = function () {\n model.arrays = [];\n };\n\n publicAPI.removeArray = function (arrayName) {\n model.arrays = model.arrays.filter(function (entry) {\n return arrayName !== entry.data.getName();\n });\n };\n\n publicAPI.removeArrayByIndex = function (arrayIdx) {\n model.arrays = model.arrays.filter(function (entry, idx) {\n return idx !== arrayIdx;\n });\n };\n\n publicAPI.getArrays = function () {\n return model.arrays.map(function (entry) {\n return entry.data;\n });\n };\n\n publicAPI.getArray = function (arraySpec) {\n return typeof arraySpec === 'number' ? publicAPI.getArrayByIndex(arraySpec) : publicAPI.getArrayByName(arraySpec);\n };\n\n publicAPI.getArrayByName = function (arrayName) {\n return model.arrays.reduce(function (a, b, i) {\n return b.data.getName() === arrayName ? b.data : a;\n }, null);\n };\n\n publicAPI.getArrayWithIndex = function (arrayName) {\n return model.arrays.reduce(function (a, b, i) {\n return b.data && b.data.getName() === arrayName ? {\n array: b.data,\n index: i\n } : a;\n }, {\n array: null,\n index: -1\n });\n };\n\n publicAPI.getArrayByIndex = function (idx) {\n return idx >= 0 && idx < model.arrays.length ? model.arrays[idx].data : null;\n };\n\n publicAPI.hasArray = function (arrayName) {\n return publicAPI.getArrayWithIndex(arrayName).index >= 0;\n };\n\n publicAPI.getArrayName = function (idx) {\n var arr = model.arrays[idx];\n return arr ? arr.data.getName() : '';\n };\n\n publicAPI.getCopyFieldFlags = function () {\n return model.copyFieldFlags;\n };\n\n publicAPI.getFlag = function (arrayName) {\n return model.copyFieldFlags[arrayName];\n };\n\n publicAPI.passData = function (other) {\n var fromId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;\n var toId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;\n other.getArrays().forEach(function (arr) {\n var copyFlag = publicAPI.getFlag(arr.getName());\n\n if (copyFlag !== false && !(model.doCopyAllOff && copyFlag !== true) && arr) {\n var destArr = publicAPI.getArrayByName(arr.getName());\n\n if (!destArr) {\n if (fromId < 0 || fromId > arr.getNumberOfTuples()) {\n publicAPI.addArray(arr);\n } else {\n var ncomps = arr.getNumberOfComponents();\n var newSize = arr.getNumberOfValues();\n var tId = toId > -1 ? toId : fromId;\n\n if (newSize < tId * ncomps) {\n newSize = (tId + 1) * ncomps;\n }\n\n destArr = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n name: arr.getName(),\n dataType: arr.getDataType(),\n numberOfComponents: arr.getNumberOfComponents(),\n size: newSize\n });\n destArr.setTuple(tId, arr.getTuple(fromId));\n publicAPI.addArray(destArr);\n }\n } else if (arr.getNumberOfComponents() === destArr.getNumberOfComponents()) {\n if (fromId > -1 && fromId < arr.getNumberOfTuples()) {\n var _tId = toId > -1 ? toId : fromId;\n\n destArr.setTuple(_tId, arr.getTuple(fromId));\n } else {\n // if fromId and not provided, just copy all (or as much possible)\n // of arr to destArr.\n for (var i = 0; i < arr.getNumberOfTuples(); ++i) {\n destArr.setTuple(i, arr.getTuple(i));\n }\n }\n }\n }\n });\n };\n\n publicAPI.copyFieldOn = function (arrayName) {\n model.copyFieldFlags[arrayName] = true;\n };\n\n publicAPI.copyFieldOff = function (arrayName) {\n model.copyFieldFlags[arrayName] = false;\n };\n\n publicAPI.copyAllOn = function () {\n if (!model.doCopyAllOn || model.doCopyAllOff) {\n model.doCopyAllOn = true;\n model.doCopyAllOff = false;\n publicAPI.modified();\n }\n };\n\n publicAPI.copyAllOff = function () {\n if (model.doCopyAllOn || !model.doCopyAllOff) {\n model.doCopyAllOn = false;\n model.doCopyAllOff = true;\n publicAPI.modified();\n }\n };\n\n publicAPI.clearFieldFlags = function () {\n model.copyFieldFlags = {};\n };\n\n publicAPI.deepCopy = function (other) {\n model.arrays = other.getArrays().map(function (arr) {\n var arrNew = arr.newClone();\n arrNew.deepCopy(arr);\n return {\n data: arrNew\n };\n });\n };\n\n publicAPI.copyFlags = function (other) {\n return other.getCopyFieldFlags().map(function (x) {\n return x;\n });\n }; // TODO: publicAPI.squeeze = () => model.arrays.forEach(entry => entry.data.squeeze());\n\n\n publicAPI.reset = function () {\n return model.arrays.forEach(function (entry) {\n return entry.data.reset();\n });\n }; // TODO: getActualMemorySize\n\n\n publicAPI.getMTime = function () {\n return model.arrays.reduce(function (a, b) {\n return b.data.getMTime() > a ? b.data.getMTime() : a;\n }, model.mtime);\n }; // TODO: publicAPI.getField = (ids, other) => { copy ids from other into this model's arrays }\n // TODO: publicAPI.getArrayContainingComponent = (component) => ...\n\n\n publicAPI.getNumberOfComponents = function () {\n return model.arrays.reduce(function (a, b) {\n return a + b.data.getNumberOfComponents();\n }, 0);\n };\n\n publicAPI.getNumberOfTuples = function () {\n return model.arrays.length > 0 ? model.arrays[0].getNumberOfTuples() : 0;\n };\n\n publicAPI.getState = function () {\n var result = superGetState();\n result.arrays = model.arrays.map(function (item) {\n return {\n data: item.data.getState()\n };\n });\n return result;\n };\n}\n\nvar DEFAULT_VALUES = {\n arrays: [],\n copyFieldFlags: [],\n // fields not to copy\n doCopyAllOn: true,\n doCopyAllOff: false\n};\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(publicAPI, model);\n vtkFieldData(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkFieldData'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/FieldData.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/index.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/index.js ***! - \*********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSetAttributes_FieldData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSetAttributes/FieldData */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/FieldData.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSetAttributes_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSetAttributes/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\nvar AttributeTypes = vtk_js_Sources_Common_DataModel_DataSetAttributes_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].AttributeTypes,\n AttributeCopyOperations = vtk_js_Sources_Common_DataModel_DataSetAttributes_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].AttributeCopyOperations;\nvar vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkWarningMacro; // ----------------------------------------------------------------------------\n// vtkDataSetAttributes methods\n// ----------------------------------------------------------------------------\n\nfunction vtkDataSetAttributes(publicAPI, model) {\n var attrTypes = ['Scalars', 'Vectors', 'Normals', 'TCoords', 'Tensors', 'GlobalIds', 'PedigreeIds'];\n\n function cleanAttributeType(attType) {\n // Given an integer or string, convert the result to one of the\n // strings in the \"attrTypes\" array above or null (if\n // no match is found)\n var cleanAttType = attrTypes.find(function (ee) {\n return AttributeTypes[ee.toUpperCase()] === attType || typeof attType !== 'number' && ee.toLowerCase() === attType.toLowerCase();\n });\n\n if (typeof cleanAttType === 'undefined') {\n cleanAttType = null;\n }\n\n return cleanAttType;\n } // Set our className\n\n\n model.classHierarchy.push('vtkDataSetAttributes');\n\n publicAPI.checkNumberOfComponents = function (x) {\n return true;\n }; // TODO\n\n\n publicAPI.setAttribute = function (arr, uncleanAttType) {\n var attType = cleanAttributeType(uncleanAttType);\n\n if (arr && attType.toUpperCase() === 'PEDIGREEIDS' && !arr.isA('vtkDataArray')) {\n vtkWarningMacro(\"Cannot set attribute \".concat(attType, \". The attribute must be a vtkDataArray.\"));\n return -1;\n }\n\n if (arr && !publicAPI.checkNumberOfComponents(arr, attType)) {\n vtkWarningMacro(\"Cannot set attribute \".concat(attType, \". Incorrect number of components.\"));\n return -1;\n }\n\n var currentAttribute = model[\"active\".concat(attType)];\n\n if (currentAttribute >= 0 && currentAttribute < model.arrays.length) {\n if (model.arrays[currentAttribute] === arr) {\n return currentAttribute;\n }\n\n publicAPI.removeArrayByIndex(currentAttribute);\n }\n\n if (arr) {\n currentAttribute = publicAPI.addArray(arr);\n model[\"active\".concat(attType)] = currentAttribute;\n } else {\n model[\"active\".concat(attType)] = -1;\n }\n\n publicAPI.modified();\n return model[\"active\".concat(attType)];\n };\n\n publicAPI.setActiveAttributeByName = function (arrayName, attType) {\n return publicAPI.setActiveAttributeByIndex(publicAPI.getArrayWithIndex(arrayName).index, attType);\n };\n\n publicAPI.setActiveAttributeByIndex = function (arrayIdx, uncleanAttType) {\n var attType = cleanAttributeType(uncleanAttType);\n\n if (arrayIdx >= 0 && arrayIdx < model.arrays.length) {\n if (attType.toUpperCase() !== 'PEDIGREEIDS') {\n var arr = publicAPI.getArrayByIndex(arrayIdx);\n\n if (!arr.isA('vtkDataArray')) {\n vtkWarningMacro(\"Cannot set attribute \".concat(attType, \". Only vtkDataArray subclasses can be set as active attributes.\"));\n return -1;\n }\n\n if (!publicAPI.checkNumberOfComponents(arr, attType)) {\n vtkWarningMacro(\"Cannot set attribute \".concat(attType, \". Incorrect number of components.\"));\n return -1;\n }\n }\n\n model[\"active\".concat(attType)] = arrayIdx;\n publicAPI.modified();\n return arrayIdx;\n }\n\n if (arrayIdx === -1) {\n model[\"active\".concat(attType)] = arrayIdx;\n publicAPI.modified();\n }\n\n return -1;\n };\n\n publicAPI.getActiveAttribute = function (attType) {\n // Given an integer enum value or a string (with random capitalization),\n // find the matching string in attrTypes.\n var cleanAttType = cleanAttributeType(attType);\n return publicAPI[\"get\".concat(cleanAttType)]();\n }; // Override to allow proper handling of active attributes\n\n\n publicAPI.removeAllArrays = function () {\n model.arrays = [];\n attrTypes.forEach(function (attType) {\n model[\"active\".concat(attType)] = -1;\n });\n }; // Override to allow proper handling of active attributes\n\n\n publicAPI.removeArray = function (arrayName) {\n model.arrays = model.arrays.filter(function (entry, idx) {\n if (arrayName === entry.data.getName()) {\n // Found the array to remove, but is it an active attribute?\n attrTypes.forEach(function (attType) {\n if (idx === model[\"active\".concat(attType)]) {\n model[\"active\".concat(attType)] = -1;\n }\n });\n return false;\n }\n\n return true;\n });\n }; // Override to allow proper handling of active attributes\n\n\n publicAPI.removeArrayByIndex = function (arrayIdx) {\n model.arrays = model.arrays.filter(function (entry, idx) {\n return idx !== arrayIdx;\n });\n attrTypes.forEach(function (attType) {\n if (arrayIdx === model[\"active\".concat(attType)]) {\n model[\"active\".concat(attType)] = -1;\n }\n });\n };\n\n attrTypes.forEach(function (value) {\n var activeVal = \"active\".concat(value);\n\n publicAPI[\"get\".concat(value)] = function () {\n return publicAPI.getArrayByIndex(model[activeVal]);\n };\n\n publicAPI[\"set\".concat(value)] = function (da) {\n return publicAPI.setAttribute(da, value);\n };\n\n publicAPI[\"setActive\".concat(value)] = function (arrayName) {\n return publicAPI.setActiveAttributeByIndex(publicAPI.getArrayWithIndex(arrayName).index, value);\n };\n\n publicAPI[\"copy\".concat(value, \"Off\")] = function () {\n var attType = value.toUpperCase();\n model.copyAttributeFlags[AttributeCopyOperations.PASSDATA][AttributeTypes[attType]] = false;\n };\n });\n\n publicAPI.initializeAttributeCopyFlags = function () {\n // Default to copying all attributes in every circumstance:\n model.copyAttributeFlags = [];\n Object.keys(AttributeCopyOperations).filter(function (op) {\n return op !== 'ALLCOPY';\n }).forEach(function (attCopyOp) {\n model.copyAttributeFlags[AttributeCopyOperations[attCopyOp]] = Object.keys(AttributeTypes).filter(function (ty) {\n return ty !== 'NUM_ATTRIBUTES';\n }).reduce(function (a, b) {\n a[AttributeTypes[b]] = true;\n return a;\n }, []);\n }); // Override some operations where we don't want to copy:\n\n model.copyAttributeFlags[AttributeCopyOperations.COPYTUPLE][AttributeTypes.GLOBALIDS] = false;\n model.copyAttributeFlags[AttributeCopyOperations.INTERPOLATE][AttributeTypes.GLOBALIDS] = false;\n model.copyAttributeFlags[AttributeCopyOperations.COPYTUPLE][AttributeTypes.PEDIGREEIDS] = false;\n };\n\n publicAPI.initialize = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.initialize, publicAPI.initializeAttributeCopyFlags); // Process dataArrays if any\n\n if (model.dataArrays && Object.keys(model.dataArrays).length) {\n Object.keys(model.dataArrays).forEach(function (name) {\n if (!model.dataArrays[name].ref && model.dataArrays[name].type === 'vtkDataArray') {\n publicAPI.addArray(vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance(model.dataArrays[name]));\n }\n });\n }\n\n var superShallowCopy = publicAPI.shallowCopy;\n\n publicAPI.shallowCopy = function (other, debug) {\n superShallowCopy(other, debug);\n model.arrays = other.getArrays().map(function (arr) {\n var arrNew = arr.newClone();\n arrNew.shallowCopy(arr, debug);\n return {\n data: arrNew\n };\n });\n };\n\n publicAPI.initializeAttributeCopyFlags();\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n activeScalars: -1,\n activeVectors: -1,\n activeTensors: -1,\n activeNormals: -1,\n activeTCoords: -1,\n activeGlobalIds: -1,\n activePedigreeIds: -1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_Common_DataModel_DataSetAttributes_FieldData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['activeScalars', 'activeNormals', 'activeTCoords', 'activeVectors', 'activeTensors', 'activeGlobalIds', 'activePedigreeIds']);\n\n if (!model.arrays) {\n model.arrays = {};\n } // Object specific methods\n\n\n vtkDataSetAttributes(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkDataSetAttributes'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Common_DataModel_DataSetAttributes_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/ImageData/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/ImageData/index.js ***! - \*************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSet */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_StructuredData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/StructuredData */ \"./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/StructuredData/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/Constants.js\");\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkImageData methods\n// ----------------------------------------------------------------------------\n\nfunction vtkImageData(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkImageData');\n\n publicAPI.setExtent = function () {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return false;\n }\n\n for (var _len = arguments.length, inExtent = new Array(_len), _key = 0; _key < _len; _key++) {\n inExtent[_key] = arguments[_key];\n }\n\n var extentArray = inExtent.length === 1 ? inExtent[0] : inExtent;\n\n if (extentArray.length !== 6) {\n return false;\n }\n\n var changeDetected = false;\n model.extent.forEach(function (item, index) {\n if (item !== extentArray[index]) {\n if (changeDetected) {\n return;\n }\n\n changeDetected = true;\n }\n });\n\n if (changeDetected) {\n model.extent = extentArray.slice();\n model.dataDescription = vtk_js_Sources_Common_DataModel_StructuredData__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getDataDescriptionFromExtent(model.extent);\n publicAPI.modified();\n }\n\n return changeDetected;\n };\n\n publicAPI.setDimensions = function () {\n var i;\n var j;\n var k;\n\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n\n if (arguments.length === 1) {\n var array = arguments.length <= 0 ? undefined : arguments[0];\n i = array[0];\n j = array[1];\n k = array[2];\n } else if (arguments.length === 3) {\n i = arguments.length <= 0 ? undefined : arguments[0];\n j = arguments.length <= 1 ? undefined : arguments[1];\n k = arguments.length <= 2 ? undefined : arguments[2];\n } else {\n vtkErrorMacro('Bad dimension specification');\n return;\n }\n\n publicAPI.setExtent(0, i - 1, 0, j - 1, 0, k - 1);\n };\n\n publicAPI.getDimensions = function () {\n return [model.extent[1] - model.extent[0] + 1, model.extent[3] - model.extent[2] + 1, model.extent[5] - model.extent[4] + 1];\n };\n\n publicAPI.getNumberOfCells = function () {\n var dims = publicAPI.getDimensions();\n var nCells = 1;\n\n for (var i = 0; i < 3; i++) {\n if (dims[i] === 0) {\n return 0;\n }\n\n if (dims[i] > 1) {\n nCells *= dims[i] - 1;\n }\n }\n\n return nCells;\n };\n\n publicAPI.getNumberOfPoints = function () {\n var dims = publicAPI.getDimensions();\n return dims[0] * dims[1] * dims[2];\n };\n\n publicAPI.getPoint = function (index) {\n var dims = publicAPI.getDimensions();\n\n if (dims[0] === 0 || dims[1] === 0 || dims[2] === 0) {\n vtkErrorMacro('Requesting a point from an empty image.');\n return null;\n }\n\n var ijk = new Float64Array(3);\n\n switch (model.dataDescription) {\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].EMPTY:\n return null;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].SINGLE_POINT:\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].X_LINE:\n ijk[0] = index;\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].Y_LINE:\n ijk[1] = index;\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].Z_LINE:\n ijk[2] = index;\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].XY_PLANE:\n ijk[0] = index % dims[0];\n ijk[1] = index / dims[0];\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].YZ_PLANE:\n ijk[1] = index % dims[1];\n ijk[2] = index / dims[1];\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].XZ_PLANE:\n ijk[0] = index % dims[0];\n ijk[2] = index / dims[0];\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].XYZ_GRID:\n ijk[0] = index % dims[0];\n ijk[1] = index / dims[0] % dims[1];\n ijk[2] = index / (dims[0] * dims[1]);\n break;\n\n default:\n vtkErrorMacro('Invalid dataDescription');\n break;\n }\n\n var coords = [0, 0, 0];\n publicAPI.indexToWorld(ijk, coords);\n return coords;\n }; // vtkCell *GetCell(vtkIdType cellId) VTK_OVERRIDE;\n // void GetCell(vtkIdType cellId, vtkGenericCell *cell) VTK_OVERRIDE;\n // void GetCellBounds(vtkIdType cellId, double bounds[6]) VTK_OVERRIDE;\n // virtual vtkIdType FindPoint(double x, double y, double z)\n // {\n // return this->vtkDataSet::FindPoint(x, y, z);\n // }\n // vtkIdType FindPoint(double x[3]) VTK_OVERRIDE;\n // vtkIdType FindCell(\n // double x[3], vtkCell *cell, vtkIdType cellId, double tol2,\n // int& subId, double pcoords[3], double *weights) VTK_OVERRIDE;\n // vtkIdType FindCell(\n // double x[3], vtkCell *cell, vtkGenericCell *gencell,\n // vtkIdType cellId, double tol2, int& subId,\n // double pcoords[3], double *weights) VTK_OVERRIDE;\n // vtkCell *FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId,\n // double tol2, int& subId, double pcoords[3],\n // double *weights) VTK_OVERRIDE;\n // int GetCellType(vtkIdType cellId) VTK_OVERRIDE;\n // void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) VTK_OVERRIDE\n // {vtkStructuredData::GetCellPoints(cellId,ptIds,this->DataDescription,\n // this->GetDimensions());}\n // void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) VTK_OVERRIDE\n // {vtkStructuredData::GetPointCells(ptId,cellIds,this->GetDimensions());}\n // void ComputeBounds() VTK_OVERRIDE;\n // int GetMaxCellSize() VTK_OVERRIDE {return 8;}; //voxel is the largest\n\n\n publicAPI.getBounds = function () {\n return publicAPI.extentToBounds(model.extent);\n };\n\n publicAPI.extentToBounds = function (ex) {\n // prettier-ignore\n var corners = [ex[0], ex[2], ex[4], ex[1], ex[2], ex[4], ex[0], ex[3], ex[4], ex[1], ex[3], ex[4], ex[0], ex[2], ex[5], ex[1], ex[2], ex[5], ex[0], ex[3], ex[5], ex[1], ex[3], ex[5]];\n var idx = new Float64Array([corners[0], corners[1], corners[2]]);\n var vout = new Float64Array(3);\n publicAPI.indexToWorld(idx, vout);\n var bounds = [vout[0], vout[0], vout[1], vout[1], vout[2], vout[2]];\n\n for (var i = 3; i < 24; i += 3) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].set(idx, corners[i], corners[i + 1], corners[i + 2]);\n publicAPI.indexToWorld(idx, vout);\n\n if (vout[0] < bounds[0]) {\n bounds[0] = vout[0];\n }\n\n if (vout[1] < bounds[2]) {\n bounds[2] = vout[1];\n }\n\n if (vout[2] < bounds[4]) {\n bounds[4] = vout[2];\n }\n\n if (vout[0] > bounds[1]) {\n bounds[1] = vout[0];\n }\n\n if (vout[1] > bounds[3]) {\n bounds[3] = vout[1];\n }\n\n if (vout[2] > bounds[5]) {\n bounds[5] = vout[2];\n }\n }\n\n return bounds;\n }; // Internal, shouldn't need to call this manually.\n\n\n publicAPI.computeTransforms = function () {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].fromTranslation(model.indexToWorld, model.origin);\n model.indexToWorld[0] = model.direction[0];\n model.indexToWorld[1] = model.direction[1];\n model.indexToWorld[2] = model.direction[2];\n model.indexToWorld[4] = model.direction[3];\n model.indexToWorld[5] = model.direction[4];\n model.indexToWorld[6] = model.direction[5];\n model.indexToWorld[8] = model.direction[6];\n model.indexToWorld[9] = model.direction[7];\n model.indexToWorld[10] = model.direction[8];\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].scale(model.indexToWorld, model.indexToWorld, model.spacing);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].invert(model.worldToIndex, model.indexToWorld);\n }; //\n // The direction matrix is a 3x3 basis for the I, J, K axes\n // of the image. The rows of the matrix correspond to the\n // axes directions in world coordinates. Direction must\n // form an orthonormal basis, results are undefined if\n // it is not.\n //\n\n\n publicAPI.setDirection = function () {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return false;\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var array = args; // allow an array passed as a single arg.\n\n if (array.length === 1 && (Array.isArray(array[0]) || array[0].constructor === Float32Array || array[0].constructor === Float64Array)) {\n array = array[0];\n }\n\n if (array.length !== 9) {\n throw new RangeError('Invalid number of values for array setter');\n }\n\n var changeDetected = false;\n model.direction.forEach(function (item, index) {\n if (item !== array[index]) {\n if (changeDetected) {\n return;\n }\n\n changeDetected = true;\n }\n });\n\n if (changeDetected) {\n for (var i = 0; i < 9; ++i) {\n model.direction[i] = array[i];\n }\n\n publicAPI.modified();\n }\n\n return true;\n };\n\n publicAPI.indexToWorld = function (ain) {\n var aout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(aout, ain, model.indexToWorld);\n return aout;\n };\n\n publicAPI.indexToWorldVec3 = publicAPI.indexToWorld;\n\n publicAPI.worldToIndex = function (ain) {\n var aout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(aout, ain, model.worldToIndex);\n return aout;\n };\n\n publicAPI.worldToIndexVec3 = publicAPI.worldToIndex;\n\n publicAPI.indexToWorldBounds = function (bin) {\n var bout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var in1 = [0, 0, 0];\n var in2 = [0, 0, 0];\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].computeCornerPoints(bin, in1, in2);\n var out1 = [0, 0, 0];\n var out2 = [0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(out1, in1, model.indexToWorld);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(out2, in2, model.indexToWorld);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"computeBoundsFromPoints\"](out1, out2, bout);\n return bout;\n };\n\n publicAPI.worldToIndexBounds = function (bin) {\n var bout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var in1 = [0, 0, 0];\n var in2 = [0, 0, 0];\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].computeCornerPoints(bin, in1, in2);\n var out1 = [0, 0, 0];\n var out2 = [0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(out1, in1, model.worldToIndex);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(out2, in2, model.worldToIndex);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"computeBoundsFromPoints\"](out1, out2, bout);\n return bout;\n }; // Make sure the transform is correct\n\n\n publicAPI.onModified(publicAPI.computeTransforms);\n publicAPI.computeTransforms();\n\n publicAPI.getCenter = function () {\n var bounds = publicAPI.getBounds();\n var center = [];\n\n for (var i = 0; i < 3; i++) {\n center[i] = (bounds[2 * i + 1] + bounds[2 * i]) / 2;\n }\n\n return center;\n };\n\n publicAPI.computeHistogram = function (worldBounds) {\n var voxelFunc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var bounds = [0, 0, 0, 0, 0, 0];\n publicAPI.worldToIndexBounds(worldBounds, bounds);\n var point1 = [0, 0, 0];\n var point2 = [0, 0, 0];\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].computeCornerPoints(bounds, point1, point2);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"roundVector\"](point1, point1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"roundVector\"](point2, point2);\n var dimensions = publicAPI.getDimensions();\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"clampVector\"](point1, [0, 0, 0], [dimensions[0] - 1, dimensions[1] - 1, dimensions[2] - 1], point1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"clampVector\"](point2, [0, 0, 0], [dimensions[0] - 1, dimensions[1] - 1, dimensions[2] - 1], point2);\n var yStride = dimensions[0];\n var zStride = dimensions[0] * dimensions[1];\n var pixels = publicAPI.getPointData().getScalars().getData();\n var maximum = -Infinity;\n var minimum = Infinity;\n var sumOfSquares = 0;\n var isum = 0;\n var inum = 0;\n\n for (var z = point1[2]; z <= point2[2]; z++) {\n for (var y = point1[1]; y <= point2[1]; y++) {\n var index = point1[0] + y * yStride + z * zStride;\n\n for (var x = point1[0]; x <= point2[0]; x++) {\n if (!voxelFunc || voxelFunc([x, y, z], bounds)) {\n var pixel = pixels[index];\n if (pixel > maximum) maximum = pixel;\n if (pixel < minimum) minimum = pixel;\n sumOfSquares += pixel * pixel;\n isum += pixel;\n inum += 1;\n }\n\n ++index;\n }\n }\n }\n\n var average = inum > 0 ? isum / inum : 0;\n var variance = sumOfSquares - average * average;\n var sigma = Math.sqrt(variance);\n return {\n minimum: minimum,\n maximum: maximum,\n average: average,\n variance: variance,\n sigma: sigma\n };\n }; // TODO: use the unimplemented `vtkDataSetAttributes` for scalar length, that is currently also a TODO (GetNumberOfComponents).\n // Scalar data could be tuples for color information?\n\n\n publicAPI.computeIncrements = function (extent) {\n var numberOfComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var increments = [];\n var incr = numberOfComponents; // Calculate array increment offsets\n // similar to c++ vtkImageData::ComputeIncrements\n\n for (var idx = 0; idx < 3; ++idx) {\n increments[idx] = incr;\n incr *= extent[idx * 2 + 1] - extent[idx * 2] + 1;\n }\n\n return increments;\n };\n /**\n * @param {Number[]} index the localized `[i,j,k]` pixel array position. Float values will be rounded.\n * @return {Number} the corresponding flattened index in the scalar array\n */\n\n\n publicAPI.computeOffsetIndex = function (_ref) {\n var _ref2 = _slicedToArray(_ref, 3),\n i = _ref2[0],\n j = _ref2[1],\n k = _ref2[2];\n\n var extent = publicAPI.getExtent();\n var numberOfComponents = publicAPI.getPointData().getScalars().getNumberOfComponents();\n var increments = publicAPI.computeIncrements(extent, numberOfComponents); // Use the array increments to find the pixel index\n // similar to c++ vtkImageData::GetArrayPointer\n // Math.floor to catch \"practically 0\" e^-15 scenarios.\n\n return Math.floor((Math.round(i) - extent[0]) * increments[0] + (Math.round(j) - extent[2]) * increments[1] + (Math.round(k) - extent[4]) * increments[2]);\n };\n /**\n * @param {Number[]} xyz the [x,y,z] Array in world coordinates\n * @return {Number|NaN} the corresponding pixel's index in the scalar array\n */\n\n\n publicAPI.getOffsetIndexFromWorld = function (xyz) {\n var extent = publicAPI.getExtent();\n var index = publicAPI.worldToIndex(xyz); // Confirm indexed i,j,k coords are within the bounds of the volume\n\n for (var idx = 0; idx < 3; ++idx) {\n if (index[idx] < extent[idx * 2] || index[idx] > extent[idx * 2 + 1]) {\n vtkErrorMacro(\"GetScalarPointer: Pixel \".concat(index, \" is not in memory. Current extent = \").concat(extent));\n return NaN;\n }\n } // Assumed the index here is within 0 <-> scalarData.length, but doesn't hurt to check upstream\n\n\n return publicAPI.computeOffsetIndex(index);\n };\n /**\n * @param {Number[]} xyz the [x,y,z] Array in world coordinates\n * @param {Number?} comp the scalar component index for multi-component scalars\n * @return {Number|NaN} the corresponding pixel's scalar value\n */\n\n\n publicAPI.getScalarValueFromWorld = function (xyz) {\n var comp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var numberOfComponents = publicAPI.getPointData().getScalars().getNumberOfComponents();\n\n if (comp < 0 || comp >= numberOfComponents) {\n vtkErrorMacro(\"GetScalarPointer: Scalar Component \".concat(comp, \" is not within bounds. Current Scalar numberOfComponents: \").concat(numberOfComponents));\n return NaN;\n }\n\n var offsetIndex = publicAPI.getOffsetIndexFromWorld(xyz);\n\n if (Number.isNaN(offsetIndex)) {\n // VTK Error Macro will have been tripped already, no need to do it again,\n return offsetIndex;\n }\n\n return publicAPI.getPointData().getScalars().getComponent(offsetIndex, comp);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n direction: null,\n // a mat3\n indexToWorld: null,\n // a mat4\n worldToIndex: null,\n // a mat4\n spacing: [1.0, 1.0, 1.0],\n origin: [0.0, 0.0, 0.0],\n extent: [0, -1, 0, -1, 0, -1],\n dataDescription: vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].EMPTY\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues);\n\n if (!model.direction) {\n model.direction = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat3\"].identity(new Float64Array(9));\n } else if (Array.isArray(model.direction)) {\n model.direction = new Float64Array(model.direction.slice(0, 9));\n }\n\n model.indexToWorld = new Float64Array(16);\n model.worldToIndex = new Float64Array(16); // Set/Get methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['direction', 'indexToWorld', 'worldToIndex']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['origin', 'spacing'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['extent'], 6); // Object specific methods\n\n vtkImageData(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkImageData'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/ImageData/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/Line/Constants.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/Line/Constants.js ***! - \************************************************************************/ -/*! exports provided: IntersectionState, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IntersectionState\", function() { return IntersectionState; });\nvar IntersectionState = {\n NO_INTERSECTION: 0,\n YES_INTERSECTION: 1,\n ON_LINE: 2\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n IntersectionState: IntersectionState\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/Line/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/Line/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/Line/index.js ***! - \********************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Line_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Line/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/Line/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Cell */ \"./node_modules/vtk.js/Sources/Common/DataModel/Cell/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\nvar IntersectionState = vtk_js_Sources_Common_DataModel_Line_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].IntersectionState; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction distanceToLine(x, p1, p2) {\n var closestPoint = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n var outObj = {\n t: Number.MIN_VALUE,\n distance: 0\n };\n var p21 = [];\n var closest; // Determine appropriate vector\n\n p21[0] = p2[0] - p1[0];\n p21[1] = p2[1] - p1[1];\n p21[2] = p2[2] - p1[2]; // Get parametric location\n\n var num = p21[0] * (x[0] - p1[0]) + p21[1] * (x[1] - p1[1]) + p21[2] * (x[2] - p1[2]);\n var denom = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](p21, p21); // trying to avoid an expensive fabs\n\n var tolerance = 1e-5 * num;\n\n if (denom !== 0.0) {\n outObj.t = num / denom;\n }\n\n if (tolerance < 0.0) {\n tolerance = -tolerance;\n }\n\n if (-tolerance < denom && denom < tolerance) {\n closest = p1;\n } else if (denom <= 0.0 || outObj.t < 0.0) {\n // If parametric coordinate is within 0<=p<=1, then the point is closest to\n // the line. Otherwise, it's closest to a point at the end of the line.\n closest = p1;\n } else if (outObj.t > 1.0) {\n closest = p2;\n } else {\n closest = p21;\n p21[0] = p1[0] + outObj.t * p21[0];\n p21[1] = p1[1] + outObj.t * p21[1];\n p21[2] = p1[2] + outObj.t * p21[2];\n }\n\n if (closestPoint) {\n closestPoint[0] = closest[0];\n closestPoint[1] = closest[1];\n closestPoint[2] = closest[2];\n }\n\n outObj.distance = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"distance2BetweenPoints\"](closest, x);\n return outObj;\n}\n\nfunction intersection(a1, a2, b1, b2, u, v) {\n var a21 = [];\n var b21 = [];\n var b1a1 = [];\n u[0] = 0.0;\n v[0] = 0.0; // Determine line vectors.\n\n a21[0] = a2[0] - a1[0];\n a21[1] = a2[1] - a1[1];\n a21[2] = a2[2] - a1[2];\n b21[0] = b2[0] - b1[0];\n b21[1] = b2[1] - b1[1];\n b21[2] = b2[2] - b1[2];\n b1a1[0] = b1[0] - a1[0];\n b1a1[1] = b1[1] - a1[1];\n b1a1[2] = b1[2] - a1[2]; // Compute the system (least squares) matrix.\n\n var A = [];\n A[0] = [vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](a21, a21), -vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](a21, b21)];\n A[1] = [A[0][1], vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](b21, b21)]; // Compute the least squares system constant term.\n\n var c = [];\n c[0] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](a21, b1a1);\n c[1] = -vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](b21, b1a1); // Solve the system of equations\n\n if (vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"solveLinearSystem\"](A, c, 2) === 0) {\n // The lines are colinear. Therefore, one of the four endpoints is the\n // point of closest approach\n var minDist = Number.MAX_VALUE;\n var p = [a1, a2, b1, b2];\n var l1 = [b1, b1, a1, a1];\n var l2 = [b2, b2, a2, a2];\n var uv1 = [v[0], v[0], u[0], u[0]];\n var uv2 = [u[0], u[0], v[0], v[0]];\n var obj;\n\n for (var i = 0; i < 4; i++) {\n obj = distanceToLine(p[i], l1[i], l2[i]);\n\n if (obj.distance < minDist) {\n minDist = obj.distance;\n uv1[i] = obj.t;\n uv2[i] = i % 2;\n }\n }\n\n return IntersectionState.ON_LINE;\n }\n\n u[0] = c[0];\n v[0] = c[1]; // Check parametric coordinates for intersection.\n\n if (u[0] >= 0.0 && u[0] <= 1.0 && v[0] >= 0.0 && v[0] <= 1.0) {\n return IntersectionState.YES_INTERSECTION;\n }\n\n return IntersectionState.NO_INTERSECTION;\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n distanceToLine: distanceToLine,\n intersection: intersection\n}; // ----------------------------------------------------------------------------\n// vtkLine methods\n// ----------------------------------------------------------------------------\n\nfunction vtkLine(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkLine');\n\n function isBetweenPoints(t) {\n return t >= 0.0 && t <= 1.0;\n }\n\n publicAPI.getCellDimension = function () {\n return 1;\n };\n\n publicAPI.intersectWithLine = function (p1, p2, tol, x, pcoords) {\n var outObj = {\n intersect: 0,\n t: Number.MAX_VALUE,\n subId: 0,\n betweenPoints: null\n };\n pcoords[1] = 0.0;\n pcoords[2] = 0.0;\n var projXYZ = [];\n var a1 = [];\n var a2 = [];\n model.points.getPoint(0, a1);\n model.points.getPoint(1, a2);\n var u = [];\n var v = [];\n var intersect = intersection(p1, p2, a1, a2, u, v);\n outObj.t = u[0];\n outObj.betweenPoints = isBetweenPoints(outObj.t);\n pcoords[0] = v[0];\n\n if (intersect === IntersectionState.YES_INTERSECTION) {\n // make sure we are within tolerance\n for (var i = 0; i < 3; i++) {\n x[i] = a1[i] + pcoords[0] * (a2[i] - a1[i]);\n projXYZ[i] = p1[i] + outObj.t * (p2[i] - p1[i]);\n }\n\n if (vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"distance2BetweenPoints\"](x, projXYZ) <= tol * tol) {\n outObj.intersect = 1;\n return outObj;\n }\n } else {\n var outDistance; // check to see if it lies within tolerance\n // one of the parametric coords must be outside 0-1\n\n if (outObj.t < 0.0) {\n outDistance = distanceToLine(p1, a1, a2, x);\n\n if (outDistance.distance <= tol * tol) {\n outObj.t = 0.0;\n outObj.intersect = 1;\n outObj.betweenPoints = true; // Intersection is near p1\n\n return outObj;\n }\n\n return outObj;\n }\n\n if (outObj.t > 1.0) {\n outDistance = distanceToLine(p2, a1, a2, x);\n\n if (outDistance.distance <= tol * tol) {\n outObj.t = 1.0;\n outObj.intersect = 1;\n outObj.betweenPoints = true; // Intersection is near p2\n\n return outObj;\n }\n\n return outObj;\n }\n\n if (pcoords[0] < 0.0) {\n pcoords[0] = 0.0;\n outDistance = distanceToLine(a1, p1, p2, x);\n outObj.t = outDistance.t;\n\n if (outDistance.distance <= tol * tol) {\n outObj.intersect = 1;\n return outObj;\n }\n\n return outObj;\n }\n\n if (pcoords[0] > 1.0) {\n pcoords[0] = 1.0;\n outDistance = distanceToLine(a2, p1, p2, x);\n outObj.t = outDistance.t;\n\n if (outDistance.distance <= tol * tol) {\n outObj.intersect = 1;\n return outObj;\n }\n\n return outObj;\n }\n }\n\n return outObj;\n };\n\n publicAPI.evaluatePosition = function (x, closestPoint, subId, pcoords, dist2, weights) {}; // virtual\n\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtkLine(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkLine'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread(_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC), vtk_js_Sources_Common_DataModel_Line_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/Line/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/PiecewiseFunction/index.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/PiecewiseFunction/index.js ***! - \*********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkPiecewiseFunction methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPiecewiseFunction(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPiecewiseFunction'); // Return the number of points which specify this function\n\n publicAPI.getSize = function () {\n return model.nodes.length;\n }; // Return the type of function stored in object:\n // Function Types:\n // 0 : Constant (No change in slope between end points)\n // 1 : NonDecreasing (Always increasing or zero slope)\n // 2 : NonIncreasing (Always decreasing or zero slope)\n // 3 : Varied (Contains both decreasing and increasing slopes)\n // 4 : Unknown (Error condition)\n //\n\n\n publicAPI.getType = function () {\n var value;\n var prevValue = 0.0;\n var functionType = 0;\n\n if (model.nodes.length > 0) {\n prevValue = model.nodes[0].y;\n }\n\n for (var i = 1; i < model.nodes.length; i++) {\n value = model.nodes[i].y; // Do not change the function type if equal\n\n if (value !== prevValue) {\n if (value > prevValue) {\n switch (functionType) {\n case 0:\n case 1:\n functionType = 1; // NonDecreasing\n\n break;\n\n default:\n case 2:\n functionType = 3; // Varied\n\n break;\n }\n } else {\n // value < prev_value\n switch (functionType) {\n case 0:\n case 2:\n functionType = 2; // NonIncreasing\n\n break;\n\n default:\n case 1:\n functionType = 3; // Varied\n\n break;\n }\n }\n }\n\n prevValue = value; // Exit loop if we find a Varied function\n\n if (functionType === 3) {\n break;\n }\n }\n\n switch (functionType) {\n case 0:\n return 'Constant';\n\n case 1:\n return 'NonDecreasing';\n\n case 2:\n return 'NonIncreasing';\n\n default:\n case 3:\n return 'Varied';\n }\n }; // Since we no longer store the data in an array, we must\n // copy out of the vector into an array. No modified check -\n // could be added if performance is a problem\n\n\n publicAPI.getDataPointer = function () {\n var size = model.nodes.length;\n model.function = null;\n\n if (size > 0) {\n model.function = [];\n\n for (var i = 0; i < size; i++) {\n model.function[2 * i] = model.nodes[i].x;\n model.function[2 * i + 1] = model.nodes[i].y;\n }\n }\n\n return model.function;\n }; // Returns the first point location which starts a non-zero segment of the\n // function. Note that the value at this point may be zero.\n\n\n publicAPI.getFirstNonZeroValue = function () {\n // Check if no points specified\n if (model.nodes.length === 0) {\n return 0;\n }\n\n var allZero = 1;\n var x = 0.0;\n var i = 0;\n\n for (; i < model.nodes.length; i++) {\n if (model.nodes[i].y !== 0.0) {\n allZero = 0;\n break;\n }\n } // If every specified point has a zero value then return\n // a large value\n\n\n if (allZero) {\n x = Number.MAX_VALUE;\n } else if (i > 0) {\n // A point was found with a non-zero value\n // Return the value of the point that precedes this one\n x = model.nodes[i - 1].x;\n } else if (model.clamping) {\n // If this is the first point in the function, return its\n // value is clamping is off, otherwise VTK_DOUBLE_MIN if\n // clamping is on.\n x = -Number.MAX_VALUE;\n } else {\n x = model.nodes[0].x;\n }\n\n return x;\n }; // For a specified index value, get the node parameters\n\n\n publicAPI.getNodeValue = function (index, val) {\n var size = model.nodes.length;\n\n if (index < 0 || index >= size) {\n vtkErrorMacro('Index out of range!');\n return -1;\n }\n\n val[0] = model.nodes[index].x;\n val[1] = model.nodes[index].y;\n val[2] = model.nodes[index].midpoint;\n val[3] = model.nodes[index].sharpness;\n return 1;\n }; // For a specified index value, get the node parameters\n\n\n publicAPI.setNodeValue = function (index, val) {\n var size = model.nodes.length;\n\n if (index < 0 || index >= size) {\n vtkErrorMacro('Index out of range!');\n return -1;\n }\n\n var oldX = model.nodes[index].x;\n model.nodes[index].x = val[0];\n model.nodes[index].y = val[1];\n model.nodes[index].midpoint = val[2];\n model.nodes[index].sharpness = val[3];\n\n if (oldX !== val[0]) {\n // The point has been moved, the order of points or the range might have\n // been modified.\n publicAPI.sortAndUpdateRange(); // No need to call Modified() here because SortAndUpdateRange() has done it\n // already.\n } else {\n publicAPI.modified();\n }\n\n return 1;\n }; // Adds a point to the function. If a duplicate point is inserted\n // then the function value at that location is set to the new value.\n // This is the legacy version that assumes midpoint = 0.5 and\n // sharpness = 0.0\n\n\n publicAPI.addPoint = function (x, y) {\n return publicAPI.addPointLong(x, y, 0.5, 0.0);\n }; // Adds a point to the function and returns the array index of the point.\n\n\n publicAPI.addPointLong = function (x, y, midpoint, sharpness) {\n // Error check\n if (midpoint < 0.0 || midpoint > 1.0) {\n vtkErrorMacro('Midpoint outside range [0.0, 1.0]');\n return -1;\n }\n\n if (sharpness < 0.0 || sharpness > 1.0) {\n vtkErrorMacro('Sharpness outside range [0.0, 1.0]');\n return -1;\n } // remove any node already at this X location\n\n\n if (!model.allowDuplicateScalars) {\n publicAPI.removePoint(x);\n } // Create the new node\n\n\n var node = {\n x: x,\n y: y,\n midpoint: midpoint,\n sharpness: sharpness\n }; // Add it, then sort to get everything in order\n\n model.nodes.push(node);\n publicAPI.sortAndUpdateRange(); // Now find this node so we can return the index\n\n var i;\n\n for (i = 0; i < model.nodes.length; i++) {\n if (model.nodes[i].x === x) {\n break;\n }\n } // If we didn't find it, something went horribly wrong so\n // return -1\n\n\n if (i < model.nodes.length) {\n return i;\n }\n\n return -1;\n };\n\n publicAPI.setNodes = function (nodes) {\n if (model.nodes !== nodes) {\n model.nodes = nodes;\n publicAPI.sortAndUpdateRange();\n }\n }; // Sort the vector in increasing order, then fill in\n // the Range\n\n\n publicAPI.sortAndUpdateRange = function () {\n model.nodes.sort(function (a, b) {\n return a.x - b.x;\n });\n var modifiedInvoked = publicAPI.updateRange(); // If range is updated, Modified() has been called, don't call it again.\n\n if (!modifiedInvoked) {\n publicAPI.modified();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.updateRange = function () {\n var oldRange = model.range.slice();\n var size = model.nodes.length;\n\n if (size) {\n model.range[0] = model.nodes[0].x;\n model.range[1] = model.nodes[size - 1].x;\n } else {\n model.range[0] = 0;\n model.range[1] = 0;\n } // If the rage is the same, then no need to call Modified()\n\n\n if (oldRange[0] === model.range[0] && oldRange[1] === model.range[1]) {\n return false;\n }\n\n publicAPI.modified();\n return true;\n }; // Removes a point from the function. If no point is found then function\n // remains the same.\n\n\n publicAPI.removePoint = function (x) {\n // First find the node since we need to know its\n // index as our return value\n var i;\n\n for (i = 0; i < model.nodes.length; i++) {\n if (model.nodes[i].x === x) {\n break;\n }\n } // If the node doesn't exist, we return -1\n\n\n if (i >= model.nodes.length) {\n return -1;\n }\n\n var retVal = i; // If the first or last point has been removed, then we update the range\n // No need to sort here as the order of points hasn't changed.\n\n var modifiedInvoked = false;\n model.nodes.splice(i, 1);\n\n if (i === 0 || i === model.nodes.length) {\n modifiedInvoked = publicAPI.updateRange();\n }\n\n if (!modifiedInvoked) {\n publicAPI.modified();\n }\n\n return retVal;\n }; // Removes all points from the function.\n\n\n publicAPI.removeAllPoints = function () {\n model.nodes = [];\n publicAPI.sortAndUpdateRange();\n }; // Add in end points of line and remove any points between them\n // Legacy method with no way to specify midpoint and sharpness\n\n\n publicAPI.addSegment = function (x1, y1, x2, y2) {\n // First, find all points in this range and remove them\n publicAPI.sortAndUpdateRange();\n\n for (var i = 0; i < model.nodes.length;) {\n if (model.nodes[i].x >= x1 && model.nodes[i].x <= x2) {\n model.nodes.splice(i, 1);\n } else {\n i++;\n }\n } // Now add the points\n\n\n publicAPI.addPoint(x1, y1, 0.5, 0.0);\n publicAPI.addPoint(x2, y2, 0.5, 0.0);\n }; // Return the value of the function at a position\n\n\n publicAPI.getValue = function (x) {\n var table = [];\n publicAPI.getTable(x, x, 1, table);\n return table[0];\n }; // Remove all points outside the range, and make sure a point\n // exists at each end of the range. Used as a convenience method\n // for transfer function editors\n\n\n publicAPI.adjustRange = function (range) {\n if (range.length < 2) {\n return 0;\n }\n\n var functionRange = publicAPI.getRange(); // Make sure we have points at each end of the range\n\n if (functionRange[0] < range[0]) {\n publicAPI.addPoint(range[0], publicAPI.getValue(range[0]));\n } else {\n publicAPI.addPoint(range[0], publicAPI.getValue(functionRange[0]));\n }\n\n if (functionRange[1] > range[1]) {\n publicAPI.addPoint(range[1], publicAPI.getValue(range[1]));\n } else {\n publicAPI.addPoint(range[1], publicAPI.getValue(functionRange[1]));\n } // Remove all points out-of-range\n\n\n publicAPI.sortAndUpdateRange();\n\n for (var i = 0; i < model.nodes.length;) {\n if (model.nodes[i].x >= range[0] && model.nodes[i].x <= range[1]) {\n model.nodes.splice(i, 1);\n } else {\n ++i;\n }\n }\n\n publicAPI.sortAndUpdateRange();\n return 1;\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.estimateMinNumberOfSamples = function (x1, x2) {\n var d = publicAPI.findMinimumXDistance();\n return Math.ceil((x2 - x1) / d);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.findMinimumXDistance = function () {\n var size = model.nodes.length;\n\n if (size < 2) {\n return -1.0;\n }\n\n var distance = model.nodes[1].x - model.nodes[0].x;\n\n for (var i = 0; i < size - 1; i++) {\n var currentDist = model.nodes[i + 1].x - model.nodes[i].x;\n\n if (currentDist < distance) {\n distance = currentDist;\n }\n }\n\n return distance;\n }; // Returns a table of function values evaluated at regular intervals\n\n /* eslint-disable prefer-destructuring */\n\n /* eslint-disable no-continue */\n\n\n publicAPI.getTable = function (xStart, xEnd, size, table) {\n var stride = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;\n var i;\n var idx = 0;\n var numNodes = model.nodes.length; // Need to keep track of the last value so that\n // we can fill in table locations past this with\n // this value if Clamping is On.\n\n var lastValue = 0.0;\n\n if (numNodes !== 0) {\n lastValue = model.nodes[numNodes - 1].y;\n }\n\n var x = 0.0;\n var x1 = 0.0;\n var x2 = 0.0;\n var y1 = 0.0;\n var y2 = 0.0;\n var midpoint = 0.0;\n var sharpness = 0.0; // For each table entry\n\n for (i = 0; i < size; i++) {\n // Find our location in the table\n var tidx = stride * i; // Find our X location. If we are taking only 1 sample, make\n // it halfway between start and end (usually start and end will\n // be the same in this case)\n\n if (size > 1) {\n x = xStart + i / (size - 1.0) * (xEnd - xStart);\n } else {\n x = 0.5 * (xStart + xEnd);\n } // Do we need to move to the next node?\n\n\n while (idx < numNodes && x > model.nodes[idx].x) {\n idx++; // If we are at a valid point index, fill in\n // the value at this node, and the one before (the\n // two that surround our current sample location)\n // idx cannot be 0 since we just incremented it.\n\n if (idx < numNodes) {\n x1 = model.nodes[idx - 1].x;\n x2 = model.nodes[idx].x;\n y1 = model.nodes[idx - 1].y;\n y2 = model.nodes[idx].y; // We only need the previous midpoint and sharpness\n // since these control this region\n\n midpoint = model.nodes[idx - 1].midpoint;\n sharpness = model.nodes[idx - 1].sharpness; // Move midpoint away from extreme ends of range to avoid\n // degenerate math\n\n if (midpoint < 0.00001) {\n midpoint = 0.00001;\n }\n\n if (midpoint > 0.99999) {\n midpoint = 0.99999;\n }\n }\n } // Are we at the end? If so, just use the last value\n\n\n if (idx >= numNodes) {\n table[tidx] = model.clamping ? lastValue : 0.0;\n } else if (idx === 0) {\n // Are we before the first node? If so, duplicate this nodes values\n table[tidx] = model.clamping ? model.nodes[0].y : 0.0;\n } else {\n // Otherwise, we are between two nodes - interpolate\n // Our first attempt at a normalized location [0,1] -\n // we will be modifying this based on midpoint and\n // sharpness to get the curve shape we want and to have\n // it pass through (y1+y2)/2 at the midpoint.\n var s = (x - x1) / (x2 - x1); // Readjust based on the midpoint - linear adjustment\n\n if (s < midpoint) {\n s = 0.5 * s / midpoint;\n } else {\n s = 0.5 + 0.5 * (s - midpoint) / (1.0 - midpoint);\n } // override for sharpness > 0.99\n // In this case we just want piecewise constant\n\n\n if (sharpness > 0.99) {\n // Use the first value since we are below the midpoint\n if (s < 0.5) {\n table[tidx] = y1;\n continue;\n } else {\n // Use the second value at or above the midpoint\n table[tidx] = y2;\n continue;\n }\n } // Override for sharpness < 0.01\n // In this case we want piecewise linear\n\n\n if (sharpness < 0.01) {\n // Simple linear interpolation\n table[tidx] = (1 - s) * y1 + s * y2;\n continue;\n } // We have a sharpness between [0.01, 0.99] - we will\n // used a modified hermite curve interpolation where we\n // derive the slope based on the sharpness, and we compress\n // the curve non-linearly based on the sharpness\n // First, we will adjust our position based on sharpness in\n // order to make the curve sharper (closer to piecewise constant)\n\n\n if (s < 0.5) {\n s = 0.5 * Math.pow(s * 2, 1.0 + 10 * sharpness);\n } else if (s > 0.5) {\n s = 1.0 - 0.5 * Math.pow((1.0 - s) * 2, 1 + 10 * sharpness);\n } // Compute some coefficients we will need for the hermite curve\n\n\n var ss = s * s;\n var sss = ss * s;\n var h1 = 2 * sss - 3 * ss + 1;\n var h2 = -2 * sss + 3 * ss;\n var h3 = sss - 2 * ss + s;\n var h4 = sss - ss; // Use one slope for both end points\n\n var slope = y2 - y1;\n var t = (1.0 - sharpness) * slope; // Compute the value\n\n table[tidx] = h1 * y1 + h2 * y2 + h3 * t + h4 * t; // Final error check to make sure we don't go outside\n // the Y range\n\n var min = y1 < y2 ? y1 : y2;\n var max = y1 > y2 ? y1 : y2;\n table[tidx] = table[tidx] < min ? min : table[tidx];\n table[tidx] = table[tidx] > max ? max : table[tidx];\n }\n }\n };\n}\n/* eslint-enable prefer-destructuring */\n\n/* eslint-enable no-continue */\n// ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n // model.function = NULL;\n range: [0, 0],\n clamping: true,\n allowDuplicateScalars: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Internal objects initialization\n\n model.nodes = []; // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['allowDuplicateScalars', 'clamping']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setArray(publicAPI, model, ['range'], 2); // Create get macros for array\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['range']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkPiecewiseFunction(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPiecewiseFunction'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/PiecewiseFunction/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js ***! - \*********************************************************************/ -/*! exports provided: STATIC, vtkPlane, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkPlane\", function() { return vtkPlane; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar PLANE_TOLERANCE = 1.0e-6;\nvar COINCIDE = 'coincide';\nvar DISJOINT = 'disjoint'; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction evaluate(normal, origin, x) {\n return normal[0] * (x[0] - origin[0]) + normal[1] * (x[1] - origin[1]) + normal[2] * (x[2] - origin[2]);\n}\n\nfunction distanceToPlane(x, origin, normal) {\n var distance = normal[0] * (x[0] - origin[0]) + normal[1] * (x[1] - origin[1]) + normal[2] * (x[2] - origin[2]);\n return Math.abs(distance);\n}\n\nfunction projectPoint(x, origin, normal, xproj) {\n var xo = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](x, origin, xo);\n var t = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](normal, xo);\n xproj[0] = x[0] - t * normal[0];\n xproj[1] = x[1] - t * normal[1];\n xproj[2] = x[2] - t * normal[2];\n}\n\nfunction projectVector(v, normal, vproj) {\n var t = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](v, normal);\n var n2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](normal, normal);\n\n if (n2 === 0) {\n n2 = 1.0;\n }\n\n vproj[0] = v[0] - t * normal[0] / n2;\n vproj[1] = v[1] - t * normal[1] / n2;\n vproj[2] = v[2] - t * normal[2] / n2;\n return vproj;\n}\n\nfunction generalizedProjectPoint(x, origin, normal, xproj) {\n var xo = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](x, origin, xo);\n var t = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](normal, xo);\n var n2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](normal, normal);\n\n if (n2 !== 0) {\n xproj[0] = x[0] - t * normal[0] / n2;\n xproj[1] = x[1] - t * normal[1] / n2;\n xproj[2] = x[2] - t * normal[2] / n2;\n } else {\n xproj[0] = x[0];\n xproj[1] = x[1];\n xproj[2] = x[2];\n }\n}\n\nfunction intersectWithLine(p1, p2, origin, normal) {\n var outObj = {\n intersection: false,\n betweenPoints: false,\n t: Number.MAX_VALUE,\n x: []\n };\n var p21 = [];\n var p1Origin = []; // Compute line vector\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](p2, p1, p21);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](origin, p1, p1Origin); // Compute denominator. If ~0, line and plane are parallel.\n // const num = vtkMath.dot(normal, origin) - vtkMath.dot(normal, p1);\n\n var num = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](normal, p1Origin);\n var den = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](normal, p21); // If denominator with respect to numerator is \"zero\", then the line and\n // plane are considered parallel.\n\n var fabsden;\n var fabstolerance; // Trying to avoid an expensive call to fabs()\n\n if (den < 0.0) {\n fabsden = -den;\n } else {\n fabsden = den;\n }\n\n if (num < 0.0) {\n fabstolerance = -num * PLANE_TOLERANCE;\n } else {\n fabstolerance = num * PLANE_TOLERANCE;\n }\n\n if (fabsden <= fabstolerance) {\n return outObj;\n } // Where on the line between p1 and p2 is the intersection\n // If between 0 and 1, it is between the two points. If < 0 it's before p1, if > 1 it's after p2\n\n\n outObj.t = num / den;\n outObj.x[0] = p1[0] + outObj.t * p21[0];\n outObj.x[1] = p1[1] + outObj.t * p21[1];\n outObj.x[2] = p1[2] + outObj.t * p21[2];\n outObj.intersection = true;\n outObj.betweenPoints = outObj.t >= 0.0 && outObj.t <= 1.0;\n return outObj;\n}\n\nfunction intersectWithPlane(plane1Origin, plane1Normal, plane2Origin, plane2Normal) {\n var outObj = {\n intersection: false,\n l0: [],\n l1: [],\n error: null\n };\n var cross = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"cross\"](plane1Normal, plane2Normal, cross);\n var absCross = cross.map(function (n) {\n return Math.abs(n);\n }); // test if the two planes are parallel\n\n if (absCross[0] + absCross[1] + absCross[2] < PLANE_TOLERANCE) {\n // test if disjoint or coincide\n var v = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](plane1Origin, plane2Origin, v);\n\n if (vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](plane1Normal, v) === 0) {\n outObj.error = COINCIDE;\n } else {\n outObj.error = DISJOINT;\n }\n\n return outObj;\n } // Plane1 and Plane2 intersect in a line\n // first determine max abs coordinate of the cross product\n\n\n var maxc;\n\n if (absCross[0] > absCross[1] && absCross[0] > absCross[2]) {\n maxc = 'x';\n } else if (absCross[1] > absCross[2]) {\n maxc = 'y';\n } else {\n maxc = 'z';\n } // To get a point on the intersect line, zero the max coord, and solve for the other two\n\n\n var iP = []; // intersectionPoint\n // the constants in the 2 plane equations\n\n var d1 = -vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](plane1Normal, plane1Origin);\n var d2 = -vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](plane2Normal, plane2Origin); // eslint-disable-next-line default-case\n\n switch (maxc) {\n case 'x':\n // intersect with x=0\n iP[0] = 0;\n iP[1] = (d2 * plane1Normal[2] - d1 * plane2Normal[2]) / cross[0];\n iP[2] = (d1 * plane2Normal[1] - d2 * plane1Normal[1]) / cross[0];\n break;\n\n case 'y':\n // intersect with y=0\n iP[0] = (d1 * plane2Normal[2] - d2 * plane1Normal[2]) / cross[1];\n iP[1] = 0;\n iP[2] = (d2 * plane1Normal[0] - d1 * plane2Normal[0]) / cross[1];\n break;\n\n case 'z':\n // intersect with z=0\n iP[0] = (d2 * plane1Normal[1] - d1 * plane2Normal[1]) / cross[2];\n iP[1] = (d1 * plane2Normal[0] - d2 * plane1Normal[0]) / cross[2];\n iP[2] = 0;\n break;\n }\n\n outObj.l0 = iP;\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"add\"](iP, cross, outObj.l1);\n outObj.intersection = true;\n return outObj;\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n evaluate: evaluate,\n distanceToPlane: distanceToPlane,\n projectPoint: projectPoint,\n projectVector: projectVector,\n generalizedProjectPoint: generalizedProjectPoint,\n intersectWithLine: intersectWithLine,\n intersectWithPlane: intersectWithPlane,\n DISJOINT: DISJOINT,\n COINCIDE: COINCIDE\n}; // ----------------------------------------------------------------------------\n// vtkPlane methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPlane(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPlane');\n\n publicAPI.distanceToPlane = function (x) {\n return distanceToPlane(x, model.origin, model.normal);\n };\n\n publicAPI.projectPoint = function (x, xproj) {\n projectPoint(x, model.origin, model.normal, xproj);\n };\n\n publicAPI.projectVector = function (v, vproj) {\n return projectVector(v, model.normal, vproj);\n };\n\n publicAPI.push = function (distance) {\n if (distance === 0.0) {\n return;\n }\n\n for (var i = 0; i < 3; i++) {\n model.origin[i] += distance * model.normal[i];\n }\n };\n\n publicAPI.generalizedProjectPoint = function (x, xproj) {\n generalizedProjectPoint(x, model.origin, model.normal, xproj);\n };\n\n publicAPI.evaluateFunction = function (x, y, z) {\n if (!Array.isArray(x)) {\n return model.normal[0] * (x - model.origin[0]) + model.normal[1] * (y - model.origin[1]) + model.normal[2] * (z - model.origin[2]);\n }\n\n return model.normal[0] * (x[0] - model.origin[0]) + model.normal[1] * (x[1] - model.origin[1]) + model.normal[2] * (x[2] - model.origin[2]);\n };\n\n publicAPI.evaluateGradient = function (xyz) {\n var retVal = [model.normal[0], model.normal[1], model.normal[2]];\n return retVal;\n };\n\n publicAPI.intersectWithLine = function (p1, p2) {\n return intersectWithLine(p1, p2, model.origin, model.normal);\n };\n\n publicAPI.intersectWithPlane = function (planeOrigin, planeNormal) {\n return intersectWithPlane(planeOrigin, planeNormal, model.origin, model.normal);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\nvar DEFAULT_VALUES = {\n normal: [0.0, 0.0, 1.0],\n origin: [0.0, 0.0, 0.0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGetArray(publicAPI, model, ['normal', 'origin'], 3);\n vtkPlane(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkPlane'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/PointSet/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/PointSet/index.js ***! - \************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/vtk */ \"./node_modules/vtk.js/Sources/vtk.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSet */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Points__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Points */ \"./node_modules/vtk.js/Sources/Common/Core/Points/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n// ----------------------------------------------------------------------------\n// vtkPointSet methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPointSet(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPointSet'); // Create empty points\n\n if (!model.points) {\n model.points = vtk_js_Sources_Common_Core_Points__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n } else {\n model.points = Object(vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(model.points);\n }\n\n publicAPI.getNumberOfPoints = function () {\n return model.points.getNumberOfPoints();\n };\n\n publicAPI.getBounds = function () {\n return model.points.getBounds();\n };\n\n publicAPI.computeBounds = function () {\n publicAPI.getBounds();\n };\n\n var superShallowCopy = publicAPI.shallowCopy;\n\n publicAPI.shallowCopy = function (other) {\n var debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n superShallowCopy(other, debug);\n model.points = vtk_js_Sources_Common_Core_Points__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.points.shallowCopy(other.getPoints());\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {// points: null,\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['points']); // Object specific methods\n\n vtkPointSet(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkPointSet'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/PointSet/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/PolyData/Constants.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/PolyData/Constants.js ***! - \****************************************************************************/ -/*! exports provided: POLYDATA_FIELDS, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"POLYDATA_FIELDS\", function() { return POLYDATA_FIELDS; });\nvar POLYDATA_FIELDS = ['verts', 'lines', 'polys', 'strips'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n POLYDATA_FIELDS: POLYDATA_FIELDS\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/PolyData/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js ***! - \************************************************************************/ -/*! exports provided: CELL_FACTORY, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CELL_FACTORY\", function() { return CELL_FACTORY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/vtk */ \"./node_modules/vtk.js/Sources/vtk.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_CellArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/CellArray */ \"./node_modules/vtk.js/Sources/Common/Core/CellArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_CellLinks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/CellLinks */ \"./node_modules/vtk.js/Sources/Common/DataModel/CellLinks/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_CellTypes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/CellTypes */ \"./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Line */ \"./node_modules/vtk.js/Sources/Common/DataModel/Line/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PointSet__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PointSet */ \"./node_modules/vtk.js/Sources/Common/DataModel/PointSet/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Triangle__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Triangle */ \"./node_modules/vtk.js/Sources/Common/DataModel/Triangle/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/CellTypes/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData_Constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/Constants.js\");\nvar _CELL_FACTORY;\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n\n\n\n\n\nvar vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkWarningMacro;\nvar CELL_FACTORY = (_CELL_FACTORY = {}, _defineProperty(_CELL_FACTORY, vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_LINE, vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_5__[\"default\"]), _defineProperty(_CELL_FACTORY, vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLY_LINE, vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_5__[\"default\"]), _defineProperty(_CELL_FACTORY, vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_TRIANGLE, vtk_js_Sources_Common_DataModel_Triangle__WEBPACK_IMPORTED_MODULE_7__[\"default\"]), _CELL_FACTORY); // ----------------------------------------------------------------------------\n// vtkPolyData methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPolyData(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPolyData');\n\n function camelize(str) {\n return str.replace(/(?:^\\w|[A-Z]|\\b\\w)/g, function (letter) {\n return letter.toUpperCase();\n }).replace(/\\s+/g, '');\n } // build empty cell arrays and set methods\n\n\n vtk_js_Sources_Common_DataModel_PolyData_Constants__WEBPACK_IMPORTED_MODULE_9__[\"POLYDATA_FIELDS\"].forEach(function (type) {\n publicAPI[\"getNumberOf\".concat(camelize(type))] = function () {\n return model[type].getNumberOfCells();\n };\n\n if (!model[type]) {\n model[type] = vtk_js_Sources_Common_Core_CellArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n } else {\n model[type] = Object(vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(model[type]);\n }\n });\n\n publicAPI.getNumberOfCells = function () {\n return vtk_js_Sources_Common_DataModel_PolyData_Constants__WEBPACK_IMPORTED_MODULE_9__[\"POLYDATA_FIELDS\"].reduce(function (num, cellType) {\n return num + model[cellType].getNumberOfCells();\n }, 0);\n };\n\n var superShallowCopy = publicAPI.shallowCopy;\n\n publicAPI.shallowCopy = function (other) {\n var debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n superShallowCopy(other, debug);\n vtk_js_Sources_Common_DataModel_PolyData_Constants__WEBPACK_IMPORTED_MODULE_9__[\"POLYDATA_FIELDS\"].forEach(function (type) {\n model[type] = vtk_js_Sources_Common_Core_CellArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model[type].shallowCopy(other.getReferenceByName(type));\n });\n };\n\n publicAPI.buildCells = function () {\n // here are the number of cells we have\n var nVerts = publicAPI.getNumberOfVerts();\n var nLines = publicAPI.getNumberOfLines();\n var nPolys = publicAPI.getNumberOfPolys();\n var nStrips = publicAPI.getNumberOfStrips(); // pre-allocate the space we need\n\n var nCells = nVerts + nLines + nPolys + nStrips;\n var types = new Uint8Array(nCells);\n var pTypes = types;\n var locs = new Uint32Array(nCells);\n var pLocs = locs; // record locations and type of each cell.\n // verts\n\n if (nVerts) {\n var nextCellPts = 0;\n model.verts.getCellSizes().forEach(function (numCellPts, index) {\n pLocs[index] = nextCellPts;\n pTypes[index] = numCellPts > 1 ? vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLY_VERTEX : vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_VERTEX;\n nextCellPts += numCellPts + 1;\n });\n pLocs = pLocs.subarray(nVerts);\n pTypes = pTypes.subarray(nVerts);\n } // lines\n\n\n if (nLines) {\n var _nextCellPts = 0;\n model.lines.getCellSizes().forEach(function (numCellPts, index) {\n pLocs[index] = _nextCellPts;\n pTypes[index] = numCellPts > 2 ? vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLY_LINE : vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_LINE;\n\n if (numCellPts === 1) {\n vtkWarningMacro('Building VTK_LINE ', index, ' with only one point, but VTK_LINE needs at least two points. Check the input.');\n }\n\n _nextCellPts += numCellPts + 1;\n });\n pLocs = pLocs.subarray(nLines);\n pTypes = pTypes.subarray(nLines);\n } // polys\n\n\n if (nPolys) {\n var _nextCellPts2 = 0;\n model.polys.getCellSizes().forEach(function (numCellPts, index) {\n pLocs[index] = _nextCellPts2;\n\n switch (numCellPts) {\n case 3:\n pTypes[index] = vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_TRIANGLE;\n break;\n\n case 4:\n pTypes[index] = vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_QUAD;\n break;\n\n default:\n pTypes[index] = vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLYGON;\n break;\n }\n\n if (numCellPts < 3) {\n vtkWarningMacro('Building VTK_TRIANGLE ', index, ' with less than three points, but VTK_TRIANGLE needs at least three points. Check the input.');\n }\n\n _nextCellPts2 += numCellPts + 1;\n });\n pLocs += pLocs.subarray(nPolys);\n pTypes += pTypes.subarray(nPolys);\n } // strips\n\n\n if (nStrips) {\n var _nextCellPts3 = 0;\n pTypes.fill(vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_TRIANGLE_STRIP, 0, nStrips);\n model.strips.getCellSizes().forEach(function (numCellPts, index) {\n pLocs[index] = _nextCellPts3;\n _nextCellPts3 += numCellPts + 1;\n });\n } // set up the cell types data structure\n\n\n model.cells = vtk_js_Sources_Common_DataModel_CellTypes__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n model.cells.setCellTypes(nCells, types, locs);\n };\n /**\n * Create upward links from points to cells that use each point. Enables\n * topologically complex queries.\n */\n\n\n publicAPI.buildLinks = function () {\n var initialSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n if (model.cells === undefined) {\n publicAPI.buildCells();\n }\n\n model.links = vtk_js_Sources_Common_DataModel_CellLinks__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n\n if (initialSize > 0) {\n model.links.allocate(initialSize);\n } else {\n model.links.allocate(publicAPI.getPoints().getNumberOfPoints());\n }\n\n model.links.buildLinks(publicAPI);\n }; // Returns an object made of the cellType and a subarray `cellPointIds` of\n // the cell points.\n\n\n publicAPI.getCellPoints = function (cellId) {\n var cellType = model.cells.getCellType(cellId);\n var cells = null;\n\n switch (cellType) {\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_VERTEX:\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLY_VERTEX:\n cells = model.verts;\n break;\n\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_LINE:\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLY_LINE:\n cells = model.lines;\n break;\n\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_TRIANGLE:\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_QUAD:\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLYGON:\n cells = model.polys;\n break;\n\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_TRIANGLE_STRIP:\n cells = model.strips;\n break;\n\n default:\n cells = null;\n return {\n type: 0,\n cellPointIds: null\n };\n }\n\n var loc = model.cells.getCellLocation(cellId);\n var cellPointIds = cells.getCell(loc);\n return {\n cellType: cellType,\n cellPointIds: cellPointIds\n };\n };\n\n publicAPI.getPointCells = function (ptId) {\n return model.links.getCells(ptId);\n };\n\n publicAPI.getCellEdgeNeighbors = function (cellId, point1, point2) {\n var link1 = model.links.getLink(point1);\n var link2 = model.links.getLink(point2);\n return link1.cells.filter(function (cell) {\n return cell !== cellId && link2.cells.indexOf(cell) !== -1;\n });\n };\n /**\n * If you know the type of cell, you may provide it to improve performances.\n */\n\n\n publicAPI.getCell = function (cellId) {\n var cellHint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var cellInfo = publicAPI.getCellPoints(cellId);\n var cell = cellHint || CELL_FACTORY[cellInfo.cellType].newInstance();\n cell.initialize(publicAPI.getPoints(), cellInfo.cellPointIds);\n return cell;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {// verts: null,\n // lines: null,\n // polys: null,\n // strips: null,\n // cells: null,\n // links: null,\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Common_DataModel_PointSet__WEBPACK_IMPORTED_MODULE_6__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['cells', 'links']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['verts', 'lines', 'polys', 'strips']); // Object specific methods\n\n vtkPolyData(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPolyData'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/Constants.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/Constants.js ***! - \*********************************************************************************/ -/*! exports provided: SelectionContent, SelectionField, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SelectionContent\", function() { return SelectionContent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SelectionField\", function() { return SelectionField; });\n/**\n * The (primary) property that describes the content of a selection\n * node's data. Other auxiliary description properties follow.\n * GLOBALIDS means that the selection list contains values from the\n * vtkDataSetAttribute array of the same name.\n * PEDIGREEIDS means that the selection list contains values from the\n * vtkDataSetAttribute array of the same name.\n * VALUES means the the selection list contains values from an\n * arbitrary attribute array (ignores any globalids attribute)\n * INDICES means that the selection list contains indexes into the\n * cell or point arrays.\n * FRUSTUM means the set of points and cells inside a frustum\n * LOCATIONS means the set of points and cells near a set of positions\n * THRESHOLDS means the points and cells with values within a set of ranges\n * getContentType() returns -1 if the content type is not set.\n */\n// Specify how data arrays can be used by data objects\nvar SelectionContent = {\n GLOBALIDS: 0,\n PEDIGREEIDS: 1,\n VALUES: 2,\n INDICES: 3,\n FRUSTUM: 4,\n LOCATIONS: 5,\n THRESHOLDS: 6,\n BLOCKS: 7,\n QUERY: 8\n};\nvar SelectionField = {\n CELL: 0,\n POINT: 1,\n FIELD: 2,\n VERTEX: 3,\n EDGE: 4,\n ROW: 5\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n SelectionContent: SelectionContent,\n SelectionField: SelectionField\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/index.js ***! - \*****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_SelectionNode_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/SelectionNode/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n // ----------------------------------------------------------------------------\n// vtkSelectionNode methods\n// ----------------------------------------------------------------------------\n\nfunction vtkSelectionNode(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkSelectionNode');\n\n publicAPI.getBounds = function () {\n return model.points.getBounds();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n contentType: -1,\n fieldType: -1,\n properties: null,\n selectionList: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.properties = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['contentType', 'fieldType', 'properties', 'selectionList']); // Object specific methods\n\n vtkSelectionNode(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkSelectionNode'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Common_DataModel_SelectionNode_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/Constants.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/Constants.js ***! - \**********************************************************************************/ -/*! exports provided: StructuredType, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StructuredType\", function() { return StructuredType; });\nvar StructuredType = {\n UNCHANGED: 0,\n SINGLE_POINT: 1,\n X_LINE: 2,\n Y_LINE: 3,\n Z_LINE: 4,\n XY_PLANE: 5,\n YZ_PLANE: 6,\n XZ_PLANE: 7,\n XYZ_GRID: 8,\n EMPTY: 9\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n StructuredType: StructuredType\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/index.js ***! - \******************************************************************************/ -/*! exports provided: getDataDescriptionFromExtent, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDataDescriptionFromExtent\", function() { return getDataDescriptionFromExtent; });\n/* harmony import */ var vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/StructuredData/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\nvar StructuredType = vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].StructuredType;\nfunction getDataDescriptionFromExtent(inExt) {\n var dataDim = 0;\n\n for (var i = 0; i < 3; ++i) {\n if (inExt[i * 2] < inExt[i * 2 + 1]) {\n dataDim++;\n }\n }\n\n if (inExt[0] > inExt[1] || inExt[2] > inExt[3] || inExt[4] > inExt[5]) {\n return StructuredType.EMPTY;\n }\n\n if (dataDim === 3) {\n return StructuredType.XYZ_GRID;\n }\n\n if (dataDim === 2) {\n if (inExt[0] === inExt[1]) {\n return StructuredType.YZ_PLANE;\n }\n\n if (inExt[2] === inExt[3]) {\n return StructuredType.XZ_PLANE;\n }\n\n return StructuredType.XY_PLANE;\n }\n\n if (dataDim === 1) {\n if (inExt[0] < inExt[1]) {\n return StructuredType.X_LINE;\n }\n\n if (inExt[2] < inExt[3]) {\n return StructuredType.Y_LINE;\n }\n\n return StructuredType.Z_LINE;\n }\n\n return StructuredType.SINGLE_POINT;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n getDataDescriptionFromExtent: getDataDescriptionFromExtent\n}, vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/Triangle/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/Triangle/index.js ***! - \************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Cell */ \"./node_modules/vtk.js/Sources/Common/DataModel/Cell/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Line */ \"./node_modules/vtk.js/Sources/Common/DataModel/Line/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Plane */ \"./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction computeNormalDirection(v1, v2, v3, n) {\n // order is important!!! maintain consistency with triangle vertex order\n var ax = v3[0] - v2[0];\n var ay = v3[1] - v2[1];\n var az = v3[2] - v2[2];\n var bx = v1[0] - v2[0];\n var by = v1[1] - v2[1];\n var bz = v1[2] - v2[2];\n n[0] = ay * bz - az * by;\n n[1] = az * bx - ax * bz;\n n[2] = ax * by - ay * bx;\n}\n\nfunction computeNormal(v1, v2, v3, n) {\n computeNormalDirection(v1, v2, v3, n);\n var length = Math.sqrt(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]);\n\n if (length !== 0.0) {\n n[0] /= length;\n n[1] /= length;\n n[2] /= length;\n }\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n computeNormalDirection: computeNormalDirection,\n computeNormal: computeNormal\n}; // ----------------------------------------------------------------------------\n// vtkTriangle methods\n// ----------------------------------------------------------------------------\n\nfunction vtkTriangle(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkTriangle');\n\n publicAPI.getCellDimension = function () {\n return 2;\n };\n\n publicAPI.intersectWithLine = function (p1, p2, tol, x, pcoords) {\n var outObj = {\n subId: 0,\n t: Number.MAX_VALUE,\n intersect: 0,\n betweenPoints: false\n };\n pcoords[2] = 0.0;\n var closestPoint = [];\n var tol2 = tol * tol; // Get normal for triangle\n\n var pt1 = [];\n var pt2 = [];\n var pt3 = [];\n model.points.getPoint(0, pt1);\n model.points.getPoint(1, pt2);\n model.points.getPoint(2, pt3);\n var n = [];\n var weights = [];\n computeNormal(pt1, pt2, pt3, n);\n\n if (n[0] !== 0 || n[1] !== 0 || n[2] !== 0) {\n // Intersect plane of triangle with line\n var plane = vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_4__[\"default\"].intersectWithLine(p1, p2, pt1, n);\n outObj.betweenPoints = plane.betweenPoints;\n outObj.t = plane.t;\n x[0] = plane.x[0];\n x[1] = plane.x[1];\n x[2] = plane.x[2];\n\n if (!plane.intersection) {\n pcoords[0] = 0.0;\n pcoords[1] = 0.0;\n outObj.intersect = 0;\n return outObj;\n } // Evaluate position\n\n\n var inside = publicAPI.evaluatePosition(x, closestPoint, pcoords, weights);\n\n if (inside.evaluation >= 0) {\n if (inside.dist2 <= tol2) {\n outObj.intersect = 1;\n return outObj;\n }\n\n outObj.intersect = inside.evaluation;\n return outObj;\n }\n } // Normals are null, so the triangle is degenerated and\n // we still need to check intersection between line and\n // the longest edge.\n\n\n var dist2Pt1Pt2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](pt1, pt2);\n var dist2Pt2Pt3 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](pt2, pt3);\n var dist2Pt3Pt1 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](pt3, pt1);\n\n if (!model.line) {\n model.line = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n }\n\n if (dist2Pt1Pt2 > dist2Pt2Pt3 && dist2Pt1Pt2 > dist2Pt3Pt1) {\n model.line.getPoints().setPoint(0, pt1);\n model.line.getPoints().setPoint(1, pt2);\n } else if (dist2Pt2Pt3 > dist2Pt3Pt1 && dist2Pt2Pt3 > dist2Pt1Pt2) {\n model.line.getPoints().setPoint(0, pt2);\n model.line.getPoints().setPoint(1, pt3);\n } else {\n model.line.getPoints().setPoint(0, pt3);\n model.line.getPoints().setPoint(1, pt1);\n }\n\n var intersectLine = model.line.intersectWithLine(p1, p2, tol, x, pcoords);\n outObj.betweenPoints = intersectLine.betweenPoints;\n outObj.t = intersectLine.t;\n\n if (intersectLine.intersect) {\n var pt3Pt1 = [];\n var pt3Pt2 = [];\n var pt3X = []; // Compute r and s manually, using dot and norm.\n\n for (var i = 0; i < 3; i++) {\n pt3Pt1[i] = pt1[i] - pt3[i];\n pt3Pt2[i] = pt2[i] - pt3[i];\n pt3X[i] = x[i] - pt3[i];\n }\n\n pcoords[0] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"dot\"](pt3X, pt3Pt1) / dist2Pt3Pt1;\n pcoords[1] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"dot\"](pt3X, pt3Pt2) / dist2Pt2Pt3;\n outObj.intersect = 1;\n return outObj;\n }\n\n pcoords[0] = 0.0;\n pcoords[1] = 0.0;\n outObj.intersect = 0;\n return outObj;\n };\n\n publicAPI.evaluatePosition = function (x, closestPoint, pcoords, weights) {\n // will return obj\n var outObj = {\n subId: 0,\n dist2: 0,\n evaluation: -1\n };\n var i;\n var j;\n var pt1 = [];\n var pt2 = [];\n var pt3 = [];\n var n = [];\n var fabsn;\n var rhs = [];\n var c1 = [];\n var c2 = [];\n var det = 0;\n var idx = 0;\n var indices = [];\n var dist2Point;\n var dist2Line1;\n var dist2Line2;\n var closest = [];\n var closestPoint1 = [];\n var closestPoint2 = [];\n var cp = [];\n outObj.subId = 0;\n pcoords[2] = 0.0; // Get normal for triangle, only the normal direction is needed, i.e. the\n // normal need not be normalized (unit length)\n //\n\n model.points.getPoint(1, pt1);\n model.points.getPoint(2, pt2);\n model.points.getPoint(0, pt3);\n computeNormalDirection(pt1, pt2, pt3, n); // Project point to plane\n\n vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_4__[\"default\"].generalizedProjectPoint(x, pt1, n, cp); // Construct matrices. Since we have over determined system, need to find\n // which 2 out of 3 equations to use to develop equations. (Any 2 should\n // work since we've projected point to plane.)\n\n var maxComponent = 0.0;\n\n for (i = 0; i < 3; i++) {\n // trying to avoid an expensive call to fabs()\n if (n[i] < 0) {\n fabsn = -n[i];\n } else {\n fabsn = n[i];\n }\n\n if (fabsn > maxComponent) {\n maxComponent = fabsn;\n idx = i;\n }\n }\n\n for (j = 0, i = 0; i < 3; i++) {\n if (i !== idx) {\n indices[j++] = i;\n }\n }\n\n for (i = 0; i < 2; i++) {\n rhs[i] = cp[indices[i]] - pt3[indices[i]];\n c1[i] = pt1[indices[i]] - pt3[indices[i]];\n c2[i] = pt2[indices[i]] - pt3[indices[i]];\n }\n\n det = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"determinant2x2\"](c1, c2);\n\n if (det === 0.0) {\n pcoords[0] = 0.0;\n pcoords[1] = 0.0;\n outObj.evaluation = -1;\n return outObj;\n }\n\n pcoords[0] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"determinant2x2\"](rhs, c2) / det;\n pcoords[1] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"determinant2x2\"](c1, rhs) / det; // Okay, now find closest point to element\n\n weights[0] = 1 - (pcoords[0] + pcoords[1]);\n weights[1] = pcoords[0];\n weights[2] = pcoords[1];\n\n if (weights[0] >= 0.0 && weights[0] <= 1.0 && weights[1] >= 0.0 && weights[1] <= 1.0 && weights[2] >= 0.0 && weights[2] <= 1.0) {\n // projection distance\n if (closestPoint) {\n outObj.dist2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](cp, x);\n closestPoint[0] = cp[0];\n closestPoint[1] = cp[1];\n closestPoint[2] = cp[2];\n }\n\n outObj.evaluation = 1;\n } else {\n var t;\n\n if (closestPoint) {\n if (weights[1] < 0.0 && weights[2] < 0.0) {\n dist2Point = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](x, pt3);\n dist2Line1 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt1, pt3, t, closestPoint1);\n dist2Line2 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt3, pt2, t, closestPoint2);\n\n if (dist2Point < dist2Line1) {\n outObj.dist2 = dist2Point;\n closest = pt3;\n } else {\n outObj.dist2 = dist2Line1;\n closest = closestPoint1;\n }\n\n if (dist2Line2 < outObj.dist2) {\n outObj.dist2 = dist2Line2;\n closest = closestPoint2;\n }\n\n for (i = 0; i < 3; i++) {\n closestPoint[i] = closest[i];\n }\n } else if (weights[2] < 0.0 && weights[0] < 0.0) {\n dist2Point = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](x, pt1);\n dist2Line1 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt1, pt3, t, closestPoint1);\n dist2Line2 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt1, pt2, t, closestPoint2);\n\n if (dist2Point < dist2Line1) {\n outObj.dist2 = dist2Point;\n closest = pt1;\n } else {\n outObj.dist2 = dist2Line1;\n closest = closestPoint1;\n }\n\n if (dist2Line2 < outObj.dist2) {\n outObj.dist2 = dist2Line2;\n closest = closestPoint2;\n }\n\n for (i = 0; i < 3; i++) {\n closestPoint[i] = closest[i];\n }\n } else if (weights[1] < 0.0 && weights[0] < 0.0) {\n dist2Point = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](x, pt2);\n dist2Line1 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt2, pt3, t, closestPoint1);\n dist2Line2 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt1, pt2, t, closestPoint2);\n\n if (dist2Point < dist2Line1) {\n outObj.dist2 = dist2Point;\n closest = pt2;\n } else {\n outObj.dist2 = dist2Line1;\n closest = closestPoint1;\n }\n\n if (dist2Line2 < outObj.dist2) {\n outObj.dist2 = dist2Line2;\n closest = closestPoint2;\n }\n\n for (i = 0; i < 3; i++) {\n closestPoint[i] = closest[i];\n }\n } else if (weights[0] < 0.0) {\n var lineDistance = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt1, pt2, closestPoint);\n outObj.dist2 = lineDistance.distance;\n } else if (weights[1] < 0.0) {\n var _lineDistance = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt2, pt3, closestPoint);\n\n outObj.dist2 = _lineDistance.distance;\n } else if (weights[2] < 0.0) {\n var _lineDistance2 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt1, pt3, closestPoint);\n\n outObj.dist2 = _lineDistance2.distance;\n }\n }\n\n outObj.evaluation = 0;\n }\n\n return outObj;\n };\n\n publicAPI.evaluateLocation = function (pcoords, x, weights) {\n var p0 = [];\n var p1 = [];\n var p2 = [];\n model.points.getPoint(0, p0);\n model.points.getPoint(1, p1);\n model.points.getPoint(2, p2);\n var u3 = 1.0 - pcoords[0] - pcoords[1];\n\n for (var i = 0; i < 3; i++) {\n x[i] = p0[i] * u3 + p1[i] * pcoords[0] + p2[i] * pcoords[1];\n }\n\n weights[0] = u3;\n weights[1] = pcoords[0];\n weights[2] = pcoords[1];\n };\n\n publicAPI.getParametricDistance = function (pcoords) {\n var pDist;\n var pDistMax = 0.0;\n var pc = [];\n pc[0] = pcoords[0];\n pc[1] = pcoords[1];\n pc[2] = 1.0 - pcoords[0] - pcoords[1];\n\n for (var i = 0; i < 3; i++) {\n if (pc[i] < 0.0) {\n pDist = -pc[i];\n } else if (pc[i] > 1.0) {\n pDist = pc[i] - 1.0;\n } else {\n // inside the cell in the parametric direction\n pDist = 0.0;\n }\n\n if (pDist > pDistMax) {\n pDistMax = pDist;\n }\n }\n\n return pDistMax;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtkTriangle(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkTriangle'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/Triangle/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Filters/General/ImageCropFilter/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Filters/General/ImageCropFilter/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/ImageData */ \"./node_modules/vtk.js/Sources/Common/DataModel/ImageData/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkImageCropFilter methods\n// ----------------------------------------------------------------------------\n\nfunction vtkImageCropFilter(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkImageCropFilter'); // --------------------------------------------------------------------------\n\n publicAPI.reset = function () {\n var data = publicAPI.getInputData();\n\n if (data) {\n publicAPI.setCroppingPlanes.apply(publicAPI, _toConsumableArray(data.getExtent()));\n }\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.requestData = function (inData, outData) {\n // implement requestData\n var input = inData[0];\n\n if (!input) {\n vtkErrorMacro('Invalid or missing input');\n return;\n }\n\n var scalars = input.getPointData().getScalars();\n\n if (!scalars) {\n vtkErrorMacro('No scalars from input');\n return;\n }\n\n var extent = input.getExtent();\n var cropped = model.croppingPlanes.length === 6 ? extent.map(function (e, i) {\n if (i % 2 === 0) {\n // min plane\n return Math.max(e, Math.round(model.croppingPlanes[i]));\n } // max plane\n\n\n return Math.min(e, Math.round(model.croppingPlanes[i]));\n }) : extent.slice();\n\n if (cropped[0] === extent[0] && cropped[1] === extent[1] && cropped[2] === extent[2] && cropped[3] === extent[3] && cropped[4] === extent[4] && cropped[5] === extent[5]) {\n var sameAsInput = vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n sameAsInput.shallowCopy(input); // Force new mtime\n\n outData[0] = sameAsInput;\n return;\n } // reorder if needed\n\n\n for (var i = 0; i < 3; ++i) {\n if (cropped[i * 2] > cropped[i * 2 + 1]) {\n var _ref = [cropped[i * 2 + 1], cropped[i * 2]];\n cropped[i * 2] = _ref[0];\n cropped[i * 2 + 1] = _ref[1];\n }\n } // restrict crop bounds based on extent bounds\n\n\n for (var _i = 0; _i < 6; _i += 2) {\n // min case\n cropped[_i] = Math.max(cropped[_i], extent[_i]); // max case\n\n cropped[_i + 1] = Math.min(cropped[_i + 1], extent[_i + 1]);\n }\n\n var numberOfComponents = scalars.getNumberOfComponents();\n var componentSize = (cropped[1] - cropped[0] + 1) * (cropped[3] - cropped[2] + 1) * (cropped[5] - cropped[4] + 1) * numberOfComponents;\n var scalarsData = scalars.getData();\n var dims = input.getDimensions();\n var jStride = numberOfComponents * dims[0];\n var kStride = numberOfComponents * dims[0] * dims[1];\n var beginOffset = (cropped[0] - extent[0]) * numberOfComponents;\n var stripSize = (cropped[1] - cropped[0] + 1) * numberOfComponents; // +1 because subarray end is exclusive\n // crop image\n\n var croppedArray = new scalarsData.constructor(componentSize);\n var index = 0;\n\n for (var k = cropped[4]; k <= cropped[5]; ++k) {\n for (var j = cropped[2]; j <= cropped[3]; ++j) {\n var begin = beginOffset + (j - extent[2]) * jStride + (k - extent[4]) * kStride;\n var end = begin + stripSize;\n var slice = scalarsData.subarray(begin, end);\n croppedArray.set(slice, index);\n index += slice.length;\n }\n }\n\n var outImage = vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance({\n extent: cropped,\n origin: input.getOrigin(),\n direction: input.getDirection(),\n spacing: input.getSpacing()\n });\n var croppedScalars = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n name: scalars.getName(),\n numberOfComponents: numberOfComponents,\n values: croppedArray\n });\n outImage.getPointData().setScalars(croppedScalars);\n outData[0] = outImage;\n };\n\n publicAPI.isResetAvailable = function () {\n if (model.croppingPlanes.length === 0) {\n return false;\n }\n\n var data = publicAPI.getInputData();\n\n if (data) {\n var originalExtent = data.getExtent();\n var findDifference = originalExtent.find(function (v, i) {\n return Math.abs(model.croppingPlanes[i] - v) > Number.EPSILON;\n });\n return findDifference !== undefined;\n }\n\n return false;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n croppingPlanes: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Make this a VTK object\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Also make it an algorithm with one input and one output\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].algo(publicAPI, model, 1, 1); // no orientation support yet\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['croppingPlanes'], 6); // Object specific methods\n\n vtkImageCropFilter(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkImageCropFilter'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Filters/General/ImageCropFilter/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Filters/Sources/PlaneSource/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Filters/Sources/PlaneSource/index.js ***! - \**************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/MatrixBuilder */ \"./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n\nvar vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkWarningMacro;\nvar EPSILON = 1e-6; // ----------------------------------------------------------------------------\n// vtkPlaneSource methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPlaneSource(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPlaneSource');\n\n publicAPI.requestData = function (inData, outData) {\n if (model.deleted) {\n return;\n }\n\n var dataset = outData[0]; // Check input\n\n var pointDataType = dataset ? dataset.getPoints().getDataType() : 'Float32Array';\n var pd = vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n var v10 = new Float32Array(3);\n var v20 = new Float32Array(3);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point1, model.origin, v10);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point2, model.origin, v20);\n\n if (!publicAPI.updatePlane(v10, v20)) {\n vtkWarningMacro('Bad plane definition');\n return;\n } // hand create a plane with special scalars\n\n\n var xres = model.xResolution;\n var yres = model.yResolution;\n var numPts = (xres + 1) * (yres + 1);\n var numPolys = xres * yres; // Points\n\n var points = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newTypedArray(pointDataType, numPts * 3);\n pd.getPoints().setData(points, 3); // Cells\n\n var polys = new Uint32Array(5 * numPolys);\n pd.getPolys().setData(polys, 1); // Normals\n\n var normalsData = new Float32Array(numPts * 3);\n var normals = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 3,\n values: normalsData,\n name: 'Normals'\n });\n pd.getPointData().setNormals(normals); // Texture coords\n\n var tcData = new Float32Array(numPts * 2);\n var tcoords = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 2,\n values: tcData,\n name: 'TextureCoordinates'\n });\n pd.getPointData().setTCoords(tcoords);\n var tc = new Float32Array(2);\n var idx = 0;\n\n for (var j = 0; j < yres + 1; j++) {\n tc[1] = j / yres;\n\n for (var i = 0; i < xres + 1; i++) {\n tc[0] = i / xres;\n points[idx * 3] = model.origin[0] + tc[0] * v10[0] + tc[1] * v20[0];\n points[idx * 3 + 1] = model.origin[1] + tc[0] * v10[1] + tc[1] * v20[1];\n points[idx * 3 + 2] = model.origin[2] + tc[0] * v10[2] + tc[1] * v20[2];\n tcData[idx * 2] = tc[0];\n tcData[idx * 2 + 1] = tc[1];\n normalsData[idx * 3] = model.normal[0];\n normalsData[idx * 3 + 1] = model.normal[1];\n normalsData[idx * 3 + 2] = model.normal[2];\n idx++;\n }\n } // Generate polygon connectivity\n //\n\n\n idx = 0;\n\n for (var _j = 0; _j < yres; _j++) {\n for (var _i = 0; _i < xres; _i++) {\n polys[idx * 5 + 0] = 4;\n polys[idx * 5 + 1] = _i + _j * (xres + 1);\n polys[idx * 5 + 2] = polys[idx * 5 + 1] + 1;\n polys[idx * 5 + 3] = polys[idx * 5 + 1] + xres + 2;\n polys[idx * 5 + 4] = polys[idx * 5 + 1] + xres + 1;\n idx++;\n }\n } // Update output\n\n\n outData[0] = pd;\n };\n\n publicAPI.setNormal = function () {\n var n = [];\n\n if (arguments.length === 1 || Array.isArray(arguments.length <= 0 ? undefined : arguments[0])) {\n n = _toConsumableArray(arguments.length <= 0 ? undefined : arguments[0]);\n } else if (arguments.length === 3) {\n n = [arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], arguments.length <= 2 ? undefined : arguments[2]];\n }\n\n if (vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"normalize\"](n) !== 0) {\n var dp = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](model.normal, n);\n var theta = 0;\n var rotationVector = [];\n\n if (dp < 1.0) {\n if (dp <= -1.0) {\n theta = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"radiansFromDegrees\"](180.0);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point1, model.origin, rotationVector);\n } else {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"cross\"](model.normal, n, rotationVector);\n theta = Math.acos(dp);\n }\n\n publicAPI.rotate(theta, rotationVector);\n }\n }\n };\n /**\n * Rotate plane around a given axis\n * @param {float} theta Angle (radian) to rotate about\n * @param {vec3} rotationAxis Axis to rotate around\n */\n\n\n publicAPI.rotate = function (angle, rotationAxis) {\n if (Math.abs(angle) < EPSILON) {\n return;\n } // Create rotation matrix\n\n\n var transform = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n var negCenter = [];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].negate(negCenter, model.center);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(transform, transform, model.center);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(transform, transform, angle, rotationAxis);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(transform, transform, negCenter);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(model.origin, model.origin, transform);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(model.point1, model.point1, transform);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(model.point2, model.point2, transform);\n vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_4__[\"default\"].buildFromRadian().rotate(angle, rotationAxis).apply(model.normal);\n publicAPI.modified();\n };\n\n publicAPI.setCenter = function () {\n var c = [];\n\n if (arguments.length === 1 || Array.isArray(arguments.length <= 0 ? undefined : arguments[0])) {\n c = _toConsumableArray(arguments.length <= 0 ? undefined : arguments[0]);\n } else if (arguments.length === 3) {\n c = [arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], arguments.length <= 2 ? undefined : arguments[2]];\n }\n\n if (!gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].exactEquals(c, model.center)) {\n var v1 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point1, model.origin, v1);\n var v2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point2, model.origin, v2);\n\n for (var i = 0; i < 3; i++) {\n model.center[i] = c[i];\n model.origin[i] = model.center[i] - 0.5 * (v1[i] + v2[i]);\n model.point1[i] = model.origin[i] + v1[i];\n model.point2[i] = model.origin[i] + v2[i];\n }\n\n publicAPI.modified();\n }\n };\n\n publicAPI.setPoint1 = function () {\n var point1 = [];\n\n if (arguments.length === 1 || Array.isArray(arguments.length <= 0 ? undefined : arguments[0])) {\n point1 = _toConsumableArray(arguments.length <= 0 ? undefined : arguments[0]);\n } else if (arguments.length === 3) {\n point1 = [arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], arguments.length <= 2 ? undefined : arguments[2]];\n }\n\n if (!gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].exactEquals(point1, model.point1)) {\n var v1 = [];\n var v2 = [];\n model.point1 = _toConsumableArray(point1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point1, model.origin, v1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point2, model.origin, v2); // set plane normal\n\n publicAPI.updatePlane(v1, v2);\n publicAPI.modified();\n }\n };\n\n publicAPI.setPoint2 = function () {\n var point2 = [];\n\n if (arguments.length === 1 || Array.isArray(arguments.length <= 0 ? undefined : arguments[0])) {\n point2 = _toConsumableArray(arguments.length <= 0 ? undefined : arguments[0]);\n } else if (arguments.length === 3) {\n point2 = [arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], arguments.length <= 2 ? undefined : arguments[2]];\n }\n\n if (!gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].exactEquals(point2, model.point2)) {\n var v1 = [];\n var v2 = [];\n model.point2 = _toConsumableArray(point2);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point1, model.origin, v1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point2, model.origin, v2); // set plane normal\n\n publicAPI.updatePlane(v1, v2);\n publicAPI.modified();\n }\n };\n\n publicAPI.updatePlane = function (v1, v2) {\n // set plane center\n for (var i = 0; i < 3; i++) {\n model.center[i] = model.origin[i] + 0.5 * (v1[i] + v2[i]);\n } // set plane normal\n\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"cross\"](v1, v2, model.normal);\n return vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"normalize\"](model.normal) !== 0.0;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n xResolution: 10,\n yResolution: 10,\n origin: [0, 0, 0],\n point1: [1, 0, 0],\n point2: [0, 1, 0],\n pointType: 'Float32Array'\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n model.normal = [0, 0, 1];\n model.center = [0, 0, 0]; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['xResolution', 'yResolution']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGetArray(publicAPI, model, ['origin'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getArray(publicAPI, model, ['point1', 'point2', 'normal', 'center'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].algo(publicAPI, model, 0, 1);\n vtkPlaneSource(publicAPI, model);\n publicAPI.setPoint1(model.point1);\n publicAPI.setPoint2(model.point2);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkPlaneSource'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Filters/Sources/PlaneSource/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Filters/Sources/SphereSource/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Filters/Sources/SphereSource/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkSphereSource methods\n// ----------------------------------------------------------------------------\n\nfunction vtkSphereSource(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkSphereSource');\n\n publicAPI.requestData = function (inData, outData) {\n if (model.deleted) {\n return;\n }\n\n var dataset = outData[0];\n var pointDataType = dataset ? dataset.getPoints().getDataType() : 'Float32Array';\n dataset = vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(); // ----------------------------------------------------------------------\n\n var numPoles = 0; // Check data, determine increments, and convert to radians\n\n var thetaResolution = model.thetaResolution;\n var startTheta = model.startTheta < model.endTheta ? model.startTheta : model.endTheta;\n startTheta *= Math.PI / 180.0;\n var endTheta = model.endTheta > model.startTheta ? model.endTheta : model.startTheta;\n endTheta *= Math.PI / 180.0;\n var startPhi = model.startPhi < model.endPhi ? model.startPhi : model.endPhi;\n startPhi *= Math.PI / 180.0;\n var endPhi = model.endPhi > model.startPhi ? model.endPhi : model.startPhi;\n endPhi *= Math.PI / 180.0;\n\n if (Math.abs(startTheta - endTheta) < 2.0 * Math.PI) {\n ++thetaResolution;\n }\n\n var deltaTheta = (endTheta - startTheta) / model.thetaResolution;\n var jStart = model.startPhi <= 0.0 ? 1 : 0;\n var jEnd = model.phiResolution + (model.endPhi >= 180.0 ? -1 : 0);\n var numPts = model.phiResolution * thetaResolution + 2;\n var numPolys = model.phiResolution * 2 * model.thetaResolution; // Points\n\n var pointIdx = 0;\n var points = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newTypedArray(pointDataType, numPts * 3); // Normals\n\n var normals = new Float32Array(numPts * 3); // Cells\n\n var cellLocation = 0;\n var polys = new Uint32Array(numPolys * 5); // Create north pole if needed\n\n if (model.startPhi <= 0.0) {\n points[pointIdx * 3 + 0] = model.center[0];\n points[pointIdx * 3 + 1] = model.center[1];\n points[pointIdx * 3 + 2] = model.center[2] + model.radius;\n normals[pointIdx * 3 + 0] = 0;\n normals[pointIdx * 3 + 1] = 0;\n normals[pointIdx * 3 + 2] = 1;\n pointIdx++;\n numPoles++;\n } // Create south pole if needed\n\n\n if (model.endPhi >= 180.0) {\n points[pointIdx * 3 + 0] = model.center[0];\n points[pointIdx * 3 + 1] = model.center[1];\n points[pointIdx * 3 + 2] = model.center[2] - model.radius;\n normals[pointIdx * 3 + 0] = 0;\n normals[pointIdx * 3 + 1] = 0;\n normals[pointIdx * 3 + 2] = -1;\n pointIdx++;\n numPoles++;\n }\n\n var phiResolution = model.phiResolution - numPoles;\n var deltaPhi = (endPhi - startPhi) / (model.phiResolution - 1); // Create intermediate points\n\n for (var i = 0; i < thetaResolution; i++) {\n var theta = startTheta + i * deltaTheta;\n\n for (var j = jStart; j < jEnd; j++) {\n var phi = startPhi + j * deltaPhi;\n var radius = model.radius * Math.sin(phi);\n normals[pointIdx * 3 + 0] = radius * Math.cos(theta);\n normals[pointIdx * 3 + 1] = radius * Math.sin(theta);\n normals[pointIdx * 3 + 2] = model.radius * Math.cos(phi);\n points[pointIdx * 3 + 0] = normals[pointIdx * 3 + 0] + model.center[0];\n points[pointIdx * 3 + 1] = normals[pointIdx * 3 + 1] + model.center[1];\n points[pointIdx * 3 + 2] = normals[pointIdx * 3 + 2] + model.center[2];\n var norm = Math.sqrt(normals[pointIdx * 3 + 0] * normals[pointIdx * 3 + 0] + normals[pointIdx * 3 + 1] * normals[pointIdx * 3 + 1] + normals[pointIdx * 3 + 2] * normals[pointIdx * 3 + 2]);\n norm = norm === 0 ? 1 : norm;\n normals[pointIdx * 3 + 0] /= norm;\n normals[pointIdx * 3 + 1] /= norm;\n normals[pointIdx * 3 + 2] /= norm;\n pointIdx++;\n }\n } // Generate mesh connectivity\n\n\n var base = phiResolution * thetaResolution;\n\n if (Math.abs(startTheta - endTheta) < 2.0 * Math.PI) {\n --thetaResolution;\n } // around north pole\n\n\n if (model.startPhi <= 0.0) {\n for (var _i = 0; _i < thetaResolution; _i++) {\n polys[cellLocation++] = 3;\n polys[cellLocation++] = phiResolution * _i + numPoles;\n polys[cellLocation++] = phiResolution * (_i + 1) % base + numPoles;\n polys[cellLocation++] = 0;\n }\n } // around south pole\n\n\n if (model.endPhi >= 180.0) {\n var numOffset = phiResolution - 1 + numPoles;\n\n for (var _i2 = 0; _i2 < thetaResolution; _i2++) {\n polys[cellLocation++] = 3;\n polys[cellLocation++] = phiResolution * _i2 + numOffset;\n polys[cellLocation++] = numPoles - 1;\n polys[cellLocation++] = phiResolution * (_i2 + 1) % base + numOffset;\n }\n } // bands in-between poles\n\n\n for (var _i3 = 0; _i3 < thetaResolution; _i3++) {\n for (var _j = 0; _j < phiResolution - 1; _j++) {\n var a = phiResolution * _i3 + _j + numPoles;\n var b = a + 1;\n var c = (phiResolution * (_i3 + 1) + _j) % base + numPoles + 1;\n\n if (!model.latLongTessellation) {\n polys[cellLocation++] = 3;\n polys[cellLocation++] = a;\n polys[cellLocation++] = b;\n polys[cellLocation++] = c;\n polys[cellLocation++] = 3;\n polys[cellLocation++] = a;\n polys[cellLocation++] = c;\n polys[cellLocation++] = c - 1;\n } else {\n polys[cellLocation++] = 4;\n polys[cellLocation++] = a;\n polys[cellLocation++] = b;\n polys[cellLocation++] = c;\n polys[cellLocation++] = c - 1;\n }\n }\n } // Squeeze\n\n\n points = points.subarray(0, pointIdx * 3);\n dataset.getPoints().setData(points, 3);\n normals = normals.subarray(0, pointIdx * 3);\n var normalArray = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n name: 'Normals',\n values: normals,\n numberOfComponents: 3\n });\n dataset.getPointData().setNormals(normalArray);\n polys = polys.subarray(0, cellLocation);\n dataset.getPolys().setData(polys, 1); // Update output\n\n outData[0] = dataset;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n radius: 0.5,\n latLongTessellation: false,\n thetaResolution: 8,\n startTheta: 0.0,\n endTheta: 360.0,\n phiResolution: 8,\n startPhi: 0.0,\n endPhi: 180.0,\n center: [0, 0, 0],\n pointType: 'Float32Array'\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['radius', 'latLongTessellation', 'thetaResolution', 'startTheta', 'endTheta', 'phiResolution', 'startPhi', 'endPhi']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['center'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].algo(publicAPI, model, 0, 1);\n vtkSphereSource(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkSphereSource'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Filters/Sources/SphereSource/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator/index.js": -/*!**************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator/index.js ***! - \**************************************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkCompositeCameraManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCompositeCameraManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCompositeCameraManipulator'); //-------------------------------------------------------------------------\n\n publicAPI.computeDisplayCenter = function (iObserver, renderer) {\n var pt = iObserver.computeWorldToDisplay(renderer, model.center[0], model.center[1], model.center[2]);\n model.displayCenter[0] = pt[0];\n model.displayCenter[1] = pt[1];\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n center: [0, 0, 0],\n rotationFactor: 1,\n displayCenter: [0, 0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['rotationFactor']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['displayCenter'], 2);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['center'], 3); // Object specific methods\n\n vtkCompositeCameraManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js ***! - \*************************************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkCompositeMouseManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCompositeMouseManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCompositeMouseManipulator');\n\n publicAPI.startInteraction = function () {};\n\n publicAPI.endInteraction = function () {};\n\n publicAPI.onButtonDown = function (interactor, renderer, position) {};\n\n publicAPI.onButtonUp = function (interactor) {};\n\n publicAPI.onMouseMove = function (interactor, renderer, position) {};\n\n publicAPI.onStartScroll = function (interactor, renderer, delta) {};\n\n publicAPI.onScroll = function (interactor, renderer, delta) {};\n\n publicAPI.onEndScroll = function (interactor) {};\n\n publicAPI.isDragEnabled = function () {\n return model.dragEnabled;\n };\n\n publicAPI.isScrollEnabled = function () {\n return model.scrollEnabled;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n button: 1,\n shift: false,\n control: false,\n alt: false,\n dragEnabled: true,\n scrollEnabled: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['button', 'shift', 'control', 'alt']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].set(publicAPI, model, ['dragEnabled', 'scrollEnabled']); // Object specific methods\n\n vtkCompositeMouseManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js": -/*!**********************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js ***! - \**********************************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeCameraManipulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkMouseCameraTrackballPanManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkMouseCameraTrackballPanManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkMouseCameraTrackballPanManipulator');\n\n publicAPI.onButtonDown = function (interactor, renderer, position) {\n model.previousPosition = position;\n };\n\n publicAPI.onMouseMove = function (interactor, renderer, position) {\n if (!position) {\n return;\n }\n\n var pos = position;\n var lastPos = model.previousPosition;\n model.previousPosition = position;\n var camera = renderer.getActiveCamera();\n var camPos = camera.getPosition();\n var fp = camera.getFocalPoint();\n\n if (camera.getParallelProjection()) {\n camera.orthogonalizeViewUp();\n var up = camera.getViewUp();\n var vpn = camera.getViewPlaneNormal();\n var right = [0, 0, 0];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"cross\"](vpn, up, right); // These are different because y is flipped.\n\n var height = interactor.getView().getSize()[1];\n var dx = (pos.x - lastPos.x) / height;\n var dy = (lastPos.y - pos.y) / height;\n var scale = camera.getParallelScale();\n dx *= scale * 2.0;\n dy *= scale * 2.0;\n var tmp = right[0] * dx + up[0] * dy;\n camPos[0] += tmp;\n fp[0] += tmp;\n tmp = right[1] * dx + up[1] * dy;\n camPos[1] += tmp;\n fp[1] += tmp;\n tmp = right[2] * dx + up[2] * dy;\n camPos[2] += tmp;\n fp[2] += tmp;\n camera.setPosition(camPos[0], camPos[1], camPos[2]);\n camera.setFocalPoint(fp[0], fp[1], fp[2]);\n } else {\n var center = model.center;\n var style = interactor.getInteractorStyle();\n var focalDepth = style.computeWorldToDisplay(renderer, center[0], center[1], center[2])[2];\n var worldPoint = style.computeDisplayToWorld(renderer, pos.x, pos.y, focalDepth);\n var lastWorldPoint = style.computeDisplayToWorld(renderer, lastPos.x, lastPos.y, focalDepth);\n var newCamPos = [camPos[0] + (lastWorldPoint[0] - worldPoint[0]), camPos[1] + (lastWorldPoint[1] - worldPoint[1]), camPos[2] + (lastWorldPoint[2] - worldPoint[2])];\n var newFp = [fp[0] + (lastWorldPoint[0] - worldPoint[0]), fp[1] + (lastWorldPoint[1] - worldPoint[1]), fp[2] + (lastWorldPoint[2] - worldPoint[2])];\n camera.setPosition(newCamPos[0], newCamPos[1], newCamPos[2]);\n camera.setFocalPoint(newFp[0], newFp[1], newFp[2]);\n }\n\n renderer.resetCameraClippingRange();\n\n if (interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_Interaction_Manipulators_CompositeCameraManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues); // Object specific methods\n\n vtkMouseCameraTrackballPanManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkMouseCameraTrackballPanManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js": -/*!*************************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js ***! - \*************************************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeCameraManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n\n\n\n // ----------------------------------------------------------------------------\n// vtkMouseCameraTrackballRotateManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkMouseCameraTrackballRotateManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkMouseCameraTrackballRotateManipulator');\n var newCamPos = new Float64Array(3);\n var newFp = new Float64Array(3);\n var newViewUp = new Float64Array(3);\n var trans = new Float64Array(16);\n var v2 = new Float64Array(3);\n var centerNeg = new Float64Array(3);\n var direction = new Float64Array(3);\n\n publicAPI.onButtonDown = function (interactor, renderer, position) {\n model.previousPosition = position;\n };\n\n publicAPI.onMouseMove = function (interactor, renderer, position) {\n if (!position) {\n return;\n }\n\n var camera = renderer.getActiveCamera();\n var cameraPos = camera.getPosition();\n var cameraFp = camera.getFocalPoint();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(trans);\n var center = model.center,\n rotationFactor = model.rotationFactor; // Translate to center\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, center);\n var dx = model.previousPosition.x - position.x;\n var dy = model.previousPosition.y - position.y;\n var size = interactor.getView().getSize(); // Azimuth\n\n var viewUp = camera.getViewUp();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(trans, trans, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"radiansFromDegrees\"](360.0 * dx / size[0] * rotationFactor), viewUp); // Elevation\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"cross\"](camera.getDirectionOfProjection(), viewUp, v2);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(trans, trans, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"radiansFromDegrees\"](-360.0 * dy / size[1] * rotationFactor), v2); // Translate back\n\n centerNeg[0] = -center[0];\n centerNeg[1] = -center[1];\n centerNeg[2] = -center[2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, centerNeg); // Apply transformation to camera position, focal point, and view up\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newCamPos, cameraPos, trans);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newFp, cameraFp, trans);\n direction[0] = viewUp[0] + cameraPos[0];\n direction[1] = viewUp[1] + cameraPos[1];\n direction[2] = viewUp[2] + cameraPos[2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newViewUp, direction, trans);\n camera.setPosition(newCamPos[0], newCamPos[1], newCamPos[2]);\n camera.setFocalPoint(newFp[0], newFp[1], newFp[2]);\n camera.setViewUp(newViewUp[0] - newCamPos[0], newViewUp[1] - newCamPos[1], newViewUp[2] - newCamPos[2]);\n camera.orthogonalizeViewUp();\n renderer.resetCameraClippingRange();\n\n if (interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n\n model.previousPosition = position;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_Interaction_Manipulators_CompositeCameraManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues); // Object specific methods\n\n vtkMouseCameraTrackballRotateManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkMouseCameraTrackballRotateManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js": -/*!***********************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js ***! - \***********************************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeCameraManipulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkMouseCameraTrackballZoomManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkMouseCameraTrackballZoomManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkMouseCameraTrackballZoomManipulator');\n\n publicAPI.onButtonDown = function (interactor, renderer, position) {\n model.previousPosition = position;\n var size = interactor.getView().getSize();\n var camera = renderer.getActiveCamera();\n var direction = model.flipDirection ? -1 : 1;\n\n if (camera.getParallelProjection()) {\n model.zoomScale = 1.5 / size[1] * direction;\n } else {\n var range = camera.getClippingRange();\n model.zoomScale = 1.5 * (range[1] / size[1]) * direction;\n }\n };\n\n publicAPI.onMouseMove = function (interactor, renderer, position) {\n if (!position) {\n return;\n }\n\n var dy = model.previousPosition.y - position.y;\n var camera = renderer.getActiveCamera();\n\n if (camera.getParallelProjection()) {\n var k = dy * model.zoomScale;\n camera.setParallelScale((1.0 - k) * camera.getParallelScale());\n } else {\n var cameraPos = camera.getPosition();\n var cameraFp = camera.getFocalPoint();\n var norm = camera.getDirectionOfProjection();\n\n var _k = dy * model.zoomScale;\n\n var tmp = _k * norm[0];\n cameraPos[0] += tmp;\n cameraFp[0] += tmp;\n tmp = _k * norm[1];\n cameraPos[1] += tmp;\n cameraFp[1] += tmp;\n tmp = _k * norm[2];\n cameraPos[2] += tmp;\n cameraFp[2] += tmp;\n\n if (!camera.getFreezeFocalPoint()) {\n camera.setFocalPoint(cameraFp[0], cameraFp[1], cameraFp[2]);\n }\n\n camera.setPosition(cameraPos[0], cameraPos[1], cameraPos[2]);\n renderer.resetCameraClippingRange();\n }\n\n if (interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n\n model.previousPosition = position;\n };\n\n publicAPI.onScroll = function (interactor, renderer, delta) {\n if (!delta) {\n return;\n }\n\n var camera = renderer.getActiveCamera();\n var dyf = 1 - delta / 10;\n\n if (camera.getParallelProjection()) {\n camera.setParallelScale(camera.getParallelScale() / dyf);\n } else {\n camera.dolly(dyf);\n renderer.resetCameraClippingRange();\n }\n\n if (interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n zoomScale: 0.0,\n flipDirection: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_Interaction_Manipulators_CompositeCameraManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['flipDirection']); // Object specific methods\n\n vtkMouseCameraTrackballZoomManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkMouseCameraTrackballZoomManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js ***! - \*********************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js\");\n\n // ----------------------------------------------------------------------------\n// vtkMouseRangeManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkMouseRangeManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkMouseRangeManipulator'); // Keep track of delta that is below the value\n // of one step to progressively increment it\n\n var incrementalDelta = new Map(); // Internal methods\n //-------------------------------------------------------------------------\n\n function scaleDeltaToRange(listener, normalizedDelta) {\n return normalizedDelta * ((listener.max - listener.min) / (listener.step + 1));\n } //-------------------------------------------------------------------------\n\n\n function processDelta(listener, delta) {\n var oldValue = listener.getValue(); // Apply scale and cached delta to current delta\n\n var newDelta = delta * listener.scale + incrementalDelta.get(listener);\n var value = oldValue + newDelta; // Compute new value based on step\n\n var difference = value - listener.min;\n var stepsToDifference = Math.round(difference / listener.step);\n value = listener.min + listener.step * stepsToDifference;\n value = Math.max(value, listener.min);\n value = Math.min(value, listener.max);\n\n if (value !== oldValue) {\n // Update value\n listener.setValue(value);\n incrementalDelta.set(listener, 0);\n } else if (value === listener.min && newDelta < 0 || value === listener.max && newDelta > 0) {\n // Do not allow incremental delta to go past range\n incrementalDelta.set(listener, 0);\n } else {\n // Store delta for the next iteration\n incrementalDelta.set(listener, newDelta);\n }\n } // Public API methods\n // min:number = minimum allowable value\n // max:number = maximum allowable value\n // step:number = value per step -- smaller = more steps over a given distance, larger = fewer steps over a given distance\n // getValue:fn = function that returns current value\n // setValue:fn = function to set value\n // scale:number = scale value is applied to mouse event to allow users accelerate or decelerate delta without emitting more events\n //-------------------------------------------------------------------------\n\n\n publicAPI.setHorizontalListener = function (min, max, step, getValue, setValue) {\n var scale = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;\n var getFn = Number.isFinite(getValue) ? function () {\n return getValue;\n } : getValue;\n model.horizontalListener = {\n min: min,\n max: max,\n step: step,\n getValue: getFn,\n setValue: setValue,\n scale: scale\n };\n incrementalDelta.set(model.horizontalListener, 0);\n publicAPI.modified();\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.setVerticalListener = function (min, max, step, getValue, setValue) {\n var scale = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;\n var getFn = Number.isFinite(getValue) ? function () {\n return getValue;\n } : getValue;\n model.verticalListener = {\n min: min,\n max: max,\n step: step,\n getValue: getFn,\n setValue: setValue,\n scale: scale\n };\n incrementalDelta.set(model.verticalListener, 0);\n publicAPI.modified();\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.setScrollListener = function (min, max, step, getValue, setValue) {\n var scale = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;\n var getFn = Number.isFinite(getValue) ? function () {\n return getValue;\n } : getValue;\n model.scrollListener = {\n min: min,\n max: max,\n step: step,\n getValue: getFn,\n setValue: setValue,\n scale: scale\n };\n incrementalDelta.set(model.scrollListener, 0);\n publicAPI.modified();\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeHorizontalListener = function () {\n if (model.verticalListener) {\n incrementalDelta.delete(model.verticalListener);\n delete model.verticalListener;\n publicAPI.modified();\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeVerticalListener = function () {\n if (model.horizontalListener) {\n incrementalDelta.delete(model.horizontalListener);\n delete model.horizontalListener;\n publicAPI.modified();\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeScrollListener = function () {\n if (model.scrollListener) {\n incrementalDelta.delete(model.scrollListener);\n delete model.scrollListener;\n publicAPI.modified();\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeAllListeners = function () {\n publicAPI.removeHorizontalListener();\n publicAPI.removeVerticalListener();\n publicAPI.removeScrollListener();\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.onButtonDown = function (interactor, renderer, position) {\n model.previousPosition = position;\n var glRenderWindow = interactor.getView(); // Ratio is the dom size vs renderwindow size\n\n var ratio = glRenderWindow.getContainerSize()[0] / glRenderWindow.getSize()[0]; // Get proper pixel range used by viewport in rw size space\n\n var size = glRenderWindow.getViewportSize(renderer); // rescale size to match mouse event position\n\n model.containerSize = size.map(function (v) {\n return v * ratio;\n });\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.onMouseMove = function (interactor, renderer, position) {\n if (!model.verticalListener && !model.horizontalListener) {\n return;\n }\n\n if (!position) {\n return;\n }\n\n if (model.horizontalListener) {\n var dxNorm = (position.x - model.previousPosition.x) / model.containerSize[0];\n var dx = scaleDeltaToRange(model.horizontalListener, dxNorm);\n processDelta(model.horizontalListener, dx);\n }\n\n if (model.verticalListener) {\n var dyNorm = (position.y - model.previousPosition.y) / model.containerSize[1];\n var dy = scaleDeltaToRange(model.verticalListener, dyNorm);\n processDelta(model.verticalListener, dy);\n }\n\n model.previousPosition = position;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.onScroll = function (interactor, renderer, delta) {\n if (!model.scrollListener || !delta) {\n return;\n }\n\n processDelta(model.scrollListener, delta * model.scrollListener.step);\n };\n\n publicAPI.onStartScroll = publicAPI.onScroll;\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n horizontalListener: null,\n verticalListener: null,\n scrollListener: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object specific methods\n\n vtkMouseRangeManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkMouseRangeManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleManipulator/index.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleManipulator/index.js ***! - \*******************************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkDebugMacro;\nvar States = vtk_js_Sources_Rendering_Core_InteractorStyle__WEBPACK_IMPORTED_MODULE_1__[\"default\"].States; // ----------------------------------------------------------------------------\n// Event Types\n// ----------------------------------------------------------------------------\n\nvar START_INTERACTION_EVENT = {\n type: 'StartInteractionEvent'\n};\nvar INTERACTION_EVENT = {\n type: 'InteractionEvent'\n};\nvar END_INTERACTION_EVENT = {\n type: 'EndInteractionEvent'\n}; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction translateCamera(renderer, rwi, toX, toY, fromX, fromY) {\n var cam = renderer.getActiveCamera();\n var viewFocus = cam.getFocalPoint();\n viewFocus = rwi.getInteractorStyle().computeWorldToDisplay(renderer, viewFocus[0], viewFocus[1], viewFocus[2]);\n var focalDepth = viewFocus[2];\n var newPickPoint = rwi.getInteractorStyle().computeDisplayToWorld(renderer, toX, toY, focalDepth);\n var oldPickPoint = rwi.getInteractorStyle().computeDisplayToWorld(renderer, fromX, fromY, focalDepth); // camera motion is reversed\n\n var motionVector = [oldPickPoint[0] - newPickPoint[0], oldPickPoint[1] - newPickPoint[1], oldPickPoint[2] - newPickPoint[2]];\n viewFocus = cam.getFocalPoint();\n var viewPoint = cam.getPosition();\n cam.setFocalPoint(motionVector[0] + viewFocus[0], motionVector[1] + viewFocus[1], motionVector[2] + viewFocus[2]);\n cam.setPosition(motionVector[0] + viewPoint[0], motionVector[1] + viewPoint[1], motionVector[2] + viewPoint[2]);\n}\n\nfunction dollyToPosition(fact, position, renderer, rwi) {\n var cam = renderer.getActiveCamera();\n\n if (cam.getParallelProjection()) {\n // Zoom relatively to the cursor\n var aSize = rwi.getView().getSize();\n var w = aSize[0];\n var h = aSize[1];\n var x0 = w / 2;\n var y0 = h / 2;\n var x1 = position.x;\n var y1 = position.y;\n translateCamera(renderer, rwi, x0, y0, x1, y1);\n cam.setParallelScale(cam.getParallelScale() / fact);\n translateCamera(renderer, rwi, x1, y1, x0, y0);\n } else {\n // Zoom relatively to the cursor position\n // Move focal point to cursor position\n var viewFocus = cam.getFocalPoint();\n var norm = cam.getViewPlaneNormal();\n viewFocus = rwi.getInteractorStyle().computeWorldToDisplay(renderer, viewFocus[0], viewFocus[1], viewFocus[2]);\n var newFp = rwi.getInteractorStyle().computeDisplayToWorld(renderer, position.x, position.y, viewFocus[2]);\n cam.setFocalPoint(newFp[0], newFp[1], newFp[2]); // Move camera in/out along projection direction\n\n cam.dolly(fact);\n renderer.resetCameraClippingRange(); // Find new focal point\n\n var newCameraPos = cam.getPosition();\n viewFocus = cam.getFocalPoint();\n var newPoint = [0, 0, 0];\n var t = norm[0] * (viewFocus[0] - newCameraPos[0]) + norm[1] * (viewFocus[1] - newCameraPos[1]) + norm[2] * (viewFocus[2] - newCameraPos[2]);\n t /= Math.pow(norm[0], 2) + Math.pow(norm[1], 2) + Math.pow(norm[2], 2);\n newPoint[0] = newCameraPos[0] + norm[0] * t;\n newPoint[1] = newCameraPos[1] + norm[1] * t;\n newPoint[2] = newCameraPos[2] + norm[2] * t;\n cam.setFocalPoint(newPoint[0], newPoint[1], newPoint[2]);\n renderer.resetCameraClippingRange();\n }\n}\n\nfunction dollyByFactor(interactor, renderer, factor) {\n if (Number.isNaN(factor)) {\n return;\n }\n\n var camera = renderer.getActiveCamera();\n\n if (camera.getParallelProjection()) {\n camera.setParallelScale(camera.getParallelScale() / factor);\n } else {\n camera.dolly(factor);\n renderer.resetCameraClippingRange();\n }\n\n if (interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n dollyToPosition: dollyToPosition,\n translateCamera: translateCamera,\n dollyByFactor: dollyByFactor\n}; // ----------------------------------------------------------------------------\n// vtkInteractorStyleManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyleManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkInteractorStyleManipulator');\n model.mouseManipulators = [];\n model.keyboardManipulators = [];\n model.vrManipulators = [];\n model.gestureManipulators = [];\n model.currentManipulator = null;\n model.currentWheelManipulator = null;\n model.centerOfRotation = [0, 0, 0];\n model.rotationFactor = 1; //-------------------------------------------------------------------------\n\n publicAPI.removeAllManipulators = function () {\n publicAPI.removeAllMouseManipulators();\n publicAPI.removeAllKeyboardManipulators();\n publicAPI.removeAllVRManipulators();\n publicAPI.removeAllGestureManipulators();\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeAllMouseManipulators = function () {\n model.mouseManipulators = [];\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeAllKeyboardManipulators = function () {\n model.keyboardManipulators = [];\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeAllVRManipulators = function () {\n model.vrManipulators = [];\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeAllGestureManipulators = function () {\n model.gestureManipulators = [];\n }; //-------------------------------------------------------------------------\n\n\n var removeManipulator = function removeManipulator(manipulator, list) {\n var index = list.indexOf(manipulator);\n\n if (index === -1) {\n return false;\n }\n\n list.splice(index, 1);\n publicAPI.modified();\n return true;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeMouseManipulator = function (manipulator) {\n return removeManipulator(manipulator, model.mouseManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeKeyboardManipulator = function (manipulator) {\n return removeManipulator(manipulator, model.keyboardManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeVRManipulator = function (manipulator) {\n return removeManipulator(manipulator, model.vrManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeGestureManipulator = function (manipulator) {\n return removeManipulator(manipulator, model.gestureManipulators);\n }; //-------------------------------------------------------------------------\n\n\n var addManipulator = function addManipulator(manipulator, list) {\n var index = list.indexOf(manipulator);\n\n if (index !== -1) {\n return false;\n }\n\n list.push(manipulator);\n publicAPI.modified();\n return true;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.addMouseManipulator = function (manipulator) {\n return addManipulator(manipulator, model.mouseManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.addKeyboardManipulator = function (manipulator) {\n return addManipulator(manipulator, model.keyboardManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.addVRManipulator = function (manipulator) {\n return addManipulator(manipulator, model.vrManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.addGestureManipulator = function (manipulator) {\n return addManipulator(manipulator, model.gestureManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfMouseManipulators = function () {\n return model.mouseManipulators.length;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfKeyboardManipulators = function () {\n return model.keyboardManipulators.length;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfVRManipulators = function () {\n return model.vrManipulators.length;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfGestureManipulators = function () {\n return model.gestureManipulators.length;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.resetCurrentManipulator = function () {\n model.currentManipulator = null;\n model.currentWheelManipulator = null;\n }; //-------------------------------------------------------------------------\n // Mouse\n //-------------------------------------------------------------------------\n\n\n publicAPI.handleLeftButtonPress = function (callData) {\n model.previousPosition = callData.position;\n publicAPI.onButtonDown(1, callData);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleMiddleButtonPress = function (callData) {\n model.previousPosition = callData.position;\n publicAPI.onButtonDown(2, callData);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleRightButtonPress = function (callData) {\n model.previousPosition = callData.position;\n publicAPI.onButtonDown(3, callData);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleButton3D = function (ed) {\n if (!ed) {\n return;\n } // Look for a matching 3D camera interactor.\n\n\n model.currentManipulator = publicAPI.findVRManipulator(ed.device, ed.input, ed.pressed);\n\n if (model.currentManipulator) {\n model.currentManipulator.onButton3D(publicAPI, ed.pokedRenderer, model.state, ed.device, ed.input, ed.pressed);\n\n if (ed.pressed) {\n publicAPI.startCameraPose();\n } else {\n publicAPI.endCameraPose();\n }\n } else {\n vtkDebugMacro('No manipulator found');\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleMove3D = function (ed) {\n if (model.currentManipulator && model.state === States.IS_CAMERA_POSE) {\n model.currentManipulator.onMove3D(publicAPI, ed.pokedRenderer, model.state, ed);\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.onButtonDown = function (button, callData) {\n // Must not be processing an interaction to start another.\n if (model.currentManipulator) {\n return;\n } // Look for a matching camera interactor.\n\n\n model.currentManipulator = publicAPI.findMouseManipulator(button, callData.shiftKey, callData.controlKey, callData.altKey);\n\n if (model.currentManipulator) {\n if (model.currentManipulator.setCenter) {\n model.currentManipulator.setCenter(model.centerOfRotation);\n }\n\n if (model.currentManipulator.setRotationFactor) {\n model.currentManipulator.setRotationFactor(model.rotationFactor);\n }\n\n model.currentManipulator.startInteraction();\n model.currentManipulator.onButtonDown(model.interactor, callData.pokedRenderer, callData.position);\n model.interactor.requestAnimation(publicAPI.onButtonDown);\n publicAPI.invokeStartInteractionEvent(START_INTERACTION_EVENT);\n } else {\n vtkDebugMacro('No manipulator found');\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.findMouseManipulator = function (button, shift, control, alt) {\n // Look for a matching camera manipulator\n var manipulator = null;\n var count = model.mouseManipulators.length;\n\n while (count--) {\n var manip = model.mouseManipulators[count];\n\n if (manip && manip.getButton() === button && manip.getShift() === shift && manip.getControl() === control && manip.getAlt() === alt && manip.isDragEnabled()) {\n manipulator = manip;\n }\n }\n\n return manipulator;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.findVRManipulator = function (device, input) {\n // Look for a matching camera manipulator\n var manipulator = null;\n var count = model.vrManipulators.length;\n\n while (count--) {\n var manip = model.vrManipulators[count];\n\n if (manip && manip.getDevice() === device && manip.getInput() === input) {\n manipulator = manip;\n }\n }\n\n return manipulator;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleLeftButtonRelease = function () {\n publicAPI.onButtonUp(1);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleMiddleButtonRelease = function () {\n publicAPI.onButtonUp(2);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleRightButtonRelease = function () {\n publicAPI.onButtonUp(3);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.onButtonUp = function (button) {\n if (!model.currentManipulator) {\n return;\n }\n\n if (model.currentManipulator.getButton && model.currentManipulator.getButton() === button) {\n model.currentManipulator.onButtonUp(model.interactor);\n model.currentManipulator.endInteraction();\n model.currentManipulator = null;\n model.interactor.cancelAnimation(publicAPI.onButtonDown);\n publicAPI.invokeEndInteractionEvent(END_INTERACTION_EVENT);\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleStartMouseWheel = function (callData) {\n // Must not be processing a wheel interaction to start another.\n if (model.currentWheelManipulator) {\n return;\n }\n\n var manipulator = null;\n var count = model.mouseManipulators.length;\n\n while (count--) {\n var manip = model.mouseManipulators[count];\n\n if (manip && manip.isScrollEnabled() && manip.getShift() === callData.shiftKey && manip.getControl() === callData.controlKey && manip.getAlt() === callData.altKey) {\n manipulator = manip;\n }\n }\n\n if (manipulator) {\n model.currentWheelManipulator = manipulator;\n model.currentWheelManipulator.onStartScroll(model.interactor, callData.pokedRenderer, callData.spinY);\n model.currentWheelManipulator.startInteraction();\n model.interactor.requestAnimation(publicAPI.handleStartMouseWheel);\n publicAPI.invokeStartInteractionEvent(START_INTERACTION_EVENT);\n } else {\n vtkDebugMacro('No manipulator found');\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleEndMouseWheel = function () {\n if (!model.currentWheelManipulator) {\n return;\n }\n\n if (model.currentWheelManipulator.onEndScroll) {\n model.currentWheelManipulator.onEndScroll(model.interactor);\n model.currentWheelManipulator.endInteraction();\n model.currentWheelManipulator = null;\n model.interactor.cancelAnimation(publicAPI.handleStartMouseWheel);\n publicAPI.invokeEndInteractionEvent(END_INTERACTION_EVENT);\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleMouseWheel = function (callData) {\n if (model.currentWheelManipulator && model.currentWheelManipulator.onScroll) {\n model.currentWheelManipulator.onScroll(model.interactor, callData.pokedRenderer, callData.spinY, model.cachedMousePosition);\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleMouseMove = function (callData) {\n model.cachedMousePosition = callData.position;\n\n if (model.currentManipulator && model.currentManipulator.onMouseMove) {\n model.currentManipulator.onMouseMove(model.interactor, callData.pokedRenderer, callData.position);\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n }\n }; //-------------------------------------------------------------------------\n // Keyboard\n //-------------------------------------------------------------------------\n\n\n publicAPI.handleKeyPress = function (callData) {\n model.keyboardManipulators.filter(function (m) {\n return m.onKeyPress;\n }).forEach(function (manipulator) {\n manipulator.onKeyPress(model.interactor, callData.pokedRenderer, callData.key);\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n });\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleKeyDown = function (callData) {\n model.keyboardManipulators.filter(function (m) {\n return m.onKeyDown;\n }).forEach(function (manipulator) {\n manipulator.onKeyDown(model.interactor, callData.pokedRenderer, callData.key);\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n });\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleKeyUp = function (callData) {\n model.keyboardManipulators.filter(function (m) {\n return m.onKeyUp;\n }).forEach(function (manipulator) {\n manipulator.onKeyUp(model.interactor, callData.pokedRenderer, callData.key);\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n });\n }; //-------------------------------------------------------------------------\n // Gesture\n //-------------------------------------------------------------------------\n\n\n publicAPI.handleStartPinch = function (callData) {\n publicAPI.startDolly();\n var count = model.gestureManipulators.length;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isPinchEnabled()) {\n manipulator.onStartPinch(model.interactor, callData.scale);\n manipulator.startInteraction();\n }\n }\n\n model.interactor.requestAnimation(publicAPI.handleStartPinch);\n publicAPI.invokeStartInteractionEvent(START_INTERACTION_EVENT);\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndPinch = function () {\n publicAPI.endDolly();\n var count = model.gestureManipulators.length;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isPinchEnabled()) {\n manipulator.onEndPinch(model.interactor);\n manipulator.endInteraction();\n }\n }\n\n model.interactor.cancelAnimation(publicAPI.handleStartPinch);\n publicAPI.invokeEndInteractionEvent(END_INTERACTION_EVENT);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleStartRotate = function (callData) {\n publicAPI.startRotate();\n var count = model.gestureManipulators.length;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isRotateEnabled()) {\n manipulator.onStartRotate(model.interactor, callData.rotation);\n manipulator.startInteraction();\n }\n }\n\n model.interactor.requestAnimation(publicAPI.handleStartRotate);\n publicAPI.invokeStartInteractionEvent(START_INTERACTION_EVENT);\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndRotate = function () {\n publicAPI.endRotate();\n var count = model.gestureManipulators.length;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isRotateEnabled()) {\n manipulator.onEndRotate(model.interactor);\n manipulator.endInteraction();\n }\n }\n\n model.interactor.cancelAnimation(publicAPI.handleStartRotate);\n publicAPI.invokeEndInteractionEvent(END_INTERACTION_EVENT);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleStartPan = function (callData) {\n publicAPI.startPan();\n var count = model.gestureManipulators.length;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isPanEnabled()) {\n manipulator.onStartPan(model.interactor, callData.translation);\n manipulator.startInteraction();\n }\n }\n\n model.interactor.requestAnimation(publicAPI.handleStartPan);\n publicAPI.invokeStartInteractionEvent(START_INTERACTION_EVENT);\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndPan = function () {\n publicAPI.endPan();\n var count = model.gestureManipulators.length;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isPanEnabled()) {\n manipulator.onEndPan(model.interactor);\n manipulator.endInteraction();\n }\n }\n\n model.interactor.cancelAnimation(publicAPI.handleStartPan);\n publicAPI.invokeEndInteractionEvent(END_INTERACTION_EVENT);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handlePinch = function (callData) {\n var count = model.gestureManipulators.length;\n var actionCount = 0;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isPinchEnabled()) {\n manipulator.onPinch(model.interactor, callData.pokedRenderer, callData.scale);\n actionCount++;\n }\n }\n\n if (actionCount) {\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handlePan = function (callData) {\n var count = model.gestureManipulators.length;\n var actionCount = 0;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isPanEnabled()) {\n manipulator.onPan(model.interactor, callData.pokedRenderer, callData.translation);\n actionCount++;\n }\n }\n\n if (actionCount) {\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleRotate = function (callData) {\n var count = model.gestureManipulators.length;\n var actionCount = 0;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isRotateEnabled()) {\n manipulator.onRotate(model.interactor, callData.pokedRenderer, callData.rotation);\n actionCount++;\n }\n }\n\n if (actionCount) {\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n cachedMousePosition: null,\n currentManipulator: null,\n currentWheelManipulator: null,\n // mouseManipulators: null,\n // keyboardManipulators: null,\n // vrManipulators: null,\n // gestureManipulators: null,\n centerOfRotation: [0, 0, 0],\n rotationFactor: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_InteractorStyle__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['rotationFactor']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['mouseManipulators', 'keyboardManipulators', 'vrManipulators', 'gestureManipulators']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['centerOfRotation'], 3); // Object specific methods\n\n vtkInteractorStyleManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkInteractorStyleManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleTrackballCamera/index.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleTrackballCamera/index.js ***! - \***********************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants.js\");\n\n\n\n\n\nvar States = vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].States;\n/* eslint-disable no-lonely-if */\n// ----------------------------------------------------------------------------\n// vtkInteractorStyleTrackballCamera methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyleTrackballCamera(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkInteractorStyleTrackballCamera'); // Public API methods\n\n publicAPI.handleMouseMove = function (callData) {\n var pos = callData.position;\n var renderer = callData.pokedRenderer;\n\n switch (model.state) {\n case States.IS_ROTATE:\n publicAPI.handleMouseRotate(renderer, pos);\n publicAPI.invokeInteractionEvent({\n type: 'InteractionEvent'\n });\n break;\n\n case States.IS_PAN:\n publicAPI.handleMousePan(renderer, pos);\n publicAPI.invokeInteractionEvent({\n type: 'InteractionEvent'\n });\n break;\n\n case States.IS_DOLLY:\n publicAPI.handleMouseDolly(renderer, pos);\n publicAPI.invokeInteractionEvent({\n type: 'InteractionEvent'\n });\n break;\n\n case States.IS_SPIN:\n publicAPI.handleMouseSpin(renderer, pos);\n publicAPI.invokeInteractionEvent({\n type: 'InteractionEvent'\n });\n break;\n\n default:\n break;\n }\n\n model.previousPosition = pos;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleButton3D = function (ed) {\n if (ed && ed.pressed && ed.device === vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_4__[\"Device\"].RightController && ed.input === vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_4__[\"Input\"].TrackPad) {\n publicAPI.startCameraPose();\n return;\n }\n\n if (ed && !ed.pressed && ed.device === vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_4__[\"Device\"].RightController && ed.input === vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_4__[\"Input\"].TrackPad && model.state === States.IS_CAMERA_POSE) {\n publicAPI.endCameraPose(); // return;\n }\n };\n\n publicAPI.handleMove3D = function (ed) {\n switch (model.state) {\n case States.IS_CAMERA_POSE:\n publicAPI.updateCameraPose(ed);\n break;\n\n default:\n }\n };\n\n publicAPI.updateCameraPose = function (ed) {\n // move the world in the direction of the\n // controller\n var camera = ed.pokedRenderer.getActiveCamera();\n var oldTrans = camera.getPhysicalTranslation(); // look at the y axis to determine how fast / what direction to move\n\n var speed = ed.gamepad.axes[1]; // 0.05 meters / frame movement\n\n var pscale = speed * 0.05 / camera.getPhysicalScale(); // convert orientation to world coordinate direction\n\n var dir = camera.physicalOrientationToWorldDirection(ed.orientation);\n camera.setPhysicalTranslation(oldTrans[0] + dir[0] * pscale, oldTrans[1] + dir[1] * pscale, oldTrans[2] + dir[2] * pscale);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleLeftButtonPress = function (callData) {\n var pos = callData.position;\n model.previousPosition = pos;\n\n if (callData.shiftKey) {\n if (callData.controlKey || callData.altKey) {\n publicAPI.startDolly();\n } else {\n publicAPI.startPan();\n }\n } else {\n if (callData.controlKey || callData.altKey) {\n publicAPI.startSpin();\n } else {\n publicAPI.startRotate();\n }\n }\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleLeftButtonRelease = function () {\n switch (model.state) {\n case States.IS_DOLLY:\n publicAPI.endDolly();\n break;\n\n case States.IS_PAN:\n publicAPI.endPan();\n break;\n\n case States.IS_SPIN:\n publicAPI.endSpin();\n break;\n\n case States.IS_ROTATE:\n publicAPI.endRotate();\n break;\n\n default:\n break;\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleStartMouseWheel = function (callData) {\n publicAPI.startDolly();\n publicAPI.handleMouseWheel(callData);\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndMouseWheel = function () {\n publicAPI.endDolly();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleStartPinch = function (callData) {\n model.previousScale = callData.scale;\n publicAPI.startDolly();\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndPinch = function () {\n publicAPI.endDolly();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleStartRotate = function (callData) {\n model.previousRotation = callData.rotation;\n publicAPI.startRotate();\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndRotate = function () {\n publicAPI.endRotate();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleStartPan = function (callData) {\n model.previousTranslation = callData.translation;\n publicAPI.startPan();\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndPan = function () {\n publicAPI.endPan();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handlePinch = function (callData) {\n publicAPI.dollyByFactor(callData.pokedRenderer, callData.scale / model.previousScale);\n model.previousScale = callData.scale;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handlePan = function (callData) {\n var camera = callData.pokedRenderer.getActiveCamera(); // Calculate the focal depth since we'll be using it a lot\n\n var viewFocus = camera.getFocalPoint();\n viewFocus = publicAPI.computeWorldToDisplay(callData.pokedRenderer, viewFocus[0], viewFocus[1], viewFocus[2]);\n var focalDepth = viewFocus[2];\n var trans = callData.translation;\n var lastTrans = model.previousTranslation;\n var newPickPoint = publicAPI.computeDisplayToWorld(callData.pokedRenderer, viewFocus[0] + trans[0] - lastTrans[0], viewFocus[1] + trans[1] - lastTrans[1], focalDepth); // Has to recalc old mouse point since the viewport has moved,\n // so can't move it outside the loop\n\n var oldPickPoint = publicAPI.computeDisplayToWorld(callData.pokedRenderer, viewFocus[0], viewFocus[1], focalDepth); // Camera motion is reversed\n\n var motionVector = [];\n motionVector[0] = oldPickPoint[0] - newPickPoint[0];\n motionVector[1] = oldPickPoint[1] - newPickPoint[1];\n motionVector[2] = oldPickPoint[2] - newPickPoint[2];\n viewFocus = camera.getFocalPoint();\n var viewPoint = camera.getPosition();\n camera.setFocalPoint(motionVector[0] + viewFocus[0], motionVector[1] + viewFocus[1], motionVector[2] + viewFocus[2]);\n camera.setPosition(motionVector[0] + viewPoint[0], motionVector[1] + viewPoint[1], motionVector[2] + viewPoint[2]);\n\n if (model.interactor.getLightFollowCamera()) {\n callData.pokedRenderer.updateLightsGeometryToFollowCamera();\n }\n\n camera.orthogonalizeViewUp();\n model.previousTranslation = callData.translation;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleRotate = function (callData) {\n var camera = callData.pokedRenderer.getActiveCamera();\n camera.roll(callData.rotation - model.previousRotation);\n camera.orthogonalizeViewUp();\n model.previousRotation = callData.rotation;\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleMouseRotate = function (renderer, position) {\n var rwi = model.interactor;\n var dx = position.x - model.previousPosition.x;\n var dy = position.y - model.previousPosition.y;\n var size = rwi.getView().getViewportSize(renderer);\n var deltaElevation = -0.1;\n var deltaAzimuth = -0.1;\n\n if (size[0] && size[1]) {\n deltaElevation = -20.0 / size[1];\n deltaAzimuth = -20.0 / size[0];\n }\n\n var rxf = dx * deltaAzimuth * model.motionFactor;\n var ryf = dy * deltaElevation * model.motionFactor;\n var camera = renderer.getActiveCamera();\n\n if (!Number.isNaN(rxf) && !Number.isNaN(ryf)) {\n camera.azimuth(rxf);\n camera.elevation(ryf);\n camera.orthogonalizeViewUp();\n }\n\n if (model.autoAdjustCameraClippingRange) {\n renderer.resetCameraClippingRange();\n }\n\n if (rwi.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleMouseSpin = function (renderer, position) {\n var rwi = model.interactor;\n var camera = renderer.getActiveCamera();\n var center = rwi.getView().getViewportCenter(renderer);\n var oldAngle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"degreesFromRadians\"](Math.atan2(model.previousPosition.y - center[1], model.previousPosition.x - center[0]));\n var newAngle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"degreesFromRadians\"](Math.atan2(position.y - center[1], position.x - center[0])) - oldAngle;\n\n if (!Number.isNaN(newAngle)) {\n camera.roll(newAngle);\n camera.orthogonalizeViewUp();\n }\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleMousePan = function (renderer, position) {\n var camera = renderer.getActiveCamera(); // Calculate the focal depth since we'll be using it a lot\n\n var viewFocus = camera.getFocalPoint();\n viewFocus = publicAPI.computeWorldToDisplay(renderer, viewFocus[0], viewFocus[1], viewFocus[2]);\n var focalDepth = viewFocus[2];\n var newPickPoint = publicAPI.computeDisplayToWorld(renderer, position.x, position.y, focalDepth); // Has to recalc old mouse point since the viewport has moved,\n // so can't move it outside the loop\n\n var oldPickPoint = publicAPI.computeDisplayToWorld(renderer, model.previousPosition.x, model.previousPosition.y, focalDepth); // Camera motion is reversed\n\n var motionVector = [];\n motionVector[0] = oldPickPoint[0] - newPickPoint[0];\n motionVector[1] = oldPickPoint[1] - newPickPoint[1];\n motionVector[2] = oldPickPoint[2] - newPickPoint[2];\n viewFocus = camera.getFocalPoint();\n var viewPoint = camera.getPosition();\n camera.setFocalPoint(motionVector[0] + viewFocus[0], motionVector[1] + viewFocus[1], motionVector[2] + viewFocus[2]);\n camera.setPosition(motionVector[0] + viewPoint[0], motionVector[1] + viewPoint[1], motionVector[2] + viewPoint[2]);\n\n if (model.interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleMouseDolly = function (renderer, position) {\n var dy = position.y - model.previousPosition.y;\n var rwi = model.interactor;\n var center = rwi.getView().getViewportCenter(renderer);\n var dyf = model.motionFactor * dy / center[1];\n publicAPI.dollyByFactor(renderer, Math.pow(1.1, dyf));\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleMouseWheel = function (callData) {\n var dyf = 1 - callData.spinY / 10; // divide by 10 to lower the zoom factor\n\n publicAPI.dollyByFactor(callData.pokedRenderer, dyf);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.dollyByFactor = function (renderer, factor) {\n if (Number.isNaN(factor)) {\n return;\n }\n\n var camera = renderer.getActiveCamera();\n\n if (camera.getParallelProjection()) {\n camera.setParallelScale(camera.getParallelScale() / factor);\n } else {\n camera.dolly(factor);\n\n if (model.autoAdjustCameraClippingRange) {\n renderer.resetCameraClippingRange();\n }\n }\n\n if (model.interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n motionFactor: 10.0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_InteractorStyle__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['motionFactor']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkInteractorStyleTrackballCamera(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkInteractorStyleTrackballCamera'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleTrackballCamera/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js": -/*!************************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js ***! - \************************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Worker_fn; });\n/* harmony import */ var _worker_loader_dist_runtime_inline_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../../worker-loader/dist/runtime/inline.js */ \"./node_modules/worker-loader/dist/runtime/inline.js\");\n/* harmony import */ var _worker_loader_dist_runtime_inline_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_worker_loader_dist_runtime_inline_js__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction Worker_fn() {\n return _worker_loader_dist_runtime_inline_js__WEBPACK_IMPORTED_MODULE_0___default()(\"/******/ (function(modules) { // webpackBootstrap\\n/******/ \\t// The module cache\\n/******/ \\tvar installedModules = {};\\n/******/\\n/******/ \\t// The require function\\n/******/ \\tfunction __webpack_require__(moduleId) {\\n/******/\\n/******/ \\t\\t// Check if module is in cache\\n/******/ \\t\\tif(installedModules[moduleId]) {\\n/******/ \\t\\t\\treturn installedModules[moduleId].exports;\\n/******/ \\t\\t}\\n/******/ \\t\\t// Create a new module (and put it into the cache)\\n/******/ \\t\\tvar module = installedModules[moduleId] = {\\n/******/ \\t\\t\\ti: moduleId,\\n/******/ \\t\\t\\tl: false,\\n/******/ \\t\\t\\texports: {}\\n/******/ \\t\\t};\\n/******/\\n/******/ \\t\\t// Execute the module function\\n/******/ \\t\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\n/******/\\n/******/ \\t\\t// Flag the module as loaded\\n/******/ \\t\\tmodule.l = true;\\n/******/\\n/******/ \\t\\t// Return the exports of the module\\n/******/ \\t\\treturn module.exports;\\n/******/ \\t}\\n/******/\\n/******/\\n/******/ \\t// expose the modules object (__webpack_modules__)\\n/******/ \\t__webpack_require__.m = modules;\\n/******/\\n/******/ \\t// expose the module cache\\n/******/ \\t__webpack_require__.c = installedModules;\\n/******/\\n/******/ \\t// define getter function for harmony exports\\n/******/ \\t__webpack_require__.d = function(exports, name, getter) {\\n/******/ \\t\\tif(!__webpack_require__.o(exports, name)) {\\n/******/ \\t\\t\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\n/******/ \\t\\t}\\n/******/ \\t};\\n/******/\\n/******/ \\t// define __esModule on exports\\n/******/ \\t__webpack_require__.r = function(exports) {\\n/******/ \\t\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\n/******/ \\t\\t\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\n/******/ \\t\\t}\\n/******/ \\t\\tObject.defineProperty(exports, '__esModule', { value: true });\\n/******/ \\t};\\n/******/\\n/******/ \\t// create a fake namespace object\\n/******/ \\t// mode & 1: value is a module id, require it\\n/******/ \\t// mode & 2: merge all properties of value into the ns\\n/******/ \\t// mode & 4: return value when already ns object\\n/******/ \\t// mode & 8|1: behave like require\\n/******/ \\t__webpack_require__.t = function(value, mode) {\\n/******/ \\t\\tif(mode & 1) value = __webpack_require__(value);\\n/******/ \\t\\tif(mode & 8) return value;\\n/******/ \\t\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\n/******/ \\t\\tvar ns = Object.create(null);\\n/******/ \\t\\t__webpack_require__.r(ns);\\n/******/ \\t\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\n/******/ \\t\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\n/******/ \\t\\treturn ns;\\n/******/ \\t};\\n/******/\\n/******/ \\t// getDefaultExport function for compatibility with non-harmony modules\\n/******/ \\t__webpack_require__.n = function(module) {\\n/******/ \\t\\tvar getter = module && module.__esModule ?\\n/******/ \\t\\t\\tfunction getDefault() { return module['default']; } :\\n/******/ \\t\\t\\tfunction getModuleExports() { return module; };\\n/******/ \\t\\t__webpack_require__.d(getter, 'a', getter);\\n/******/ \\t\\treturn getter;\\n/******/ \\t};\\n/******/\\n/******/ \\t// Object.prototype.hasOwnProperty.call\\n/******/ \\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\n/******/\\n/******/ \\t// __webpack_public_path__\\n/******/ \\t__webpack_require__.p = \\\"\\\";\\n/******/\\n/******/\\n/******/ \\t// Load entry module and return exports\\n/******/ \\treturn __webpack_require__(__webpack_require__.s = \\\"./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js\\\");\\n/******/ })\\n/************************************************************************/\\n/******/ ({\\n\\n/***/ \\\"./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js\\\":\\n/*!************************************************************************************************************!*\\\\\\n !*** ./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js ***!\\n \\\\************************************************************************************************************/\\n/*! no exports provided */\\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\\n\\n\\\"use strict\\\";\\neval(\\\"__webpack_require__.r(__webpack_exports__);\\\\n/* harmony import */ var webworker_promise_lib_register__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! webworker-promise/lib/register */ \\\\\\\"./node_modules/webworker-promise/lib/register.js\\\\\\\");\\\\n/* harmony import */ var webworker_promise_lib_register__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(webworker_promise_lib_register__WEBPACK_IMPORTED_MODULE_0__);\\\\n\\\\n\\\\n/* eslint-disable */\\\\n// prettier-ignore\\\\nwebworker_promise_lib_register__WEBPACK_IMPORTED_MODULE_0___default()(function (message, emit) {\\\\n var array = message.array;\\\\n var min = message.min;\\\\n var max = message.max;\\\\n\\\\n var offset = message.component || 0;\\\\n var step = message.numberOfComponents || 1;\\\\n\\\\n var numberOfBins = message.numberOfBins;\\\\n var delta = max - min;\\\\n var histogram = new Float32Array(numberOfBins);\\\\n histogram.fill(0);\\\\n var len = array.length;\\\\n for (var i = offset; i < len; i += step) {\\\\n var idx = Math.floor(\\\\n (numberOfBins - 1) * (Number(array[i]) - min) / delta\\\\n );\\\\n histogram[idx] += 1;\\\\n }\\\\n\\\\n return Promise.resolve(\\\\n new webworker_promise_lib_register__WEBPACK_IMPORTED_MODULE_0___default.a.TransferableResponse(histogram, [histogram.buffer])\\\\n );\\\\n});\\\\n\\\\n\\\\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js?\\\");\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/webworker-promise/lib/register.js\\\":\\n/*!********************************************************!*\\\\\\n !*** ./node_modules/webworker-promise/lib/register.js ***!\\n \\\\********************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\neval(\\\"\\\\n\\\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\\\\\"value\\\\\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\\\\n\\\\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\\\\\\\"value\\\\\\\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\\\\n\\\\nvar _typeof = typeof Symbol === \\\\\\\"function\\\\\\\" && typeof Symbol.iterator === \\\\\\\"symbol\\\\\\\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \\\\\\\"function\\\\\\\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \\\\\\\"symbol\\\\\\\" : typeof obj; };\\\\n\\\\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\\\\n\\\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\\\\\"Cannot call a class as a function\\\\\\\"); } }\\\\n\\\\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\\\\\\\"this hasn't been initialised - super() hasn't been called\\\\\\\"); } return call && (typeof call === \\\\\\\"object\\\\\\\" || typeof call === \\\\\\\"function\\\\\\\") ? call : self; }\\\\n\\\\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \\\\\\\"function\\\\\\\" && superClass !== null) { throw new TypeError(\\\\\\\"Super expression must either be null or a function, not \\\\\\\" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\\\\n\\\\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\\\\n\\\\nvar TinyEmitter = __webpack_require__(/*! ./tiny-emitter */ \\\\\\\"./node_modules/webworker-promise/lib/tiny-emitter.js\\\\\\\");\\\\n\\\\nvar MESSAGE_RESULT = 0;\\\\nvar MESSAGE_EVENT = 1;\\\\n\\\\nvar RESULT_ERROR = 0;\\\\nvar RESULT_SUCCESS = 1;\\\\n\\\\nvar DEFAULT_HANDLER = 'main';\\\\n\\\\nvar isPromise = function isPromise(o) {\\\\n return (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object' && typeof o.then === 'function' && typeof o.catch === 'function';\\\\n};\\\\n\\\\nfunction RegisterPromise(fn) {\\\\n var handlers = _defineProperty({}, DEFAULT_HANDLER, fn);\\\\n var sendPostMessage = self.postMessage.bind(self);\\\\n\\\\n var server = new (function (_TinyEmitter) {\\\\n _inherits(WorkerRegister, _TinyEmitter);\\\\n\\\\n function WorkerRegister() {\\\\n _classCallCheck(this, WorkerRegister);\\\\n\\\\n return _possibleConstructorReturn(this, (WorkerRegister.__proto__ || Object.getPrototypeOf(WorkerRegister)).apply(this, arguments));\\\\n }\\\\n\\\\n _createClass(WorkerRegister, [{\\\\n key: 'emit',\\\\n value: function emit(eventName) {\\\\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\\\\n args[_key - 1] = arguments[_key];\\\\n }\\\\n\\\\n sendPostMessage({ eventName: eventName, args: args });\\\\n return this;\\\\n }\\\\n }, {\\\\n key: 'emitLocally',\\\\n value: function emitLocally(eventName) {\\\\n var _get2;\\\\n\\\\n for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\\\\n args[_key2 - 1] = arguments[_key2];\\\\n }\\\\n\\\\n (_get2 = _get(WorkerRegister.prototype.__proto__ || Object.getPrototypeOf(WorkerRegister.prototype), 'emit', this)).call.apply(_get2, [this, eventName].concat(args));\\\\n }\\\\n }, {\\\\n key: 'operation',\\\\n value: function operation(name, handler) {\\\\n handlers[name] = handler;\\\\n return this;\\\\n }\\\\n }]);\\\\n\\\\n return WorkerRegister;\\\\n }(TinyEmitter))();\\\\n\\\\n var run = function run(messageId, payload, handlerName) {\\\\n\\\\n var onSuccess = function onSuccess(result) {\\\\n if (result && result instanceof TransferableResponse) {\\\\n sendResult(messageId, RESULT_SUCCESS, result.payload, result.transferable);\\\\n } else {\\\\n sendResult(messageId, RESULT_SUCCESS, result);\\\\n }\\\\n };\\\\n\\\\n var onError = function onError(e) {\\\\n sendResult(messageId, RESULT_ERROR, {\\\\n message: e.message,\\\\n stack: e.stack\\\\n });\\\\n };\\\\n\\\\n try {\\\\n var result = runFn(messageId, payload, handlerName);\\\\n if (isPromise(result)) {\\\\n result.then(onSuccess).catch(onError);\\\\n } else {\\\\n onSuccess(result);\\\\n }\\\\n } catch (e) {\\\\n onError(e);\\\\n }\\\\n };\\\\n\\\\n var runFn = function runFn(messageId, payload, handlerName) {\\\\n var handler = handlers[handlerName || DEFAULT_HANDLER];\\\\n if (!handler) throw new Error('Not found handler for this request');\\\\n\\\\n return handler(payload, sendEvent.bind(null, messageId));\\\\n };\\\\n\\\\n var sendResult = function sendResult(messageId, success, payload) {\\\\n var transferable = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];\\\\n\\\\n sendPostMessage([MESSAGE_RESULT, messageId, success, payload], transferable);\\\\n };\\\\n\\\\n var sendEvent = function sendEvent(messageId, eventName, payload) {\\\\n if (!eventName) throw new Error('eventName is required');\\\\n\\\\n if (typeof eventName !== 'string') throw new Error('eventName should be string');\\\\n\\\\n sendPostMessage([MESSAGE_EVENT, messageId, eventName, payload]);\\\\n };\\\\n\\\\n self.addEventListener('message', function (_ref) {\\\\n var data = _ref.data;\\\\n\\\\n if (Array.isArray(data)) {\\\\n run.apply(undefined, _toConsumableArray(data));\\\\n } else if (data && data.eventName) {\\\\n server.emitLocally.apply(server, [data.eventName].concat(_toConsumableArray(data.args)));\\\\n }\\\\n });\\\\n\\\\n return server;\\\\n}\\\\n\\\\nvar TransferableResponse = function TransferableResponse(payload, transferable) {\\\\n _classCallCheck(this, TransferableResponse);\\\\n\\\\n this.payload = payload;\\\\n this.transferable = transferable;\\\\n};\\\\n\\\\nmodule.exports = RegisterPromise;\\\\nmodule.exports.TransferableResponse = TransferableResponse;\\\\n\\\\n//# sourceURL=webpack://diglettk/./node_modules/webworker-promise/lib/register.js?\\\");\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/webworker-promise/lib/tiny-emitter.js\\\":\\n/*!************************************************************!*\\\\\\n !*** ./node_modules/webworker-promise/lib/tiny-emitter.js ***!\\n \\\\************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\neval(\\\"\\\\n\\\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\\\\\"value\\\\\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\\\\n\\\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\\\\\"Cannot call a class as a function\\\\\\\"); } }\\\\n\\\\nvar TinyEmitter = function () {\\\\n function TinyEmitter() {\\\\n _classCallCheck(this, TinyEmitter);\\\\n\\\\n Object.defineProperty(this, '__listeners', {\\\\n value: {},\\\\n enumerable: false,\\\\n writable: false\\\\n });\\\\n }\\\\n\\\\n _createClass(TinyEmitter, [{\\\\n key: 'emit',\\\\n value: function emit(eventName) {\\\\n if (!this.__listeners[eventName]) return this;\\\\n\\\\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\\\\n args[_key - 1] = arguments[_key];\\\\n }\\\\n\\\\n var _iteratorNormalCompletion = true;\\\\n var _didIteratorError = false;\\\\n var _iteratorError = undefined;\\\\n\\\\n try {\\\\n for (var _iterator = this.__listeners[eventName][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\\\\n var handler = _step.value;\\\\n\\\\n handler.apply(undefined, args);\\\\n }\\\\n } catch (err) {\\\\n _didIteratorError = true;\\\\n _iteratorError = err;\\\\n } finally {\\\\n try {\\\\n if (!_iteratorNormalCompletion && _iterator.return) {\\\\n _iterator.return();\\\\n }\\\\n } finally {\\\\n if (_didIteratorError) {\\\\n throw _iteratorError;\\\\n }\\\\n }\\\\n }\\\\n\\\\n return this;\\\\n }\\\\n }, {\\\\n key: 'once',\\\\n value: function once(eventName, handler) {\\\\n var _this = this;\\\\n\\\\n var once = function once() {\\\\n _this.off(eventName, once);\\\\n handler.apply(undefined, arguments);\\\\n };\\\\n\\\\n return this.on(eventName, once);\\\\n }\\\\n }, {\\\\n key: 'on',\\\\n value: function on(eventName, handler) {\\\\n if (!this.__listeners[eventName]) this.__listeners[eventName] = [];\\\\n\\\\n this.__listeners[eventName].push(handler);\\\\n\\\\n return this;\\\\n }\\\\n }, {\\\\n key: 'off',\\\\n value: function off(eventName, handler) {\\\\n if (handler) this.__listeners[eventName] = this.__listeners[eventName].filter(function (h) {\\\\n return h !== handler;\\\\n });else this.__listeners[eventName] = [];\\\\n\\\\n return this;\\\\n }\\\\n }]);\\\\n\\\\n return TinyEmitter;\\\\n}();\\\\n\\\\nmodule.exports = TinyEmitter;\\\\n\\\\n//# sourceURL=webpack://diglettk/./node_modules/webworker-promise/lib/tiny-emitter.js?\\\");\\n\\n/***/ })\\n\\n/******/ });\", \"Worker\", undefined, undefined);\n}\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/index.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/index.js ***! - \******************************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var webworker_promise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! webworker-promise */ \"./node_modules/webworker-promise/lib/index.js\");\n/* harmony import */ var webworker_promise__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(webworker_promise__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _ComputeHistogram_worker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ComputeHistogram.worker */ \"./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n/* eslint-disable no-continue */\n// ----------------------------------------------------------------------------\n// Global structures\n// ----------------------------------------------------------------------------\n\nvar MIN_GAUSSIAN_WIDTH = 0.001;\nvar ACTION_TO_CURSOR = {\n adjustPosition: '-webkit-grab',\n adjustHeight: 'row-resize',\n adjustBias: 'crosshair',\n adjustWidth: 'col-resize',\n adjustZoom: 'col-resize'\n};\nvar TOUCH_CLICK = []; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nvar ACTIONS = {\n adjustPosition: function adjustPosition(x, y, _ref) {\n var originalXY = _ref.originalXY,\n gaussian = _ref.gaussian,\n originalGaussian = _ref.originalGaussian;\n var xOffset = originalGaussian.position - originalXY[0];\n gaussian.position = x + xOffset;\n return true;\n },\n adjustHeight: function adjustHeight(x, y, _ref2) {\n var model = _ref2.model,\n gaussian = _ref2.gaussian;\n gaussian.height = 1 - y;\n gaussian.height = Math.min(1, Math.max(model.gaussianMinimumHeight, gaussian.height));\n return true;\n },\n adjustBias: function adjustBias(x, y, _ref3) {\n var originalXY = _ref3.originalXY,\n gaussian = _ref3.gaussian,\n originalGaussian = _ref3.originalGaussian;\n gaussian.xBias = originalGaussian.xBias - (originalXY[0] - x) / gaussian.height;\n gaussian.yBias = originalGaussian.yBias + 4 * (originalXY[1] - y) / gaussian.height; // Clamps\n\n gaussian.xBias = Math.max(-1, Math.min(1, gaussian.xBias));\n gaussian.yBias = Math.max(0, Math.min(2, gaussian.yBias));\n return true;\n },\n adjustWidth: function adjustWidth(x, y, _ref4) {\n var originalXY = _ref4.originalXY,\n gaussian = _ref4.gaussian,\n originalGaussian = _ref4.originalGaussian,\n gaussianSide = _ref4.gaussianSide;\n gaussian.width = gaussianSide < 0 ? originalGaussian.width - (originalXY[0] - x) : originalGaussian.width + (originalXY[0] - x);\n\n if (gaussian.width < MIN_GAUSSIAN_WIDTH) {\n gaussian.width = MIN_GAUSSIAN_WIDTH;\n }\n\n return true;\n },\n adjustZoom: function adjustZoom(x, y, _ref5) {\n var rangeZoom = _ref5.rangeZoom,\n publicAPI = _ref5.publicAPI;\n var delta = rangeZoom[1] - rangeZoom[0];\n var absNormX = (x - rangeZoom[0]) / delta;\n var minDelta = Math.abs(absNormX - rangeZoom[0]);\n var maxDelta = Math.abs(absNormX - rangeZoom[1]);\n var meanDelta = Math.abs(absNormX - 0.5 * (rangeZoom[0] + rangeZoom[1]));\n\n if (meanDelta < Math.min(minDelta, maxDelta)) {\n var halfDelta = delta * 0.5;\n rangeZoom[0] = Math.min(Math.max(absNormX - halfDelta, 0), rangeZoom[1] - 0.1);\n rangeZoom[1] = Math.max(Math.min(absNormX + halfDelta, 1), rangeZoom[0] + 0.1);\n } else if (minDelta < maxDelta) {\n rangeZoom[0] = Math.min(Math.max(absNormX, 0), rangeZoom[1] - 0.1);\n } else {\n rangeZoom[1] = Math.max(Math.min(absNormX, 1), rangeZoom[0] + 0.1);\n }\n\n publicAPI.invokeZoomChange(rangeZoom); // The opacity did not changed\n\n return false;\n }\n}; // ----------------------------------------------------------------------------\n\nfunction computeOpacities(gaussians) {\n var sampling = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 256;\n var opacities = [];\n\n while (opacities.length < sampling) {\n opacities.push(0);\n }\n\n var count = gaussians.length;\n\n while (count--) {\n var _gaussians$count = gaussians[count],\n position = _gaussians$count.position,\n height = _gaussians$count.height,\n width = _gaussians$count.width,\n xBias = _gaussians$count.xBias,\n yBias = _gaussians$count.yBias;\n\n for (var i = 0; i < sampling; i++) {\n var x = i / (sampling - 1); // clamp non-zero values to pos +/- width\n\n if (x > position + width || x < position - width) {\n if (opacities[i] < 0.0) {\n opacities[i] = 0.0;\n }\n\n continue;\n } // non-zero width\n\n\n var correctedWidth = width < MIN_GAUSSIAN_WIDTH ? MIN_GAUSSIAN_WIDTH : width; // translate the original x to a new x based on the xbias\n\n var x0 = 0;\n\n if (xBias === 0 || x === position + xBias) {\n x0 = x;\n } else if (x > position + xBias) {\n if (correctedWidth === xBias) {\n x0 = position;\n } else {\n x0 = position + (x - position - xBias) * (correctedWidth / (correctedWidth - xBias));\n }\n } else if (-correctedWidth === xBias) {\n // (x < pos+xBias)\n x0 = position;\n } else {\n x0 = position - (x - position - xBias) * (correctedWidth / (correctedWidth + xBias));\n } // center around 0 and normalize to -1,1\n\n\n var x1 = (x0 - position) / correctedWidth; // do a linear interpolation between:\n // a gaussian and a parabola if 0 < yBias <1\n // a parabola and a step function if 1 < yBias <2\n\n var h0a = Math.exp(-(4 * x1 * x1));\n var h0b = 1.0 - x1 * x1;\n var h0c = 1.0;\n var h1 = void 0;\n\n if (yBias < 1) {\n h1 = yBias * h0b + (1 - yBias) * h0a;\n } else {\n h1 = (2 - yBias) * h0b + (yBias - 1) * h0c;\n }\n\n var h2 = height * h1; // perform the MAX over different gaussians, not the sum\n\n if (h2 > opacities[i]) {\n opacities[i] = h2;\n }\n }\n }\n\n return opacities;\n} // ----------------------------------------------------------------------------\n\n\nfunction applyGaussianToPiecewiseFunction(gaussians, sampling, rangeToUse, piecewiseFunction) {\n var opacities = computeOpacities(gaussians, sampling);\n var nodes = [];\n var delta = (rangeToUse[1] - rangeToUse[0]) / (opacities.length - 1);\n var midpoint = 0.5;\n var sharpness = 0;\n\n for (var index = 0; index < opacities.length; index++) {\n var x = rangeToUse[0] + delta * index;\n var y = opacities[index];\n nodes.push({\n x: x,\n y: y,\n midpoint: midpoint,\n sharpness: sharpness\n });\n }\n\n piecewiseFunction.setNodes(nodes);\n} // ----------------------------------------------------------------------------\n\n\nfunction drawChart(ctx, area, values) {\n var style = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {\n lineWidth: 1,\n strokeStyle: '#000'\n };\n var verticalScale = area[3];\n var horizontalScale = area[2] / (values.length - 1);\n var fill = !!style.fillStyle;\n var offset = verticalScale + area[1];\n ctx.lineWidth = style.lineWidth;\n ctx.strokeStyle = style.strokeStyle;\n ctx.beginPath();\n ctx.moveTo(area[0], area[1] + area[3]);\n\n for (var index = 0; index < values.length; index++) {\n ctx.lineTo(area[0] + index * horizontalScale, Math.max(area[1], offset - values[index] * verticalScale));\n }\n\n if (fill) {\n ctx.fillStyle = style.fillStyle;\n ctx.lineTo(area[0] + area[2], area[1] + area[3]);\n\n if (style.clip) {\n ctx.clip();\n return;\n }\n\n ctx.fill();\n }\n\n ctx.stroke();\n} // ----------------------------------------------------------------------------\n\n\nfunction updateColorCanvas(colorTransferFunction, width, rangeToUse, canvas) {\n var workCanvas = canvas || document.createElement('canvas');\n workCanvas.setAttribute('width', width);\n workCanvas.setAttribute('height', 256);\n var ctx = workCanvas.getContext('2d');\n var rgba = colorTransferFunction.getUint8Table(rangeToUse[0], rangeToUse[1], width, 4);\n var pixelsArea = ctx.getImageData(0, 0, width, 256);\n\n for (var lineIdx = 0; lineIdx < 256; lineIdx++) {\n pixelsArea.data.set(rgba, lineIdx * 4 * width);\n }\n\n var nbValues = 256 * width * 4;\n var lineSize = width * 4;\n\n for (var i = 3; i < nbValues; i += 4) {\n pixelsArea.data[i] = 255 - Math.floor(i / lineSize);\n }\n\n ctx.putImageData(pixelsArea, 0, 0);\n return workCanvas;\n} // ----------------------------------------------------------------------------\n\n\nfunction updateColorCanvasFromImage(img, width, canvas) {\n var workCanvas = canvas || document.createElement('canvas');\n workCanvas.setAttribute('width', width);\n workCanvas.setAttribute('height', 256);\n var ctx = workCanvas.getContext('2d');\n ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, width, 256);\n return workCanvas;\n} // ----------------------------------------------------------------------------\n\n\nfunction normalizeCoordinates(x, y, subRectangeArea) {\n var zoomRange = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [0, 1];\n return [zoomRange[0] + (x - subRectangeArea[0]) / subRectangeArea[2] * (zoomRange[1] - zoomRange[0]), (y - subRectangeArea[1]) / subRectangeArea[3]];\n} // ----------------------------------------------------------------------------\n\n\nfunction findGaussian(x, gaussians) {\n var distances = gaussians.map(function (g) {\n return Math.abs(g.position - x);\n });\n var min = Math.min.apply(Math, _toConsumableArray(distances));\n return distances.indexOf(min);\n} // ----------------------------------------------------------------------------\n\n\nfunction createListener(callback) {\n var preventDefault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n return function (e) {\n var offsetX = e.offsetX,\n offsetY = e.offsetY;\n\n if (preventDefault) {\n e.preventDefault();\n }\n\n callback(offsetX, offsetY);\n };\n} // ----------------------------------------------------------------------------\n\n\nfunction createTouchClickListener() {\n var id = TOUCH_CLICK.length;\n\n for (var _len = arguments.length, callbacks = new Array(_len), _key = 0; _key < _len; _key++) {\n callbacks[_key] = arguments[_key];\n }\n\n TOUCH_CLICK.push({\n callbacks: callbacks,\n timeout: 0,\n deltaT: 200,\n count: 0,\n ready: false\n });\n return id;\n} // ----------------------------------------------------------------------------\n\n\nfunction processTouchClicks() {\n TOUCH_CLICK.filter(function (t) {\n return t.ready;\n }).forEach(function (touchHandle) {\n touchHandle.callbacks.forEach(function (callback) {\n if (callback.touches === touchHandle.touches && callback.clicks === touchHandle.count) {\n callback.action.apply(callback, _toConsumableArray(touchHandle.singleTouche));\n }\n }); // Clear state\n\n touchHandle.ts = 0;\n touchHandle.count = 0;\n touchHandle.touches = 0;\n touchHandle.ready = false;\n });\n} // ----------------------------------------------------------------------------\n\n\nfunction createTouchListener(id, callback) {\n var nbTouches = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var preventDefault = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n return function (e) {\n var targetBounds = e.target.getBoundingClientRect();\n var relativeTouches = Array.prototype.map.call(e.touches, function (t) {\n return [t.pageX - targetBounds.left, t.pageY - targetBounds.top];\n });\n var singleTouche = relativeTouches.reduce(function (a, b) {\n return [a[0] + b[0], a[1] + b[1]];\n }, [0, 0]).map(function (v) {\n return v / e.touches.length;\n });\n\n if (e.type === 'touchstart') {\n clearTimeout(TOUCH_CLICK[id].timeout);\n TOUCH_CLICK[id].ts = e.timeStamp;\n TOUCH_CLICK[id].singleTouche = singleTouche;\n TOUCH_CLICK[id].touches = e.touches.length;\n } else if (e.type === 'touchmove') {\n TOUCH_CLICK[id].ts = 0;\n TOUCH_CLICK[id].count = 0;\n TOUCH_CLICK[id].ready = false;\n } else if (e.type === 'touchend') {\n if (e.timeStamp - TOUCH_CLICK[id].ts < TOUCH_CLICK[id].deltaT) {\n TOUCH_CLICK[id].count += 1;\n TOUCH_CLICK[id].ready = true;\n\n if (preventDefault) {\n e.preventDefault();\n }\n\n TOUCH_CLICK[id].timeout = setTimeout(processTouchClicks, TOUCH_CLICK[id].deltaT);\n } else {\n TOUCH_CLICK[id].ready = false;\n }\n }\n\n if (e.touches.length === nbTouches) {\n callback.apply(void 0, _toConsumableArray(singleTouche));\n\n if (preventDefault) {\n e.preventDefault();\n }\n }\n };\n} // ----------------------------------------------------------------------------\n\n\nfunction listenerSelector(condition, ok, ko) {\n return function (e) {\n return condition() ? ok(e) : ko(e);\n };\n} // ----------------------------------------------------------------------------\n\n\nfunction rescaleArray(array, focusArea) {\n if (!focusArea) {\n return array;\n }\n\n var maxIdx = array.length - 1;\n var idxRange = focusArea.map(function (v) {\n return Math.round(v * maxIdx);\n });\n return array.slice(idxRange[0], idxRange[1] + 1);\n} // ----------------------------------------------------------------------------\n\n\nfunction rescaleValue(value, focusArea) {\n if (!focusArea) {\n return value;\n }\n\n return (value - focusArea[0]) / (focusArea[1] - focusArea[0]);\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n applyGaussianToPiecewiseFunction: applyGaussianToPiecewiseFunction,\n computeOpacities: computeOpacities,\n createListener: createListener,\n drawChart: drawChart,\n findGaussian: findGaussian,\n listenerSelector: listenerSelector,\n normalizeCoordinates: normalizeCoordinates\n}; // ----------------------------------------------------------------------------\n// vtkPiecewiseGaussianWidget methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPiecewiseGaussianWidget(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPiecewiseGaussianWidget');\n\n if (!model.canvas) {\n model.canvas = document.createElement('canvas');\n }\n\n publicAPI.setContainer = function (el) {\n if (model.container && model.container !== el) {\n model.container.removeChild(model.canvas);\n }\n\n if (model.container !== el) {\n model.container = el;\n\n if (model.container) {\n model.container.appendChild(model.canvas);\n }\n\n publicAPI.modified();\n }\n };\n\n publicAPI.setGaussians = function (gaussians) {\n if (model.gaussians === gaussians) {\n return;\n }\n\n model.gaussians = gaussians;\n model.opacities = computeOpacities(model.gaussians, model.piecewiseSize);\n publicAPI.invokeOpacityChange(publicAPI);\n publicAPI.modified();\n };\n\n publicAPI.addGaussian = function (position, height, width, xBias, yBias) {\n var nextIndex = model.gaussians.length;\n model.gaussians.push({\n position: position,\n height: height,\n width: width,\n xBias: xBias,\n yBias: yBias\n });\n model.opacities = computeOpacities(model.gaussians, model.piecewiseSize);\n publicAPI.invokeOpacityChange(publicAPI);\n publicAPI.modified();\n return nextIndex;\n };\n\n publicAPI.removeGaussian = function (index) {\n model.gaussians.splice(index, 1);\n model.opacities = computeOpacities(model.gaussians, model.piecewiseSize);\n publicAPI.invokeOpacityChange(publicAPI);\n publicAPI.modified();\n };\n\n publicAPI.setSize = function (width, height) {\n model.canvas.setAttribute('width', width);\n model.canvas.setAttribute('height', height);\n\n if (model.size[0] !== width || model.size[1] !== height) {\n model.size = [width, height];\n model.colorCanvasMTime = 0;\n publicAPI.modified();\n }\n };\n\n publicAPI.updateStyle = function (style) {\n model.style = _objectSpread(_objectSpread({}, model.style), style);\n publicAPI.modified();\n }; // Method used to compute and show data distribution in the background.\n // When an array with many components is used, you can provide additional\n // information to choose which component you want to extract the histogram\n // from.\n\n\n publicAPI.setDataArray = function (array) {\n var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref6$numberOfBinToCo = _ref6.numberOfBinToConsiders,\n numberOfBinToConsiders = _ref6$numberOfBinToCo === void 0 ? 1 : _ref6$numberOfBinToCo,\n _ref6$numberOfBinsToS = _ref6.numberOfBinsToSkip,\n numberOfBinsToSkip = _ref6$numberOfBinsToS === void 0 ? 1 : _ref6$numberOfBinsToS,\n _ref6$numberOfCompone = _ref6.numberOfComponents,\n numberOfComponents = _ref6$numberOfCompone === void 0 ? 1 : _ref6$numberOfCompone,\n _ref6$component = _ref6.component,\n component = _ref6$component === void 0 ? 0 : _ref6$component;\n\n model.histogram = null;\n model.histogramArray = array;\n model.dataRange = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"arrayRange\"](array, component, numberOfComponents);\n\n var _model$dataRange = _slicedToArray(model.dataRange, 2),\n min = _model$dataRange[0],\n max = _model$dataRange[1];\n\n var maxNumberOfWorkers = 4;\n var arrayStride = Math.floor(array.length / maxNumberOfWorkers) || 1;\n arrayStride += arrayStride % numberOfComponents;\n var arrayIndex = 0;\n var workerChunks = [];\n var workers = [];\n\n while (arrayIndex < array.length) {\n var worker = new _ComputeHistogram_worker__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n workers.push(worker);\n var workerPromise = new webworker_promise__WEBPACK_IMPORTED_MODULE_2___default.a(worker);\n var arrayStart = arrayIndex;\n var arrayEnd = Math.min(arrayIndex + arrayStride, array.length - 1);\n var subArray = new array.constructor(array.slice(arrayStart, arrayEnd + 1));\n workerChunks.push(workerPromise.postMessage({\n array: subArray,\n component: component,\n numberOfComponents: numberOfComponents,\n min: min,\n max: max,\n numberOfBins: model.numberOfBins\n }, [subArray.buffer]));\n arrayIndex += arrayStride;\n }\n\n Promise.all(workerChunks).then(function (subHistograms) {\n workers.forEach(function (worker) {\n return worker.terminate();\n });\n model.histogram = new Float32Array(model.numberOfBins);\n model.histogram.fill(0);\n subHistograms.forEach(function (subHistogram) {\n for (var i = 0, len = subHistogram.length; i < len; ++i) {\n model.histogram[i] += subHistogram[i];\n }\n }); // Smart Rescale Histogram\n\n var sampleSize = Math.min(numberOfBinToConsiders, model.histogram.length - numberOfBinsToSkip);\n var sortedArray = Array.from(model.histogram);\n sortedArray.sort(function (a, b) {\n return Number(a) - Number(b);\n });\n\n for (var i = 0; i < numberOfBinsToSkip; i++) {\n sortedArray.pop();\n }\n\n while (sortedArray.length > sampleSize) {\n sortedArray.shift();\n }\n\n var mean = sortedArray.reduce(function (a, b) {\n return a + b;\n }, 0) / sampleSize;\n\n for (var _i2 = 0, len = model.histogram.length; _i2 < len; ++_i2) {\n model.histogram[_i2] /= mean;\n }\n\n publicAPI.modified();\n setTimeout(publicAPI.render, 0);\n });\n publicAPI.modified();\n };\n\n publicAPI.onClick = function (x, y) {\n var _normalizeCoordinates = normalizeCoordinates(x, y, model.graphArea, model.enableRangeZoom ? model.rangeZoom : null),\n _normalizeCoordinates2 = _slicedToArray(_normalizeCoordinates, 2),\n xNormalized = _normalizeCoordinates2[0],\n yNormalized = _normalizeCoordinates2[1];\n\n if (xNormalized < 0 && model.style.iconSize > 1) {\n // Control buttons\n var delta = model.style.iconSize + model.style.padding;\n var offset = delta;\n var buttonIdx = 0;\n\n while (y > offset) {\n buttonIdx += 1;\n offset += delta;\n }\n\n switch (buttonIdx) {\n case 0:\n {\n var gaussianIdx = publicAPI.addGaussian(0, 1, 0.1, 0, 0);\n var gaussian = model.gaussians[gaussianIdx];\n\n var originalGaussian = _objectSpread({}, gaussian);\n\n var action = ACTIONS.adjustPosition;\n model.activeGaussian = gaussianIdx;\n model.selectedGaussian = gaussianIdx; // Fake active action\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setImmediate(function () {\n publicAPI.onDown(x, y);\n model.dragAction = {\n originalXY: [0, 0],\n action: action,\n gaussian: gaussian,\n originalGaussian: originalGaussian\n };\n });\n break;\n }\n\n case 1:\n {\n if (model.selectedGaussian !== -1) {\n publicAPI.removeGaussian(model.selectedGaussian);\n }\n\n break;\n }\n\n default:\n {\n model.selectedGaussian = -1;\n model.dragAction = null;\n }\n }\n } else if (xNormalized < 0 || xNormalized > 1 || yNormalized < 0 || yNormalized > 1) {\n model.selectedGaussian = -1;\n model.dragAction = null;\n } else {\n var newSelected = findGaussian(xNormalized, model.gaussians);\n\n if (newSelected !== model.selectedGaussian) {\n model.selectedGaussian = newSelected;\n publicAPI.modified();\n }\n }\n\n return true;\n };\n\n publicAPI.onHover = function (x, y) {\n // Determines the interaction region size for adjusting the Gaussian's\n // height.\n var tolerance = 20 / model.canvas.height;\n\n var _normalizeCoordinates3 = normalizeCoordinates(x, y, model.graphArea, model.enableRangeZoom ? model.rangeZoom : null),\n _normalizeCoordinates4 = _slicedToArray(_normalizeCoordinates3, 2),\n xNormalized = _normalizeCoordinates4[0],\n yNormalized = _normalizeCoordinates4[1];\n\n var _normalizeCoordinates5 = normalizeCoordinates(x, y, model.graphArea),\n _normalizeCoordinates6 = _slicedToArray(_normalizeCoordinates5, 1),\n xNormalizedAbs = _normalizeCoordinates6[0];\n\n var newActive = xNormalized < 0 ? model.selectedGaussian : findGaussian(xNormalized, model.gaussians);\n model.canvas.style.cursor = 'default';\n var gaussian = model.gaussians[newActive];\n\n if (model.enableRangeZoom && xNormalizedAbs >= 0 && y < model.graphArea[1] - 6 // circle radius\n ) {\n var thirdDelta = (model.rangeZoom[1] - model.rangeZoom[0]) / 3;\n\n if (xNormalizedAbs < model.rangeZoom[0] + thirdDelta || xNormalizedAbs > model.rangeZoom[1] - thirdDelta) {\n model.canvas.style.cursor = ACTION_TO_CURSOR.adjustZoom;\n } else {\n model.canvas.style.cursor = ACTION_TO_CURSOR.adjustPosition;\n }\n\n model.dragAction = {\n rangeZoom: model.rangeZoom,\n action: ACTIONS.adjustZoom\n };\n } else if (gaussian && xNormalizedAbs >= 0) {\n var invY = 1 - yNormalized;\n var actionName = null;\n\n if (invY > gaussian.height + tolerance) {\n actionName = 'adjustPosition';\n } else if (invY > gaussian.height - tolerance) {\n if (Math.abs(xNormalized - gaussian.position) < tolerance) {\n actionName = 'adjustHeight';\n } else {\n actionName = 'adjustPosition';\n }\n } else if (invY > gaussian.height * 0.5 + tolerance) {\n actionName = 'adjustPosition';\n } else if (invY > gaussian.height * 0.5 - tolerance) {\n if (Math.abs(xNormalized - gaussian.position) < tolerance) {\n actionName = 'adjustBias';\n } else {\n actionName = 'adjustPosition';\n }\n } else if (invY > tolerance) {\n actionName = 'adjustPosition';\n } else {\n actionName = 'adjustWidth';\n }\n\n model.canvas.style.cursor = ACTION_TO_CURSOR[actionName];\n var action = ACTIONS[actionName];\n\n var originalGaussian = _objectSpread({}, gaussian);\n\n model.dragAction = {\n originalXY: [xNormalized, yNormalized],\n action: action,\n gaussian: gaussian,\n originalGaussian: originalGaussian\n };\n }\n\n if (newActive !== model.activeGaussian) {\n model.activeGaussian = newActive;\n publicAPI.modified();\n }\n\n return true;\n };\n\n publicAPI.onDown = function (x, y) {\n if (!model.mouseIsDown) {\n publicAPI.invokeAnimation(true);\n }\n\n model.mouseIsDown = true;\n var xNormalized = normalizeCoordinates(x, y, model.graphArea, model.enableRangeZoom ? model.rangeZoom : null)[0];\n var newSelected = findGaussian(xNormalized, model.gaussians);\n model.gaussianSide = 0;\n var gaussian = model.gaussians[newSelected];\n\n if (gaussian) {\n model.gaussianSide = gaussian.position - xNormalized;\n }\n\n if (newSelected !== model.selectedGaussian && xNormalized > 0) {\n model.selectedGaussian = newSelected;\n publicAPI.modified();\n }\n\n return true;\n };\n\n publicAPI.onDrag = function (x, y) {\n if (model.dragAction) {\n var _normalizeCoordinates7 = normalizeCoordinates(x, y, model.graphArea, model.enableRangeZoom ? model.rangeZoom : null),\n _normalizeCoordinates8 = _slicedToArray(_normalizeCoordinates7, 2),\n xNormalized = _normalizeCoordinates8[0],\n yNormalized = _normalizeCoordinates8[1];\n\n var action = model.dragAction.action;\n\n if (action(xNormalized, yNormalized, _objectSpread({\n gaussianSide: model.gaussianSide,\n model: model,\n publicAPI: publicAPI\n }, model.dragAction))) {\n model.opacities = computeOpacities(model.gaussians, model.piecewiseSize);\n publicAPI.invokeOpacityChange(publicAPI, true);\n }\n\n publicAPI.modified();\n }\n\n return true;\n };\n\n publicAPI.onUp = function (x, y) {\n if (model.mouseIsDown) {\n publicAPI.invokeAnimation(false);\n }\n\n model.mouseIsDown = false;\n return true;\n };\n\n publicAPI.onLeave = function (x, y) {\n publicAPI.onUp(x, y);\n model.canvas.style.cursor = 'default';\n model.activeGaussian = -1;\n publicAPI.modified();\n return true;\n };\n\n publicAPI.onAddGaussian = function (x, y) {\n var _normalizeCoordinates9 = normalizeCoordinates(x, y, model.graphArea, model.enableRangeZoom ? model.rangeZoom : null),\n _normalizeCoordinates10 = _slicedToArray(_normalizeCoordinates9, 2),\n xNormalized = _normalizeCoordinates10[0],\n yNormalized = _normalizeCoordinates10[1];\n\n if (xNormalized >= 0) {\n publicAPI.addGaussian(xNormalized, 1 - yNormalized, 0.1, 0, 0);\n }\n\n return true;\n };\n\n publicAPI.onRemoveGaussian = function (x, y) {\n var xNormalized = normalizeCoordinates(x, y, model.graphArea, model.enableRangeZoom ? model.rangeZoom : null)[0];\n var newSelected = findGaussian(xNormalized, model.gaussians);\n\n if (xNormalized >= 0 && newSelected !== -1) {\n publicAPI.removeGaussian(newSelected);\n }\n\n return true;\n };\n\n publicAPI.bindMouseListeners = function () {\n if (!model.listeners) {\n var isDown = function isDown() {\n return !!model.mouseIsDown;\n };\n\n var touchId = createTouchClickListener({\n clicks: 1,\n touches: 1,\n action: publicAPI.onClick\n }, {\n clicks: 2,\n touches: 1,\n action: publicAPI.onAddGaussian\n }, {\n clicks: 2,\n touches: 2,\n action: publicAPI.onRemoveGaussian\n });\n model.listeners = {\n mousemove: listenerSelector(isDown, createListener(publicAPI.onDrag), createListener(publicAPI.onHover)),\n dblclick: createListener(publicAPI.onAddGaussian),\n contextmenu: createListener(publicAPI.onRemoveGaussian),\n click: createListener(publicAPI.onClick),\n mouseup: createListener(publicAPI.onUp),\n mousedown: createListener(publicAPI.onDown),\n mouseout: createListener(publicAPI.onLeave),\n touchstart: createTouchListener(touchId, vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.onHover, publicAPI.onDown)),\n touchmove: listenerSelector(isDown, createTouchListener(touchId, publicAPI.onDrag), createTouchListener(touchId, publicAPI.onHover)),\n touchend: createTouchListener(touchId, publicAPI.onUp, 0) // touchend have 0 touch event...\n\n };\n Object.keys(model.listeners).forEach(function (eventType) {\n model.canvas.addEventListener(eventType, model.listeners[eventType], false);\n });\n }\n };\n\n publicAPI.unbindMouseListeners = function () {\n if (model.listeners) {\n Object.keys(model.listeners).forEach(function (eventType) {\n model.canvas.removeEventListener(eventType, model.listeners[eventType]);\n });\n delete model.listeners;\n }\n };\n\n publicAPI.render = function () {\n var ctx = model.canvas.getContext('2d');\n ctx.imageSmoothingEnabled = true;\n\n var _model$size = _slicedToArray(model.size, 2),\n width = _model$size[0],\n height = _model$size[1];\n\n var offset = model.style.padding;\n var graphArea = [Math.floor(model.style.iconSize + offset), Math.floor(offset), Math.ceil(width - 2 * offset - model.style.iconSize), Math.ceil(height - 2 * offset)];\n var zoomControlHeight = model.style.zoomControlHeight;\n\n if (model.enableRangeZoom) {\n graphArea[1] += Math.floor(zoomControlHeight);\n graphArea[3] -= Math.floor(zoomControlHeight);\n }\n\n model.graphArea = graphArea; // Clear canvas\n\n ctx.clearRect(0, 0, width, height);\n ctx.lineJoin = 'round';\n ctx.fillStyle = model.style.backgroundColor;\n ctx.fillRect.apply(ctx, graphArea);\n\n if (model.style.iconSize > 1) {\n // Draw icons\n // +\n var halfSize = Math.round(model.style.iconSize / 2 - model.style.strokeWidth);\n var center = Math.round(halfSize + offset + model.style.strokeWidth);\n ctx.beginPath();\n ctx.lineWidth = model.style.buttonStrokeWidth;\n ctx.strokeStyle = model.style.buttonStrokeColor;\n ctx.arc(center - offset / 2, center, halfSize, 0, 2 * Math.PI, false);\n ctx.fillStyle = model.style.buttonFillColor;\n ctx.fill();\n ctx.stroke();\n ctx.moveTo(center - halfSize + model.style.strokeWidth + 2 - offset / 2, center);\n ctx.lineTo(center + halfSize - model.style.strokeWidth - 2 - offset / 2, center);\n ctx.stroke();\n ctx.moveTo(center - offset / 2, center - halfSize + model.style.strokeWidth + 2);\n ctx.lineTo(center - offset / 2, center + halfSize - model.style.strokeWidth - 2);\n ctx.stroke(); // -\n\n if (model.selectedGaussian === -1) {\n ctx.fillStyle = model.style.buttonDisableFillColor;\n ctx.lineWidth = model.style.buttonDisableStrokeWidth;\n ctx.strokeStyle = model.style.buttonDisableStrokeColor;\n } else {\n ctx.fillStyle = model.style.buttonFillColor;\n ctx.lineWidth = model.style.buttonStrokeWidth;\n ctx.strokeStyle = model.style.buttonStrokeColor;\n }\n\n ctx.beginPath();\n ctx.arc(center - offset / 2, center + offset / 2 + model.style.iconSize, halfSize, 0, 2 * Math.PI, false);\n ctx.fill();\n ctx.stroke();\n ctx.moveTo(center - halfSize + model.style.strokeWidth + 2 - offset / 2, center + offset / 2 + model.style.iconSize);\n ctx.lineTo(center + halfSize - model.style.strokeWidth - 2 - offset / 2, center + offset / 2 + model.style.iconSize);\n ctx.stroke();\n } // Draw histogram\n\n\n if (model.histogram) {\n drawChart(ctx, graphArea, rescaleArray(model.histogram, model.rangeZoom), {\n lineWidth: 1,\n strokeStyle: model.style.histogramColor,\n fillStyle: model.style.histogramColor\n });\n } // Draw gaussians\n\n\n drawChart(ctx, graphArea, rescaleArray(model.opacities, model.enableRangeZoom && model.rangeZoom), {\n lineWidth: model.style.strokeWidth,\n strokeStyle: model.style.strokeColor\n }); // Draw color function if any\n\n if (model.colorTransferFunction && model.colorTransferFunction.getSize()) {\n var rangeToUse = model.dataRange || model.colorTransferFunction.getMappingRange();\n\n if (!model.colorCanvas || model.colorCanvasMTime !== model.colorTransferFunction.getMTime()) {\n model.colorCanvasMTime = model.colorTransferFunction.getMTime();\n model.colorCanvas = updateColorCanvas(model.colorTransferFunction, graphArea[2], rangeToUse, model.colorCanvas);\n }\n\n ctx.save();\n drawChart(ctx, graphArea, rescaleArray(model.opacities, model.enableRangeZoom && model.rangeZoom), {\n lineWidth: 1,\n strokeStyle: 'rgba(0,0,0,0)',\n fillStyle: 'rgba(0,0,0,1)',\n clip: true\n }); // Draw the correct portion of the color BG image\n\n if (model.enableRangeZoom) {\n ctx.drawImage(model.colorCanvas, model.rangeZoom[0] * graphArea[2], 0, graphArea[2], graphArea[3], graphArea[0], graphArea[1], graphArea[2] / (model.rangeZoom[1] - model.rangeZoom[0]), graphArea[3]);\n } else {\n ctx.drawImage(model.colorCanvas, graphArea[0], graphArea[1]);\n }\n\n ctx.restore();\n } else if (model.backgroundImage) {\n model.colorCanvas = updateColorCanvasFromImage(model.backgroundImage, graphArea[2], model.colorCanvas);\n ctx.save();\n drawChart(ctx, graphArea, rescaleArray(model.opacities, model.enableRangeZoom && model.rangeZoom), {\n lineWidth: 1,\n strokeStyle: 'rgba(0,0,0,0)',\n fillStyle: 'rgba(0,0,0,1)',\n clip: true\n });\n ctx.drawImage(model.colorCanvas, graphArea[0], graphArea[1]);\n ctx.restore();\n } // Draw zoomed area\n\n\n if (model.enableRangeZoom) {\n ctx.fillStyle = model.style.zoomControlColor;\n ctx.beginPath();\n ctx.rect(graphArea[0] + model.rangeZoom[0] * graphArea[2], 0, (model.rangeZoom[1] - model.rangeZoom[0]) * graphArea[2], zoomControlHeight);\n ctx.fill();\n } // Draw active gaussian\n\n\n var activeGaussian = model.gaussians[model.activeGaussian] || model.gaussians[model.selectedGaussian];\n\n if (activeGaussian) {\n var activeOpacities = computeOpacities([activeGaussian], graphArea[2]);\n drawChart(ctx, graphArea, rescaleArray(activeOpacities, model.enableRangeZoom && model.rangeZoom), {\n lineWidth: model.style.activeStrokeWidth,\n strokeStyle: model.style.activeColor\n }); // Draw controls\n\n var xCenter = graphArea[0] + rescaleValue(activeGaussian.position, model.enableRangeZoom && model.rangeZoom) * graphArea[2];\n var yTop = graphArea[1] + (1 - activeGaussian.height) * graphArea[3];\n var yMiddle = graphArea[1] + (1 - 0.5 * activeGaussian.height) * graphArea[3];\n var yBottom = graphArea[1] + graphArea[3];\n var widthInPixel = activeGaussian.width * graphArea[2];\n\n if (model.enableRangeZoom) {\n widthInPixel /= model.rangeZoom[1] - model.rangeZoom[0];\n }\n\n ctx.lineWidth = model.style.handleWidth;\n ctx.strokeStyle = model.style.handleColor;\n ctx.fillStyle = model.style.backgroundColor;\n ctx.beginPath();\n ctx.moveTo(xCenter, graphArea[1] + (1 - activeGaussian.height) * graphArea[3]);\n ctx.lineTo(xCenter, graphArea[1] + graphArea[3]);\n ctx.stroke(); // Height\n\n ctx.beginPath();\n ctx.arc(xCenter, yTop, 6, 0, 2 * Math.PI);\n ctx.fill();\n ctx.stroke(); // Bias\n\n var radius = Math.min(widthInPixel * 0.1, activeGaussian.height * graphArea[3] * 0.2);\n ctx.beginPath();\n ctx.rect(xCenter - radius, yMiddle - radius, radius * 2, radius * 2);\n ctx.fill();\n ctx.stroke();\n ctx.beginPath(); // Width\n\n var sliderWidth = widthInPixel * 0.8;\n ctx.rect(xCenter - sliderWidth, yBottom - 5, 2 * sliderWidth, 10);\n ctx.fill();\n ctx.stroke();\n }\n };\n\n publicAPI.getOpacityNodes = function (dataRange) {\n var rangeToUse = dataRange || model.dataRange;\n var delta = (rangeToUse[1] - rangeToUse[0]) / (model.opacities.length - 1);\n var nodes = [];\n var midpoint = 0.5;\n var sharpness = 0;\n\n for (var index = 0; index < model.opacities.length; index++) {\n var x = rangeToUse[0] + delta * index;\n var y = model.opacities[index];\n nodes.push({\n x: x,\n y: y,\n midpoint: midpoint,\n sharpness: sharpness\n });\n }\n\n return nodes;\n };\n\n publicAPI.applyOpacity = function (piecewiseFunction, dataRange) {\n var nodes = publicAPI.getOpacityNodes(dataRange);\n piecewiseFunction.setNodes(nodes);\n };\n\n publicAPI.getOpacityRange = function (dataRange) {\n var rangeToUse = dataRange || model.dataRange;\n var delta = (rangeToUse[1] - rangeToUse[0]) / (model.opacities.length - 1);\n var minIndex = model.opacities.length - 1;\n var maxIndex = 0;\n\n for (var index = 0; index < model.opacities.length; index++) {\n if (model.opacities[index] > 0) {\n minIndex = Math.min(minIndex, index);\n }\n\n if (model.opacities[index] > 0) {\n maxIndex = Math.max(maxIndex, index);\n }\n }\n\n return [rangeToUse[0] + minIndex * delta, rangeToUse[0] + maxIndex * delta];\n };\n\n var enableZoom = publicAPI.setEnableRangeZoom;\n\n publicAPI.setEnableRangeZoom = function (v) {\n var change = enableZoom(v);\n\n if (change) {\n model.colorCanvasMTime = 0;\n model.rangeZoom = [0, 1];\n }\n\n return change;\n };\n\n var rangeZoom = publicAPI.setRangeZoom;\n\n publicAPI.setRangeZoom = function () {\n var change = rangeZoom.apply(void 0, arguments);\n\n if (change) {\n model.colorCanvasMTime = 0;\n }\n\n return change;\n }; // Trigger rendering for any modified event\n\n\n publicAPI.onModified(function () {\n return publicAPI.render();\n });\n publicAPI.setSize.apply(publicAPI, _toConsumableArray(model.size));\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n histogram: [],\n numberOfBins: 256,\n histogramArray: null,\n dataRange: [0, 1],\n gaussians: [],\n opacities: [],\n size: [600, 300],\n piecewiseSize: 256,\n colorCanvasMTime: 0,\n gaussianMinimumHeight: 0.05,\n style: {\n backgroundColor: 'rgba(255, 255, 255, 1)',\n histogramColor: 'rgba(200, 200, 200, 0.5)',\n strokeColor: 'rgb(0, 0, 0)',\n activeColor: 'rgb(0, 0, 150)',\n buttonDisableFillColor: 'rgba(255, 255, 255, 0.5)',\n buttonDisableStrokeColor: 'rgba(0, 0, 0, 0.5)',\n buttonStrokeColor: 'rgba(0, 0, 0, 1)',\n buttonFillColor: 'rgba(255, 255, 255, 1)',\n handleColor: 'rgb(0, 150, 0)',\n strokeWidth: 2,\n activeStrokeWidth: 3,\n buttonStrokeWidth: 1.5,\n handleWidth: 3,\n iconSize: 20,\n padding: 10,\n zoomControlHeight: 10,\n zoomControlColor: '#999'\n },\n activeGaussian: -1,\n selectedGaussian: -1,\n enableRangeZoom: true,\n rangeZoom: [0, 1] // normalized value\n\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['piecewiseSize', 'numberOfBins', 'colorTransferFunction', 'backgroundImage', 'enableRangeZoom', 'gaussianMinimumHeight']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['rangeZoom'], 2);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['size', 'canvas', 'gaussians']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'opacityChange');\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'animation');\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'zoomChange'); // Object specific methods\n\n vtkPiecewiseGaussianWidget(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPiecewiseGaussianWidget'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper/index.js ***! - \****************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkAbstractMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkAbstractMapper(publicAPI, model) {\n publicAPI.update = function () {\n publicAPI.getInputData();\n };\n\n publicAPI.addClippingPlane = function (plane) {\n if (plane.getClassName() !== 'vtkPlane') {\n return;\n }\n\n model.clippingPlanes.push(plane);\n };\n\n publicAPI.getNumberOfClippingPlanes = function () {\n return model.clippingPlanes.length;\n };\n\n publicAPI.removeAllClippingPlanes = function () {\n model.clippingPlanes.length = 0;\n };\n\n publicAPI.removeClippingPlane = function (i) {\n if (i < 0 || i >= 6) {\n return;\n }\n\n model.clippingPlanes.splice(i, 1);\n };\n\n publicAPI.getClippingPlanes = function () {\n return model.clippingPlanes;\n };\n\n publicAPI.setClippingPlanes = function (planes) {\n if (!planes) {\n return;\n }\n\n if (!Array.isArray(planes)) {\n publicAPI.addClippingPlane(planes);\n } else {\n var nbPlanes = planes.length;\n\n for (var i = 0; i < nbPlanes && i < 6; i++) {\n publicAPI.addClippingPlane(planes[i]);\n }\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n clippingPlanes: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].algo(publicAPI, model, 1, 0);\n\n if (!model.clippingPlanes) {\n model.clippingPlanes = [];\n }\n\n vtkAbstractMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper3D/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper3D/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_AbstractMapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/AbstractMapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkAbstractMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkAbstractMapper3D(publicAPI, model) {\n publicAPI.getBounds = function () {\n return 0;\n };\n\n publicAPI.getBounds = function (bounds) {\n publicAPI.getBounds();\n\n for (var i = 0; i < 6; i++) {\n bounds[i] = model.bounds[i];\n }\n };\n\n publicAPI.getCenter = function () {\n publicAPI.getBounds();\n\n for (var i = 0; i < 3; i++) {\n model.center[i] = (model.bounds[2 * i + 1] + model.bounds[2 * i]) / 2.0;\n }\n\n return model.center.slice();\n };\n\n publicAPI.getLength = function () {\n var diff = 0.0;\n var l = 0.0;\n publicAPI.getBounds();\n\n for (var i = 0; i < 3; i++) {\n diff = model.bounds[2 * i + 1] - model.bounds[2 * i];\n l += diff * diff;\n }\n\n return Math.sqrt(l);\n };\n\n publicAPI.getClippingPlaneInDataCoords = function (propMatrix, i, hnormal) {\n var clipPlanes = model.clippingPlanes;\n var mat = propMatrix;\n\n if (clipPlanes) {\n var n = clipPlanes.length;\n\n if (i >= 0 && i < n) {\n // Get the plane\n var plane = clipPlanes[i];\n var normal = plane.getNormal();\n var origin = plane.getOrigin(); // Compute the plane equation\n\n var v1 = normal[0];\n var v2 = normal[1];\n var v3 = normal[2];\n var v4 = -(v1 * origin[0] + v2 * origin[1] + v3 * origin[2]); // Transform normal from world to data coords\n\n hnormal[0] = v1 * mat[0] + v2 * mat[4] + v3 * mat[8] + v4 * mat[12];\n hnormal[1] = v1 * mat[1] + v2 * mat[5] + v3 * mat[9] + v4 * mat[13];\n hnormal[2] = v1 * mat[2] + v2 * mat[6] + v3 * mat[10] + v4 * mat[14];\n hnormal[3] = v1 * mat[3] + v2 * mat[7] + v3 * mat[11] + v4 * mat[15];\n return;\n }\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro(\"Clipping plane index \".concat(i, \" is out of range.\"));\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bounds: [1, -1, 1, -1, 1, -1],\n center: [0, 0, 0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_AbstractMapper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n\n if (!model.bounds) {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"uninitializeBounds\"](model.bounds);\n }\n\n if (!model.center) {\n model.center = [0.0, 0.0, 0.0];\n }\n\n vtkAbstractMapper3D(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper3D/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/AbstractPicker/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/AbstractPicker/index.js ***! - \****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkAbstractPicker methods\n// ----------------------------------------------------------------------------\n\nfunction vtkAbstractPicker(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkAbstractPicker');\n\n publicAPI.initialize = function () {\n model.renderer = null;\n model.selectionPoint[0] = 0.0;\n model.selectionPoint[1] = 0.0;\n model.selectionPoint[2] = 0.0;\n model.pickPosition[0] = 0.0;\n model.pickPosition[1] = 0.0;\n model.pickPosition[2] = 0.0;\n };\n\n publicAPI.initializePickList = function () {\n model.pickList = [];\n };\n\n publicAPI.addPickList = function (actor) {\n model.pickList.push(actor);\n };\n\n publicAPI.deletePickList = function (actor) {\n var i = model.pickList.indexOf(actor);\n\n if (i !== -1) {\n model.pickList.splice(i, 1);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n renderer: null,\n selectionPoint: [0.0, 0.0, 0.0],\n pickPosition: [0.0, 0.0, 0.0],\n pickFromList: 0,\n pickList: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['renderer']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['selectionPoint', 'pickPosition']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['pickFromList', 'pickList']);\n vtkAbstractPicker(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkAbstractPicker'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/AbstractPicker/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js": -/*!*******************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js ***! - \*******************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Prop3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Prop3D */ \"./node_modules/vtk.js/Sources/Rendering/Core/Prop3D/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkDebugMacro; // ----------------------------------------------------------------------------\n// vtkActor methods\n// ----------------------------------------------------------------------------\n\nfunction vtkActor(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkActor'); // Capture 'parentClass' api for internal use\n\n var superClass = _objectSpread({}, publicAPI);\n\n publicAPI.getActors = function () {\n return publicAPI;\n };\n\n publicAPI.getIsOpaque = function () {\n if (model.forceOpaque) {\n return true;\n }\n\n if (model.forceTranslucent) {\n return false;\n } // make sure we have a property\n\n\n if (!model.property) {\n // force creation of a property\n publicAPI.getProperty();\n }\n\n var isOpaque = model.property.getOpacity() >= 1.0; // are we using an opaque texture, if any?\n\n isOpaque = isOpaque && (!model.texture || !model.texture.isTranslucent()); // are we using an opaque scalar array, if any?\n\n isOpaque = isOpaque && (!model.mapper || model.mapper.getIsOpaque());\n return isOpaque;\n };\n\n publicAPI.hasTranslucentPolygonalGeometry = function () {\n if (model.mapper === null) {\n return false;\n } // make sure we have a property\n\n\n if (model.property === null) {\n // force creation of a property\n publicAPI.setProperty(publicAPI.makeProperty());\n } // is this actor opaque ?\n\n\n return !publicAPI.getIsOpaque();\n };\n\n publicAPI.makeProperty = vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance;\n\n publicAPI.getProperty = function () {\n if (model.property === null) {\n model.property = publicAPI.makeProperty();\n }\n\n return model.property;\n };\n\n publicAPI.getBounds = function () {\n if (model.mapper === null) {\n return model.bounds;\n } // Check for the special case when the mapper's bounds are unknown\n\n\n var bds = model.mapper.getBounds();\n\n if (!bds || bds.length !== 6) {\n return bds;\n } // Check for the special case when the actor is empty.\n\n\n if (bds[0] > bds[1]) {\n model.mapperBounds = bds.concat(); // copy the mapper's bounds\n\n model.bounds = [1, -1, 1, -1, 1, -1];\n model.boundsMTime.modified();\n return bds;\n } // Check if we have cached values for these bounds - we cache the\n // values returned by model.mapper.getBounds() and we store the time\n // of caching. If the values returned this time are different, or\n // the modified time of this class is newer than the cached time,\n // then we need to rebuild.\n\n\n if (!model.mapperBounds || bds[0] !== model.mapperBounds[0] || bds[1] !== model.mapperBounds[1] || bds[2] !== model.mapperBounds[2] || bds[3] !== model.mapperBounds[3] || bds[4] !== model.mapperBounds[4] || bds[5] !== model.mapperBounds[5] || publicAPI.getMTime() > model.boundsMTime.getMTime()) {\n vtkDebugMacro('Recomputing bounds...');\n model.mapperBounds = bds.concat(); // copy the mapper's bounds\n\n var bbox = [];\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getCorners(bds, bbox);\n publicAPI.computeMatrix();\n var tmp4 = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(tmp4, model.matrix);\n bbox.forEach(function (pt) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(pt, pt, tmp4);\n });\n /* eslint-disable no-multi-assign */\n\n model.bounds[0] = model.bounds[2] = model.bounds[4] = Number.MAX_VALUE;\n model.bounds[1] = model.bounds[3] = model.bounds[5] = -Number.MAX_VALUE;\n /* eslint-enable no-multi-assign */\n\n model.bounds = model.bounds.map(function (d, i) {\n return i % 2 === 0 ? bbox.reduce(function (a, b) {\n return a > b[i / 2] ? b[i / 2] : a;\n }, d) : bbox.reduce(function (a, b) {\n return a < b[(i - 1) / 2] ? b[(i - 1) / 2] : a;\n }, d);\n });\n model.boundsMTime.modified();\n }\n\n return model.bounds;\n };\n\n publicAPI.getMTime = function () {\n var mt = superClass.getMTime();\n\n if (model.property !== null) {\n var time = model.property.getMTime();\n mt = time > mt ? time : mt;\n }\n\n if (model.backfaceProperty !== null) {\n var _time = model.backfaceProperty.getMTime();\n\n mt = _time > mt ? _time : mt;\n }\n\n return mt;\n };\n\n publicAPI.getRedrawMTime = function () {\n var mt = model.mtime;\n\n if (model.mapper !== null) {\n var time = model.mapper.getMTime();\n mt = time > mt ? time : mt;\n\n if (model.mapper.getInput() !== null) {\n // FIXME !!! getInputAlgorithm / getInput\n model.mapper.getInputAlgorithm().update();\n time = model.mapper.getInput().getMTime();\n mt = time > mt ? time : mt;\n }\n }\n\n return mt;\n };\n\n publicAPI.getSupportsSelection = function () {\n return model.mapper ? model.mapper.getSupportsSelection() : false;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n mapper: null,\n property: null,\n backfaceProperty: null,\n forceOpaque: false,\n forceTranslucent: false,\n bounds: [1, -1, 1, -1, 1, -1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Prop3D__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues); // vtkTimeStamp\n\n model.boundsMTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(model.boundsMTime); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].set(publicAPI, model, ['property']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['backfaceProperty', 'forceOpaque', 'forceTranslucent', 'mapper']); // Object methods\n\n vtkActor(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkActor'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Camera/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Camera/index.js ***! - \********************************************************************/ -/*! exports provided: DEFAULT_VALUES, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_VALUES\", function() { return DEFAULT_VALUES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkDebugMacro;\n/* eslint-disable new-cap */\n\n/*\n * Convenience function to access elements of a gl-matrix. If it turns\n * out I have rows and columns swapped everywhere, then I'll just change\n * the order of 'row' and 'col' parameters in this function\n */\n// function getMatrixElement(matrix, row, col) {\n// const idx = (row * 4) + col;\n// return matrix[idx];\n// }\n// ----------------------------------------------------------------------------\n// vtkCamera methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCamera(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCamera'); // Set up private variables and methods\n\n var origin = new Float64Array(3);\n var dopbasis = new Float64Array([0.0, 0.0, -1.0]);\n var upbasis = new Float64Array([0.0, 1.0, 0.0]);\n var tmpMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n var tmpvec1 = new Float64Array(3);\n var tmpvec2 = new Float64Array(3);\n var tmpvec3 = new Float64Array(3);\n var rotateMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n var trans = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n var newPosition = new Float64Array(3);\n var newFocalPoint = new Float64Array(3); // Internal Functions that don't need to be public\n\n function computeViewPlaneNormal() {\n // VPN is -DOP\n model.viewPlaneNormal[0] = -model.directionOfProjection[0];\n model.viewPlaneNormal[1] = -model.directionOfProjection[1];\n model.viewPlaneNormal[2] = -model.directionOfProjection[2];\n }\n\n publicAPI.orthogonalizeViewUp = function () {\n var vt = publicAPI.getViewMatrix();\n model.viewUp[0] = vt[4];\n model.viewUp[1] = vt[5];\n model.viewUp[2] = vt[6];\n publicAPI.modified();\n };\n\n publicAPI.setPosition = function (x, y, z) {\n if (x === model.position[0] && y === model.position[1] && z === model.position[2]) {\n return;\n }\n\n model.position[0] = x;\n model.position[1] = y;\n model.position[2] = z; // recompute the focal distance\n\n publicAPI.computeDistance();\n publicAPI.modified();\n };\n\n publicAPI.setFocalPoint = function (x, y, z) {\n if (x === model.focalPoint[0] && y === model.focalPoint[1] && z === model.focalPoint[2]) {\n return;\n }\n\n model.focalPoint[0] = x;\n model.focalPoint[1] = y;\n model.focalPoint[2] = z; // recompute the focal distance\n\n publicAPI.computeDistance();\n publicAPI.modified();\n };\n\n publicAPI.setDistance = function (d) {\n if (model.distance === d) {\n return;\n }\n\n model.distance = d;\n\n if (model.distance < 1e-20) {\n model.distance = 1e-20;\n vtkDebugMacro('Distance is set to minimum.');\n } // we want to keep the camera pointing in the same direction\n\n\n var vec = model.directionOfProjection; // recalculate FocalPoint\n\n model.focalPoint[0] = model.position[0] + vec[0] * model.distance;\n model.focalPoint[1] = model.position[1] + vec[1] * model.distance;\n model.focalPoint[2] = model.position[2] + vec[2] * model.distance;\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n // This method must be called when the focal point or camera position changes\n\n\n publicAPI.computeDistance = function () {\n var dx = model.focalPoint[0] - model.position[0];\n var dy = model.focalPoint[1] - model.position[1];\n var dz = model.focalPoint[2] - model.position[2];\n model.distance = Math.sqrt(dx * dx + dy * dy + dz * dz);\n\n if (model.distance < 1e-20) {\n model.distance = 1e-20;\n vtkDebugMacro('Distance is set to minimum.');\n var vec = model.directionOfProjection; // recalculate FocalPoint\n\n model.focalPoint[0] = model.position[0] + vec[0] * model.distance;\n model.focalPoint[1] = model.position[1] + vec[1] * model.distance;\n model.focalPoint[2] = model.position[2] + vec[2] * model.distance;\n }\n\n model.directionOfProjection[0] = dx / model.distance;\n model.directionOfProjection[1] = dy / model.distance;\n model.directionOfProjection[2] = dz / model.distance;\n computeViewPlaneNormal();\n }; //----------------------------------------------------------------------------\n // Move the position of the camera along the view plane normal. Moving\n // towards the focal point (e.g., > 1) is a dolly-in, moving away\n // from the focal point (e.g., < 1) is a dolly-out.\n\n\n publicAPI.dolly = function (amount) {\n if (amount <= 0.0) {\n return;\n } // dolly moves the camera towards the focus\n\n\n var d = model.distance / amount;\n publicAPI.setPosition(model.focalPoint[0] - d * model.directionOfProjection[0], model.focalPoint[1] - d * model.directionOfProjection[1], model.focalPoint[2] - d * model.directionOfProjection[2]);\n };\n\n publicAPI.roll = function (angle) {\n var eye = model.position;\n var at = model.focalPoint;\n var up = model.viewUp;\n var viewUpVec4 = new Float64Array([up[0], up[1], up[2], 0.0]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(rotateMatrix);\n var viewDir = new Float64Array([at[0] - eye[0], at[1] - eye[1], at[2] - eye[2]]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(rotateMatrix, rotateMatrix, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](angle), viewDir);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec4\"].transformMat4(viewUpVec4, viewUpVec4, rotateMatrix);\n model.viewUp[0] = viewUpVec4[0];\n model.viewUp[1] = viewUpVec4[1];\n model.viewUp[2] = viewUpVec4[2];\n publicAPI.modified();\n };\n\n publicAPI.azimuth = function (angle) {\n var fp = model.focalPoint;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(trans); // translate the focal point to the origin,\n // rotate about view up,\n // translate back again\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, fp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(trans, trans, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](angle), model.viewUp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, [-fp[0], -fp[1], -fp[2]]); // apply the transform to the position\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newPosition, model.position, trans);\n publicAPI.setPosition(newPosition[0], newPosition[1], newPosition[2]);\n };\n\n publicAPI.yaw = function (angle) {\n var position = model.position;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(trans); // translate the camera to the origin,\n // rotate about axis,\n // translate back again\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, position);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(trans, trans, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](angle), model.viewUp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, [-position[0], -position[1], -position[2]]); // apply the transform to the position\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newFocalPoint, model.focalPoint, trans);\n publicAPI.setFocalPoint(newFocalPoint[0], newFocalPoint[1], newFocalPoint[2]);\n };\n\n publicAPI.elevation = function (angle) {\n var fp = model.focalPoint; // get the eye / camera position from the viewMatrix\n\n var vt = publicAPI.getViewMatrix();\n var axis = [-vt[0], -vt[1], -vt[2]];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(trans); // translate the focal point to the origin,\n // rotate about view up,\n // translate back again\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, fp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(trans, trans, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](angle), axis);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, [-fp[0], -fp[1], -fp[2]]); // apply the transform to the position\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newPosition, model.position, trans);\n publicAPI.setPosition(newPosition[0], newPosition[1], newPosition[2]);\n };\n\n publicAPI.pitch = function (angle) {\n var position = model.position;\n var vt = publicAPI.getViewMatrix();\n var axis = [vt[0], vt[1], vt[2]];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(trans); // translate the camera to the origin,\n // rotate about axis,\n // translate back again\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, position);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(trans, trans, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](angle), axis);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, [-position[0], -position[1], -position[2]]); // apply the transform to the focal point\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newFocalPoint, model.focalPoint, trans);\n publicAPI.setFocalPoint.apply(publicAPI, _toConsumableArray(newFocalPoint));\n };\n\n publicAPI.zoom = function (factor) {\n if (factor <= 0) {\n return;\n }\n\n if (model.parallelProjection) {\n model.parallelScale /= factor;\n } else {\n model.viewAngle /= factor;\n }\n\n publicAPI.modified();\n };\n\n publicAPI.translate = function (x, y, z) {\n var offset = [x, y, z];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"add\"](model.position, offset, model.position);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"add\"](model.focalPoint, offset, model.focalPoint);\n publicAPI.computeDistance();\n publicAPI.modified();\n };\n\n publicAPI.applyTransform = function (transformMat4) {\n var vuOld = [].concat(_toConsumableArray(model.viewUp), [1.0]);\n var posNew = [];\n var fpNew = [];\n var vuNew = [];\n vuOld[0] += model.position[0];\n vuOld[1] += model.position[1];\n vuOld[2] += model.position[2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec4\"].transformMat4(posNew, [].concat(_toConsumableArray(model.position), [1.0]), transformMat4);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec4\"].transformMat4(fpNew, [].concat(_toConsumableArray(model.focalPoint), [1.0]), transformMat4);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec4\"].transformMat4(vuNew, vuOld, transformMat4);\n vuNew[0] -= posNew[0];\n vuNew[1] -= posNew[1];\n vuNew[2] -= posNew[2];\n publicAPI.setPosition.apply(publicAPI, _toConsumableArray(posNew.slice(0, 3)));\n publicAPI.setFocalPoint.apply(publicAPI, _toConsumableArray(fpNew.slice(0, 3)));\n publicAPI.setViewUp.apply(publicAPI, _toConsumableArray(vuNew.slice(0, 3)));\n };\n\n publicAPI.getThickness = function () {\n return model.clippingRange[1] - model.clippingRange[0];\n };\n\n publicAPI.setThickness = function (thickness) {\n var t = thickness;\n\n if (t < 1e-20) {\n t = 1e-20;\n vtkDebugMacro('Thickness is set to minimum.');\n }\n\n publicAPI.setClippingRange(model.clippingRange[0], model.clippingRange[0] + t);\n };\n\n publicAPI.setThicknessFromFocalPoint = function (thickness) {\n var t = thickness;\n\n if (t < 1e-20) {\n t = 1e-20;\n vtkDebugMacro('Thickness is set to minimum.');\n }\n\n publicAPI.setClippingRange(model.distance - t / 2, model.distance + t / 2);\n }; // Unimplemented functions\n\n\n publicAPI.setRoll = function (angle) {}; // dependency on GetOrientation() and a model.ViewTransform object, see https://github.com/Kitware/VTK/blob/master/Common/Transforms/vtkTransform.cxx and https://vtk.org/doc/nightly/html/classvtkTransform.html\n\n\n publicAPI.getRoll = function () {};\n\n publicAPI.setObliqueAngles = function (alpha, beta) {};\n\n publicAPI.getOrientation = function () {};\n\n publicAPI.getOrientationWXYZ = function () {};\n\n publicAPI.getFrustumPlanes = function (aspect) {// Return array of 24 params (4 params for each of 6 plane equations)\n };\n\n publicAPI.getCameraLightTransformMatrix = function () {};\n\n publicAPI.deepCopy = function (sourceCamera) {};\n\n publicAPI.physicalOrientationToWorldDirection = function (ori) {\n // push the x axis through the orientation quat\n var oriq = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].fromValues(ori[0], ori[1], ori[2], ori[3]);\n var coriq = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].create();\n var qdir = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].fromValues(0.0, 0.0, 1.0, 0.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].conjugate(coriq, oriq); // rotate the z axis by the quat\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].multiply(qdir, oriq, qdir);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].multiply(qdir, qdir, coriq); // return the z axis in world coords\n\n return [qdir[0], qdir[1], qdir[2]];\n };\n\n publicAPI.getPhysicalToWorldMatrix = function (result) {\n publicAPI.getWorldToPhysicalMatrix(result);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(result, result);\n };\n\n publicAPI.getWorldToPhysicalMatrix = function (result) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(result); // now the physical to vtk world rotation tform\n\n var physVRight = [3];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](model.physicalViewNorth, model.physicalViewUp, physVRight);\n result[0] = physVRight[0];\n result[1] = physVRight[1];\n result[2] = physVRight[2];\n result[4] = model.physicalViewUp[0];\n result[5] = model.physicalViewUp[1];\n result[6] = model.physicalViewUp[2];\n result[8] = -model.physicalViewNorth[0];\n result[9] = -model.physicalViewNorth[1];\n result[10] = -model.physicalViewNorth[2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(result, result);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(tmpvec1, 1 / model.physicalScale, 1 / model.physicalScale, 1 / model.physicalScale);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].scale(result, result, tmpvec1);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(result, result, model.physicalTranslation);\n };\n\n publicAPI.computeViewParametersFromViewMatrix = function (vmat) {\n // invert to get view to world\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(tmpMatrix, vmat); // note with glmatrix operations happen in\n // the reverse order\n // mat.scale\n // mat.translate\n // will result in the translation then the scale\n // mat.mult(a,b)\n // results in perform the B transformation then A\n // then extract the params position, orientation\n // push 0,0,0 through to get a translation\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(tmpvec1, origin, tmpMatrix);\n publicAPI.computeDistance();\n var oldDist = model.distance;\n publicAPI.setPosition(tmpvec1[0], tmpvec1[1], tmpvec1[2]); // push basis vectors to get orientation\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(tmpvec2, dopbasis, tmpMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].subtract(tmpvec2, tmpvec2, tmpvec1);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].normalize(tmpvec2, tmpvec2);\n publicAPI.setDirectionOfProjection(tmpvec2[0], tmpvec2[1], tmpvec2[2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(tmpvec3, upbasis, tmpMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].subtract(tmpvec3, tmpvec3, tmpvec1);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].normalize(tmpvec3, tmpvec3);\n publicAPI.setViewUp(tmpvec3[0], tmpvec3[1], tmpvec3[2]);\n publicAPI.setDistance(oldDist);\n }; // the provided matrix should include\n // translation and orientation only\n // mat is physical to view\n\n\n publicAPI.computeViewParametersFromPhysicalMatrix = function (mat) {\n // get the WorldToPhysicalMatrix\n publicAPI.getWorldToPhysicalMatrix(tmpMatrix); // first convert the physical -> view matrix to be\n // world -> view\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(tmpMatrix, mat, tmpMatrix);\n publicAPI.computeViewParametersFromViewMatrix(tmpMatrix);\n };\n\n publicAPI.setViewMatrix = function (mat) {\n model.viewMatrix = mat;\n\n if (model.viewMatrix) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(tmpMatrix, model.viewMatrix);\n publicAPI.computeViewParametersFromViewMatrix(tmpMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.viewMatrix, model.viewMatrix);\n }\n };\n\n publicAPI.getViewMatrix = function () {\n if (model.viewMatrix) {\n return model.viewMatrix;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].lookAt(tmpMatrix, model.position, // eye\n model.focalPoint, // at\n model.viewUp // up\n );\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(tmpMatrix, tmpMatrix);\n var result = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(result, tmpMatrix);\n return result;\n };\n\n publicAPI.setProjectionMatrix = function (mat) {\n model.projectionMatrix = mat;\n };\n\n publicAPI.getProjectionMatrix = function (aspect, nearz, farz) {\n var result = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(result);\n\n if (model.projectionMatrix) {\n var scale = 1 / model.physicalScale;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(tmpvec1, scale, scale, scale);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(result, model.projectionMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].scale(result, result, tmpvec1);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(result, result);\n return result;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(tmpMatrix); // FIXME: Not sure what to do about adjust z buffer here\n // adjust Z-buffer range\n // this->ProjectionTransform->AdjustZBuffer( -1, +1, nearz, farz );\n\n var cWidth = model.clippingRange[1] - model.clippingRange[0];\n var cRange = [model.clippingRange[0] + (nearz + 1) * cWidth / 2.0, model.clippingRange[0] + (farz + 1) * cWidth / 2.0];\n\n if (model.parallelProjection) {\n // set up a rectangular parallelipiped\n var width = model.parallelScale * aspect;\n var height = model.parallelScale;\n var xmin = (model.windowCenter[0] - 1.0) * width;\n var xmax = (model.windowCenter[0] + 1.0) * width;\n var ymin = (model.windowCenter[1] - 1.0) * height;\n var ymax = (model.windowCenter[1] + 1.0) * height;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].ortho(tmpMatrix, xmin, xmax, ymin, ymax, cRange[0], cRange[1]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(tmpMatrix, tmpMatrix);\n } else if (model.useOffAxisProjection) {\n throw new Error('Off-Axis projection is not supported at this time');\n } else {\n var tmp = Math.tan(vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](model.viewAngle) / 2.0);\n\n var _width;\n\n var _height;\n\n if (model.useHorizontalViewAngle === true) {\n _width = model.clippingRange[0] * tmp;\n _height = model.clippingRange[0] * tmp / aspect;\n } else {\n _width = model.clippingRange[0] * tmp * aspect;\n _height = model.clippingRange[0] * tmp;\n }\n\n var _xmin = (model.windowCenter[0] - 1.0) * _width;\n\n var _xmax = (model.windowCenter[0] + 1.0) * _width;\n\n var _ymin = (model.windowCenter[1] - 1.0) * _height;\n\n var _ymax = (model.windowCenter[1] + 1.0) * _height;\n\n var znear = cRange[0];\n var zfar = cRange[1];\n tmpMatrix[0] = 2.0 * znear / (_xmax - _xmin);\n tmpMatrix[5] = 2.0 * znear / (_ymax - _ymin);\n tmpMatrix[2] = (_xmin + _xmax) / (_xmax - _xmin);\n tmpMatrix[6] = (_ymin + _ymax) / (_ymax - _ymin);\n tmpMatrix[10] = -(znear + zfar) / (zfar - znear);\n tmpMatrix[14] = -1.0;\n tmpMatrix[11] = -2.0 * znear * zfar / (zfar - znear);\n tmpMatrix[15] = 0.0;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(result, tmpMatrix);\n return result;\n };\n\n publicAPI.getCompositeProjectionMatrix = function (aspect, nearz, farz) {\n var vMat = publicAPI.getViewMatrix();\n var pMat = publicAPI.getProjectionMatrix(aspect, nearz, farz); // mats are transposed so the order is A then B\n // we reuse pMat as it is a copy so we can do what we want with it\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(pMat, vMat, pMat);\n return pMat;\n };\n\n publicAPI.setDirectionOfProjection = function (x, y, z) {\n if (model.directionOfProjection[0] === x && model.directionOfProjection[1] === y && model.directionOfProjection[2] === z) {\n return;\n }\n\n model.directionOfProjection[0] = x;\n model.directionOfProjection[1] = y;\n model.directionOfProjection[2] = z;\n var vec = model.directionOfProjection; // recalculate FocalPoint\n\n model.focalPoint[0] = model.position[0] + vec[0] * model.distance;\n model.focalPoint[1] = model.position[1] + vec[1] * model.distance;\n model.focalPoint[2] = model.position[2] + vec[2] * model.distance;\n computeViewPlaneNormal();\n }; // used to handle convert js device orientation angles\n // when you use this method the camera will adjust to the\n // device orientation such that the physicalViewUp you set\n // in world coordinates looks up, and the physicalViewNorth\n // you set in world coorindates will (maybe) point north\n //\n // NOTE WARNING - much of the documentation out there on how\n // orientation works is seriously wrong. Even worse the Chrome\n // device orientation simulator is completely wrong and should\n // never be used. OMG it is so messed up.\n //\n // how it seems to work on iOS is that the device orientation\n // is specified in extrinsic angles with a alpha, beta, gamma\n // convention with axes of Z, X, Y (the code below substitutes\n // the physical coordinate system for these axes to get the right\n // modified coordinate system.\n\n\n publicAPI.setDeviceAngles = function (alpha, beta, gamma, screen) {\n var physVRight = [3];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](model.physicalViewNorth, model.physicalViewUp, physVRight); // phone to physical coordinates\n\n var rotmat = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(rotmat, rotmat, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](alpha), model.physicalViewUp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(rotmat, rotmat, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](beta), physVRight);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(rotmat, rotmat, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](gamma), model.physicalViewNorth);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(rotmat, rotmat, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](-screen), model.physicalViewUp);\n var dop = new Float64Array([-model.physicalViewUp[0], -model.physicalViewUp[1], -model.physicalViewUp[2]]);\n var vup = new Float64Array(model.physicalViewNorth);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(dop, dop, rotmat);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(vup, vup, rotmat);\n publicAPI.setDirectionOfProjection(dop[0], dop[1], dop[2]);\n publicAPI.setViewUp(vup[0], vup[1], vup[2]);\n publicAPI.modified();\n };\n\n publicAPI.setOrientationWXYZ = function (degrees, x, y, z) {\n var quatMat = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n\n if (degrees !== 0.0 && (x !== 0.0 || y !== 0.0 || z !== 0.0)) {\n // convert to radians\n var angle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](degrees);\n var q = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].setAxisAngle(q, [x, y, z], angle);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].fromQuat(quatMat, q);\n }\n\n var newdop = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newdop, [0.0, 0.0, -1.0], quatMat);\n var newvup = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newvup, [0.0, 1.0, 0.0], quatMat);\n publicAPI.setDirectionOfProjection.apply(publicAPI, _toConsumableArray(newdop));\n publicAPI.setViewUp.apply(publicAPI, _toConsumableArray(newvup));\n publicAPI.modified();\n };\n\n publicAPI.computeClippingRange = function (bounds) {\n var vn = null;\n var position = null;\n vn = model.viewPlaneNormal;\n position = model.position;\n var a = -vn[0];\n var b = -vn[1];\n var c = -vn[2];\n var d = -(a * position[0] + b * position[1] + c * position[2]); // Set the max near clipping plane and the min far clipping plane\n\n var range = [a * bounds[0] + b * bounds[2] + c * bounds[4] + d, 1e-18]; // Find the closest / farthest bounding box vertex\n\n for (var k = 0; k < 2; k++) {\n for (var j = 0; j < 2; j++) {\n for (var i = 0; i < 2; i++) {\n var dist = a * bounds[i] + b * bounds[2 + j] + c * bounds[4 + k] + d;\n range[0] = dist < range[0] ? dist : range[0];\n range[1] = dist > range[1] ? dist : range[1];\n }\n }\n }\n\n return range;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n position: [0, 0, 1],\n focalPoint: [0, 0, 0],\n viewUp: [0, 1, 0],\n directionOfProjection: [0, 0, -1],\n parallelProjection: false,\n useHorizontalViewAngle: false,\n viewAngle: 30,\n parallelScale: 1,\n clippingRange: [0.01, 1000.01],\n windowCenter: [0, 0],\n viewPlaneNormal: [0, 0, 1],\n useOffAxisProjection: false,\n screenBottomLeft: [-0.5, -0.5, -0.5],\n screenBottomRight: [0.5, -0.5, -0.5],\n screenTopRight: [0.5, 0.5, -0.5],\n freezeFocalPoint: false,\n projectionMatrix: null,\n viewMatrix: null,\n // used for world to physical transformations\n physicalTranslation: [0, 0, 0],\n physicalScale: 1.0,\n physicalViewUp: [0, 1, 0],\n physicalViewNorth: [0, 0, -1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get(publicAPI, model, ['distance']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['parallelProjection', 'useHorizontalViewAngle', 'viewAngle', 'parallelScale', 'useOffAxisProjection', 'freezeFocalPoint', 'physicalScale']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getArray(publicAPI, model, ['directionOfProjection', 'viewPlaneNormal', 'position', 'focalPoint']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGetArray(publicAPI, model, ['clippingRange', 'windowCenter'], 2);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGetArray(publicAPI, model, ['viewUp', 'screenBottomLeft', 'screenBottomRight', 'screenTopRight', 'physicalTranslation', 'physicalViewUp', 'physicalViewNorth'], 3); // Object methods\n\n vtkCamera(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkCamera'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Camera/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.js ***! - \***************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json */ \"./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json\");\nvar vtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps_json__WEBPACK_IMPORTED_MODULE_0___namespace = /*#__PURE__*/__webpack_require__.t(/*! vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json */ \"./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json\", 1);\n\nvar presetMap = Object.create(null);\nvtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps_json__WEBPACK_IMPORTED_MODULE_0__.filter(function (p) {\n return p.RGBPoints;\n}).filter(function (p) {\n return p.ColorSpace !== 'CIELAB';\n}).forEach(function (p) {\n presetMap[p.Name] = p;\n}); // ----------------------------------------------------------------------------\n\nvar rgbPresetNames = Object.keys(presetMap);\nrgbPresetNames.sort(); // ----------------------------------------------------------------------------\n\nfunction getPresetByName(name) {\n return presetMap[name];\n} // ----------------------------------------------------------------------------\n\n\nfunction addPreset(preset) {\n if (!preset.RGBPoints || preset.ColorSpace === 'CIELAB') {\n return;\n }\n\n if (!presetMap[preset.Name]) {\n rgbPresetNames.push(preset.Name);\n rgbPresetNames.sort();\n }\n\n presetMap[preset.Name] = preset;\n} // ----------------------------------------------------------------------------\n\n\nfunction removePresetByName(name) {\n var index = rgbPresetNames.indexOf(name);\n\n if (index > -1) {\n rgbPresetNames.splice(index, 1);\n }\n\n delete presetMap[name];\n} // ----------------------------------------------------------------------------\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n addPreset: addPreset,\n removePresetByName: removePresetByName,\n getPresetByName: getPresetByName,\n rgbPresetNames: rgbPresetNames\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json": -/*!*****************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json ***! - \*****************************************************************************************/ -/*! exports provided: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, default */ -/***/ (function(module) { - -eval("module.exports = [{\"Name\":\"KAAMS\",\"IndexedColors\":[1,1,1,1,0,0,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,0.63,0.63,1,0.67,0.5,0.33,1,0.5,0.75,0.53,0.35,0.7,1,0.75,0.5],\"Annotations\":[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11]},{\"ColorSpace\":\"Diverging\",\"Name\":\"Cool to Warm\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0.23137254902,0.298039215686,0.752941176471,0.5,0.865,0.865,0.865,1,0.705882352941,0.0156862745098,0.149019607843]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Cool to Warm (Extended)\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,0,0,0.34902,0.03125,0.039216,0.062745,0.380392,0.0625,0.062745,0.117647,0.411765,0.09375,0.090196,0.184314,0.45098,0.125,0.12549,0.262745,0.501961,0.15625,0.160784,0.337255,0.541176,0.1875,0.2,0.396078,0.568627,0.21875,0.239216,0.454902,0.6,0.25,0.286275,0.521569,0.65098,0.28125,0.337255,0.592157,0.701961,0.3125,0.388235,0.654902,0.74902,0.34375,0.466667,0.737255,0.819608,0.375,0.572549,0.819608,0.878431,0.40625,0.654902,0.866667,0.909804,0.4375,0.752941,0.917647,0.941176,0.46875,0.823529,0.956863,0.968627,0.5,0.988235,0.960784,0.901961,0.5,0.941176,0.984314,0.988235,0.52,0.988235,0.945098,0.85098,0.54,0.980392,0.898039,0.784314,0.5625,0.968627,0.835294,0.698039,0.59375,0.94902,0.733333,0.588235,0.625,0.929412,0.65098,0.509804,0.65625,0.909804,0.564706,0.435294,0.6875,0.878431,0.458824,0.352941,0.71875,0.839216,0.388235,0.286275,0.75,0.760784,0.294118,0.211765,0.78125,0.701961,0.211765,0.168627,0.8125,0.65098,0.156863,0.129412,0.84375,0.6,0.094118,0.094118,0.875,0.54902,0.066667,0.098039,0.90625,0.501961,0.05098,0.12549,0.9375,0.45098,0.054902,0.172549,0.96875,0.4,0.054902,0.192157,1,0.34902,0.070588,0.211765]},{\"ColorSpace\":\"Diverging\",\"Name\":\"Warm to Cool\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0.705882352941,0.0156862745098,0.149019607843,0.5,0.865,0.865,0.865,1,0.23137254902,0.298039215686,0.752941176471]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Warm to Cool (Extended)\",\"NanColor\":[0.250004,0,0],\"RGBPoints\":[0,0.34902,0,0.129412,0.025,0.4,0.00392157,0.101961,0.05,0.470588,0.0156863,0.0901961,0.075,0.54902,0.027451,0.0705882,0.1,0.619608,0.0627451,0.0431373,0.125,0.690196,0.12549,0.0627451,0.15,0.741176,0.184314,0.0745098,0.175,0.788235,0.266667,0.0941176,0.2,0.811765,0.345098,0.113725,0.225,0.831373,0.411765,0.133333,0.25,0.85098,0.47451,0.145098,0.275,0.870588,0.54902,0.156863,0.3,0.878431,0.619608,0.168627,0.325,0.890196,0.658824,0.196078,0.35,0.909804,0.717647,0.235294,0.375,0.929412,0.776471,0.278431,0.395522,0.94902,0.823529,0.321569,0.418905,0.968627,0.87451,0.407843,0.444278,0.980392,0.917647,0.509804,0.470149,0.988235,0.956863,0.643137,0.483582,0.992157,0.964706,0.713725,0.499,0.988235,0.980392,0.870588,0.5,1,1,1,0.501,0.913725,0.988235,0.937255,0.516418,0.827451,0.980392,0.886275,0.531343,0.764706,0.980392,0.866667,0.546766,0.658824,0.980392,0.843137,0.564179,0.572549,0.964706,0.835294,0.587562,0.423529,0.941176,0.87451,0.60597,0.262745,0.901961,0.862745,0.629851,0.0705882,0.854902,0.870588,0.651741,0.0509804,0.8,0.85098,0.681592,0.0235294,0.709804,0.831373,0.712935,0.0313725,0.615686,0.811765,0.75,0.0313725,0.537255,0.788235,0.775,0.0392157,0.466667,0.768627,0.8,0.0509804,0.396078,0.741176,0.825,0.054902,0.317647,0.709804,0.85,0.054902,0.243137,0.678431,0.875,0.0431373,0.164706,0.639216,0.9,0.0313725,0.0980392,0.6,0.925,0.0392157,0.0392157,0.560784,0.95,0.105882,0.0509804,0.509804,0.975,0.113725,0.0235294,0.45098,1,0.12549,0,0.380392]},{\"ColorSpace\":\"RGB\",\"Name\":\"Rainbow Desaturated\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0.278431372549,0.278431372549,0.858823529412,0.143,0,0,0.360784313725,0.285,0,1,1,0.429,0,0.501960784314,0,0.571,1,1,0,0.714,1,0.380392156863,0,0.857,0.419607843137,0,0,1,0.878431372549,0.301960784314,0.301960784314]},{\"ColorSpace\":\"RGB\",\"Name\":\"Cold and Hot\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0,1,1,0.45,0,0,1,0.5,0,0,0.501960784314,0.55,1,0,0,1,1,1,0]},{\"ColorSpace\":\"RGB\",\"Name\":\"Black-Body Radiation\",\"NanColor\":[0,0.498039215686,1],\"RGBPoints\":[0,0,0,0,0.4,0.901960784314,0,0,0.8,0.901960784314,0.901960784314,0,1,1,1,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"X Ray\",\"NanColor\":[1,0,0],\"RGBPoints\":[0,1,1,1,1,0,0,0]},{\"ColorSpace\":\"RGB\",\"Name\":\"Grayscale\",\"NanColor\":[1,0,0],\"RGBPoints\":[0,0,0,0,1,1,1,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"BkRd\",\"NanColor\":[0,1,1],\"RGBPoints\":[0,0,0,0,1,1,0,0]},{\"ColorSpace\":\"RGB\",\"Name\":\"BkGn\",\"NanColor\":[1,0,1],\"RGBPoints\":[0,0,0,0,1,0,1,0]},{\"ColorSpace\":\"RGB\",\"Name\":\"BkBu\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0,0,0,1,0,0,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"BkMa\",\"NanColor\":[0,1,0],\"RGBPoints\":[0,0,0,0,1,1,0,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"BkCy\",\"NanColor\":[0,1,1],\"RGBPoints\":[0,0,0,0,1,0,1,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"Black, Blue and White\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0,0,0,0.333,0,0,0.501960784314,0.666,0,0.501960784314,1,1,1,1,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"Black, Orange and White\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0,0,0,0.333,0.501960784314,0,0,0.666,1,0.501960784314,0,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Linear YGB 1211g\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,1,0.988235,0.968627,0.02,1,0.952941,0.878431,0.05,0.968627,0.905882,0.776471,0.1,0.94902,0.898039,0.647059,0.15,0.901961,0.878431,0.556863,0.2,0.847059,0.858824,0.482353,0.25,0.690196,0.819608,0.435294,0.3,0.513725,0.768627,0.384314,0.35,0.337255,0.721569,0.337255,0.4,0.278431,0.658824,0.392157,0.45,0.231373,0.639216,0.435294,0.5,0.203922,0.6,0.486275,0.55,0.172549,0.568627,0.537255,0.6,0.141176,0.517647,0.54902,0.65,0.133333,0.458824,0.541176,0.7,0.12549,0.396078,0.529412,0.75,0.117647,0.321569,0.521569,0.8,0.121569,0.258824,0.509804,0.85,0.133333,0.227451,0.501961,0.9,0.145098,0.192157,0.490196,0.95,0.188235,0.164706,0.470588,1,0.258824,0.196078,0.439216]},{\"ColorSpace\":\"CIELAB\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Linear Green (Gr4L)\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,0.054902,0.109804,0.121569,0.05,0.07451,0.172549,0.180392,0.1,0.086275,0.231373,0.219608,0.15,0.094118,0.278431,0.25098,0.2,0.109804,0.34902,0.278431,0.25,0.113725,0.4,0.278431,0.3,0.117647,0.45098,0.270588,0.35,0.117647,0.490196,0.243137,0.4,0.113725,0.521569,0.203922,0.45,0.109804,0.54902,0.152941,0.5,0.082353,0.588235,0.082353,0.55,0.109804,0.631373,0.05098,0.6,0.211765,0.678431,0.082353,0.65,0.317647,0.721569,0.113725,0.7,0.431373,0.760784,0.160784,0.75,0.556863,0.8,0.239216,0.8,0.666667,0.839216,0.294118,0.85,0.784314,0.878431,0.396078,0.9,0.886275,0.921569,0.533333,0.95,0.960784,0.94902,0.670588,1,1,0.984314,0.901961]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Linear Blue (8_31f)\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,0.960784,1,0.980392,0.05,0.815686,0.960784,0.913725,0.1,0.670588,0.929412,0.870588,0.15,0.556863,0.901961,0.843137,0.2,0.478431,0.870588,0.823529,0.25,0.439216,0.831373,0.803922,0.3,0.4,0.8,0.788235,0.35,0.376471,0.768627,0.768627,0.4,0.34902,0.709804,0.729412,0.45,0.32549,0.654902,0.690196,0.5,0.301961,0.607843,0.658824,0.55,0.247059,0.545098,0.619608,0.6,0.239216,0.494118,0.580392,0.65,0.227451,0.439216,0.541176,0.7,0.227451,0.403922,0.521569,0.75,0.231373,0.368627,0.501961,0.8,0.227451,0.321569,0.470588,0.85,0.219608,0.282353,0.439216,0.9,0.192157,0.235294,0.4,0.95,0.160784,0.184314,0.34902,1,0.133333,0.12549,0.301961]},{\"ColorSpace\":\"HSV\",\"Name\":\"Blue to Red Rainbow\",\"NanColor\":[0.498039215686,0.498039215686,0.498039215686],\"RGBPoints\":[0,0,0,1,1,1,0,0]},{\"ColorSpace\":\"HSV\",\"Name\":\"Red to Blue Rainbow\",\"NanColor\":[0.498039215686,0.498039215686,0.498039215686],\"RGBPoints\":[0,1,0,0,1,0,0,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"Rainbow Blended White\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,1,1,1,0.17,0,0,1,0.34,0,1,1,0.5,0,1,0,0.67,1,1,0,0.84,1,0,0,1,0.878431372549,0,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"Rainbow Blended Grey\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0.317647058824,0.341176470588,0.43137254902,0.17,0,0,1,0.34,0,1,1,0.5,0,1,0,0.67,1,1,0,0.84,1,0,0,1,0.878431372549,0,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"Rainbow Blended Black\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0,0,0,0.17,0,0,1,0.34,0,1,1,0.5,0,1,0,0.67,1,1,0,0.84,1,0,0,1,0.878431372549,0,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"Blue to Yellow\",\"NanColor\":[1,0,0],\"RGBPoints\":[0,0.0392156862745,0.0392156862745,0.949019607843,1,0.949019607843,0.949019607843,0.0392156862745]},{\"ColorSpace\":\"HSV\",\"Name\":\"blot\",\"RGBPoints\":[0,0,0,1,0.166,0,0,1,0.167,1,0,1,0.332,1,0,1,0.333,0,1,1,0.5,0,1,1,0.501,0,1,0,0.666,0,1,0,0.667,1,1,0,0.832,1,1,0,0.833,1,0,0,1,1,0,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"CIELab Blue to Red\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0,0.6,0.749019607843,1,0.76862745098,0.466666666667,0.341176470588]},{\"ColorSpace\":\"RGB\",\"Name\":\"jet\",\"RGBPoints\":[-1,0,0,0.5625,-0.777778,0,0,1,-0.269841,0,1,1,-0.015873,0.5,1,0.5,0.238095,1,1,0,0.746032,1,0,0,1,0.5,0,0]},{\"ColorSpace\":\"RGB\",\"Name\":\"rainbow\",\"RGBPoints\":[-1,0,0,1,-0.5,0,1,1,0,0,1,0,0.5,1,1,0,1,1,0,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_rainbow_bright\",\"RGBPoints\":[-1,0.32549,0.14902,0.960784,-0.866221,0.297047,0.375586,0.963836,-0.732441,0.180302,0.536818,0.964627,-0.598662,0.1302,0.649207,0.929647,-0.464883,0.0445143,0.749654,0.855998,-0.331104,0.0271325,0.830713,0.721527,-0.197324,0.259504,0.866145,0.543555,-0.0635452,0.428364,0.890725,0.329819,0.0702341,0.568503,0.898508,0.187623,0.204013,0.738259,0.890317,0.0825461,0.337793,0.84546,0.86136,0.0147555,0.471572,0.912191,0.808018,0,0.605351,0.962848,0.710445,0,0.73913,0.999469,0.600258,0.0176284,0.87291,0.994156,0.445975,0.193912,1,0.980407,0.247105,0.262699]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_rainbow_dark\",\"RGBPoints\":[-1,0,0,0.423499,-0.866221,0,0.119346,0.529237,-0.732441,0,0.238691,0.634976,-0.598662,0,0.346852,0.68788,-0.464883,0,0.45022,0.718141,-0.331104,0,0.553554,0.664839,-0.197324,0,0.651082,0.519303,-0.0635452,0.115841,0.72479,0.352857,0.0702341,0.326771,0.781195,0.140187,0.204013,0.522765,0.798524,0.0284624,0.337793,0.703162,0.788685,0.00885756,0.471572,0.845118,0.751133,0,0.605351,0.955734,0.690825,0,0.73913,0.995402,0.567916,0.0618524,0.87291,0.987712,0.403398,0.164851,1,0.980407,0.247105,0.262699]},{\"ColorSpace\":\"Lab\",\"Name\":\"nic_CubicL\",\"RGBPoints\":[-1,0.479965,0.0118108,0.5307,-0.87451,0.522213,0.0551282,0.706919,-0.74902,0.50839,0.237278,0.867764,-0.623529,0.451617,0.373834,0.987255,-0.498039,0.39365,0.497255,0.97506,-0.372549,0.328631,0.599639,0.891843,-0.247059,0.250043,0.690286,0.778553,-0.121569,0.249656,0.764905,0.645857,0.00392157,0.297954,0.821466,0.50449,0.129412,0.337509,0.872595,0.358447,0.254902,0.430011,0.913789,0.297079,0.380392,0.587191,0.931381,0.333353,0.505882,0.727937,0.93591,0.353742,0.631373,0.826403,0.921081,0.365066,0.756863,0.893201,0.846317,0.372662,0.882353,0.965347,0.73884,0.378506,1,0.983235,0.597451,0.366856]},{\"ColorSpace\":\"Lab\",\"Name\":\"nic_CubicYF\",\"RGBPoints\":[-1,0.5151,0.0482,0.6697,-0.87451,0.520711,0.168955,0.800574,-0.74902,0.493694,0.278596,0.911824,-0.623529,0.440026,0.369475,0.984978,-0.498039,0.398932,0.457593,0.987053,-0.372549,0.350651,0.540644,0.929608,-0.247059,0.298827,0.615625,0.857729,-0.121569,0.239928,0.685061,0.769531,0.00392157,0.228832,0.739349,0.673287,0.129412,0.263297,0.78608,0.569988,0.254902,0.298107,0.828337,0.460214,0.380392,0.33092,0.864071,0.352674,0.505882,0.38306,0.898169,0.287309,0.631373,0.49023,0.917481,0.307961,0.756863,0.62372,0.926026,0.332309,0.882353,0.717458,0.92527,0.342476,1,0.8,0.9255,0.3529]},{\"ColorSpace\":\"Lab\",\"Name\":\"gist_earth\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.239216,0.027451,0.415686,-0.74902,0.0901961,0.254902,0.556863,-0.623529,0.0941176,0.352941,0.54902,-0.498039,0.105882,0.435294,0.533333,-0.372549,0.12549,0.52549,0.501961,-0.247059,0.156863,0.596078,0.443137,-0.121569,0.196078,0.65098,0.380392,0.00392157,0.282353,0.717647,0.301961,0.129412,0.466667,0.772549,0.27451,0.254902,0.678431,0.784314,0.309804,0.380392,0.901961,0.756863,0.376471,0.505882,0.992157,0.705882,0.521569,0.631373,1,0.721569,0.701961,0.756863,1,0.784314,0.784314,0.882353,1,0.866667,0.866667,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"2hot\",\"RGBPoints\":[-1,0.0416667,0,0,-0.873016,0.208333,0,0,-0.746032,0.375,0,0,-0.619048,0.541667,0,0,-0.492063,0.708333,0,0,-0.365079,0.854137,0,0,-0.238095,0.937488,0.039062,0,-0.111111,1,0.208333,0,0.015873,1,0.375,0,0.142857,1,0.541667,0,0.269841,1,0.708333,0,0.396825,1,0.858805,0.03125,0.52381,1,0.947392,0.15625,0.650794,1,1,0.3125,0.777778,1,1,0.5625,0.904762,1,1,0.8125,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_red2yellow_BW\",\"RGBPoints\":[-1,7.54296e-7,0,0.0000109827,-0.87451,0.18285,0.0264094,0,-0.74902,0.3066,0,0,-0.623529,0.422841,0,0,-0.498039,0.522945,0,0,-0.372549,0.605721,0,0,-0.247059,0.672502,0.14168,0,-0.121569,0.728167,0.244025,0,0.00392157,0.781215,0.333454,0,0.129412,0.825,0.423586,0,0.254902,0.855893,0.516793,0,0.380392,0.880491,0.608846,0,0.505882,0.910305,0.695505,0,0.631373,0.94109,0.779067,0.223528,0.756863,0.967873,0.858572,0.473521,0.882353,0.986815,0.933211,0.751583,1,1,1,0.999997]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_marine2gold_BW\",\"RGBPoints\":[-1,1.11641e-7,0,0.00000162551,-0.87451,0.0413146,0.0619808,0.209857,-0.74902,0.0185557,0.101341,0.350684,-0.623529,0.00486405,0.149847,0.461054,-0.498039,0.0836345,0.210845,0.517906,-0.372549,0.173222,0.276134,0.541793,-0.247059,0.259857,0.343877,0.535869,-0.121569,0.362299,0.408124,0.504293,0.00392157,0.468266,0.468276,0.468257,0.129412,0.582781,0.527545,0.374914,0.254902,0.691591,0.585251,0.274266,0.380392,0.784454,0.645091,0.247332,0.505882,0.862299,0.710383,0.27518,0.631373,0.920863,0.782923,0.351563,0.756863,0.955792,0.859699,0.533541,0.882353,0.976162,0.93433,0.780671,1,1,1,0.999983]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue2gold_BW\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.0742735,0.0440331,0.230013,-0.74902,0.125276,0.0258685,0.415826,-0.623529,0.143879,0.0163031,0.591346,-0.498039,0.212261,0.0627855,0.705239,-0.372549,0.306048,0.141178,0.763636,-0.247059,0.391537,0.232286,0.773263,-0.121569,0.461734,0.336633,0.708321,0.00392157,0.54209,0.427581,0.590007,0.129412,0.61704,0.508623,0.460978,0.254902,0.702703,0.579586,0.309117,0.380392,0.790336,0.644811,0.170397,0.505882,0.870173,0.710733,0.117134,0.631373,0.93656,0.781991,0.157144,0.756863,0.965672,0.862068,0.409836,0.882353,0.985751,0.936296,0.714162,1,1,1,0.999999]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_sapphire2gold_BW\",\"RGBPoints\":[-1,0.107704,0.107708,0.107694,-0.87451,0.1851,0.112354,0.308554,-0.74902,0.236782,0.114233,0.48788,-0.623529,0.28296,0.126187,0.639464,-0.498039,0.344787,0.171643,0.739713,-0.372549,0.413325,0.242371,0.76913,-0.247059,0.481863,0.3131,0.719841,-0.121569,0.550402,0.383829,0.612222,0.00392157,0.61894,0.454558,0.51126,0.129412,0.687478,0.525287,0.39993,0.254902,0.756017,0.596016,0.289923,0.380392,0.824555,0.666745,0.255498,0.505882,0.892979,0.736822,0.27696,0.631373,0.938851,0.804966,0.351734,0.756863,0.966491,0.874853,0.53572,0.882353,0.982105,0.94153,0.782579,1,1,1,0.999986]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_red2purple_BW\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.167793,0.0166271,0.0431278,-0.74902,0.262608,0.0107595,0.0791181,-0.623529,0.351902,0.0101858,0.100926,-0.498039,0.441257,0.0160835,0.131919,-0.372549,0.5221,0.0555972,0.195625,-0.247059,0.593852,0.104294,0.310234,-0.121569,0.654628,0.158115,0.448486,0.00392157,0.707443,0.220914,0.570253,0.129412,0.749504,0.293268,0.67897,0.254902,0.781587,0.370517,0.779269,0.380392,0.809951,0.451099,0.855831,0.505882,0.84424,0.531462,0.900451,0.631373,0.865174,0.620901,0.91606,0.756863,0.875041,0.714054,0.910284,0.882353,0.880764,0.80554,0.896276,1,0.887572,0.887591,0.887556]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_purple2pink_BW\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.117562,0.0291202,0.175876,-0.74902,0.178368,0.0458476,0.285454,-0.623529,0.237731,0.0680173,0.387717,-0.498039,0.300877,0.0956291,0.484802,-0.372549,0.370929,0.136858,0.554985,-0.247059,0.449033,0.189273,0.58863,-0.121569,0.529971,0.245796,0.598587,0.00392157,0.609914,0.300643,0.610244,0.129412,0.697079,0.351286,0.616371,0.254902,0.785858,0.401991,0.617376,0.380392,0.862517,0.45745,0.64463,0.505882,0.91359,0.525462,0.705336,0.631373,0.932583,0.61064,0.767412,0.756863,0.922478,0.706966,0.817522,0.882353,0.901302,0.803071,0.856311,1,0.887571,0.887591,0.887549]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_pbj_lin\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.091821,0.0611476,0.10617,-0.74902,0.160311,0.0900022,0.192713,-0.623529,0.22484,0.12126,0.272128,-0.498039,0.291263,0.157469,0.340828,-0.372549,0.360015,0.200388,0.388903,-0.247059,0.437497,0.250058,0.387201,-0.121569,0.512636,0.304969,0.355955,0.00392157,0.582603,0.360874,0.33488,0.129412,0.655126,0.416374,0.306351,0.254902,0.725889,0.473329,0.279051,0.380392,0.778125,0.537928,0.302697,0.505882,0.815894,0.606931,0.382431,0.631373,0.839159,0.679308,0.497608,0.756863,0.854748,0.751666,0.631792,0.882353,0.869483,0.822508,0.768592,1,0.887572,0.887589,0.887565]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue2green_muted\",\"RGBPoints\":[-1,0.107704,0.107708,0.107695,-0.87451,0.141522,0.13066,0.270741,-0.74902,0.180123,0.146119,0.42308,-0.623529,0.210161,0.169674,0.551795,-0.498039,0.239701,0.212939,0.634969,-0.372549,0.253916,0.282947,0.653641,-0.247059,0.242791,0.366933,0.608521,-0.121569,0.226302,0.446776,0.52693,0.00392157,0.236237,0.514689,0.458798,0.129412,0.274641,0.577589,0.376069,0.254902,0.349625,0.633993,0.288131,0.380392,0.4437,0.683677,0.260497,0.505882,0.536247,0.731214,0.285424,0.631373,0.628472,0.777128,0.349151,0.756863,0.718259,0.819287,0.496825,0.882353,0.804768,0.856164,0.703299,1,0.887571,0.887591,0.887548]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue2green_BW\",\"RGBPoints\":[-1,3.63578e-7,0,0.00000529374,-0.87451,0.0539915,0.0577948,0.212806,-0.74902,0.0620393,0.0758942,0.388959,-0.623529,0.0697499,0.102032,0.54177,-0.498039,0.113295,0.156156,0.64334,-0.372549,0.152047,0.243196,0.670283,-0.247059,0.158096,0.344084,0.622864,-0.121569,0.151142,0.43922,0.532767,0.00392157,0.17155,0.521588,0.457719,0.129412,0.225861,0.599141,0.363997,0.254902,0.32328,0.67007,0.259083,0.380392,0.442344,0.733697,0.223754,0.505882,0.558409,0.794941,0.257411,0.631373,0.673875,0.854344,0.340822,0.756863,0.787244,0.909326,0.524717,0.882353,0.896483,0.958063,0.775914,1,1,1,0.999982]},{\"ColorSpace\":\"Lab\",\"Name\":\"GREEN-WHITE_LINEAR\",\"RGBPoints\":[-1,0,0,0,-0.87451,0,0.062745,0,-0.74902,0,0.12549,0,-0.623529,0,0.188235,0,-0.498039,0,0.25098,0,-0.372549,0,0.313725,0,-0.247059,0,0.376471,0,-0.121569,0.094118,0.439216,0,0.00392157,0.196078,0.501961,0,0.129412,0.294118,0.564706,0,0.254902,0.396078,0.627451,0,0.380392,0.498039,0.690196,0,0.505882,0.6,0.752941,0.145098,0.631373,0.701961,0.815686,0.364706,0.756863,0.8,0.878431,0.580392,0.882353,0.901961,0.941176,0.796078,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_green2yellow_BW\",\"RGBPoints\":[-1,0,0,0,-0.87451,0,0.105542,0.0603919,-0.74902,0,0.159454,0.104148,-0.623529,0,0.219502,0.15542,-0.498039,0,0.282276,0.203811,-0.372549,0,0.346331,0.235652,-0.247059,0,0.411765,0.235428,-0.121569,0,0.477177,0.217977,0.00392157,0.0593644,0.541635,0.21361,0.129412,0.233081,0.604722,0.210591,0.254902,0.369803,0.664942,0.226536,0.380392,0.498446,0.722367,0.288237,0.505882,0.601929,0.782244,0.380815,0.631373,0.703207,0.840497,0.512134,0.756863,0.803186,0.896433,0.674462,0.882353,0.903834,0.950266,0.846715,1,1,1,0.999981]},{\"ColorSpace\":\"Lab\",\"Name\":\"blue2cyan\",\"RGBPoints\":[-1,0,0,0,-0.87451,0,0.152941,0.364706,-0.74902,0,0.254902,0.470588,-0.623529,0,0.34902,0.572549,-0.498039,0,0.443137,0.670588,-0.372549,0,0.537255,0.772549,-0.247059,0,0.627451,0.870588,-0.121569,0,0.717647,0.964706,0.00392157,0.0784314,0.772549,1,0.129412,0.207843,0.858824,1,0.254902,0.32549,0.941176,1,0.380392,0.45098,1,1,0.505882,0.560784,1,1,0.631373,0.662745,1,1,0.756863,0.760784,1,1,0.882353,0.870588,1,1,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue2cyan_BW\",\"RGBPoints\":[-1,4.05298e-7,0,0.0000059012,-0.87451,0.0207526,0.0740933,0.18093,-0.74902,0,0.121033,0.30343,-0.623529,0,0.166892,0.416095,-0.498039,0,0.216768,0.524796,-0.372549,0.0164769,0.275471,0.608585,-0.247059,0.0544527,0.344824,0.659267,-0.121569,0.0880643,0.419118,0.688675,0.00392157,0.127938,0.492556,0.720256,0.129412,0.149476,0.566946,0.756918,0.254902,0.188961,0.641333,0.792122,0.380392,0.245482,0.715336,0.827609,0.505882,0.329216,0.786235,0.874761,0.631373,0.453558,0.852803,0.918466,0.756863,0.626281,0.910493,0.954,0.882353,0.82257,0.958709,0.980146,1,1,1,0.999989]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue_BW\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.0425591,0.0763529,0.150682,-0.74902,0.0569472,0.119154,0.275403,-0.623529,0.0635978,0.164772,0.395427,-0.498039,0.0774342,0.213851,0.510014,-0.372549,0.106815,0.267034,0.615102,-0.247059,0.122093,0.324649,0.720068,-0.121569,0.160851,0.387068,0.806956,0.00392157,0.213754,0.453516,0.878012,0.129412,0.26722,0.524656,0.932436,0.254902,0.326844,0.599279,0.968038,0.380392,0.403403,0.674712,0.984784,0.505882,0.499703,0.745519,1,0.631373,0.615055,0.813983,1,0.756863,0.74405,0.879228,1,0.882353,0.877909,0.941913,1,1,1,1,0.999996]},{\"ColorSpace\":\"Lab\",\"Name\":\"BLUE-WHITE\",\"RGBPoints\":[-1,0,0,0,-0.87451,0,0,0.082353,-0.74902,0,0,0.168627,-0.623529,0,0,0.254902,-0.498039,0,0,0.337255,-0.372549,0,0,0.423529,-0.247059,0,0,0.509804,-0.121569,0,0.101961,0.592157,0.00392157,0,0.203922,0.678431,0.129412,0,0.301961,0.764706,0.254902,0,0.403922,0.85098,0.380392,0,0.505882,0.933333,0.505882,0,0.603922,1,0.631373,0.254902,0.705882,1,0.756863,0.509804,0.807843,1,0.882353,0.764706,0.905882,1,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_purple_BW\",\"RGBPoints\":[-1,4.264e-8,0,6.20844e-7,-0.87451,0.100579,0.0593111,0.145666,-0.74902,0.167794,0.0889224,0.254953,-0.623529,0.231446,0.123339,0.360511,-0.498039,0.296699,0.163027,0.461278,-0.372549,0.363211,0.209286,0.55306,-0.247059,0.431136,0.260776,0.637195,-0.121569,0.498202,0.320012,0.705799,0.00392157,0.567456,0.380459,0.778091,0.129412,0.629381,0.445284,0.8448,0.254902,0.688373,0.517374,0.895694,0.380392,0.74891,0.590906,0.93976,0.505882,0.805017,0.667956,0.977626,0.631373,0.850914,0.752618,0.992396,0.756863,0.89724,0.838454,0.994093,0.882353,0.948461,0.922603,0.994449,1,1,1,0.999967]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_magenta_BW\",\"RGBPoints\":[-1,0,0,0.0000254023,-0.87451,0.128696,0.0456782,0.11635,-0.74902,0.228133,0.0476299,0.201452,-0.623529,0.327273,0.0374065,0.282107,-0.498039,0.420953,0.0408166,0.35709,-0.372549,0.511562,0.0642203,0.430511,-0.247059,0.599552,0.102686,0.504257,-0.121569,0.684646,0.150536,0.579429,0.00392157,0.765817,0.205978,0.656062,0.129412,0.839176,0.27229,0.731807,0.254902,0.89536,0.357594,0.797309,0.380392,0.930238,0.457825,0.846984,0.505882,0.945921,0.564536,0.880571,0.631373,0.948995,0.670753,0.902279,0.756863,0.947124,0.772819,0.918171,0.882353,0.947265,0.869424,0.934352,1,0.954719,0.95475,0.954726]},{\"ColorSpace\":\"Lab\",\"Name\":\"magenta\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.364706,0,0.152941,-0.74902,0.470588,0,0.254902,-0.623529,0.572549,0,0.34902,-0.498039,0.670588,0,0.443137,-0.372549,0.772549,0,0.537255,-0.247059,0.870588,0,0.627451,-0.121569,0.964706,0,0.717647,0.00392157,1,0.0784314,0.772549,0.129412,1,0.207843,0.858824,0.254902,1,0.32549,0.941176,0.380392,1,0.45098,1,0.505882,1,0.560784,1,0.631373,1,0.662745,1,0.756863,1,0.760784,1,0.882353,1,0.870588,1,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"RED-PURPLE\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.188235,0,0.007843,-0.74902,0.345098,0,0.035294,-0.623529,0.439216,0,0.098039,-0.498039,0.533333,0,0.152941,-0.372549,0.627451,0.015686,0.211765,-0.247059,0.721569,0.031373,0.266667,-0.121569,0.8,0.047059,0.329412,0.00392157,0.862745,0.047059,0.403922,0.129412,0.941176,0.062745,0.466667,0.254902,0.988235,0.078431,0.54902,0.380392,0.988235,0.141176,0.643137,0.505882,0.988235,0.25098,0.729412,0.631373,0.988235,0.376471,0.811765,0.756863,0.988235,0.54902,0.886275,0.882353,0.988235,0.752941,0.952941,1,0.996078,0.996078,0.996078]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_red_BW\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.147204,0.0480135,0.0401815,-0.74902,0.253411,0.0617478,0.0301333,-0.623529,0.356059,0.0746331,0.0446897,-0.498039,0.457731,0.0934935,0.0636931,-0.372549,0.557199,0.122714,0.0860013,-0.247059,0.665179,0.144238,0.105585,-0.121569,0.763833,0.187056,0.138326,0.00392157,0.847035,0.254558,0.189407,0.129412,0.905663,0.345937,0.258215,0.254902,0.941431,0.447111,0.346277,0.380392,0.962608,0.546927,0.457571,0.505882,0.987833,0.637276,0.569944,0.631373,0.994202,0.732176,0.687958,0.756863,0.993304,0.826268,0.800567,0.882353,0.994413,0.917205,0.906393,1,1,1,0.999979]},{\"ColorSpace\":\"Lab\",\"Name\":\"RED_TEMPERATURE\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.090196,0,0,-0.74902,0.180392,0,0,-0.623529,0.270588,0,0,-0.498039,0.360784,0,0,-0.372549,0.45098,0,0,-0.247059,0.545098,0,0,-0.121569,0.635294,0,0,0.00392157,0.72549,0.058824,0,0.129412,0.815686,0.176471,0,0.254902,0.905882,0.294118,0,0.380392,1,0.411765,0,0.505882,1,0.533333,0.027451,0.631373,1,0.65098,0.27451,0.756863,1,0.768627,0.521569,0.882353,1,0.886275,0.768627,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_orange_BW\",\"RGBPoints\":[-1,0,0,0.0000253806,-0.87451,0.135871,0.0593824,0,-0.74902,0.224328,0.0907216,0,-0.623529,0.318083,0.119647,0,-0.498039,0.414443,0.150246,0,-0.372549,0.511077,0.184884,0,-0.247059,0.605501,0.226033,0,-0.121569,0.695274,0.275491,0,0.00392157,0.777826,0.334445,0,0.129412,0.851498,0.402441,0,0.254902,0.915899,0.47759,0.000602975,0.380392,0.971984,0.557882,0.0361443,0.505882,1,0.641287,0.135967,0.631373,1,0.725198,0.27997,0.756863,1,0.808205,0.438135,0.882353,1,0.89306,0.587036,1,1,0.977928,0.721599]},{\"ColorSpace\":\"Lab\",\"Name\":\"heated_object\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.34902,0.0862745,0,-0.74902,0.45098,0.172549,0,-0.623529,0.52549,0.231373,0,-0.498039,0.580392,0.278431,0,-0.372549,0.623529,0.313725,0,-0.247059,0.670588,0.352941,0,-0.121569,0.717647,0.392157,0,0.00392157,0.772549,0.439216,0,0.129412,0.839216,0.494118,0,0.254902,0.901961,0.541176,0,0.380392,0.968627,0.6,0,0.505882,1,0.658824,0,0.631373,1,0.721569,0,0.756863,1,0.827451,0.298039,0.882353,1,0.976471,0.72549,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_gold_BW\",\"RGBPoints\":[-1,0,0,0.0000190933,-0.87451,0.128363,0.0636265,0,-0.74902,0.193795,0.111057,0,-0.623529,0.25976,0.15987,0,-0.498039,0.328546,0.210589,0,-0.372549,0.399726,0.26332,0,-0.247059,0.472969,0.318261,0,-0.121569,0.546245,0.375827,0,0.00392157,0.61745,0.436719,0,0.129412,0.685545,0.501113,0,0.254902,0.749578,0.568799,0,0.380392,0.80962,0.6394,0,0.505882,0.865572,0.712699,0.10257,0.631373,0.917709,0.787569,0.233665,0.756863,0.966914,0.863138,0.369608,0.882353,1,0.939405,0.496104,1,0.999225,1,0.612275]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_brown_BW\",\"RGBPoints\":[-1,3.3216e-7,0,0.00000483629,-0.87451,0.14693,0.0518172,0,-0.74902,0.225806,0.0814996,0,-0.623529,0.301681,0.111452,0,-0.498039,0.370487,0.150664,0,-0.372549,0.43108,0.199477,0,-0.247059,0.4849,0.255107,0,-0.121569,0.536798,0.313486,0,0.00392157,0.59286,0.371167,0,0.129412,0.653119,0.428135,0,0.254902,0.714589,0.485917,0.0379541,0.380392,0.774667,0.54565,0.116634,0.505882,0.831222,0.608047,0.183895,0.631373,0.880305,0.674199,0.260298,0.756863,0.922314,0.742472,0.367086,0.882353,0.959408,0.811222,0.497258,1,0.993548,0.875183,0.622093]},{\"ColorSpace\":\"Lab\",\"Name\":\"copper_Matlab\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.0784314,0.0501961,0.0313725,-0.74902,0.156863,0.100392,0.0627451,-0.623529,0.235294,0.150588,0.0941176,-0.498039,0.313725,0.200784,0.12549,-0.372549,0.392157,0.25098,0.156863,-0.247059,0.470588,0.301176,0.188235,-0.121569,0.54902,0.351373,0.219608,0.00392157,0.627451,0.401569,0.25098,0.129412,0.705882,0.451765,0.282353,0.254902,0.784314,0.501961,0.313725,0.380392,0.862745,0.552157,0.345098,0.505882,0.941176,0.602353,0.376471,0.631373,1,0.652549,0.407843,0.756863,1,0.702745,0.439216,0.882353,1,0.752941,0.470588,1,1,0.8,0.5]},{\"ColorSpace\":\"Lab\",\"Name\":\"pink_Matlab\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.312416,0.204524,0.204524,-0.74902,0.441822,0.289241,0.289241,-0.623529,0.54112,0.354246,0.354246,-0.498039,0.624831,0.409048,0.409048,-0.372549,0.698582,0.45733,0.45733,-0.247059,0.764404,0.502282,0.500979,-0.121569,0.791292,0.591516,0.54112,0.00392157,0.817297,0.66895,0.578481,0.129412,0.842499,0.738308,0.613572,0.254902,0.866968,0.801687,0.646762,0.380392,0.890766,0.86041,0.678329,0.505882,0.913944,0.913944,0.711254,0.631373,0.936549,0.936549,0.79459,0.756863,0.958621,0.958621,0.869979,0.882353,0.980196,0.980196,0.939336,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"bone_Matlab\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.054902,0.054902,0.075817,-0.74902,0.109804,0.109804,0.151634,-0.623529,0.164706,0.164706,0.227451,-0.498039,0.219608,0.219608,0.303268,-0.372549,0.27451,0.27451,0.379085,-0.247059,0.329412,0.329902,0.454412,-0.121569,0.384314,0.405719,0.509314,0.00392157,0.439216,0.481536,0.564216,0.129412,0.494118,0.557353,0.619118,0.254902,0.54902,0.63317,0.67402,0.380392,0.603922,0.708987,0.728922,0.505882,0.660294,0.783824,0.783824,0.631373,0.746569,0.838725,0.838725,0.756863,0.832843,0.893627,0.893627,0.882353,0.919118,0.948529,0.948529,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"gray_Matlab\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.0627451,0.0627451,0.0627451,-0.74902,0.12549,0.12549,0.12549,-0.623529,0.188235,0.188235,0.188235,-0.498039,0.25098,0.25098,0.25098,-0.372549,0.313725,0.313725,0.313725,-0.247059,0.376471,0.376471,0.376471,-0.121569,0.439216,0.439216,0.439216,0.00392157,0.501961,0.501961,0.501961,0.129412,0.564706,0.564706,0.564706,0.254902,0.627451,0.627451,0.627451,0.380392,0.690196,0.690196,0.690196,0.505882,0.752941,0.752941,0.752941,0.631373,0.815686,0.815686,0.815686,0.756863,0.878431,0.878431,0.878431,0.882353,0.941176,0.941176,0.941176,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"Purples\",\"RGBPoints\":[-1,0.247059,0,0.490196,-0.87451,0.288397,0.07677,0.525629,-0.74902,0.32975,0.153587,0.561092,-0.623529,0.373057,0.236263,0.600461,-0.498039,0.416363,0.319,0.639923,-0.372549,0.459669,0.405613,0.685198,-0.247059,0.503345,0.491534,0.730058,-0.121569,0.562399,0.54862,0.757616,0.00392157,0.621453,0.606075,0.785544,0.129412,0.680508,0.674971,0.824914,0.254902,0.739562,0.743406,0.863899,0.380392,0.798616,0.800492,0.893426,0.505882,0.85684,0.856655,0.922491,0.631373,0.898178,0.894056,0.942176,0.756863,0.938654,0.930919,0.961646,0.882353,0.964245,0.958478,0.977393,1,0.988235,0.984314,0.992157]},{\"ColorSpace\":\"Lab\",\"Name\":\"Blues\",\"RGBPoints\":[-1,0.031373,0.188235,0.419608,-0.87451,0.031373,0.253195,0.516063,-0.74902,0.031757,0.318139,0.612149,-0.623529,0.080969,0.38113,0.661361,-0.498039,0.130427,0.444152,0.710327,-0.372549,0.195386,0.509112,0.743791,-0.247059,0.260715,0.573841,0.777209,-0.121569,0.341423,0.628958,0.808704,0.00392157,0.422745,0.684075,0.839892,0.129412,0.523137,0.739193,0.861546,0.254902,0.622684,0.793464,0.883429,0.380392,0.701423,0.826928,0.910988,0.505882,0.778685,0.8603,0.937993,0.631373,0.825928,0.891795,0.953741,0.756863,0.87328,0.923291,0.969489,0.882353,0.922491,0.954787,0.985236,1,0.968627,0.984314,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"Greens\",\"RGBPoints\":[-1,0,0.266667,0.105882,-0.87451,0,0.347374,0.139346,-0.74902,0.000538,0.427912,0.172933,-0.623529,0.069435,0.486967,0.222145,-0.498039,0.138178,0.546082,0.271326,-0.372549,0.197232,0.609073,0.31857,-0.247059,0.257255,0.671742,0.365859,-0.121569,0.357647,0.720953,0.415071,0.00392157,0.45767,0.769919,0.465021,0.129412,0.546251,0.811257,0.537855,0.254902,0.634295,0.852211,0.610688,0.380392,0.709097,0.883706,0.683522,0.505882,0.78316,0.914833,0.755894,0.631373,0.842215,0.938454,0.818885,0.756863,0.899977,0.961538,0.880692,0.882353,0.935409,0.975317,0.92203,1,0.968627,0.988235,0.960784]},{\"ColorSpace\":\"Lab\",\"Name\":\"PuBu\",\"RGBPoints\":[-1,0.301961,0,0.294118,-0.87451,0.404321,0.029527,0.390573,-0.74902,0.50599,0.059592,0.486782,-0.623529,0.519769,0.158016,0.551742,-0.498039,0.533456,0.256194,0.616301,-0.372549,0.54133,0.33887,0.655671,-0.247059,0.54902,0.421592,0.695087,-0.121569,0.54902,0.506236,0.736424,0.00392157,0.550127,0.590573,0.777701,0.129412,0.585559,0.665375,0.81707,0.254902,0.622145,0.739023,0.855825,0.380392,0.687105,0.784298,0.879446,0.505882,0.752065,0.829758,0.903253,0.631373,0.817024,0.87897,0.930811,0.756863,0.880907,0.927213,0.957832,0.882353,0.926182,0.958708,0.975548,1,0.968627,0.988235,0.992157]},{\"ColorSpace\":\"Lab\",\"Name\":\"BuPu\",\"RGBPoints\":[-1,0.007843,0.219608,0.345098,-0.87451,0.01178,0.286536,0.449427,-0.74902,0.015702,0.35328,0.553479,-0.623529,0.01767,0.396586,0.622376,-0.498039,0.021115,0.4402,0.690688,-0.372549,0.11757,0.503191,0.722184,-0.247059,0.214625,0.565859,0.753633,-0.121569,0.336671,0.615071,0.78316,0.00392157,0.457978,0.663975,0.812503,0.129412,0.556401,0.703345,0.836125,0.254902,0.65421,0.742714,0.859669,0.380392,0.736886,0.782084,0.881323,0.505882,0.81827,0.821638,0.903068,0.631373,0.873387,0.864944,0.92669,0.756863,0.927536,0.907605,0.949988,0.882353,0.964937,0.9391,0.967705,1,1,0.968627,0.984314]},{\"ColorSpace\":\"Lab\",\"Name\":\"BuGn\",\"RGBPoints\":[-1,0.031373,0.25098,0.505882,-0.87451,0.031373,0.329719,0.590527,-0.74902,0.031911,0.408397,0.674787,-0.623529,0.100807,0.479262,0.710219,-0.498039,0.169704,0.550219,0.745744,-0.372549,0.238601,0.62699,0.787082,-0.247059,0.307958,0.703114,0.826759,-0.121569,0.39654,0.752326,0.797232,0.00392157,0.485121,0.801046,0.767705,0.129412,0.573702,0.83451,0.738178,0.254902,0.661592,0.867743,0.711034,0.380392,0.732457,0.895302,0.74253,0.505882,0.801845,0.922307,0.774579,0.631373,0.841215,0.938055,0.817885,0.756863,0.880907,0.95391,0.861084,0.882353,0.926182,0.971626,0.902422,1,0.968627,0.988235,0.941176]},{\"ColorSpace\":\"Lab\",\"Name\":\"GnBu\",\"RGBPoints\":[-1,0,0.266667,0.105882,-0.87451,0,0.347374,0.139346,-0.74902,0.000538,0.427912,0.172933,-0.623529,0.069435,0.486967,0.222145,-0.498039,0.138178,0.546175,0.272095,-0.372549,0.197232,0.615071,0.368551,-0.247059,0.256609,0.683276,0.464867,-0.121569,0.329443,0.722645,0.555417,0.00392157,0.403137,0.762138,0.645413,0.129412,0.503529,0.805444,0.718247,0.254902,0.603922,0.848597,0.790465,0.380392,0.704314,0.887966,0.847551,0.505882,0.802307,0.926321,0.903714,0.631373,0.851519,0.944037,0.941115,0.756863,0.899977,0.961538,0.976901,0.882353,0.935409,0.975317,0.984775,1,0.968627,0.988235,0.992157]},{\"ColorSpace\":\"Lab\",\"Name\":\"GnBuPu\",\"RGBPoints\":[-1,0.003922,0.27451,0.211765,-0.87451,0.003922,0.349312,0.280661,-0.74902,0.003937,0.423852,0.349773,-0.623529,0.005905,0.46519,0.446228,-0.498039,0.009443,0.506344,0.542837,-0.372549,0.111803,0.535871,0.649135,-0.247059,0.214025,0.565859,0.753633,-0.121569,0.310481,0.615071,0.78316,0.00392157,0.407797,0.663975,0.812503,0.129412,0.531811,0.703345,0.836125,0.254902,0.65421,0.742714,0.859669,0.380392,0.736886,0.782084,0.881323,0.505882,0.81827,0.821176,0.902884,0.631373,0.873387,0.854641,0.922568,0.756863,0.927536,0.888535,0.942361,0.882353,0.964937,0.929873,0.964014,1,1,0.968627,0.984314]},{\"ColorSpace\":\"Lab\",\"Name\":\"BuGnYl\",\"RGBPoints\":[-1,0.031373,0.113725,0.345098,-0.87451,0.088458,0.159,0.463206,-0.74902,0.145052,0.204567,0.5807,-0.623529,0.139146,0.287243,0.620069,-0.498039,0.13318,0.370196,0.659562,-0.372549,0.123337,0.470588,0.706805,-0.247059,0.115386,0.570335,0.753126,-0.121569,0.186251,0.643168,0.761,0.00392157,0.258716,0.71514,0.768074,0.129412,0.380761,0.760415,0.750358,0.254902,0.503576,0.806075,0.732795,0.380392,0.645306,0.861192,0.719016,0.505882,0.783899,0.91511,0.705606,0.631373,0.858701,0.944637,0.6997,0.756863,0.931349,0.973303,0.698424,0.882353,0.966782,0.987082,0.777163,1,1,1,0.85098]},{\"ColorSpace\":\"Lab\",\"Name\":\"PuRd\",\"RGBPoints\":[-1,0.286275,0,0.415686,-0.87451,0.38273,0.001968,0.441276,-0.74902,0.479231,0.003922,0.466774,-0.623529,0.581592,0.003922,0.480554,-0.498039,0.683799,0.00549,0.494887,-0.372549,0.776317,0.105882,0.544098,-0.247059,0.867866,0.206321,0.592618,-0.121569,0.919047,0.308681,0.612303,0.00392157,0.968812,0.411226,0.632603,0.129412,0.974717,0.519493,0.671972,0.254902,0.980546,0.626451,0.71065,0.380392,0.984483,0.701253,0.732303,0.505882,0.988328,0.77504,0.755617,0.631373,0.990296,0.828189,0.812703,0.756863,0.992372,0.880907,0.869035,0.882353,0.996309,0.926182,0.912341,1,1,0.968627,0.952941]},{\"ColorSpace\":\"Lab\",\"Name\":\"RdPu\",\"RGBPoints\":[-1,0.403922,0,0.121569,-0.87451,0.500377,0,0.192434,-0.74902,0.596909,0.000277,0.263037,-0.623529,0.703206,0.035709,0.300438,-0.498039,0.808612,0.071296,0.338854,-0.372549,0.857824,0.116571,0.441215,-0.247059,0.905513,0.163552,0.54293,-0.121569,0.889765,0.281661,0.617732,0.00392157,0.873156,0.39897,0.691611,0.129412,0.82985,0.491488,0.736886,0.254902,0.789081,0.583237,0.781853,0.380392,0.810734,0.656071,0.819254,0.505882,0.833126,0.729181,0.85684,0.631373,0.870527,0.80792,0.898178,0.756863,0.907605,0.884398,0.938331,0.882353,0.9391,0.921799,0.958016,1,0.968627,0.956863,0.976471]},{\"ColorSpace\":\"Lab\",\"Name\":\"Oranges\",\"RGBPoints\":[-1,0.498039,0.152941,0.015686,-0.87451,0.57481,0.182468,0.013718,-0.74902,0.651765,0.212042,0.011734,-0.623529,0.752157,0.247474,0.007797,-0.498039,0.851719,0.283368,0.004475,-0.372549,0.898962,0.348328,0.039908,-0.247059,0.945652,0.413426,0.076401,-0.121569,0.969273,0.484291,0.157109,0.00392157,0.992157,0.554971,0.238185,0.129412,0.992157,0.619931,0.330704,0.254902,0.992157,0.684967,0.423837,0.380392,0.992157,0.751895,0.532103,0.505882,0.992249,0.817716,0.639354,0.631373,0.994218,0.861023,0.725967,0.756863,0.996186,0.903576,0.810965,0.882353,0.998155,0.933103,0.868051,1,1,0.960784,0.921569]},{\"ColorSpace\":\"Lab\",\"Name\":\"Reds\",\"RGBPoints\":[-1,0.403922,0,0.05098,-0.87451,0.525967,0.029527,0.066728,-0.74902,0.647643,0.058962,0.082476,-0.623529,0.722445,0.076678,0.098224,-0.498039,0.797186,0.095194,0.114187,-0.372549,0.868051,0.164091,0.143714,-0.247059,0.937809,0.233541,0.173933,-0.121569,0.96143,0.326059,0.232987,0.00392157,0.984375,0.418147,0.292657,0.129412,0.986344,0.496886,0.371396,0.254902,0.988235,0.575702,0.450673,0.380392,0.988235,0.656409,0.543191,0.505882,0.98842,0.736747,0.635894,0.631373,0.992357,0.809581,0.732349,0.756863,0.996186,0.880692,0.826759,0.882353,0.998155,0.92203,0.885813,1,1,0.960784,0.941176]},{\"ColorSpace\":\"Lab\",\"Name\":\"RdOr\",\"RGBPoints\":[-1,0.498039,0,0,-0.87451,0.6004,0,0,-0.74902,0.702514,0.000738,0.000477,-0.623529,0.773379,0.095225,0.061499,-0.498039,0.843875,0.189865,0.12283,-0.372549,0.891119,0.294195,0.203537,-0.247059,0.937855,0.397924,0.283137,-0.121569,0.963445,0.476663,0.316601,0.00392157,0.988297,0.555771,0.351665,0.129412,0.990265,0.646321,0.436309,0.254902,0.992157,0.735256,0.519646,0.380392,0.992157,0.784468,0.570827,0.505882,0.992249,0.833218,0.623483,0.631373,0.994218,0.872587,0.706159,0.756863,0.996186,0.911419,0.788189,0.882353,0.998155,0.940946,0.859054,1,1,0.968627,0.92549]},{\"ColorSpace\":\"Lab\",\"Name\":\"BrOrYl\",\"RGBPoints\":[-1,0.4,0.145098,0.023529,-0.87451,0.500392,0.174625,0.019592,-0.74902,0.600784,0.204291,0.015656,-0.623529,0.701176,0.251534,0.011719,-0.498039,0.800984,0.299146,0.008397,-0.372549,0.863975,0.370012,0.043829,-0.247059,0.926321,0.441107,0.0794,-0.121569,0.961753,0.521815,0.120738,0.00392157,0.996078,0.602645,0.163122,0.129412,0.996078,0.68729,0.237924,0.254902,0.996078,0.771011,0.314879,0.380392,0.996078,0.832034,0.444798,0.505882,0.996171,0.892042,0.572595,0.631373,0.998139,0.931411,0.65724,0.756863,1,0.969489,0.741669,0.882353,1,0.985236,0.822376,1,1,1,0.898039]},{\"ColorSpace\":\"Lab\",\"Name\":\"RdOrYl\",\"RGBPoints\":[-1,0.501961,0,0.14902,-0.87451,0.622038,0,0.14902,-0.74902,0.741761,0.0004,0.148866,-0.623529,0.816563,0.05158,0.129181,-0.498039,0.890965,0.10356,0.110235,-0.372549,0.940177,0.205921,0.137793,-0.247059,0.988281,0.308789,0.165536,-0.121569,0.99025,0.432803,0.200969,0.00392157,0.992218,0.555217,0.236278,0.129412,0.994187,0.628051,0.267774,0.254902,0.996078,0.701038,0.301269,0.380392,0.996078,0.777809,0.383945,0.505882,0.996171,0.852826,0.466621,0.631373,0.998139,0.892195,0.549296,0.756863,1,0.931349,0.632188,0.882353,1,0.966782,0.7188,1,1,1,0.8]},{\"ColorSpace\":\"Lab\",\"Name\":\"CIELab_blue2red\",\"RGBPoints\":[-1,0,0.6,0.74902,1,0.76863,0.46667,0.34118]},{\"ColorSpace\":\"Lab\",\"Name\":\"blue2yellow\",\"RGBPoints\":[-1,0,0,1,0,0.5,0.5,0.5,1,1,1,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue2gold\",\"RGBPoints\":[-1,0.175119,0.0438468,1,-0.874016,0.22383,0.159771,0.94557,-0.748031,0.27254,0.233611,0.891216,-0.622047,0.321251,0.296526,0.836857,-0.496063,0.369962,0.354296,0.782359,-0.370079,0.418672,0.409139,0.72754,-0.244094,0.467383,0.462152,0.672148,-0.11811,0.51609,0.51396,0.615825,0.00787402,0.572863,0.55452,0.559172,0.133858,0.630269,0.593822,0.517729,0.259843,0.689588,0.624668,0.47446,0.385827,0.745394,0.656113,0.428638,0.511811,0.798624,0.688104,0.379105,0.637795,0.849926,0.720593,0.323834,0.76378,0.899765,0.753543,0.258657,0.889764,0.948487,0.78692,0.171778,1,0.990413,0.816451,0.00729848]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue2yellow\",\"RGBPoints\":[-1,0.0830122,0,0.495617,-0.87451,0.141973,0.0551288,0.57363,-0.74902,0.193048,0.110258,0.604561,-0.623529,0.234231,0.165386,0.57643,-0.498039,0.275413,0.220515,0.548299,-0.372549,0.316596,0.275644,0.520169,-0.247059,0.357778,0.330773,0.492038,-0.121569,0.398961,0.385901,0.463908,0.00392157,0.449929,0.438487,0.426815,0.129412,0.511572,0.488299,0.379944,0.254902,0.581222,0.53603,0.325741,0.380392,0.650871,0.583761,0.271538,0.505882,0.720521,0.631493,0.217335,0.631373,0.79017,0.679224,0.163132,0.756863,0.85982,0.726955,0.108929,0.882353,0.910254,0.774159,0.14112,1,0.927513,0.81759,0.306289]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_cyan2orange\",\"RGBPoints\":[-1,0.0471513,0.213874,0.414329,-0.87451,0.0674702,0.256648,0.439027,-0.74902,0.0959957,0.299331,0.462089,-0.623529,0.132428,0.341872,0.483212,-0.498039,0.188743,0.38277,0.500597,-0.372549,0.268511,0.420229,0.512179,-0.247059,0.352945,0.455602,0.519101,-0.121569,0.43893,0.489368,0.521538,0.00392157,0.522445,0.522495,0.522436,0.129412,0.600089,0.555682,0.53205,0.254902,0.67988,0.587981,0.539163,0.380392,0.761011,0.619586,0.544439,0.505882,0.84278,0.650741,0.548567,0.631373,0.910713,0.687347,0.557822,0.756863,0.952232,0.734972,0.577775,0.882353,0.975642,0.789858,0.604868,1,0.990752,0.843643,0.632857]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_purple2green\",\"RGBPoints\":[-1,0.235006,0.0483128,0.530899,-0.87451,0.302968,0.108419,0.552391,-0.74902,0.360241,0.166059,0.569502,-0.623529,0.406746,0.226782,0.579373,-0.498039,0.444073,0.28964,0.582094,-0.372549,0.473648,0.353774,0.577947,-0.247059,0.497636,0.418154,0.567911,-0.121569,0.519086,0.481741,0.553968,0.00392157,0.542884,0.542914,0.542875,0.129412,0.566303,0.603989,0.527499,0.254902,0.595218,0.662965,0.516857,0.380392,0.628641,0.720701,0.510673,0.505882,0.665373,0.777849,0.508165,0.631373,0.704182,0.834921,0.508303,0.756863,0.743846,0.892328,0.50999,0.882353,0.783158,0.950422,0.512181,1,0.818617,1,0.513888]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_purple2green_dark\",\"RGBPoints\":[-1,0.107656,0,0.428682,-0.87451,0.1924,0,0.449799,-0.74902,0.255118,0.0648939,0.466726,-0.623529,0.304256,0.133066,0.476703,-0.498039,0.343202,0.19716,0.479793,-0.372549,0.373876,0.260353,0.476241,-0.247059,0.398497,0.322872,0.466953,-0.121569,0.420016,0.384252,0.453785,0.00392157,0.44319,0.443216,0.443186,0.129412,0.465553,0.502139,0.428233,0.254902,0.492959,0.559151,0.417591,0.380392,0.524654,0.615092,0.411016,0.505882,0.55959,0.670583,0.40779,0.631373,0.596614,0.726102,0.406948,0.756863,0.634544,0.782032,0.407439,0.882353,0.672183,0.838703,0.408237,1,0.706131,0.892759,0.408452]},{\"ColorSpace\":\"Lab\",\"Name\":\"coolwarm\",\"RGBPoints\":[-1,0.229806,0.298718,0.753683,-0.875,0.303869,0.406535,0.844959,-0.75,0.383013,0.509419,0.917388,-0.625,0.466667,0.604563,0.968155,-0.5,0.552953,0.688929,0.995376,-0.375,0.639176,0.7596,0.998151,-0.25,0.722193,0.813953,0.976575,-0.125,0.798692,0.849786,0.931689,0,0.865395,0.86541,0.865396,0.125,0.924128,0.827385,0.774508,0.25,0.958853,0.769768,0.678008,0.375,0.969954,0.694267,0.579375,0.5,0.958003,0.602842,0.481776,0.625,0.923945,0.497309,0.38797,0.75,0.869187,0.378313,0.300267,0.875,0.795632,0.241284,0.220526,1,0.705673,0.0155562,0.150233]},{\"ColorSpace\":\"Lab\",\"Name\":\"BuRd\",\"RGBPoints\":[-1,0.019608,0.188235,0.380392,-0.87451,0.088504,0.321107,0.564937,-0.74902,0.163399,0.444983,0.697501,-0.623529,0.247059,0.555709,0.754095,-0.498039,0.420684,0.676432,0.818685,-0.372549,0.606459,0.789773,0.880277,-0.247059,0.761476,0.868512,0.924567,-0.121569,0.878047,0.925721,0.951942,0.00392157,0.969089,0.966474,0.964937,0.129412,0.983852,0.897578,0.846828,0.254902,0.982468,0.800692,0.706113,0.380392,0.960323,0.66782,0.536332,0.505882,0.894579,0.503806,0.399769,0.631373,0.81707,0.33218,0.281046,0.756863,0.728489,0.155017,0.197386,0.882353,0.576932,0.055363,0.14925,1,0.403922,0,0.121569]},{\"ColorSpace\":\"Lab\",\"Name\":\"Spectral_lowBlue\",\"RGBPoints\":[-1,0.368627,0.309804,0.635294,-0.87451,0.260361,0.450058,0.70173,-0.74902,0.248058,0.591311,0.717186,-0.623529,0.376009,0.734025,0.658132,-0.498039,0.537947,0.814764,0.64506,-0.372549,0.702345,0.879585,0.636678,-0.247059,0.84752,0.938639,0.607151,-0.121569,0.940408,0.976163,0.656055,0.00392157,0.999923,0.997616,0.745021,0.129412,0.997463,0.921338,0.61707,0.254902,0.995002,0.824606,0.499885,0.380392,0.992541,0.701576,0.39654,0.505882,0.973472,0.547405,0.318108,0.631373,0.937793,0.398539,0.270127,0.756863,0.861515,0.282891,0.299654,0.882353,0.746482,0.144637,0.288812,1,0.619608,0.003922,0.258824]},{\"ColorSpace\":\"Lab\",\"Name\":\"GnRP\",\"RGBPoints\":[-1,0,0.266667,0.105882,-0.87451,0.066436,0.394617,0.174779,-0.74902,0.168858,0.524567,0.25767,-0.623529,0.323875,0.657439,0.361015,-0.498039,0.504883,0.772318,0.506344,-0.372549,0.678431,0.870127,0.654902,-0.247059,0.803922,0.921799,0.780392,-0.121569,0.897116,0.951942,0.882814,0.00392157,0.967397,0.965936,0.967474,0.129412,0.928028,0.879815,0.930565,0.254902,0.866052,0.780777,0.882891,0.380392,0.77501,0.665129,0.821376,0.505882,0.675663,0.537024,0.737024,0.631373,0.57847,0.396155,0.645982,0.756863,0.492349,0.223914,0.547559,0.882353,0.375548,0.096886,0.423299,1,0.25098,0,0.294118]},{\"ColorSpace\":\"Lab\",\"Name\":\"GYPi\",\"RGBPoints\":[-1,0.152941,0.392157,0.098039,-0.87451,0.246444,0.505344,0.117724,-0.74902,0.351942,0.614533,0.161399,-0.623529,0.474971,0.717878,0.240138,-0.498039,0.611995,0.811226,0.392849,-0.372549,0.746328,0.893118,0.565321,-0.247059,0.859516,0.94233,0.747405,-0.121569,0.928105,0.96386,0.875663,0.00392157,0.969089,0.966859,0.968012,0.129412,0.983852,0.910265,0.948328,0.254902,0.979239,0.833218,0.914648,0.380392,0.949712,0.729873,0.862976,0.505882,0.905652,0.58293,0.763552,0.631373,0.85521,0.410073,0.652211,0.756863,0.793695,0.183699,0.531642,0.882353,0.683737,0.063899,0.420761,1,0.556863,0.003922,0.321569]},{\"ColorSpace\":\"Lab\",\"Name\":\"GnYlRd\",\"RGBPoints\":[-1,0,0.407843,0.215686,-0.87451,0.063975,0.525952,0.277201,-0.74902,0.177932,0.633064,0.332718,-0.623529,0.364937,0.724106,0.379469,-0.498039,0.527951,0.797155,0.40223,-0.372549,0.678431,0.862822,0.433449,-0.247059,0.803922,0.916955,0.514648,-0.121569,0.909419,0.961861,0.625067,0.00392157,0.999923,0.997616,0.745021,0.129412,0.997463,0.921338,0.61707,0.254902,0.995002,0.824606,0.499885,0.380392,0.992541,0.701576,0.39654,0.505882,0.973472,0.547405,0.318108,0.631373,0.939023,0.389927,0.245521,0.756863,0.867666,0.239831,0.176624,0.882353,0.762399,0.110727,0.151326,1,0.647059,0,0.14902]},{\"ColorSpace\":\"Lab\",\"Name\":\"GBBr\",\"RGBPoints\":[-1,0,0.235294,0.188235,-0.87451,0.002461,0.338639,0.301423,-0.74902,0.055902,0.448981,0.417609,-0.623529,0.183852,0.56955,0.538178,-0.498039,0.357785,0.700115,0.660746,-0.372549,0.540177,0.819531,0.77624,-0.247059,0.714879,0.890888,0.864821,-0.121569,0.851134,0.934564,0.922645,0.00392157,0.960861,0.959785,0.95694,0.129412,0.963322,0.927797,0.83391,0.254902,0.939946,0.868897,0.68935,0.380392,0.883353,0.775394,0.517109,0.505882,0.808074,0.625836,0.324106,0.631373,0.717647,0.476355,0.15494,0.756863,0.592157,0.358247,0.06882,0.882353,0.458593,0.26436,0.031142,1,0.329412,0.188235,0.019608]},{\"ColorSpace\":\"Lab\",\"Name\":\"PuOr\",\"RGBPoints\":[-1,0.498039,0.231373,0.031373,-0.87451,0.62599,0.30273,0.026451,-0.74902,0.746943,0.387082,0.037524,-0.623529,0.85767,0.490427,0.071972,-0.498039,0.936409,0.617762,0.236371,-0.372549,0.992695,0.743099,0.43291,-0.247059,0.995156,0.841523,0.63714,-0.121569,0.985313,0.913802,0.813687,0.00392157,0.966244,0.966398,0.967705,0.129412,0.889965,0.89504,0.938178,0.254902,0.806151,0.804306,0.894656,0.380392,0.712649,0.688658,0.833141,0.505882,0.594233,0.554325,0.744637,0.631373,0.474894,0.404229,0.652364,0.756863,0.366628,0.217224,0.563783,0.882353,0.266436,0.089965,0.434833,1,0.176471,0,0.294118]},{\"ColorSpace\":\"Lab\",\"Name\":\"PRGn\",\"RGBPoints\":[-1,0.25098,0,0.294118,-0.87451,0.383852,0.103345,0.431911,-0.74902,0.497732,0.234679,0.55371,-0.623529,0.583852,0.40692,0.652134,-0.498039,0.681968,0.545175,0.742561,-0.372549,0.7807,0.672357,0.825221,-0.247059,0.871742,0.788005,0.886736,-0.121569,0.930488,0.885198,0.932872,0.00392157,0.966321,0.968089,0.965859,0.129412,0.892503,0.950865,0.877278,0.254902,0.796078,0.91857,0.772549,0.380392,0.670588,0.866897,0.647059,0.505882,0.493195,0.765398,0.496655,0.631373,0.314187,0.649135,0.354556,0.756863,0.15917,0.516263,0.251211,0.882353,0.062284,0.386621,0.170473,1,0,0.266667,0.105882]},{\"ColorSpace\":\"Lab\",\"Name\":\"PiYG\",\"RGBPoints\":[-1,0.556863,0.003922,0.321569,-0.87451,0.692195,0.067897,0.427374,-0.74902,0.797539,0.197847,0.539177,-0.623529,0.859054,0.424221,0.659746,-0.498039,0.908574,0.592618,0.770319,-0.372549,0.951557,0.736332,0.866205,-0.247059,0.981084,0.839677,0.917878,-0.121569,0.98293,0.913802,0.949558,0.00392157,0.96732,0.968474,0.965629,0.129412,0.92549,0.963552,0.869666,0.254902,0.852441,0.939254,0.736025,0.380392,0.739254,0.890042,0.553941,0.505882,0.60323,0.805536,0.382238,0.631373,0.467282,0.711419,0.235217,0.756863,0.344252,0.608074,0.156478,0.882353,0.2406,0.49827,0.116494,1,0.152941,0.392157,0.098039]},{\"ColorSpace\":\"Lab\",\"Name\":\"OrPu\",\"RGBPoints\":[-1,0.176471,0,0.294118,-0.87451,0.272434,0.095963,0.444214,-0.74902,0.373395,0.228912,0.56932,-0.623529,0.481661,0.415917,0.657901,-0.498039,0.601922,0.562937,0.750481,-0.372549,0.718493,0.695886,0.836986,-0.247059,0.811995,0.811534,0.898501,-0.121569,0.894733,0.8995,0.940023,0.00392157,0.969166,0.966859,0.963629,0.129412,0.98639,0.910265,0.803691,0.254902,0.995002,0.835371,0.624375,0.380392,0.992541,0.736947,0.420146,0.505882,0.931949,0.609458,0.224221,0.631373,0.85075,0.483968,0.069819,0.756863,0.740023,0.380623,0.035371,0.882353,0.617993,0.29827,0.026759,1,0.498039,0.231373,0.031373]},{\"ColorSpace\":\"Lab\",\"Name\":\"BrBG\",\"RGBPoints\":[-1,0.329412,0.188235,0.019608,-0.87451,0.467205,0.269435,0.031911,-0.74902,0.6,0.365629,0.074202,-0.623529,0.72549,0.483737,0.160323,-0.498039,0.812995,0.635832,0.336409,-0.372549,0.88689,0.781238,0.527874,-0.247059,0.943483,0.87474,0.700115,-0.121569,0.963168,0.929796,0.841599,0.00392157,0.957247,0.959938,0.959554,0.129412,0.84406,0.932872,0.920185,0.254902,0.70396,0.886428,0.859285,0.380392,0.529258,0.815071,0.770704,0.505882,0.346251,0.691811,0.653057,0.631373,0.175855,0.562015,0.530642,0.756863,0.047905,0.441446,0.410073,0.882353,0.002307,0.33218,0.294348,1,0,0.235294,0.188235]},{\"ColorSpace\":\"Lab\",\"Name\":\"GyRd\",\"RGBPoints\":[-1,0.101961,0.101961,0.101961,-0.87451,0.227451,0.227451,0.227451,-0.74902,0.359939,0.359939,0.359939,-0.623529,0.502653,0.502653,0.502653,-0.498039,0.631373,0.631373,0.631373,-0.372549,0.749865,0.749865,0.749865,-0.247059,0.843368,0.843368,0.843368,-0.121569,0.926105,0.926105,0.926105,0.00392157,0.999846,0.997232,0.995694,0.129412,0.994925,0.908651,0.857901,0.254902,0.982468,0.800692,0.706113,0.380392,0.960323,0.66782,0.536332,0.505882,0.894579,0.503806,0.399769,0.631373,0.81707,0.33218,0.281046,0.756863,0.728489,0.155017,0.197386,0.882353,0.576932,0.055363,0.14925,1,0.403922,0,0.121569]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_divHi_purpleGreen\",\"RGBPoints\":[-1,0.297553,0,0.489074,-0.87451,0.40259,0.151146,0.567754,-0.74902,0.516038,0.284843,0.658231,-0.623529,0.629783,0.423646,0.750938,-0.498039,0.735198,0.563697,0.835956,-0.372549,0.82408,0.695541,0.903582,-0.247059,0.889091,0.807454,0.944862,-0.121569,0.92334,0.886917,0.951839,0.00392157,0.921045,0.921084,0.921003,0.129412,0.877324,0.907455,0.845381,0.254902,0.797649,0.849713,0.734695,0.380392,0.691646,0.75964,0.600532,0.505882,0.568981,0.649159,0.453807,0.631373,0.438945,0.529756,0.304259,0.756863,0.30973,0.412001,0.158303,0.882353,0.187078,0.305111,0.00251458,1,0.101655,0.220836,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_divHi_purpleGreen_dim\",\"RGBPoints\":[-1,0.404088,0.131038,0.592767,-0.87451,0.486469,0.230957,0.651243,-0.74902,0.575165,0.339335,0.717723,-0.623529,0.662741,0.454332,0.784263,-0.498039,0.742071,0.570213,0.842918,-0.372549,0.806935,0.678992,0.886227,-0.247059,0.852219,0.771315,0.90763,-0.121569,0.873345,0.837327,0.901572,0.00392157,0.866783,0.86682,0.866745,0.129412,0.82839,0.858225,0.796812,0.254902,0.762578,0.814287,0.700202,0.380392,0.676429,0.744229,0.585735,0.505882,0.577033,0.65732,0.461526,0.631373,0.47128,0.562476,0.33476,0.756863,0.365461,0.467957,0.21076,0.882353,0.264758,0.381138,0.0878313,1,0.182591,0.312249,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_divLow_icePeach\",\"RGBPoints\":[-1,0.480048,0.817441,0.998056,-0.87451,0.425898,0.726921,0.883187,-0.74902,0.366682,0.629445,0.761936,-0.623529,0.308756,0.531002,0.640217,-0.498039,0.258021,0.43705,0.523433,-0.372549,0.219244,0.352381,0.416348,-0.247059,0.195127,0.281032,0.322979,-0.121569,0.186286,0.22627,0.246525,0.00392157,0.192352,0.19236,0.192364,0.129412,0.255927,0.214469,0.191756,0.254902,0.340459,0.254426,0.206666,0.380392,0.444655,0.309315,0.234029,0.505882,0.565353,0.376004,0.270969,0.631373,0.697917,0.450748,0.314293,0.756863,0.836657,0.529064,0.360227,0.882353,0.972695,0.614884,0.413123,1,1,0.705904,0.472699]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_divLow_purpleGreen\",\"RGBPoints\":[-1,0.956034,0.666487,0.952663,-0.87451,0.874457,0.572698,0.936352,-0.74902,0.753465,0.488253,0.909063,-0.623529,0.63309,0.413507,0.763833,-0.498039,0.514491,0.345878,0.620015,-0.372549,0.405008,0.288141,0.484376,-0.247059,0.311388,0.241986,0.363556,-0.121569,0.238722,0.209044,0.263449,0.00392157,0.192352,0.192366,0.192362,0.129412,0.200379,0.233201,0.168618,0.254902,0.230151,0.291737,0.165227,0.380392,0.279481,0.366076,0.178607,0.505882,0.344927,0.453267,0.205703,0.631373,0.421554,0.549449,0.242643,0.756863,0.503334,0.649999,0.284377,0.882353,0.583497,0.749672,0.324969,1,0.650705,0.837228,0.356264]},{\"ColorSpace\":\"Lab\",\"Name\":\"Haze_green\",\"RGBPoints\":[-1,1,0.835294,0.886275,-0.87451,0.937255,0.756863,0.870443,-0.74902,0.875817,0.666376,0.857807,-0.623529,0.778359,0.583007,0.808134,-0.498039,0.676253,0.494118,0.745098,-0.372549,0.561365,0.390123,0.682353,-0.247059,0.438344,0.262745,0.621496,-0.121569,0.321133,0.141031,0.558751,0.00392157,0.203922,0.0217865,0.495861,0.129412,0.265505,0.129412,0.433261,0.254902,0.311692,0.255338,0.37008,0.380392,0.356282,0.377342,0.310821,0.505882,0.39971,0.488889,0.258243,0.631373,0.442556,0.604357,0.205519,0.756863,0.48671,0.71968,0.152941,0.882353,0.529847,0.830356,0.100944,1,0.572549,0.933333,0.054902]},{\"ColorSpace\":\"Lab\",\"Name\":\"Haze_lime\",\"RGBPoints\":[-1,0.704034,0.784196,1,-0.87451,0.633111,0.691418,0.956078,-0.74902,0.564021,0.600606,0.912157,-0.623529,0.496827,0.51189,0.868235,-0.498039,0.43157,0.425416,0.824314,-0.372549,0.368248,0.341347,0.780392,-0.247059,0.306767,0.259855,0.736471,-0.121569,0.246862,0.181069,0.692549,0.00392157,0.191619,0.109542,0.648627,0.129412,0.257404,0.194031,0.604706,0.254902,0.321794,0.278775,0.560784,0.380392,0.387909,0.364617,0.516863,0.505882,0.456569,0.451881,0.472941,0.631373,0.527424,0.540773,0.42902,0.756863,0.599759,0.631427,0.385098,0.882353,0.673065,0.723898,0.341176,1,0.742751,0.812252,0.3]},{\"ColorSpace\":\"RGB\",\"Name\":\"Haze\",\"RGBPoints\":[-1,1,0.835294,0.996078,-0.00392157,0.023529,0.141176,0.498039,0.00392157,0.015686,0.137255,0.494118,1,0.984314,0.764706,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"Haze_cyan\",\"RGBPoints\":[-1,0.956863,1,0.835294,-0.87451,0.933188,0.921714,0.760784,-0.74902,0.870588,0.803486,0.671605,-0.623529,0.807843,0.684096,0.583297,-0.498039,0.745098,0.569208,0.494118,-0.372549,0.682353,0.437763,0.390123,-0.247059,0.621496,0.288163,0.262745,-0.121569,0.558751,0.144517,0.141031,0.00392157,0.495861,0.0217865,0.0413943,0.129412,0.433261,0.137255,0.129412,0.254902,0.37008,0.263181,0.255338,0.380392,0.306318,0.381845,0.372694,0.505882,0.243137,0.503994,0.494263,0.631373,0.180392,0.629484,0.619753,0.756863,0.117647,0.754975,0.747131,0.882353,0.054902,0.876398,0.866812,1,0,0.988235,0.976471]},{\"ColorSpace\":\"Lab\",\"Name\":\"nic_Edge\",\"RGBPoints\":[-1,0.191208,0.191208,0.191208,-0.87451,0.239484,0.00545035,0.614821,-0.74902,0.220593,0.0617459,0.863547,-0.623529,0.17509,0.278988,0.97794,-0.498039,0.143526,0.576069,0.998553,-0.372549,0.166456,0.871883,0.96594,-0.247059,0.376202,0.993555,0.981833,-0.121569,0.681996,0.991297,0.999239,0.00392157,0.954172,0.952734,0.94374,0.129412,0.999735,0.99301,0.662896,0.254902,0.979399,0.991466,0.357973,0.380392,0.968771,0.854967,0.162659,0.505882,0.999245,0.556697,0.144323,0.631373,0.973959,0.26223,0.177946,0.756863,0.852358,0.0526707,0.222974,0.882353,0.593889,0.00912724,0.238855,1,0.191208,0.191208,0.191208]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_iceFire_H\",\"RGBPoints\":[-1,4.05432e-7,0,0.00000590122,-0.87451,0,0.120401,0.302675,-0.74902,0,0.216583,0.524574,-0.623529,0.0552475,0.345025,0.6595,-0.498039,0.128047,0.492588,0.720288,-0.372549,0.188955,0.641309,0.792092,-0.247059,0.327673,0.784935,0.873434,-0.121569,0.60824,0.892164,0.935547,0.00392157,0.881371,0.912178,0.818099,0.129412,0.951407,0.835621,0.449279,0.254902,0.904481,0.690489,0,0.380392,0.85407,0.510864,0,0.505882,0.777093,0.33018,0.00088199,0.631373,0.672862,0.139087,0.00269398,0.756863,0.508815,0,0,0.882353,0.299417,0.000366289,0.000547829,1,0.0157519,0.00332021,4.55569e-8]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_iceFire_L\",\"RGBPoints\":[-1,0.870485,0.913768,0.832905,-0.87451,0.586919,0.887865,0.934003,-0.74902,0.31583,0.776442,0.867858,-0.623529,0.18302,0.632034,0.787722,-0.498039,0.117909,0.484134,0.713825,-0.372549,0.0507239,0.335979,0.654741,-0.247059,0,0.209874,0.511832,-0.121569,0,0.114689,0.28935,0.00392157,0.0157519,0.00332021,4.55569e-8,0.129412,0.312914,0,0,0.254902,0.520865,0,0,0.380392,0.680105,0.15255,0.0025996,0.505882,0.785109,0.339479,0.000797922,0.631373,0.857354,0.522494,0,0.756863,0.910974,0.699774,0,0.882353,0.951921,0.842817,0.478545,1,0.881371,0.912178,0.818099]},{\"ColorSpace\":\"RGB\",\"Name\":\"hsv\",\"RGBPoints\":[-1,1,0,0,-0.666666,1,0,1,-0.333333,0,0,1,0,0,1,1,0.33333,0,1,0,0.66666,1,1,0,1,1,0,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"hue_L60\",\"RGBPoints\":[-1,0.964784,0.400592,0.349549,-0.87451,0.964915,0.372498,0.53785,-0.74902,0.892353,0.401039,0.759569,-0.623529,0.79263,0.446956,0.903017,-0.498039,0.682208,0.49954,0.966673,-0.372549,0.56392,0.553082,0.968836,-0.247059,0.442031,0.606396,0.901601,-0.121569,0.305499,0.65701,0.765784,0.00392157,0.197251,0.687914,0.620914,0.129412,0.193882,0.701887,0.472654,0.254902,0.249866,0.706123,0.320005,0.380392,0.35132,0.697417,0.202919,0.505882,0.498097,0.669467,0.125232,0.631373,0.637477,0.626239,0.107431,0.756863,0.762115,0.56872,0.155812,0.882353,0.889434,0.481116,0.240445,1,0.964784,0.400592,0.349549]},{\"IndexedColors\":[0,0,0,0.8941176470588236,0.1019607843137255,0.1098039215686274,0.2156862745098039,0.4941176470588236,0.7215686274509804,0.3019607843137255,0.6862745098039216,0.2901960784313726,0.596078431372549,0.3058823529411765,0.6392156862745098,1,0.4980392156862745,0,0.6509803921568628,0.3372549019607843,0.1568627450980392],\"Name\":\"Spectrum\",\"NanColor\":[0.6509803921568628,0.3372549019607843,0.1568627450980392]},{\"IndexedColors\":[0.4745098039215686,0.09019607843137255,0.09019607843137255,0.7098039215686275,0.00392156862745098,0.00392156862745098,0.9372549019607843,0.2784313725490196,0.09803921568627451,0.9764705882352941,0.5137254901960784,0.1411764705882353,1,0.7058823529411765,0,1,0.8980392156862745,0.02352941176470588],\"Name\":\"Warm\",\"NanColor\":[1,0.8980392156862745,0.02352941176470588]},{\"IndexedColors\":[0.4588235294117647,0.6941176470588235,0.00392156862745098,0.3450980392156863,0.5019607843137255,0.1607843137254902,0.3137254901960784,0.8431372549019608,0.7490196078431373,0.1098039215686274,0.5843137254901961,0.803921568627451,0.2313725490196079,0.407843137254902,0.6705882352941176,0.6039215686274509,0.407843137254902,1,0.3725490196078431,0.2,0.5019607843137255],\"Name\":\"Cool\",\"NanColor\":[0.3725490196078431,0.2,0.5019607843137255]},{\"IndexedColors\":[0.2313725490196079,0.407843137254902,0.6705882352941176,0.1098039215686274,0.5843137254901961,0.803921568627451,0.3058823529411765,0.8509803921568627,0.9176470588235294,0.4509803921568628,0.6039215686274509,0.8352941176470589,0.2588235294117647,0.2392156862745098,0.6627450980392157,0.3137254901960784,0.3294117647058823,0.5294117647058824,0.06274509803921569,0.1647058823529412,0.3215686274509804],\"Name\":\"Blues\",\"NanColor\":[0.06274509803921569,0.1647058823529412,0.3215686274509804]},{\"IndexedColors\":[0.1098039215686274,0.5843137254901961,0.803921568627451,0.2313725490196079,0.407843137254902,0.6705882352941176,0.4,0.2431372549019608,0.7176470588235294,0.6352941176470588,0.3294117647058823,0.8117647058823529,0.8705882352941177,0.3803921568627451,0.807843137254902,0.8627450980392157,0.3803921568627451,0.5843137254901961,0.2392156862745098,0.06274509803921569,0.3215686274509804],\"Name\":\"Wild Flower\",\"NanColor\":[0.2392156862745098,0.06274509803921569,0.3215686274509804]},{\"IndexedColors\":[0.396078431372549,0.4862745098039216,0.2156862745098039,0.4588235294117647,0.6941176470588235,0.00392156862745098,0.6980392156862745,0.7294117647058823,0.1882352941176471,1,0.8980392156862745,0.02352941176470588,1,0.7058823529411765,0,0.9764705882352941,0.5137254901960784,0.1411764705882353],\"Name\":\"Citrus\",\"NanColor\":[0.9764705882352941,0.5137254901960784,0.1411764705882353]},{\"IndexedColors\":[0.4980392156862745,0.2313725490196079,0.03137254901960784,0.7019607843137254,0.3450980392156863,0.02352941176470588,0.8784313725490196,0.5098039215686274,0.0784313725490196,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.996078431372549,0.8784313725490196,0.7137254901960784,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.5019607843137255,0.4509803921568628,0.6745098039215687,0.3294117647058823,0.1529411764705882,0.5333333333333333,0.1764705882352941,0,0.2941176470588235],\"Name\":\"Brewer Diverging Purple-Orange (11)\",\"NanColor\":[0.1764705882352941,0,0.2941176470588235]},{\"IndexedColors\":[0.4980392156862745,0.2313725490196079,0.03137254901960784,0.7019607843137254,0.3450980392156863,0.02352941176470588,0.8784313725490196,0.5098039215686274,0.0784313725490196,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.996078431372549,0.8784313725490196,0.7137254901960784,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.5019607843137255,0.4509803921568628,0.6745098039215687,0.3294117647058823,0.1529411764705882,0.5333333333333333,0.1764705882352941,0,0.2941176470588235],\"Name\":\"Brewer Diverging Purple-Orange (10)\",\"NanColor\":[0.1764705882352941,0,0.2941176470588235]},{\"IndexedColors\":[0.7019607843137254,0.3450980392156863,0.02352941176470588,0.8784313725490196,0.5098039215686274,0.0784313725490196,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.996078431372549,0.8784313725490196,0.7137254901960784,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.5019607843137255,0.4509803921568628,0.6745098039215687,0.3294117647058823,0.1529411764705882,0.5333333333333333],\"Name\":\"Brewer Diverging Purple-Orange (9)\",\"NanColor\":[0.3294117647058823,0.1529411764705882,0.5333333333333333]},{\"IndexedColors\":[0.7019607843137254,0.3450980392156863,0.02352941176470588,0.8784313725490196,0.5098039215686274,0.0784313725490196,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.996078431372549,0.8784313725490196,0.7137254901960784,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.5019607843137255,0.4509803921568628,0.6745098039215687,0.3294117647058823,0.1529411764705882,0.5333333333333333],\"Name\":\"Brewer Diverging Purple-Orange (8)\",\"NanColor\":[0.3294117647058823,0.1529411764705882,0.5333333333333333]},{\"IndexedColors\":[0.7019607843137254,0.3450980392156863,0.02352941176470588,0.9450980392156862,0.6392156862745098,0.2509803921568627,0.996078431372549,0.8784313725490196,0.7137254901960784,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6,0.5568627450980392,0.7647058823529411,0.3294117647058823,0.1529411764705882,0.5333333333333333],\"Name\":\"Brewer Diverging Purple-Orange (7)\",\"NanColor\":[0.3294117647058823,0.1529411764705882,0.5333333333333333]},{\"IndexedColors\":[0.7019607843137254,0.3450980392156863,0.02352941176470588,0.9450980392156862,0.6392156862745098,0.2509803921568627,0.996078431372549,0.8784313725490196,0.7137254901960784,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6,0.5568627450980392,0.7647058823529411,0.3294117647058823,0.1529411764705882,0.5333333333333333],\"Name\":\"Brewer Diverging Purple-Orange (6)\",\"NanColor\":[0.3294117647058823,0.1529411764705882,0.5333333333333333]},{\"IndexedColors\":[0.9019607843137255,0.3803921568627451,0.00392156862745098,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.3686274509803922,0.2352941176470588,0.6],\"Name\":\"Brewer Diverging Purple-Orange (5)\",\"NanColor\":[0.3686274509803922,0.2352941176470588,0.6]},{\"IndexedColors\":[0.9019607843137255,0.3803921568627451,0.00392156862745098,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.3686274509803922,0.2352941176470588,0.6],\"Name\":\"Brewer Diverging Purple-Orange (4)\",\"NanColor\":[0.3686274509803922,0.2352941176470588,0.6]},{\"IndexedColors\":[0.9450980392156862,0.6392156862745098,0.2509803921568627,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.6,0.5568627450980392,0.7647058823529411],\"Name\":\"Brewer Diverging Purple-Orange (3)\",\"NanColor\":[0.6,0.5568627450980392,0.7647058823529411]},{\"IndexedColors\":[0.6196078431372549,0.00392156862745098,0.2588235294117647,0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9568627450980393,0.4274509803921568,0.2627450980392157,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.996078431372549,0.8784313725490196,0.5450980392156862,1,1,0.7490196078431373,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.4,0.7607843137254902,0.6470588235294118,0.196078431372549,0.5333333333333333,0.7411764705882353,0.3686274509803922,0.3098039215686275,0.6352941176470588],\"Name\":\"Brewer Diverging Spectral (11)\",\"NanColor\":[0.3686274509803922,0.3098039215686275,0.6352941176470588]},{\"IndexedColors\":[0.6196078431372549,0.00392156862745098,0.2588235294117647,0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9568627450980393,0.4274509803921568,0.2627450980392157,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.996078431372549,0.8784313725490196,0.5450980392156862,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.4,0.7607843137254902,0.6470588235294118,0.196078431372549,0.5333333333333333,0.7411764705882353,0.3686274509803922,0.3098039215686275,0.6352941176470588],\"Name\":\"Brewer Diverging Spectral (10)\",\"NanColor\":[0.3686274509803922,0.3098039215686275,0.6352941176470588]},{\"IndexedColors\":[0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9568627450980393,0.4274509803921568,0.2627450980392157,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.996078431372549,0.8784313725490196,0.5450980392156862,1,1,0.7490196078431373,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.4,0.7607843137254902,0.6470588235294118,0.196078431372549,0.5333333333333333,0.7411764705882353],\"Name\":\"Brewer Diverging Spectral (9)\",\"NanColor\":[0.196078431372549,0.5333333333333333,0.7411764705882353]},{\"IndexedColors\":[0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9568627450980393,0.4274509803921568,0.2627450980392157,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.996078431372549,0.8784313725490196,0.5450980392156862,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.4,0.7607843137254902,0.6470588235294118,0.196078431372549,0.5333333333333333,0.7411764705882353],\"Name\":\"Brewer Diverging Spectral (8)\",\"NanColor\":[0.196078431372549,0.5333333333333333,0.7411764705882353]},{\"IndexedColors\":[0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9882352941176471,0.5529411764705883,0.3490196078431372,0.996078431372549,0.8784313725490196,0.5450980392156862,1,1,0.7490196078431373,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6,0.8352941176470589,0.5803921568627451,0.196078431372549,0.5333333333333333,0.7411764705882353],\"Name\":\"Brewer Diverging Spectral (7)\",\"NanColor\":[0.196078431372549,0.5333333333333333,0.7411764705882353]},{\"IndexedColors\":[0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9882352941176471,0.5529411764705883,0.3490196078431372,0.996078431372549,0.8784313725490196,0.5450980392156862,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6,0.8352941176470589,0.5803921568627451,0.196078431372549,0.5333333333333333,0.7411764705882353],\"Name\":\"Brewer Diverging Spectral (6)\",\"NanColor\":[0.196078431372549,0.5333333333333333,0.7411764705882353]},{\"IndexedColors\":[0.8431372549019608,0.09803921568627451,0.1098039215686274,0.9921568627450981,0.6823529411764706,0.3803921568627451,1,1,0.7490196078431373,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.1686274509803922,0.5137254901960784,0.7294117647058823],\"Name\":\"Brewer Diverging Spectral (5)\",\"NanColor\":[0.1686274509803922,0.5137254901960784,0.7294117647058823]},{\"IndexedColors\":[0.8431372549019608,0.09803921568627451,0.1098039215686274,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.1686274509803922,0.5137254901960784,0.7294117647058823],\"Name\":\"Brewer Diverging Spectral (4)\",\"NanColor\":[0.1686274509803922,0.5137254901960784,0.7294117647058823]},{\"IndexedColors\":[0.9882352941176471,0.5529411764705883,0.3490196078431372,1,1,0.7490196078431373,0.6,0.8352941176470589,0.5803921568627451],\"Name\":\"Brewer Diverging Spectral (3)\",\"NanColor\":[0.6,0.8352941176470589,0.5803921568627451]},{\"IndexedColors\":[0.3294117647058823,0.1882352941176471,0.0196078431372549,0.5490196078431373,0.3176470588235294,0.0392156862745098,0.7490196078431373,0.5058823529411764,0.1764705882352941,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.5019607843137255,0.803921568627451,0.7568627450980392,0.207843137254902,0.592156862745098,0.5607843137254902,0.00392156862745098,0.4,0.3686274509803922,0,0.2352941176470588,0.1882352941176471],\"Name\":\"Brewer Diverging Brown-Blue-Green (11)\",\"NanColor\":[0,0.2352941176470588,0.1882352941176471]},{\"IndexedColors\":[0.3294117647058823,0.1882352941176471,0.0196078431372549,0.5490196078431373,0.3176470588235294,0.0392156862745098,0.7490196078431373,0.5058823529411764,0.1764705882352941,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.5019607843137255,0.803921568627451,0.7568627450980392,0.207843137254902,0.592156862745098,0.5607843137254902,0.00392156862745098,0.4,0.3686274509803922,0,0.2352941176470588,0.1882352941176471],\"Name\":\"Brewer Diverging Brown-Blue-Green (10)\",\"NanColor\":[0,0.2352941176470588,0.1882352941176471]},{\"IndexedColors\":[0.5490196078431373,0.3176470588235294,0.0392156862745098,0.7490196078431373,0.5058823529411764,0.1764705882352941,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.5019607843137255,0.803921568627451,0.7568627450980392,0.207843137254902,0.592156862745098,0.5607843137254902,0.00392156862745098,0.4,0.3686274509803922],\"Name\":\"Brewer Diverging Brown-Blue-Green (9)\",\"NanColor\":[0.00392156862745098,0.4,0.3686274509803922]},{\"IndexedColors\":[0.5490196078431373,0.3176470588235294,0.0392156862745098,0.7490196078431373,0.5058823529411764,0.1764705882352941,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.5019607843137255,0.803921568627451,0.7568627450980392,0.207843137254902,0.592156862745098,0.5607843137254902,0.00392156862745098,0.4,0.3686274509803922],\"Name\":\"Brewer Diverging Brown-Blue-Green (8)\",\"NanColor\":[0.00392156862745098,0.4,0.3686274509803922]},{\"IndexedColors\":[0.5490196078431373,0.3176470588235294,0.0392156862745098,0.8470588235294118,0.7019607843137254,0.396078431372549,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.3529411764705883,0.7058823529411765,0.6745098039215687,0.00392156862745098,0.4,0.3686274509803922],\"Name\":\"Brewer Diverging Brown-Blue-Green (7)\",\"NanColor\":[0.00392156862745098,0.4,0.3686274509803922]},{\"IndexedColors\":[0.5490196078431373,0.3176470588235294,0.0392156862745098,0.8470588235294118,0.7019607843137254,0.396078431372549,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.3529411764705883,0.7058823529411765,0.6745098039215687,0.00392156862745098,0.4,0.3686274509803922],\"Name\":\"Brewer Diverging Brown-Blue-Green (6)\",\"NanColor\":[0.00392156862745098,0.4,0.3686274509803922]},{\"IndexedColors\":[0.6509803921568628,0.3803921568627451,0.1019607843137255,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.5019607843137255,0.803921568627451,0.7568627450980392,0.00392156862745098,0.5215686274509804,0.4431372549019608],\"Name\":\"Brewer Diverging Brown-Blue-Green (5)\",\"NanColor\":[0.00392156862745098,0.5215686274509804,0.4431372549019608]},{\"IndexedColors\":[0.6509803921568628,0.3803921568627451,0.1019607843137255,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.5019607843137255,0.803921568627451,0.7568627450980392,0.00392156862745098,0.5215686274509804,0.4431372549019608],\"Name\":\"Brewer Diverging Brown-Blue-Green (4)\",\"NanColor\":[0.00392156862745098,0.5215686274509804,0.4431372549019608]},{\"IndexedColors\":[0.8470588235294118,0.7019607843137254,0.396078431372549,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.3529411764705883,0.7058823529411765,0.6745098039215687],\"Name\":\"Brewer Diverging Brown-Blue-Green (3)\",\"NanColor\":[0.3529411764705883,0.7058823529411765,0.6745098039215687]},{\"IndexedColors\":[0.9686274509803922,0.9882352941176471,0.9921568627450981,0.8980392156862745,0.9607843137254902,0.9764705882352941,0.8,0.9254901960784314,0.9019607843137255,0.6,0.8470588235294118,0.788235294117647,0.4,0.7607843137254902,0.6431372549019608,0.2549019607843137,0.6823529411764706,0.4627450980392157,0.1372549019607843,0.5450980392156862,0.2705882352941176,0,0.4274509803921568,0.1725490196078431,0,0.2666666666666667,0.1058823529411765],\"Name\":\"Brewer Sequential Blue-Green (9)\",\"NanColor\":[0,0.2666666666666667,0.1058823529411765]},{\"IndexedColors\":[0.9686274509803922,0.9882352941176471,0.9921568627450981,0.8980392156862745,0.9607843137254902,0.9764705882352941,0.8,0.9254901960784314,0.9019607843137255,0.6,0.8470588235294118,0.788235294117647,0.4,0.7607843137254902,0.6431372549019608,0.2549019607843137,0.6823529411764706,0.4627450980392157,0.1372549019607843,0.5450980392156862,0.2705882352941176,0,0.3450980392156863,0.1411764705882353],\"Name\":\"Brewer Sequential Blue-Green (8)\",\"NanColor\":[0,0.3450980392156863,0.1411764705882353]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.8,0.9254901960784314,0.9019607843137255,0.8,0.9254901960784314,0.9019607843137255,0.4,0.7607843137254902,0.6431372549019608,0.2549019607843137,0.6823529411764706,0.4627450980392157,0.1372549019607843,0.5450980392156862,0.2705882352941176,0,0.3450980392156863,0.1411764705882353],\"Name\":\"Brewer Sequential Blue-Green (7)\",\"NanColor\":[0,0.3450980392156863,0.1411764705882353]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.8,0.9254901960784314,0.9019607843137255,0.6,0.8470588235294118,0.788235294117647,0.4,0.7607843137254902,0.6431372549019608,0.1725490196078431,0.6352941176470588,0.3725490196078431,0,0.4274509803921568,0.1725490196078431],\"Name\":\"Brewer Sequential Blue-Green (6)\",\"NanColor\":[0,0.4274509803921568,0.1725490196078431]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.6980392156862745,0.8862745098039215,0.8862745098039215,0.4,0.7607843137254902,0.6431372549019608,0.1725490196078431,0.6352941176470588,0.3725490196078431,0,0.4274509803921568,0.1725490196078431],\"Name\":\"Brewer Sequential Blue-Green (5)\",\"NanColor\":[0,0.4274509803921568,0.1725490196078431]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.6980392156862745,0.8862745098039215,0.8862745098039215,0.4,0.7607843137254902,0.6431372549019608,0.1372549019607843,0.5450980392156862,0.2705882352941176],\"Name\":\"Brewer Sequential Blue-Green (4)\",\"NanColor\":[0.1372549019607843,0.5450980392156862,0.2705882352941176]},{\"IndexedColors\":[0.8980392156862745,0.9607843137254902,0.9764705882352941,0.6,0.8470588235294118,0.788235294117647,0.1725490196078431,0.6352941176470588,0.3725490196078431],\"Name\":\"Brewer Sequential Blue-Green (3)\",\"NanColor\":[0.1725490196078431,0.6352941176470588,0.3725490196078431]},{\"IndexedColors\":[1,1,0.8980392156862745,1,0.9686274509803922,0.7372549019607844,0.996078431372549,0.8901960784313725,0.5686274509803921,0.996078431372549,0.7686274509803922,0.3098039215686275,0.996078431372549,0.6,0.1607843137254902,0.9254901960784314,0.4392156862745098,0.0784313725490196,0.8,0.2980392156862745,0.00784313725490196,0.6,0.203921568627451,0.01568627450980392,0.4,0.1450980392156863,0.02352941176470588],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (9)\",\"NanColor\":[0.4,0.1450980392156863,0.02352941176470588]},{\"IndexedColors\":[1,1,0.8980392156862745,1,0.9686274509803922,0.7372549019607844,0.996078431372549,0.8901960784313725,0.5686274509803921,0.996078431372549,0.7686274509803922,0.3098039215686275,0.996078431372549,0.6,0.1607843137254902,0.9254901960784314,0.4392156862745098,0.0784313725490196,0.8,0.2980392156862745,0.00784313725490196,0.5490196078431373,0.1764705882352941,0.01568627450980392],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (8)\",\"NanColor\":[0.5490196078431373,0.1764705882352941,0.01568627450980392]},{\"IndexedColors\":[1,1,0.8313725490196079,0.996078431372549,0.8901960784313725,0.5686274509803921,0.996078431372549,0.7686274509803922,0.3098039215686275,0.996078431372549,0.6,0.1607843137254902,0.9254901960784314,0.4392156862745098,0.0784313725490196,0.8,0.2980392156862745,0.00784313725490196,0.5490196078431373,0.1764705882352941,0.01568627450980392],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (7)\",\"NanColor\":[0.5490196078431373,0.1764705882352941,0.01568627450980392]},{\"IndexedColors\":[1,1,0.8313725490196079,0.996078431372549,0.8901960784313725,0.5686274509803921,0.996078431372549,0.7686274509803922,0.3098039215686275,0.996078431372549,0.6,0.1607843137254902,0.8509803921568627,0.3725490196078431,0.05490196078431372,0.6,0.203921568627451,0.01568627450980392],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (6)\",\"NanColor\":[0.6,0.203921568627451,0.01568627450980392]},{\"IndexedColors\":[1,1,0.8313725490196079,0.996078431372549,0.8509803921568627,0.5568627450980392,0.996078431372549,0.6,0.1607843137254902,0.8509803921568627,0.3725490196078431,0.05490196078431372,0.6,0.203921568627451,0.01568627450980392],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (5)\",\"NanColor\":[0.6,0.203921568627451,0.01568627450980392]},{\"IndexedColors\":[1,1,0.8313725490196079,0.996078431372549,0.8509803921568627,0.5568627450980392,0.996078431372549,0.6,0.1607843137254902,0.8,0.2980392156862745,0.00784313725490196],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (4)\",\"NanColor\":[0.8,0.2980392156862745,0.00784313725490196]},{\"IndexedColors\":[1,0.9686274509803922,0.7372549019607844,0.996078431372549,0.7686274509803922,0.3098039215686275,0.8509803921568627,0.3725490196078431,0.05490196078431372],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (3)\",\"NanColor\":[0.8509803921568627,0.3725490196078431,0.05490196078431372]},{\"IndexedColors\":[0.9686274509803922,0.9882352941176471,0.9921568627450981,0.8784313725490196,0.9254901960784314,0.9568627450980393,0.7490196078431373,0.8274509803921568,0.9019607843137255,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5490196078431373,0.4196078431372549,0.6941176470588235,0.5333333333333333,0.2549019607843137,0.615686274509804,0.5058823529411764,0.05882352941176471,0.4862745098039216,0.3019607843137255,0,0.2941176470588235],\"Name\":\"Brewer Sequential Blue-Purple (9)\",\"NanColor\":[0.3019607843137255,0,0.2941176470588235]},{\"IndexedColors\":[0.9686274509803922,0.9882352941176471,0.9921568627450981,0.8784313725490196,0.9254901960784314,0.9568627450980393,0.7490196078431373,0.8274509803921568,0.9019607843137255,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5490196078431373,0.4196078431372549,0.6941176470588235,0.5333333333333333,0.2549019607843137,0.615686274509804,0.4313725490196079,0.00392156862745098,0.4196078431372549],\"Name\":\"Brewer Sequential Blue-Purple (8)\",\"NanColor\":[0.4313725490196079,0.00392156862745098,0.4196078431372549]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.7490196078431373,0.8274509803921568,0.9019607843137255,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5490196078431373,0.4196078431372549,0.6941176470588235,0.5333333333333333,0.2549019607843137,0.615686274509804,0.4313725490196079,0.00392156862745098,0.4196078431372549],\"Name\":\"Brewer Sequential Blue-Purple (7)\",\"NanColor\":[0.4313725490196079,0.00392156862745098,0.4196078431372549]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.7490196078431373,0.8274509803921568,0.9019607843137255,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5333333333333333,0.3372549019607843,0.6549019607843137,0.5058823529411764,0.05882352941176471,0.4862745098039216],\"Name\":\"Brewer Sequential Blue-Purple (6)\",\"NanColor\":[0.5058823529411764,0.05882352941176471,0.4862745098039216]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.7019607843137254,0.803921568627451,0.8901960784313725,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5333333333333333,0.3372549019607843,0.6549019607843137,0.5058823529411764,0.05882352941176471,0.4862745098039216],\"Name\":\"Brewer Sequential Blue-Purple (5)\",\"NanColor\":[0.5058823529411764,0.05882352941176471,0.4862745098039216]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.7019607843137254,0.803921568627451,0.8901960784313725,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5333333333333333,0.2549019607843137,0.615686274509804],\"Name\":\"Brewer Sequential Blue-Purple (4)\",\"NanColor\":[0.5333333333333333,0.2549019607843137,0.615686274509804]},{\"IndexedColors\":[0.8784313725490196,0.9254901960784314,0.9568627450980393,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5333333333333333,0.3372549019607843,0.6549019607843137],\"Name\":\"Brewer Sequential Blue-Purple (3)\",\"NanColor\":[0.5333333333333333,0.3372549019607843,0.6549019607843137]},{\"IndexedColors\":[0.4980392156862745,0.788235294117647,0.4980392156862745,0.7450980392156863,0.6823529411764706,0.8313725490196079,0.9921568627450981,0.7529411764705882,0.5254901960784314,1,1,0.6,0.2196078431372549,0.4235294117647059,0.6901960784313725,0.9411764705882353,0.00784313725490196,0.4980392156862745,0.7490196078431373,0.3568627450980392,0.09019607843137255,0.4,0.4,0.4],\"Name\":\"Brewer Qualitative Accent\",\"NanColor\":[0.4,0.4,0.4]},{\"IndexedColors\":[0.1058823529411765,0.6196078431372549,0.4666666666666667,0.8509803921568627,0.3725490196078431,0.00784313725490196,0.4588235294117647,0.4392156862745098,0.7019607843137254,0.9058823529411765,0.1607843137254902,0.5411764705882353,0.4,0.6509803921568628,0.1176470588235294,0.9019607843137255,0.6705882352941176,0.00784313725490196,0.6509803921568628,0.4627450980392157,0.1137254901960784,0.4,0.4,0.4],\"Name\":\"Brewer Qualitative Dark2\",\"NanColor\":[0.4,0.4,0.4]},{\"IndexedColors\":[0.4,0.7607843137254902,0.6470588235294118,0.9882352941176471,0.5529411764705883,0.3843137254901961,0.5529411764705883,0.6274509803921569,0.796078431372549,0.9058823529411765,0.5411764705882353,0.7647058823529411,0.6509803921568628,0.8470588235294118,0.3294117647058823,1,0.8509803921568627,0.1843137254901961,0.8980392156862745,0.7686274509803922,0.5803921568627451,0.7019607843137254,0.7019607843137254,0.7019607843137254],\"Name\":\"Brewer Qualitative Set2\",\"NanColor\":[0.7019607843137254,0.7019607843137254,0.7019607843137254]},{\"IndexedColors\":[0.7019607843137254,0.8862745098039215,0.803921568627451,0.9921568627450981,0.803921568627451,0.6745098039215687,0.796078431372549,0.8352941176470589,0.9098039215686274,0.9568627450980393,0.792156862745098,0.8941176470588236,0.9019607843137255,0.9607843137254902,0.788235294117647,1,0.9490196078431372,0.6823529411764706,0.9450980392156862,0.8862745098039215,0.8,0.8,0.8,0.8],\"Name\":\"Brewer Qualitative Pastel2\",\"NanColor\":[0.8,0.8,0.8]},{\"IndexedColors\":[0.984313725490196,0.7058823529411765,0.6823529411764706,0.7019607843137254,0.803921568627451,0.8901960784313725,0.8,0.9215686274509803,0.7725490196078432,0.8705882352941177,0.796078431372549,0.8941176470588236,0.996078431372549,0.8509803921568627,0.6509803921568628,1,1,0.8,0.8980392156862745,0.8470588235294118,0.7411764705882353,0.9921568627450981,0.8549019607843137,0.9254901960784314,0.9490196078431372,0.9490196078431372,0.9490196078431372],\"Name\":\"Brewer Qualitative Pastel1\",\"NanColor\":[0.9490196078431372,0.9490196078431372,0.9490196078431372]},{\"IndexedColors\":[0.8941176470588236,0.1019607843137255,0.1098039215686274,0.2156862745098039,0.4941176470588236,0.7215686274509804,0.3019607843137255,0.6862745098039216,0.2901960784313726,0.596078431372549,0.3058823529411765,0.6392156862745098,1,0.4980392156862745,0,1,1,0.2,0.6509803921568628,0.3372549019607843,0.1568627450980392,0.9686274509803922,0.5058823529411764,0.7490196078431373,0.6,0.6,0.6],\"Name\":\"Brewer Qualitative Set1\",\"NanColor\":[0.6,0.6,0.6]},{\"IndexedColors\":[0.6509803921568628,0.807843137254902,0.8901960784313725,0.1215686274509804,0.4705882352941176,0.7058823529411765,0.6980392156862745,0.8745098039215686,0.5411764705882353,0.2,0.6274509803921569,0.1725490196078431,0.984313725490196,0.6039215686274509,0.6,0.8901960784313725,0.1019607843137255,0.1098039215686274,0.9921568627450981,0.7490196078431373,0.4352941176470588,1,0.4980392156862745,0,0.792156862745098,0.6980392156862745,0.8392156862745098,0.4156862745098039,0.2392156862745098,0.6039215686274509,1,1,0.6],\"Name\":\"Brewer Qualitative Paired\",\"NanColor\":[1,1,0.6]},{\"IndexedColors\":[0.5529411764705883,0.8274509803921568,0.7803921568627451,1,1,0.7019607843137254,0.7450980392156863,0.7294117647058823,0.8549019607843137,0.984313725490196,0.5019607843137255,0.4470588235294118,0.5019607843137255,0.6941176470588235,0.8274509803921568,0.9921568627450981,0.7058823529411765,0.3843137254901961,0.7019607843137254,0.8705882352941177,0.4117647058823529,0.9882352941176471,0.803921568627451,0.8980392156862745,0.8509803921568627,0.8509803921568627,0.8509803921568627,0.7372549019607844,0.5019607843137255,0.7411764705882353,0.8,0.9215686274509803,0.7725490196078432,1,0.9294117647058824,0.4352941176470588],\"Name\":\"Brewer Qualitative Set3\",\"NanColor\":[1,0.9294117647058824,0.4352941176470588]},{\"IndexedColors\":[1,0,0,1,0.862745,0,0,0.695201,0],\"Name\":\"Traffic Lights\",\"NanColor\":[0.803922,0,0.803922]},{\"IndexedColors\":[0.908659,0.604013,0.581857,1,0.862745,0,0,0.695201,0],\"Name\":\"Traffic Lights For Deuteranopes\",\"NanColor\":[0.803922,0,0.803922]},{\"IndexedColors\":[0.4196078431372549,0,0.07058823529411765,0.9019607843137255,0.9411764705882353,0.0196078431372549,0.01568627450980392,0.6196078431372549,0.00784313725490196],\"Name\":\"Traffic Lights For Deuteranopes 2\",\"NanColor\":[0.803922,0,0.803922]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Muted Blue-Green\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,0.109804,0.27451,0.301961,0.02,0.129412,0.309804,0.341176,0.05,0.14902,0.341176,0.380392,0.1,0.188235,0.403922,0.458824,0.15,0.227451,0.447059,0.521569,0.2,0.290196,0.494118,0.588235,0.25,0.368627,0.552941,0.670588,0.3,0.458824,0.619608,0.74902,0.35,0.588235,0.713725,0.85098,0.4,0.72549,0.815686,0.941176,0.45,0.831373,0.882353,0.980392,0.475,0.909804,0.933333,1,0.5,0.980392,0.984314,1,0.5,0.996078,1,0.94902,0.5,1,1,0.980392,0.5,0.980392,0.984314,1,0.525,0.972549,0.988235,0.890196,0.55,0.917647,0.960784,0.835294,0.6,0.835294,0.921569,0.772549,0.65,0.768627,0.901961,0.737255,0.7,0.670588,0.831373,0.654902,0.75,0.576471,0.760784,0.584314,0.8,0.498039,0.678431,0.521569,0.85,0.392157,0.560784,0.427451,0.9,0.294118,0.45098,0.333333,0.95,0.211765,0.34902,0.254902,1,0.152941,0.278431,0.196078]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Green-Blue Asymmetric Divergent (62Blbc)\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,0.121569,0.2,0.145098,0.05,0.196078,0.301961,0.223529,0.1,0.258824,0.4,0.278431,0.2,0.341176,0.54902,0.341176,0.25,0.419608,0.619608,0.376471,0.3,0.545098,0.701961,0.392157,0.35,0.643137,0.780392,0.403922,0.4,0.729412,0.819608,0.45098,0.45,0.811765,0.870588,0.521569,0.5,0.898039,0.909804,0.564706,0.55,0.941176,0.92549,0.686275,0.6,0.960784,0.94902,0.776471,0.64,1,1,1,0.65,0.890196,0.988235,0.972549,0.7,0.721569,0.894118,0.901961,0.75,0.631373,0.823529,0.839216,0.8,0.517647,0.662745,0.701961,0.85,0.384314,0.494118,0.54902,0.9,0.298039,0.360784,0.45098,0.95,0.223529,0.25098,0.34902,0.99,0.156863,0.172549,0.25098,1,0.137255,0.137255,0.188235]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Asymmtrical Earth Tones (6_21b)\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,0.141176,0.14902,0.2,0.05,0.215686,0.258824,0.321569,0.1,0.243137,0.368627,0.380392,0.15,0.27451,0.439216,0.4,0.2,0.32549,0.501961,0.384314,0.25,0.403922,0.6,0.419608,0.3,0.486275,0.701961,0.454902,0.35,0.556863,0.74902,0.494118,0.4,0.670588,0.8,0.545098,0.5,0.854902,0.901961,0.631373,0.55,0.92549,0.941176,0.694118,0.6,0.960784,0.94902,0.776471,0.65,0.988235,0.968627,0.909804,0.7,0.839216,0.815686,0.772549,0.75,0.701961,0.662745,0.615686,0.8,0.6,0.529412,0.478431,0.85,0.501961,0.403922,0.360784,0.9,0.439216,0.313725,0.290196,1,0.301961,0.164706,0.176471]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Yellow 15\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,1,1,0.988235,0.002,1,1,0.988235,0.05,0.984314,0.988235,0.843137,0.1,0.988235,0.988235,0.741176,0.15,0.980392,0.968627,0.654902,0.2,0.980392,0.945098,0.576471,0.25,0.968627,0.905882,0.486275,0.3,0.968627,0.862745,0.388235,0.35,0.960784,0.803922,0.286275,0.4,0.94902,0.741176,0.219608,0.45,0.941176,0.678431,0.14902,0.5,0.929412,0.607843,0.094118,0.55,0.921569,0.545098,0.054902,0.6,0.909804,0.486275,0.035294,0.65,0.890196,0.411765,0.019608,0.7,0.8,0.305882,0,0.75,0.760784,0.239216,0,0.8,0.678431,0.180392,0.011765,0.85,0.6,0.121569,0.023529,0.9,0.501961,0.054902,0.031373,0.95,0.4,0.039216,0.058824,1,0.301961,0.047059,0.090196]},{\"ColorSpace\":\"Diverging\",\"Name\":\"Magma (matplotlib)\",\"NanColor\":[0,1,0],\"Source\":\"https://github.com/BIDS/colormap/blob/master/colormaps.py\",\"License\":\"CC0\",\"Creator\":\"Nathaniel J. Smith & Stefan van der Walt\",\"RGBPoints\":[0,0.001462,0.000466,0.013866,0.003922,0.002258,0.001295,0.018331,0.007843,0.003279,0.002305,0.023708,0.011765,0.004512,0.00349,0.029965,0.015686,0.00595,0.004843,0.03713,0.019608,0.007588,0.006356,0.044973,0.023529,0.009426,0.008022,0.052844,0.027451,0.011465,0.009828,0.06075,0.031373,0.013708,0.011771,0.068667,0.035294,0.016156,0.01384,0.076603,0.039216,0.018815,0.016026,0.084584,0.043137,0.021692,0.01832,0.09261,0.047059,0.024792,0.020715,0.100676,0.05098,0.028123,0.023201,0.108787,0.054902,0.031696,0.025765,0.116965,0.058824,0.03552,0.028397,0.125209,0.062745,0.039608,0.03109,0.133515,0.066667,0.04383,0.03383,0.141886,0.070588,0.048062,0.036607,0.150327,0.07451,0.05232,0.039407,0.158841,0.078431,0.056615,0.04216,0.167446,0.082353,0.060949,0.044794,0.176129,0.086275,0.06533,0.047318,0.184892,0.090196,0.069764,0.049726,0.193735,0.094118,0.074257,0.052017,0.20266,0.098039,0.078815,0.054184,0.211667,0.101961,0.083446,0.056225,0.220755,0.105882,0.088155,0.058133,0.229922,0.109804,0.092949,0.059904,0.239164,0.113725,0.097833,0.061531,0.248477,0.117647,0.102815,0.06301,0.257854,0.121569,0.107899,0.064335,0.267289,0.12549,0.113094,0.065492,0.276784,0.129412,0.118405,0.066479,0.286321,0.133333,0.123833,0.067295,0.295879,0.137255,0.12938,0.067935,0.305443,0.141176,0.135053,0.068391,0.315,0.145098,0.140858,0.068654,0.324538,0.14902,0.146785,0.068738,0.334011,0.152941,0.152839,0.068637,0.343404,0.156863,0.159018,0.068354,0.352688,0.160784,0.165308,0.067911,0.361816,0.164706,0.171713,0.067305,0.370771,0.168627,0.178212,0.066576,0.379497,0.172549,0.184801,0.065732,0.387973,0.176471,0.19146,0.064818,0.396152,0.180392,0.198177,0.063862,0.404009,0.184314,0.204935,0.062907,0.411514,0.188235,0.211718,0.061992,0.418647,0.192157,0.218512,0.061158,0.425392,0.196078,0.225302,0.060445,0.431742,0.2,0.232077,0.059889,0.437695,0.203922,0.238826,0.059517,0.443256,0.207843,0.245543,0.059352,0.448436,0.211765,0.25222,0.059415,0.453248,0.215686,0.258857,0.059706,0.45771,0.219608,0.265447,0.060237,0.46184,0.223529,0.271994,0.060994,0.46566,0.227451,0.278493,0.061978,0.46919,0.231373,0.284951,0.063168,0.472451,0.235294,0.291366,0.064553,0.475462,0.239216,0.29774,0.066117,0.478243,0.243137,0.304081,0.067835,0.480812,0.247059,0.310382,0.069702,0.483186,0.25098,0.316654,0.07169,0.48538,0.254902,0.322899,0.073782,0.487408,0.258824,0.329114,0.075972,0.489287,0.262745,0.335308,0.078236,0.491024,0.266667,0.341482,0.080564,0.492631,0.270588,0.347636,0.082946,0.494121,0.27451,0.353773,0.085373,0.495501,0.278431,0.359898,0.087831,0.496778,0.282353,0.366012,0.090314,0.49796,0.286275,0.372116,0.092816,0.499053,0.290196,0.378211,0.095332,0.500067,0.294118,0.384299,0.097855,0.501002,0.298039,0.390384,0.100379,0.501864,0.301961,0.396467,0.102902,0.502658,0.305882,0.402548,0.10542,0.503386,0.309804,0.408629,0.10793,0.504052,0.313725,0.414709,0.110431,0.504662,0.317647,0.420791,0.11292,0.505215,0.321569,0.426877,0.115395,0.505714,0.32549,0.432967,0.117855,0.50616,0.329412,0.439062,0.120298,0.506555,0.333333,0.445163,0.122724,0.506901,0.337255,0.451271,0.125132,0.507198,0.341176,0.457386,0.127522,0.507448,0.345098,0.463508,0.129893,0.507652,0.34902,0.46964,0.132245,0.507809,0.352941,0.47578,0.134577,0.507921,0.356863,0.481929,0.136891,0.507989,0.360784,0.488088,0.139186,0.508011,0.364706,0.494258,0.141462,0.507988,0.368627,0.500438,0.143719,0.50792,0.372549,0.506629,0.145958,0.507806,0.376471,0.512831,0.148179,0.507648,0.380392,0.519045,0.150383,0.507443,0.384314,0.52527,0.152569,0.507192,0.388235,0.531507,0.154739,0.506895,0.392157,0.537755,0.156894,0.506551,0.396078,0.544015,0.159033,0.506159,0.4,0.550287,0.161158,0.505719,0.403922,0.556571,0.163269,0.50523,0.407843,0.562866,0.165368,0.504692,0.411765,0.569172,0.167454,0.504105,0.415686,0.57549,0.16953,0.503466,0.419608,0.581819,0.171596,0.502777,0.423529,0.588158,0.173652,0.502035,0.427451,0.594508,0.175701,0.501241,0.431373,0.600868,0.177743,0.500394,0.435294,0.607238,0.179779,0.499492,0.439216,0.613617,0.181811,0.498536,0.443137,0.620005,0.18384,0.497524,0.447059,0.626401,0.185867,0.496456,0.45098,0.632805,0.187893,0.495332,0.454902,0.639216,0.189921,0.49415,0.458824,0.645633,0.191952,0.49291,0.462745,0.652056,0.193986,0.491611,0.466667,0.658483,0.196027,0.490253,0.470588,0.664915,0.198075,0.488836,0.47451,0.671349,0.200133,0.487358,0.478431,0.677786,0.202203,0.485819,0.482353,0.684224,0.204286,0.484219,0.486275,0.690661,0.206384,0.482558,0.490196,0.697098,0.208501,0.480835,0.494118,0.703532,0.210638,0.479049,0.498039,0.709962,0.212797,0.477201,0.501961,0.716387,0.214982,0.47529,0.505882,0.722805,0.217194,0.473316,0.509804,0.729216,0.219437,0.471279,0.513725,0.735616,0.221713,0.46918,0.517647,0.742004,0.224025,0.467018,0.521569,0.748378,0.226377,0.464794,0.52549,0.754737,0.228772,0.462509,0.529412,0.761077,0.231214,0.460162,0.533333,0.767398,0.233705,0.457755,0.537255,0.773695,0.236249,0.455289,0.541176,0.779968,0.238851,0.452765,0.545098,0.786212,0.241514,0.450184,0.54902,0.792427,0.244242,0.447543,0.552941,0.798608,0.24704,0.444848,0.556863,0.804752,0.249911,0.442102,0.560784,0.810855,0.252861,0.439305,0.564706,0.816914,0.255895,0.436461,0.568627,0.822926,0.259016,0.433573,0.572549,0.828886,0.262229,0.430644,0.576471,0.834791,0.26554,0.427671,0.580392,0.840636,0.268953,0.424666,0.584314,0.846416,0.272473,0.421631,0.588235,0.852126,0.276106,0.418573,0.592157,0.857763,0.279857,0.415496,0.596078,0.86332,0.283729,0.412403,0.6,0.868793,0.287728,0.409303,0.603922,0.874176,0.291859,0.406205,0.607843,0.879464,0.296125,0.403118,0.611765,0.884651,0.30053,0.400047,0.615686,0.889731,0.305079,0.397002,0.619608,0.8947,0.309773,0.393995,0.623529,0.899552,0.314616,0.391037,0.627451,0.904281,0.31961,0.388137,0.631373,0.908884,0.324755,0.385308,0.635294,0.913354,0.330052,0.382563,0.639216,0.917689,0.3355,0.379915,0.643137,0.921884,0.341098,0.377376,0.647059,0.925937,0.346844,0.374959,0.65098,0.929845,0.352734,0.372677,0.654902,0.933606,0.358764,0.370541,0.658824,0.937221,0.364929,0.368567,0.662745,0.940687,0.371224,0.366762,0.666667,0.944006,0.377643,0.365136,0.670588,0.94718,0.384178,0.363701,0.67451,0.95021,0.39082,0.362468,0.678431,0.953099,0.397563,0.361438,0.682353,0.955849,0.4044,0.360619,0.686275,0.958464,0.411324,0.360014,0.690196,0.960949,0.418323,0.35963,0.694118,0.96331,0.42539,0.359469,0.698039,0.965549,0.432519,0.359529,0.701961,0.967671,0.439703,0.35981,0.705882,0.96968,0.446936,0.360311,0.709804,0.971582,0.45421,0.36103,0.713725,0.973381,0.46152,0.361965,0.717647,0.975082,0.468861,0.363111,0.721569,0.97669,0.476226,0.364466,0.72549,0.97821,0.483612,0.366025,0.729412,0.979645,0.491014,0.367783,0.733333,0.981,0.498428,0.369734,0.737255,0.982279,0.505851,0.371874,0.741176,0.983485,0.51328,0.374198,0.745098,0.984622,0.520713,0.376698,0.74902,0.985693,0.528148,0.379371,0.752941,0.9867,0.535582,0.38221,0.756863,0.987646,0.543015,0.38521,0.760784,0.988533,0.550446,0.388365,0.764706,0.989363,0.557873,0.391671,0.768627,0.990138,0.565296,0.395122,0.772549,0.990871,0.572706,0.398714,0.776471,0.991558,0.580107,0.402441,0.780392,0.992196,0.587502,0.406299,0.784314,0.992785,0.594891,0.410283,0.788235,0.993326,0.602275,0.41439,0.792157,0.993834,0.609644,0.418613,0.796078,0.994309,0.616999,0.42295,0.8,0.994738,0.62435,0.427397,0.803922,0.995122,0.631696,0.431951,0.807843,0.99548,0.639027,0.436607,0.811765,0.99581,0.646344,0.441361,0.815686,0.996096,0.653659,0.446213,0.819608,0.996341,0.660969,0.45116,0.823529,0.99658,0.668256,0.456192,0.827451,0.996775,0.675541,0.461314,0.831373,0.996925,0.682828,0.466526,0.835294,0.997077,0.690088,0.471811,0.839216,0.997186,0.697349,0.477182,0.843137,0.997254,0.704611,0.482635,0.847059,0.997325,0.711848,0.488154,0.85098,0.997351,0.719089,0.493755,0.854902,0.997351,0.726324,0.499428,0.858824,0.997341,0.733545,0.505167,0.862745,0.997285,0.740772,0.510983,0.866667,0.997228,0.747981,0.516859,0.870588,0.997138,0.75519,0.522806,0.87451,0.997019,0.762398,0.528821,0.878431,0.996898,0.769591,0.534892,0.882353,0.996727,0.776795,0.541039,0.886275,0.996571,0.783977,0.547233,0.890196,0.996369,0.791167,0.553499,0.894118,0.996162,0.798348,0.55982,0.898039,0.995932,0.805527,0.566202,0.901961,0.99568,0.812706,0.572645,0.905882,0.995424,0.819875,0.57914,0.909804,0.995131,0.827052,0.585701,0.913725,0.994851,0.834213,0.592307,0.917647,0.994524,0.841387,0.598983,0.921569,0.994222,0.84854,0.605696,0.92549,0.993866,0.855711,0.612482,0.929412,0.993545,0.862859,0.619299,0.933333,0.99317,0.870024,0.626189,0.937255,0.992831,0.877168,0.633109,0.941176,0.99244,0.88433,0.640099,0.945098,0.992089,0.89147,0.647116,0.94902,0.991688,0.898627,0.654202,0.952941,0.991332,0.905763,0.661309,0.956863,0.99093,0.912915,0.668481,0.960784,0.99057,0.920049,0.675675,0.964706,0.990175,0.927196,0.682926,0.968627,0.989815,0.934329,0.690198,0.972549,0.989434,0.94147,0.697519,0.976471,0.989077,0.948604,0.704863,0.980392,0.988717,0.955742,0.712242,0.984314,0.988367,0.962878,0.719649,0.988235,0.988033,0.970012,0.727077,0.992157,0.987691,0.977154,0.734536,0.996078,0.987387,0.984288,0.742002,1,0.987053,0.991438,0.749504]},{\"ColorSpace\":\"Diverging\",\"Name\":\"Inferno (matplotlib)\",\"NanColor\":[0,1,0],\"Source\":\"https://github.com/BIDS/colormap/blob/master/colormaps.py\",\"License\":\"CC0\",\"Creator\":\"Nathaniel J. Smith & Stefan van der Walt\",\"RGBPoints\":[0,0.001462,0.000466,0.013866,0.003922,0.002267,0.00127,0.01857,0.007843,0.003299,0.002249,0.024239,0.011765,0.004547,0.003392,0.030909,0.015686,0.006006,0.004692,0.038558,0.019608,0.007676,0.006136,0.046836,0.023529,0.009561,0.007713,0.055143,0.027451,0.011663,0.009417,0.06346,0.031373,0.013995,0.011225,0.071862,0.035294,0.016561,0.013136,0.080282,0.039216,0.019373,0.015133,0.088767,0.043137,0.022447,0.017199,0.097327,0.047059,0.025793,0.019331,0.10593,0.05098,0.029432,0.021503,0.114621,0.054902,0.033385,0.023702,0.123397,0.058824,0.037668,0.025921,0.132232,0.062745,0.042253,0.028139,0.141141,0.066667,0.046915,0.030324,0.150164,0.070588,0.051644,0.032474,0.159254,0.07451,0.056449,0.034569,0.168414,0.078431,0.06134,0.03659,0.177642,0.082353,0.066331,0.038504,0.186962,0.086275,0.071429,0.040294,0.196354,0.090196,0.076637,0.041905,0.205799,0.094118,0.081962,0.043328,0.215289,0.098039,0.087411,0.044556,0.224813,0.101961,0.09299,0.045583,0.234358,0.105882,0.098702,0.046402,0.243904,0.109804,0.104551,0.047008,0.25343,0.113725,0.110536,0.047399,0.262912,0.117647,0.116656,0.047574,0.272321,0.121569,0.122908,0.047536,0.281624,0.12549,0.129285,0.047293,0.290788,0.129412,0.135778,0.046856,0.299776,0.133333,0.142378,0.046242,0.308553,0.137255,0.149073,0.045468,0.317085,0.141176,0.15585,0.044559,0.325338,0.145098,0.162689,0.043554,0.333277,0.14902,0.169575,0.042489,0.340874,0.152941,0.176493,0.041402,0.348111,0.156863,0.183429,0.040329,0.354971,0.160784,0.190367,0.039309,0.361447,0.164706,0.197297,0.0384,0.367535,0.168627,0.204209,0.037632,0.373238,0.172549,0.211095,0.03703,0.378563,0.176471,0.217949,0.036615,0.383522,0.180392,0.224763,0.036405,0.388129,0.184314,0.231538,0.036405,0.3924,0.188235,0.238273,0.036621,0.396353,0.192157,0.244967,0.037055,0.400007,0.196078,0.25162,0.037705,0.403378,0.2,0.258234,0.038571,0.406485,0.203922,0.26481,0.039647,0.409345,0.207843,0.271347,0.040922,0.411976,0.211765,0.27785,0.042353,0.414392,0.215686,0.284321,0.043933,0.416608,0.219608,0.290763,0.045644,0.418637,0.223529,0.297178,0.04747,0.420491,0.227451,0.303568,0.049396,0.422182,0.231373,0.309935,0.051407,0.423721,0.235294,0.316282,0.05349,0.425116,0.239216,0.32261,0.055634,0.426377,0.243137,0.328921,0.057827,0.427511,0.247059,0.335217,0.06006,0.428524,0.25098,0.3415,0.062325,0.429425,0.254902,0.347771,0.064616,0.430217,0.258824,0.354032,0.066925,0.430906,0.262745,0.360284,0.069247,0.431497,0.266667,0.366529,0.071579,0.431994,0.270588,0.372768,0.073915,0.4324,0.27451,0.379001,0.076253,0.432719,0.278431,0.385228,0.078591,0.432955,0.282353,0.391453,0.080927,0.433109,0.286275,0.397674,0.083257,0.433183,0.290196,0.403894,0.08558,0.433179,0.294118,0.410113,0.087896,0.433098,0.298039,0.416331,0.090203,0.432943,0.301961,0.422549,0.092501,0.432714,0.305882,0.428768,0.09479,0.432412,0.309804,0.434987,0.097069,0.432039,0.313725,0.441207,0.099338,0.431594,0.317647,0.447428,0.101597,0.43108,0.321569,0.453651,0.103848,0.430498,0.32549,0.459875,0.106089,0.429846,0.329412,0.4661,0.108322,0.429125,0.333333,0.472328,0.110547,0.428334,0.337255,0.478558,0.112764,0.427475,0.341176,0.484789,0.114974,0.426548,0.345098,0.491022,0.117179,0.425552,0.34902,0.497257,0.119379,0.424488,0.352941,0.503493,0.121575,0.423356,0.356863,0.50973,0.123769,0.422156,0.360784,0.515967,0.12596,0.420887,0.364706,0.522206,0.12815,0.419549,0.368627,0.528444,0.130341,0.418142,0.372549,0.534683,0.132534,0.416667,0.376471,0.54092,0.134729,0.415123,0.380392,0.547157,0.136929,0.413511,0.384314,0.553392,0.139134,0.411829,0.388235,0.559624,0.141346,0.410078,0.392157,0.565854,0.143567,0.408258,0.396078,0.572081,0.145797,0.406369,0.4,0.578304,0.148039,0.404411,0.403922,0.584521,0.150294,0.402385,0.407843,0.590734,0.152563,0.40029,0.411765,0.59694,0.154848,0.398125,0.415686,0.603139,0.157151,0.395891,0.419608,0.60933,0.159474,0.393589,0.423529,0.615513,0.161817,0.391219,0.427451,0.621685,0.164184,0.388781,0.431373,0.627847,0.166575,0.386276,0.435294,0.633998,0.168992,0.383704,0.439216,0.640135,0.171438,0.381065,0.443137,0.64626,0.173914,0.378359,0.447059,0.652369,0.176421,0.375586,0.45098,0.658463,0.178962,0.372748,0.454902,0.66454,0.181539,0.369846,0.458824,0.670599,0.184153,0.366879,0.462745,0.676638,0.186807,0.363849,0.466667,0.682656,0.189501,0.360757,0.470588,0.688653,0.192239,0.357603,0.47451,0.694627,0.195021,0.354388,0.478431,0.700576,0.197851,0.351113,0.482353,0.7065,0.200728,0.347777,0.486275,0.712396,0.203656,0.344383,0.490196,0.718264,0.206636,0.340931,0.494118,0.724103,0.20967,0.337424,0.498039,0.729909,0.212759,0.333861,0.501961,0.735683,0.215906,0.330245,0.505882,0.741423,0.219112,0.326576,0.509804,0.747127,0.222378,0.322856,0.513725,0.752794,0.225706,0.319085,0.517647,0.758422,0.229097,0.315266,0.521569,0.76401,0.232554,0.311399,0.52549,0.769556,0.236077,0.307485,0.529412,0.775059,0.239667,0.303526,0.533333,0.780517,0.243327,0.299523,0.537255,0.785929,0.247056,0.295477,0.541176,0.791293,0.250856,0.29139,0.545098,0.796607,0.254728,0.287264,0.54902,0.801871,0.258674,0.283099,0.552941,0.807082,0.262692,0.278898,0.556863,0.812239,0.266786,0.274661,0.560784,0.817341,0.270954,0.27039,0.564706,0.822386,0.275197,0.266085,0.568627,0.827372,0.279517,0.26175,0.572549,0.832299,0.283913,0.257383,0.576471,0.837165,0.288385,0.252988,0.580392,0.841969,0.292933,0.248564,0.584314,0.846709,0.297559,0.244113,0.588235,0.851384,0.30226,0.239636,0.592157,0.855992,0.307038,0.235133,0.596078,0.860533,0.311892,0.230606,0.6,0.865006,0.316822,0.226055,0.603922,0.869409,0.321827,0.221482,0.607843,0.873741,0.326906,0.216886,0.611765,0.878001,0.33206,0.212268,0.615686,0.882188,0.337287,0.207628,0.619608,0.886302,0.342586,0.202968,0.623529,0.890341,0.347957,0.198286,0.627451,0.894305,0.353399,0.193584,0.631373,0.898192,0.358911,0.18886,0.635294,0.902003,0.364492,0.184116,0.639216,0.905735,0.37014,0.17935,0.643137,0.90939,0.375856,0.174563,0.647059,0.912966,0.381636,0.169755,0.65098,0.916462,0.387481,0.164924,0.654902,0.919879,0.393389,0.16007,0.658824,0.923215,0.399359,0.155193,0.662745,0.92647,0.405389,0.150292,0.666667,0.929644,0.411479,0.145367,0.670588,0.932737,0.417627,0.140417,0.67451,0.935747,0.423831,0.13544,0.678431,0.938675,0.430091,0.130438,0.682353,0.941521,0.436405,0.125409,0.686275,0.944285,0.442772,0.120354,0.690196,0.946965,0.449191,0.115272,0.694118,0.949562,0.45566,0.110164,0.698039,0.952075,0.462178,0.105031,0.701961,0.954506,0.468744,0.099874,0.705882,0.956852,0.475356,0.094695,0.709804,0.959114,0.482014,0.089499,0.713725,0.961293,0.488716,0.084289,0.717647,0.963387,0.495462,0.079073,0.721569,0.965397,0.502249,0.073859,0.72549,0.967322,0.509078,0.068659,0.729412,0.969163,0.515946,0.063488,0.733333,0.970919,0.522853,0.058367,0.737255,0.97259,0.529798,0.053324,0.741176,0.974176,0.53678,0.048392,0.745098,0.975677,0.543798,0.043618,0.74902,0.977092,0.55085,0.03905,0.752941,0.978422,0.557937,0.034931,0.756863,0.979666,0.565057,0.031409,0.760784,0.980824,0.572209,0.028508,0.764706,0.981895,0.579392,0.02625,0.768627,0.982881,0.586606,0.024661,0.772549,0.983779,0.593849,0.02377,0.776471,0.984591,0.601122,0.023606,0.780392,0.985315,0.608422,0.024202,0.784314,0.985952,0.61575,0.025592,0.788235,0.986502,0.623105,0.027814,0.792157,0.986964,0.630485,0.030908,0.796078,0.987337,0.63789,0.034916,0.8,0.987622,0.64532,0.039886,0.803922,0.987819,0.652773,0.045581,0.807843,0.987926,0.66025,0.05175,0.811765,0.987945,0.667748,0.058329,0.815686,0.987874,0.675267,0.065257,0.819608,0.987714,0.682807,0.072489,0.823529,0.987464,0.690366,0.07999,0.827451,0.987124,0.697944,0.087731,0.831373,0.986694,0.70554,0.095694,0.835294,0.986175,0.713153,0.103863,0.839216,0.985566,0.720782,0.112229,0.843137,0.984865,0.728427,0.120785,0.847059,0.984075,0.736087,0.129527,0.85098,0.983196,0.743758,0.138453,0.854902,0.982228,0.751442,0.147565,0.858824,0.981173,0.759135,0.156863,0.862745,0.980032,0.766837,0.166353,0.866667,0.978806,0.774545,0.176037,0.870588,0.977497,0.782258,0.185923,0.87451,0.976108,0.789974,0.196018,0.878431,0.974638,0.797692,0.206332,0.882353,0.973088,0.805409,0.216877,0.886275,0.971468,0.813122,0.227658,0.890196,0.969783,0.820825,0.238686,0.894118,0.968041,0.828515,0.249972,0.898039,0.966243,0.836191,0.261534,0.901961,0.964394,0.843848,0.273391,0.905882,0.962517,0.851476,0.285546,0.909804,0.960626,0.859069,0.29801,0.913725,0.95872,0.866624,0.31082,0.917647,0.956834,0.874129,0.323974,0.921569,0.954997,0.881569,0.337475,0.92549,0.953215,0.888942,0.351369,0.929412,0.951546,0.896226,0.365627,0.933333,0.950018,0.903409,0.380271,0.937255,0.948683,0.910473,0.395289,0.941176,0.947594,0.917399,0.410665,0.945098,0.946809,0.924168,0.426373,0.94902,0.946392,0.930761,0.442367,0.952941,0.946403,0.937159,0.458592,0.956863,0.946903,0.943348,0.47497,0.960784,0.947937,0.949318,0.491426,0.964706,0.949545,0.955063,0.50786,0.968627,0.95174,0.960587,0.524203,0.972549,0.954529,0.965896,0.540361,0.976471,0.957896,0.971003,0.556275,0.980392,0.961812,0.975924,0.571925,0.984314,0.966249,0.980678,0.587206,0.988235,0.971162,0.985282,0.602154,0.992157,0.976511,0.989753,0.61676,0.996078,0.982257,0.994109,0.631017,1,0.988362,0.998364,0.644924]},{\"ColorSpace\":\"Diverging\",\"Name\":\"Plasma (matplotlib)\",\"NanColor\":[0,1,0],\"Source\":\"https://github.com/BIDS/colormap/blob/master/colormaps.py\",\"License\":\"CC0\",\"Creator\":\"Nathaniel J. Smith & Stefan van der Walt\",\"RGBPoints\":[0,0.050383,0.029803,0.527975,0.003922,0.063536,0.028426,0.533124,0.007843,0.075353,0.027206,0.538007,0.011765,0.086222,0.026125,0.542658,0.015686,0.096379,0.025165,0.547103,0.019608,0.10598,0.024309,0.551368,0.023529,0.115124,0.023556,0.555468,0.027451,0.123903,0.022878,0.559423,0.031373,0.132381,0.022258,0.56325,0.035294,0.140603,0.021687,0.566959,0.039216,0.148607,0.021154,0.570562,0.043137,0.156421,0.020651,0.574065,0.047059,0.16407,0.020171,0.577478,0.05098,0.171574,0.019706,0.580806,0.054902,0.17895,0.019252,0.584054,0.058824,0.186213,0.018803,0.587228,0.062745,0.193374,0.018354,0.59033,0.066667,0.200445,0.017902,0.593364,0.070588,0.207435,0.017442,0.596333,0.07451,0.21435,0.016973,0.599239,0.078431,0.221197,0.016497,0.602083,0.082353,0.227983,0.016007,0.604867,0.086275,0.234715,0.015502,0.607592,0.090196,0.241396,0.014979,0.610259,0.094118,0.248032,0.014439,0.612868,0.098039,0.254627,0.013882,0.615419,0.101961,0.261183,0.013308,0.617911,0.105882,0.267703,0.012716,0.620346,0.109804,0.274191,0.012109,0.622722,0.113725,0.280648,0.011488,0.625038,0.117647,0.287076,0.010855,0.627295,0.121569,0.293478,0.010213,0.62949,0.12549,0.299855,0.009561,0.631624,0.129412,0.30621,0.008902,0.633694,0.133333,0.312543,0.008239,0.6357,0.137255,0.318856,0.007576,0.63764,0.141176,0.32515,0.006915,0.639512,0.145098,0.331426,0.006261,0.641316,0.14902,0.337683,0.005618,0.643049,0.152941,0.343925,0.004991,0.64471,0.156863,0.35015,0.004382,0.646298,0.160784,0.356359,0.003798,0.64781,0.164706,0.362553,0.003243,0.649245,0.168627,0.368733,0.002724,0.650601,0.172549,0.374897,0.002245,0.651876,0.176471,0.381047,0.001814,0.653068,0.180392,0.387183,0.001434,0.654177,0.184314,0.393304,0.001114,0.655199,0.188235,0.399411,0.000859,0.656133,0.192157,0.405503,0.000678,0.656977,0.196078,0.41158,0.000577,0.65773,0.2,0.417642,0.000564,0.65839,0.203922,0.423689,0.000646,0.658956,0.207843,0.429719,0.000831,0.659425,0.211765,0.435734,0.001127,0.659797,0.215686,0.441732,0.00154,0.660069,0.219608,0.447714,0.00208,0.66024,0.223529,0.453677,0.002755,0.66031,0.227451,0.459623,0.003574,0.660277,0.231373,0.46555,0.004545,0.660139,0.235294,0.471457,0.005678,0.659897,0.239216,0.477344,0.00698,0.659549,0.243137,0.48321,0.00846,0.659095,0.247059,0.489055,0.010127,0.658534,0.25098,0.494877,0.01199,0.657865,0.254902,0.500678,0.014055,0.657088,0.258824,0.506454,0.016333,0.656202,0.262745,0.512206,0.018833,0.655209,0.266667,0.517933,0.021563,0.654109,0.270588,0.523633,0.024532,0.652901,0.27451,0.529306,0.027747,0.651586,0.278431,0.534952,0.031217,0.650165,0.282353,0.54057,0.03495,0.64864,0.286275,0.546157,0.038954,0.64701,0.290196,0.551715,0.043136,0.645277,0.294118,0.557243,0.047331,0.643443,0.298039,0.562738,0.051545,0.641509,0.301961,0.568201,0.055778,0.639477,0.305882,0.573632,0.060028,0.637349,0.309804,0.579029,0.064296,0.635126,0.313725,0.584391,0.068579,0.632812,0.317647,0.589719,0.072878,0.630408,0.321569,0.595011,0.07719,0.627917,0.32549,0.600266,0.081516,0.625342,0.329412,0.605485,0.085854,0.622686,0.333333,0.610667,0.090204,0.619951,0.337255,0.615812,0.094564,0.61714,0.341176,0.620919,0.098934,0.614257,0.345098,0.625987,0.103312,0.611305,0.34902,0.631017,0.107699,0.608287,0.352941,0.636008,0.112092,0.605205,0.356863,0.640959,0.116492,0.602065,0.360784,0.645872,0.120898,0.598867,0.364706,0.650746,0.125309,0.595617,0.368627,0.65558,0.129725,0.592317,0.372549,0.660374,0.134144,0.588971,0.376471,0.665129,0.138566,0.585582,0.380392,0.669845,0.142992,0.582154,0.384314,0.674522,0.147419,0.578688,0.388235,0.67916,0.151848,0.575189,0.392157,0.683758,0.156278,0.57166,0.396078,0.688318,0.160709,0.568103,0.4,0.69284,0.165141,0.564522,0.403922,0.697324,0.169573,0.560919,0.407843,0.701769,0.174005,0.557296,0.411765,0.706178,0.178437,0.553657,0.415686,0.710549,0.182868,0.550004,0.419608,0.714883,0.187299,0.546338,0.423529,0.719181,0.191729,0.542663,0.427451,0.723444,0.196158,0.538981,0.431373,0.72767,0.200586,0.535293,0.435294,0.731862,0.205013,0.531601,0.439216,0.736019,0.209439,0.527908,0.443137,0.740143,0.213864,0.524216,0.447059,0.744232,0.218288,0.520524,0.45098,0.748289,0.222711,0.516834,0.454902,0.752312,0.227133,0.513149,0.458824,0.756304,0.231555,0.509468,0.462745,0.760264,0.235976,0.505794,0.466667,0.764193,0.240396,0.502126,0.470588,0.76809,0.244817,0.498465,0.47451,0.771958,0.249237,0.494813,0.478431,0.775796,0.253658,0.491171,0.482353,0.779604,0.258078,0.487539,0.486275,0.783383,0.2625,0.483918,0.490196,0.787133,0.266922,0.480307,0.494118,0.790855,0.271345,0.476706,0.498039,0.794549,0.27577,0.473117,0.501961,0.798216,0.280197,0.469538,0.505882,0.801855,0.284626,0.465971,0.509804,0.805467,0.289057,0.462415,0.513725,0.809052,0.293491,0.45887,0.517647,0.812612,0.297928,0.455338,0.521569,0.816144,0.302368,0.451816,0.52549,0.819651,0.306812,0.448306,0.529412,0.823132,0.311261,0.444806,0.533333,0.826588,0.315714,0.441316,0.537255,0.830018,0.320172,0.437836,0.541176,0.833422,0.324635,0.434366,0.545098,0.836801,0.329105,0.430905,0.54902,0.840155,0.33358,0.427455,0.552941,0.843484,0.338062,0.424013,0.556863,0.846788,0.342551,0.420579,0.560784,0.850066,0.347048,0.417153,0.564706,0.853319,0.351553,0.413734,0.568627,0.856547,0.356066,0.410322,0.572549,0.85975,0.360588,0.406917,0.576471,0.862927,0.365119,0.403519,0.580392,0.866078,0.36966,0.400126,0.584314,0.869203,0.374212,0.396738,0.588235,0.872303,0.378774,0.393355,0.592157,0.875376,0.383347,0.389976,0.596078,0.878423,0.387932,0.3866,0.6,0.881443,0.392529,0.383229,0.603922,0.884436,0.397139,0.37986,0.607843,0.887402,0.401762,0.376494,0.611765,0.89034,0.406398,0.37313,0.615686,0.89325,0.411048,0.369768,0.619608,0.896131,0.415712,0.366407,0.623529,0.898984,0.420392,0.363047,0.627451,0.901807,0.425087,0.359688,0.631373,0.904601,0.429797,0.356329,0.635294,0.907365,0.434524,0.35297,0.639216,0.910098,0.439268,0.34961,0.643137,0.9128,0.444029,0.346251,0.647059,0.915471,0.448807,0.34289,0.65098,0.918109,0.453603,0.339529,0.654902,0.920714,0.458417,0.336166,0.658824,0.923287,0.463251,0.332801,0.662745,0.925825,0.468103,0.329435,0.666667,0.928329,0.472975,0.326067,0.670588,0.930798,0.477867,0.322697,0.67451,0.933232,0.48278,0.319325,0.678431,0.93563,0.487712,0.315952,0.682353,0.93799,0.492667,0.312575,0.686275,0.940313,0.497642,0.309197,0.690196,0.942598,0.502639,0.305816,0.694118,0.944844,0.507658,0.302433,0.698039,0.947051,0.512699,0.299049,0.701961,0.949217,0.517763,0.295662,0.705882,0.951344,0.52285,0.292275,0.709804,0.953428,0.52796,0.288883,0.713725,0.95547,0.533093,0.28549,0.717647,0.957469,0.53825,0.282096,0.721569,0.959424,0.543431,0.278701,0.72549,0.961336,0.548636,0.275305,0.729412,0.963203,0.553865,0.271909,0.733333,0.965024,0.559118,0.268513,0.737255,0.966798,0.564396,0.265118,0.741176,0.968526,0.5697,0.261721,0.745098,0.970205,0.575028,0.258325,0.74902,0.971835,0.580382,0.254931,0.752941,0.973416,0.585761,0.25154,0.756863,0.974947,0.591165,0.248151,0.760784,0.976428,0.596595,0.244767,0.764706,0.977856,0.602051,0.241387,0.768627,0.979233,0.607532,0.238013,0.772549,0.980556,0.613039,0.234646,0.776471,0.981826,0.618572,0.231287,0.780392,0.983041,0.624131,0.227937,0.784314,0.984199,0.629718,0.224595,0.788235,0.985301,0.63533,0.221265,0.792157,0.986345,0.640969,0.217948,0.796078,0.987332,0.646633,0.214648,0.8,0.98826,0.652325,0.211364,0.803922,0.989128,0.658043,0.2081,0.807843,0.989935,0.663787,0.204859,0.811765,0.990681,0.669558,0.201642,0.815686,0.991365,0.675355,0.198453,0.819608,0.991985,0.681179,0.195295,0.823529,0.992541,0.68703,0.19217,0.827451,0.993032,0.692907,0.189084,0.831373,0.993456,0.69881,0.186041,0.835294,0.993814,0.704741,0.183043,0.839216,0.994103,0.710698,0.180097,0.843137,0.994324,0.716681,0.177208,0.847059,0.994474,0.722691,0.174381,0.85098,0.994553,0.728728,0.171622,0.854902,0.994561,0.734791,0.168938,0.858824,0.994495,0.74088,0.166335,0.862745,0.994355,0.746995,0.163821,0.866667,0.994141,0.753137,0.161404,0.870588,0.993851,0.759304,0.159092,0.87451,0.993482,0.765499,0.156891,0.878431,0.993033,0.77172,0.154808,0.882353,0.992505,0.777967,0.152855,0.886275,0.991897,0.784239,0.151042,0.890196,0.991209,0.790537,0.149377,0.894118,0.990439,0.796859,0.14787,0.898039,0.989587,0.803205,0.146529,0.901961,0.988648,0.809579,0.145357,0.905882,0.987621,0.815978,0.144363,0.909804,0.986509,0.822401,0.143557,0.913725,0.985314,0.828846,0.142945,0.917647,0.984031,0.835315,0.142528,0.921569,0.982653,0.841812,0.142303,0.92549,0.98119,0.848329,0.142279,0.929412,0.979644,0.854866,0.142453,0.933333,0.977995,0.861432,0.142808,0.937255,0.976265,0.868016,0.143351,0.941176,0.974443,0.874622,0.144061,0.945098,0.97253,0.88125,0.144923,0.94902,0.970533,0.887896,0.145919,0.952941,0.968443,0.894564,0.147014,0.956863,0.966271,0.901249,0.14818,0.960784,0.964021,0.90795,0.14937,0.964706,0.961681,0.914672,0.15052,0.968627,0.959276,0.921407,0.151566,0.972549,0.956808,0.928152,0.152409,0.976471,0.954287,0.934908,0.152921,0.980392,0.951726,0.941671,0.152925,0.984314,0.949151,0.948435,0.152178,0.988235,0.946602,0.95519,0.150328,0.992157,0.944152,0.961916,0.146861,0.996078,0.941896,0.96859,0.140956,1,0.940015,0.975158,0.131326]},{\"ColorSpace\":\"Diverging\",\"Name\":\"Viridis (matplotlib)\",\"NanColor\":[1,0,0],\"Source\":\"https://github.com/BIDS/colormap/blob/master/colormaps.py\",\"License\":\"CC0\",\"Creator\":\"Eric Firing\",\"RGBPoints\":[0,0.267004,0.004874,0.329415,0.003922,0.26851,0.009605,0.335427,0.007843,0.269944,0.014625,0.341379,0.011765,0.271305,0.019942,0.347269,0.015686,0.272594,0.025563,0.353093,0.019608,0.273809,0.031497,0.358853,0.023529,0.274952,0.037752,0.364543,0.027451,0.276022,0.044167,0.370164,0.031373,0.277018,0.050344,0.375715,0.035294,0.277941,0.056324,0.381191,0.039216,0.278791,0.062145,0.386592,0.043137,0.279566,0.067836,0.391917,0.047059,0.280267,0.073417,0.397163,0.05098,0.280894,0.078907,0.402329,0.054902,0.281446,0.08432,0.407414,0.058824,0.281924,0.089666,0.412415,0.062745,0.282327,0.094955,0.417331,0.066667,0.282656,0.100196,0.42216,0.070588,0.28291,0.105393,0.426902,0.07451,0.283091,0.110553,0.431554,0.078431,0.283197,0.11568,0.436115,0.082353,0.283229,0.120777,0.440584,0.086275,0.283187,0.125848,0.44496,0.090196,0.283072,0.130895,0.449241,0.094118,0.282884,0.13592,0.453427,0.098039,0.282623,0.140926,0.457517,0.101961,0.28229,0.145912,0.46151,0.105882,0.281887,0.150881,0.465405,0.109804,0.281412,0.155834,0.469201,0.113725,0.280868,0.160771,0.472899,0.117647,0.280255,0.165693,0.476498,0.121569,0.279574,0.170599,0.479997,0.12549,0.278826,0.17549,0.483397,0.129412,0.278012,0.180367,0.486697,0.133333,0.277134,0.185228,0.489898,0.137255,0.276194,0.190074,0.493001,0.141176,0.275191,0.194905,0.496005,0.145098,0.274128,0.199721,0.498911,0.14902,0.273006,0.20452,0.501721,0.152941,0.271828,0.209303,0.504434,0.156863,0.270595,0.214069,0.507052,0.160784,0.269308,0.218818,0.509577,0.164706,0.267968,0.223549,0.512008,0.168627,0.26658,0.228262,0.514349,0.172549,0.265145,0.232956,0.516599,0.176471,0.263663,0.237631,0.518762,0.180392,0.262138,0.242286,0.520837,0.184314,0.260571,0.246922,0.522828,0.188235,0.258965,0.251537,0.524736,0.192157,0.257322,0.25613,0.526563,0.196078,0.255645,0.260703,0.528312,0.2,0.253935,0.265254,0.529983,0.203922,0.252194,0.269783,0.531579,0.207843,0.250425,0.27429,0.533103,0.211765,0.248629,0.278775,0.534556,0.215686,0.246811,0.283237,0.535941,0.219608,0.244972,0.287675,0.53726,0.223529,0.243113,0.292092,0.538516,0.227451,0.241237,0.296485,0.539709,0.231373,0.239346,0.300855,0.540844,0.235294,0.237441,0.305202,0.541921,0.239216,0.235526,0.309527,0.542944,0.243137,0.233603,0.313828,0.543914,0.247059,0.231674,0.318106,0.544834,0.25098,0.229739,0.322361,0.545706,0.254902,0.227802,0.326594,0.546532,0.258824,0.225863,0.330805,0.547314,0.262745,0.223925,0.334994,0.548053,0.266667,0.221989,0.339161,0.548752,0.270588,0.220057,0.343307,0.549413,0.27451,0.21813,0.347432,0.550038,0.278431,0.21621,0.351535,0.550627,0.282353,0.214298,0.355619,0.551184,0.286275,0.212395,0.359683,0.55171,0.290196,0.210503,0.363727,0.552206,0.294118,0.208623,0.367752,0.552675,0.298039,0.206756,0.371758,0.553117,0.301961,0.204903,0.375746,0.553533,0.305882,0.203063,0.379716,0.553925,0.309804,0.201239,0.38367,0.554294,0.313725,0.19943,0.387607,0.554642,0.317647,0.197636,0.391528,0.554969,0.321569,0.19586,0.395433,0.555276,0.32549,0.1941,0.399323,0.555565,0.329412,0.192357,0.403199,0.555836,0.333333,0.190631,0.407061,0.556089,0.337255,0.188923,0.41091,0.556326,0.341176,0.187231,0.414746,0.556547,0.345098,0.185556,0.41857,0.556753,0.34902,0.183898,0.422383,0.556944,0.352941,0.182256,0.426184,0.55712,0.356863,0.180629,0.429975,0.557282,0.360784,0.179019,0.433756,0.55743,0.364706,0.177423,0.437527,0.557565,0.368627,0.175841,0.44129,0.557685,0.372549,0.174274,0.445044,0.557792,0.376471,0.172719,0.448791,0.557885,0.380392,0.171176,0.45253,0.557965,0.384314,0.169646,0.456262,0.55803,0.388235,0.168126,0.459988,0.558082,0.392157,0.166617,0.463708,0.558119,0.396078,0.165117,0.467423,0.558141,0.4,0.163625,0.471133,0.558148,0.403922,0.162142,0.474838,0.55814,0.407843,0.160665,0.47854,0.558115,0.411765,0.159194,0.482237,0.558073,0.415686,0.157729,0.485932,0.558013,0.419608,0.15627,0.489624,0.557936,0.423529,0.154815,0.493313,0.55784,0.427451,0.153364,0.497,0.557724,0.431373,0.151918,0.500685,0.557587,0.435294,0.150476,0.504369,0.55743,0.439216,0.149039,0.508051,0.55725,0.443137,0.147607,0.511733,0.557049,0.447059,0.14618,0.515413,0.556823,0.45098,0.144759,0.519093,0.556572,0.454902,0.143343,0.522773,0.556295,0.458824,0.141935,0.526453,0.555991,0.462745,0.140536,0.530132,0.555659,0.466667,0.139147,0.533812,0.555298,0.470588,0.13777,0.537492,0.554906,0.47451,0.136408,0.541173,0.554483,0.478431,0.135066,0.544853,0.554029,0.482353,0.133743,0.548535,0.553541,0.486275,0.132444,0.552216,0.553018,0.490196,0.131172,0.555899,0.552459,0.494118,0.129933,0.559582,0.551864,0.498039,0.128729,0.563265,0.551229,0.501961,0.127568,0.566949,0.550556,0.505882,0.126453,0.570633,0.549841,0.509804,0.125394,0.574318,0.549086,0.513725,0.124395,0.578002,0.548287,0.517647,0.123463,0.581687,0.547445,0.521569,0.122606,0.585371,0.546557,0.52549,0.121831,0.589055,0.545623,0.529412,0.121148,0.592739,0.544641,0.533333,0.120565,0.596422,0.543611,0.537255,0.120092,0.600104,0.54253,0.541176,0.119738,0.603785,0.5414,0.545098,0.119512,0.607464,0.540218,0.54902,0.119423,0.611141,0.538982,0.552941,0.119483,0.614817,0.537692,0.556863,0.119699,0.61849,0.536347,0.560784,0.120081,0.622161,0.534946,0.564706,0.120638,0.625828,0.533488,0.568627,0.12138,0.629492,0.531973,0.572549,0.122312,0.633153,0.530398,0.576471,0.123444,0.636809,0.528763,0.580392,0.12478,0.640461,0.527068,0.584314,0.126326,0.644107,0.525311,0.588235,0.128087,0.647749,0.523491,0.592157,0.130067,0.651384,0.521608,0.596078,0.132268,0.655014,0.519661,0.6,0.134692,0.658636,0.517649,0.603922,0.137339,0.662252,0.515571,0.607843,0.14021,0.665859,0.513427,0.611765,0.143303,0.669459,0.511215,0.615686,0.146616,0.67305,0.508936,0.619608,0.150148,0.676631,0.506589,0.623529,0.153894,0.680203,0.504172,0.627451,0.157851,0.683765,0.501686,0.631373,0.162016,0.687316,0.499129,0.635294,0.166383,0.690856,0.496502,0.639216,0.170948,0.694384,0.493803,0.643137,0.175707,0.6979,0.491033,0.647059,0.180653,0.701402,0.488189,0.65098,0.185783,0.704891,0.485273,0.654902,0.19109,0.708366,0.482284,0.658824,0.196571,0.711827,0.479221,0.662745,0.202219,0.715272,0.476084,0.666667,0.20803,0.718701,0.472873,0.670588,0.214,0.722114,0.469588,0.67451,0.220124,0.725509,0.466226,0.678431,0.226397,0.728888,0.462789,0.682353,0.232815,0.732247,0.459277,0.686275,0.239374,0.735588,0.455688,0.690196,0.24607,0.73891,0.452024,0.694118,0.252899,0.742211,0.448284,0.698039,0.259857,0.745492,0.444467,0.701961,0.266941,0.748751,0.440573,0.705882,0.274149,0.751988,0.436601,0.709804,0.281477,0.755203,0.432552,0.713725,0.288921,0.758394,0.428426,0.717647,0.296479,0.761561,0.424223,0.721569,0.304148,0.764704,0.419943,0.72549,0.311925,0.767822,0.415586,0.729412,0.319809,0.770914,0.411152,0.733333,0.327796,0.77398,0.40664,0.737255,0.335885,0.777018,0.402049,0.741176,0.344074,0.780029,0.397381,0.745098,0.35236,0.783011,0.392636,0.74902,0.360741,0.785964,0.387814,0.752941,0.369214,0.788888,0.382914,0.756863,0.377779,0.791781,0.377939,0.760784,0.386433,0.794644,0.372886,0.764706,0.395174,0.797475,0.367757,0.768627,0.404001,0.800275,0.362552,0.772549,0.412913,0.803041,0.357269,0.776471,0.421908,0.805774,0.35191,0.780392,0.430983,0.808473,0.346476,0.784314,0.440137,0.811138,0.340967,0.788235,0.449368,0.813768,0.335384,0.792157,0.458674,0.816363,0.329727,0.796078,0.468053,0.818921,0.323998,0.8,0.477504,0.821444,0.318195,0.803922,0.487026,0.823929,0.312321,0.807843,0.496615,0.826376,0.306377,0.811765,0.506271,0.828786,0.300362,0.815686,0.515992,0.831158,0.294279,0.819608,0.525776,0.833491,0.288127,0.823529,0.535621,0.835785,0.281908,0.827451,0.545524,0.838039,0.275626,0.831373,0.555484,0.840254,0.269281,0.835294,0.565498,0.84243,0.262877,0.839216,0.575563,0.844566,0.256415,0.843137,0.585678,0.846661,0.249897,0.847059,0.595839,0.848717,0.243329,0.85098,0.606045,0.850733,0.236712,0.854902,0.616293,0.852709,0.230052,0.858824,0.626579,0.854645,0.223353,0.862745,0.636902,0.856542,0.21662,0.866667,0.647257,0.8584,0.209861,0.870588,0.657642,0.860219,0.203082,0.87451,0.668054,0.861999,0.196293,0.878431,0.678489,0.863742,0.189503,0.882353,0.688944,0.865448,0.182725,0.886275,0.699415,0.867117,0.175971,0.890196,0.709898,0.868751,0.169257,0.894118,0.720391,0.87035,0.162603,0.898039,0.730889,0.871916,0.156029,0.901961,0.741388,0.873449,0.149561,0.905882,0.751884,0.874951,0.143228,0.909804,0.762373,0.876424,0.137064,0.913725,0.772852,0.877868,0.131109,0.917647,0.783315,0.879285,0.125405,0.921569,0.79376,0.880678,0.120005,0.92549,0.804182,0.882046,0.114965,0.929412,0.814576,0.883393,0.110347,0.933333,0.82494,0.88472,0.106217,0.937255,0.83527,0.886029,0.102646,0.941176,0.845561,0.887322,0.099702,0.945098,0.85581,0.888601,0.097452,0.94902,0.866013,0.889868,0.095953,0.952941,0.876168,0.891125,0.09525,0.956863,0.886271,0.892374,0.095374,0.960784,0.89632,0.893616,0.096335,0.964706,0.906311,0.894855,0.098125,0.968627,0.916242,0.896091,0.100717,0.972549,0.926106,0.89733,0.104071,0.976471,0.935904,0.89857,0.108131,0.980392,0.945636,0.899815,0.112838,0.984314,0.9553,0.901065,0.118128,0.988235,0.964894,0.902323,0.123941,0.992157,0.974417,0.90359,0.130215,0.996078,0.983868,0.904867,0.136897,1,0.993248,0.906157,0.143936]},{\"ShowIndexedColorActiveValues\":1,\"IndexedColors\":[0.07,0.5,0.7,1,1,1,0.85,1,1,0.8,0.5,1,0.76,1,0,1,0.71,0.71,0.5,0.5,0.5,0.05,0.05,1,1,0.05,0.05,0.7,1,1,0.7,0.89,0.96,0.67,0.36,0.95,0.54,1,0,0.75,0.65,0.65,0.5,0.6,0.6,1,0.5,0,1,1,0.19,0.12,0.94,0.12,0.5,0.82,0.89,0.56,0.25,0.83,0.24,1,0,0.9,0.9,0.9,0.75,0.76,0.78,0.65,0.65,0.67,0.54,0.6,0.78,0.61,0.48,0.78,0.5,0.48,0.78,0.44,0.48,0.78,0.36,0.48,0.76,1,0.48,0.38,0.49,0.5,0.69,0.76,0.56,0.56,0.4,0.56,0.56,0.74,0.5,0.89,1,0.63,0,0.65,0.16,0.16,0.36,0.72,0.82,0.44,0.18,0.69,0,1,0,0.58,1,1,0.58,0.88,0.88,0.45,0.76,0.79,0.33,0.71,0.71,0.23,0.62,0.62,0.14,0.56,0.56,0.04,0.49,0.55,0,0.41,0.52,0.88,0.88,1,1,0.85,0.56,0.65,0.46,0.45,0.4,0.5,0.5,0.62,0.39,0.71,0.83,0.48,0,0.58,0,0.58,0.26,0.62,0.69,0.34,0.09,0.56,0,0.79,0,0.44,0.83,1,1,1,0.78,0.85,1,0.78,0.78,1,0.78,0.64,1,0.78,0.56,1,0.78,0.38,1,0.78,0.27,1,0.78,0.19,1,0.78,0.12,1,0.78,0,1,0.61,0,0.9,0.46,0,0.83,0.32,0,0.75,0.22,0,0.67,0.14,0.3,0.76,1,0.3,0.65,1,0.13,0.58,0.84,0.15,0.49,0.67,0.15,0.4,0.59,0.09,0.33,0.53,0.96,0.93,0.82,0.8,0.82,0.12,0.71,0.71,0.76,0.65,0.33,0.3,0.34,0.35,0.38,0.62,0.31,0.71,0.67,0.36,0,0.46,0.31,0.27,0.26,0.51,0.59,0.26,0,0.4,0,0.49,0,0.44,0.67,0.98,0,0.73,1,0,0.63,1,0,0.56,1,0,0.5,1,0,0.42,1,0.33,0.36,0.95,0.47,0.36,0.89,0.54,0.31,0.89,0.63,0.21,0.83,0.7,0.12,0.83,0.7,0.12,0.73,0.7,0.05,0.65,0.74,0.05,0.53,0.78,0,0.4,0.8,0,0.35,0.82,0,0.31,0.85,0,0.27,0.88,0,0.22,0.9,0,0.18,0.91,0,0.15,0.92,0,0.14,0.93,0,0.13,0.94,0,0.12,0.95,0,0.11,0.96,0,0.1,0.97,0,0.09,0.98,0,0.08,0.99,0,0.07,1,0,0.06],\"Annotations\":[0,\"Xx\",1,\"H\",2,\"He\",3,\"Li\",4,\"Be\",5,\"B\",6,\"C\",7,\"N\",8,\"O\",9,\"F\",10,\"Ne\",11,\"Na\",12,\"Mg\",13,\"Al\",14,\"Si\",15,\"P\",16,\"S\",17,\"Cl\",18,\"Ar\",19,\"K\",20,\"Ca\",21,\"Sc\",22,\"Ti\",23,\"V\",24,\"Cr\",25,\"Mn\",26,\"Fe\",27,\"Co\",28,\"Ni\",29,\"Cu\",30,\"Zn\",31,\"Ga\",32,\"Ge\",33,\"As\",34,\"Se\",35,\"Br\",36,\"Kr\",37,\"Rb\",38,\"Sr\",39,\"Y\",40,\"Zr\",41,\"Nb\",42,\"Mo\",43,\"Tc\",44,\"Ru\",45,\"Rh\",46,\"Pd\",47,\"Ag\",48,\"Cd\",49,\"In\",50,\"Sn\",51,\"Sb\",52,\"Te\",53,\"I\",54,\"Xe\",55,\"Cs\",56,\"Ba\",57,\"La\",58,\"Ce\",59,\"Pr\",60,\"Nd\",61,\"Pm\",62,\"Sm\",63,\"Eu\",64,\"Gd\",65,\"Tb\",66,\"Dy\",67,\"Ho\",68,\"Er\",69,\"Tm\",70,\"Yb\",71,\"Lu\",72,\"Hf\",73,\"Ta\",74,\"W\",75,\"Re\",76,\"Os\",77,\"Ir\",78,\"Pt\",79,\"Au\",80,\"Hg\",81,\"Tl\",82,\"Pb\",83,\"Bi\",84,\"Po\",85,\"At\",86,\"Rn\",87,\"Fr\",88,\"Ra\",89,\"Ac\",90,\"Th\",91,\"Pa\",92,\"U\",93,\"Np\",94,\"Pu\",95,\"Am\",96,\"Cm\",97,\"Bk\",98,\"Cf\",99,\"Es\",100,\"Fm\",101,\"Md\",102,\"No\",103,\"Lr\",104,\"Rf\",105,\"Db\",106,\"Sg\",107,\"Bh\",108,\"Hs\",109,\"Mt\",110,\"Ds\",111,\"Rg\",112,\"Cn\",113,\"Uut\",114,\"Uuq\",115,\"Uup\",116,\"Uuh\",117,\"Uus\",118,\"Uuo\"],\"Name\":\"BlueObeliskElements\"}];\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/Constants.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/Constants.js ***! - \***************************************************************************************/ -/*! exports provided: ColorSpace, Scale, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ColorSpace\", function() { return ColorSpace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Scale\", function() { return Scale; });\nvar ColorSpace = {\n RGB: 0,\n HSV: 1,\n LAB: 2,\n DIVERGING: 3\n};\nvar Scale = {\n LINEAR: 0,\n LOG10: 1\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ColorSpace: ColorSpace,\n Scale: Scale\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/index.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/index.js ***! - \***********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_ScalarsToColors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/ScalarsToColors */ \"./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ColorTransferFunction_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ColorTransferFunction/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\nvar ColorSpace = vtk_js_Sources_Rendering_Core_ColorTransferFunction_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ColorSpace,\n Scale = vtk_js_Sources_Rendering_Core_ColorTransferFunction_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"].Scale;\nvar ScalarMappingTarget = vtk_js_Sources_Common_Core_ScalarsToColors__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ScalarMappingTarget;\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkDebugMacro,\n vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro,\n vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkWarningMacro; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\n/* eslint-disable no-continue */\n// Convert to and from a special polar version of CIELAB (useful for creating\n// continuous diverging color maps).\n\nfunction vtkColorTransferFunctionLabToMsh(lab, msh) {\n var L = lab[0];\n var a = lab[1];\n var b = lab[2];\n var M = Math.sqrt(L * L + a * a + b * b);\n var s = M > 0.001 ? Math.acos(L / M) : 0.0;\n var h = s > 0.001 ? Math.atan2(b, a) : 0.0;\n msh[0] = M;\n msh[1] = s;\n msh[2] = h;\n}\n\nfunction vtkColorTransferFunctionMshToLab(msh, lab) {\n var M = msh[0];\n var s = msh[1];\n var h = msh[2];\n lab[0] = M * Math.cos(s);\n lab[1] = M * Math.sin(s) * Math.cos(h);\n lab[2] = M * Math.sin(s) * Math.sin(h);\n} // For the case when interpolating from a saturated color to an unsaturated\n// color, find a hue for the unsaturated color that makes sense.\n\n\nfunction vtkColorTransferFunctionAdjustHue(msh, unsatM) {\n if (msh[0] >= unsatM - 0.1) {\n // The best we can do is hold hue constant.\n return msh[2];\n } // This equation is designed to make the perceptual change of the\n // interpolation to be close to constant.\n\n\n var hueSpin = msh[1] * Math.sqrt(unsatM * unsatM - msh[0] * msh[0]) / (msh[0] * Math.sin(msh[1])); // Spin hue away from 0 except in purple hues.\n\n if (msh[2] > -0.3 * Math.PI) {\n return msh[2] + hueSpin;\n }\n\n return msh[2] - hueSpin;\n}\n\nfunction vtkColorTransferFunctionAngleDiff(a1, a2) {\n var adiff = a1 - a2;\n\n if (adiff < 0.0) {\n adiff = -adiff;\n }\n\n while (adiff >= 2.0 * Math.PI) {\n adiff -= 2.0 * Math.PI;\n }\n\n if (adiff > Math.PI) {\n adiff = 2.0 * Math.PI - adiff;\n }\n\n return adiff;\n} // Interpolate a diverging color map.\n\n\nfunction vtkColorTransferFunctionInterpolateDiverging(s, rgb1, rgb2, result) {\n var lab1 = [];\n var lab2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2lab\"](rgb1, lab1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2lab\"](rgb2, lab2);\n var msh1 = [];\n var msh2 = [];\n vtkColorTransferFunctionLabToMsh(lab1, msh1);\n vtkColorTransferFunctionLabToMsh(lab2, msh2); // If the endpoints are distinct saturated colors, then place white in between\n // them.\n\n var localS = s;\n\n if (msh1[1] > 0.05 && msh2[1] > 0.05 && vtkColorTransferFunctionAngleDiff(msh1[2], msh2[2]) > 0.33 * Math.PI) {\n // Insert the white midpoint by setting one end to white and adjusting the\n // scalar value.\n var Mmid = Math.max(msh1[0], msh2[0]);\n Mmid = Math.max(88.0, Mmid);\n\n if (s < 0.5) {\n msh2[0] = Mmid;\n msh2[1] = 0.0;\n msh2[2] = 0.0;\n localS *= 2.0;\n } else {\n msh1[0] = Mmid;\n msh1[1] = 0.0;\n msh1[2] = 0.0;\n localS = 2.0 * localS - 1.0;\n }\n } // If one color has no saturation, then its hue value is invalid. In this\n // case, we want to set it to something logical so that the interpolation of\n // hue makes sense.\n\n\n if (msh1[1] < 0.05 && msh2[1] > 0.05) {\n msh1[2] = vtkColorTransferFunctionAdjustHue(msh2, msh1[0]);\n } else if (msh2[1] < 0.05 && msh1[1] > 0.05) {\n msh2[2] = vtkColorTransferFunctionAdjustHue(msh1, msh2[0]);\n }\n\n var mshTmp = [];\n mshTmp[0] = (1 - localS) * msh1[0] + localS * msh2[0];\n mshTmp[1] = (1 - localS) * msh1[1] + localS * msh2[1];\n mshTmp[2] = (1 - localS) * msh1[2] + localS * msh2[2]; // Now convert back to RGB\n\n var labTmp = [];\n vtkColorTransferFunctionMshToLab(mshTmp, labTmp);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"lab2rgb\"](labTmp, result);\n} // ----------------------------------------------------------------------------\n// vtkColorTransferFunction methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkColorTransferFunction(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkColorTransferFunction'); // Return the number of points which specify this function\n\n publicAPI.getSize = function () {\n return model.nodes.length;\n }; //----------------------------------------------------------------------------\n // Add a point defined in RGB\n\n\n publicAPI.addRGBPoint = function (x, r, g, b) {\n return publicAPI.addRGBPointLong(x, r, g, b, 0.5, 0.0);\n }; //----------------------------------------------------------------------------\n // Add a point defined in RGB\n\n\n publicAPI.addRGBPointLong = function (x, r, g, b) {\n var midpoint = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0.5;\n var sharpness = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0.0;\n\n // Error check\n if (midpoint < 0.0 || midpoint > 1.0) {\n vtkErrorMacro('Midpoint outside range [0.0, 1.0]');\n return -1;\n }\n\n if (sharpness < 0.0 || sharpness > 1.0) {\n vtkErrorMacro('Sharpness outside range [0.0, 1.0]');\n return -1;\n } // remove any node already at this X location\n\n\n if (!model.allowDuplicateScalars) {\n publicAPI.removePoint(x);\n } // Create the new node\n\n\n var node = {\n x: x,\n r: r,\n g: g,\n b: b,\n midpoint: midpoint,\n sharpness: sharpness\n }; // Add it, then sort to get everything in order\n\n model.nodes.push(node);\n publicAPI.sortAndUpdateRange(); // We need to find the index of the node we just added in order\n // to return this value\n\n var i = 0;\n\n for (; i < model.nodes.length; i++) {\n if (model.nodes[i].x === x) {\n break;\n }\n } // If we didn't find it, something went horribly wrong so\n // return -1\n\n\n if (i < model.nodes.length) {\n return i;\n }\n\n return -1;\n }; //----------------------------------------------------------------------------\n // Add a point defined in HSV\n\n\n publicAPI.addHSVPoint = function (x, h, s, v) {\n return publicAPI.addHSVPointLong(x, h, s, v, 0.5, 0.0);\n }; //----------------------------------------------------------------------------\n // Add a point defined in HSV\n\n\n publicAPI.addHSVPointLong = function (x, h, s, v) {\n var midpoint = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0.5;\n var sharpness = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0.0;\n var rgb = [];\n var hsv = [h, s, v];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"hsv2rgb\"](hsv, rgb);\n return publicAPI.addRGBPoint(x, rgb[0], rgb[1], rgb[2], midpoint, sharpness);\n }; //----------------------------------------------------------------------------\n // Set nodes directly\n\n\n publicAPI.setNodes = function (nodes) {\n if (model.nodes !== nodes) {\n model.nodes = nodes;\n publicAPI.sortAndUpdateRange();\n }\n }; //----------------------------------------------------------------------------\n // Sort the vector in increasing order, then fill in\n // the Range\n\n\n publicAPI.sortAndUpdateRange = function () {\n model.nodes.sort(function (a, b) {\n return a.x - b.x;\n });\n var modifiedInvoked = publicAPI.updateRange(); // If range is updated, Modified() has been called, don't call it again.\n\n if (!modifiedInvoked) {\n publicAPI.modified();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.updateRange = function () {\n var oldRange = [2];\n oldRange[0] = model.mappingRange[0];\n oldRange[1] = model.mappingRange[1];\n var size = model.nodes.length;\n\n if (size) {\n model.mappingRange[0] = model.nodes[0].x;\n model.mappingRange[1] = model.nodes[size - 1].x;\n } else {\n model.mappingRange[0] = 0;\n model.mappingRange[1] = 0;\n } // If the range is the same, then no need to call Modified()\n\n\n if (oldRange[0] === model.mappingRange[0] && oldRange[1] === model.mappingRange[1]) {\n return false;\n }\n\n publicAPI.modified();\n return true;\n }; //----------------------------------------------------------------------------\n // Remove a point\n\n\n publicAPI.removePoint = function (x) {\n // First find the node since we need to know its\n // index as our return value\n var i = 0;\n\n for (; i < model.nodes.length; i++) {\n if (model.nodes[i].x === x) {\n break;\n }\n }\n\n var retVal = i; // If the node doesn't exist, we return -1\n\n if (i >= model.nodes.length) {\n return -1;\n } // If the first or last point has been removed, then we update the range\n // No need to sort here as the order of points hasn't changed.\n\n\n var modifiedInvoked = false;\n model.nodes.splice(i, 1);\n\n if (i === 0 || i === model.nodes.length) {\n modifiedInvoked = publicAPI.updateRange();\n }\n\n if (!modifiedInvoked) {\n publicAPI.modified();\n }\n\n return retVal;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.movePoint = function (oldX, newX) {\n if (oldX === newX) {\n // Nothing to do.\n return;\n }\n\n publicAPI.removePoint(newX);\n\n for (var i = 0; i < model.nodes.length; i++) {\n if (model.nodes[i].x === oldX) {\n model.nodes[i].x = newX;\n publicAPI.sortAndUpdateRange();\n break;\n }\n }\n }; //----------------------------------------------------------------------------\n // Remove all points\n\n\n publicAPI.removeAllPoints = function () {\n model.nodes = [];\n publicAPI.sortAndUpdateRange();\n }; //----------------------------------------------------------------------------\n // Add a line defined in RGB\n\n\n publicAPI.addRGBSegment = function (x1, r1, g1, b1, x2, r2, g2, b2) {\n // First, find all points in this range and remove them\n publicAPI.sortAndUpdateRange();\n\n for (var i = 0; i < model.nodes.length;) {\n if (model.nodes[i].x >= x1 && model.nodes[i].x <= x2) {\n model.nodes.splice(i, 1);\n } else {\n i++;\n }\n } // Now add the points\n\n\n publicAPI.addRGBPointLong(x1, r1, g1, b1, 0.5, 0.0);\n publicAPI.addRGBPointLong(x2, r2, g2, b2, 0.5, 0.0);\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n // Add a line defined in HSV\n\n\n publicAPI.addHSVSegment = function (x1, h1, s1, v1, x2, h2, s2, v2) {\n var hsv1 = [h1, s1, v1];\n var hsv2 = [h2, s2, v2];\n var rgb1 = [];\n var rgb2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"hsv2rgb\"](hsv1, rgb1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"hsv2rgb\"](hsv2, rgb2);\n publicAPI.addRGBSegment(x1, rgb1[0], rgb1[1], rgb1[2], x2, rgb2[0], rgb2[1], rgb2[2]);\n }; //----------------------------------------------------------------------------\n // Returns the RGBA color evaluated at the specified location\n\n\n publicAPI.mapValue = function (x) {\n var rgb = [];\n publicAPI.getColor(x, rgb);\n return [Math.floor(255.0 * rgb[0] + 0.5), Math.floor(255.0 * rgb[1] + 0.5), Math.floor(255.0 * rgb[2] + 0.5), 255];\n }; //----------------------------------------------------------------------------\n // Returns the RGB color evaluated at the specified location\n\n\n publicAPI.getColor = function (x, rgb) {\n if (model.indexedLookup) {\n var numNodes = publicAPI.getSize(); // todo\n\n var idx = publicAPI.getAnnotatedValueIndexInternal(x);\n\n if (idx < 0 || numNodes === 0) {\n publicAPI.getNanColor(rgb);\n } else {\n var nodeVal = [];\n publicAPI.getNodeValue(idx % numNodes, nodeVal);\n rgb[0] = nodeVal.r;\n rgb[1] = nodeVal.g;\n rgb[2] = nodeVal.b;\n }\n\n return;\n }\n\n publicAPI.getTable(x, x, 1, rgb);\n }; //----------------------------------------------------------------------------\n // Returns the red color evaluated at the specified location\n\n\n publicAPI.getRedValue = function (x) {\n var rgb = [];\n publicAPI.getColor(x, rgb);\n return rgb[0];\n }; //----------------------------------------------------------------------------\n // Returns the green color evaluated at the specified location\n\n\n publicAPI.getGreenValue = function (x) {\n var rgb = [];\n publicAPI.getColor(x, rgb);\n return rgb[1];\n }; //----------------------------------------------------------------------------\n // Returns the blue color evaluated at the specified location\n\n\n publicAPI.getBlueValue = function (x) {\n var rgb = [];\n publicAPI.getColor(x, rgb);\n return rgb[2];\n }; //----------------------------------------------------------------------------\n // Returns a table of RGB colors at regular intervals along the function\n\n\n publicAPI.getTable = function (xStart, xEnd, size, table) {\n // Special case: If either the start or end is a NaN, then all any\n // interpolation done on them is also a NaN. Therefore, fill the table with\n // the NaN color.\n if (vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"isNan\"](xStart) || vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"isNan\"](xEnd)) {\n for (var i = 0; i < size; i++) {\n table[i * 3 + 0] = model.nanColor[0];\n table[i * 3 + 1] = model.nanColor[1];\n table[i * 3 + 2] = model.nanColor[2];\n }\n\n return;\n }\n\n var idx = 0;\n var numNodes = model.nodes.length; // Need to keep track of the last value so that\n // we can fill in table locations past this with\n // this value if Clamping is On.\n\n var lastR = 0.0;\n var lastG = 0.0;\n var lastB = 0.0;\n\n if (numNodes !== 0) {\n lastR = model.nodes[numNodes - 1].r;\n lastG = model.nodes[numNodes - 1].g;\n lastB = model.nodes[numNodes - 1].b;\n }\n\n var x = 0.0;\n var x1 = 0.0;\n var x2 = 0.0;\n var rgb1 = [0.0, 0.0, 0.0];\n var rgb2 = [0.0, 0.0, 0.0];\n var midpoint = 0.0;\n var sharpness = 0.0;\n var tmpVec = []; // If the scale is logarithmic, make sure the range is valid.\n\n var usingLogScale = model.scale === Scale.LOG10;\n\n if (usingLogScale) {\n // Note: This requires range[0] <= range[1].\n usingLogScale = model.mappingRange[0] > 0.0;\n }\n\n var logStart = 0.0;\n var logEnd = 0.0;\n var logX = 0.0;\n\n if (usingLogScale) {\n logStart = Math.log10(xStart);\n logEnd = Math.log10(xEnd);\n } // For each table entry\n\n\n for (var _i = 0; _i < size; _i++) {\n // Find our location in the table\n var tidx = 3 * _i; // Find our X location. If we are taking only 1 sample, make\n // it halfway between start and end (usually start and end will\n // be the same in this case)\n\n if (size > 1) {\n if (usingLogScale) {\n logX = logStart + _i / (size - 1.0) * (logEnd - logStart);\n x = Math.pow(10.0, logX);\n } else {\n x = xStart + _i / (size - 1.0) * (xEnd - xStart);\n }\n } else if (usingLogScale) {\n logX = 0.5 * (logStart + logEnd);\n x = Math.pow(10.0, logX);\n } else {\n x = 0.5 * (xStart + xEnd);\n } // Linearly map x from mappingRange to [0, numberOfValues-1],\n // discretize (round down to the closest integer),\n // then map back to mappingRange\n\n\n if (model.discretize) {\n var range = model.mappingRange;\n\n if (x >= range[0] && x <= range[1]) {\n var numberOfValues = model.numberOfValues;\n var deltaRange = range[1] - range[0];\n\n if (numberOfValues <= 1) {\n x = range[0] + deltaRange / 2.0;\n } else {\n // normalize x\n var xn = (x - range[0]) / deltaRange; // discretize\n\n var discretizeIndex = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"floor\"](numberOfValues * xn); // get discretized x\n\n x = range[0] + discretizeIndex / (numberOfValues - 1) * deltaRange;\n }\n }\n } // Do we need to move to the next node?\n\n\n while (idx < numNodes && x > model.nodes[idx].x) {\n idx++; // If we are at a valid point index, fill in\n // the value at this node, and the one before (the\n // two that surround our current sample location)\n // idx cannot be 0 since we just incremented it.\n\n if (idx < numNodes) {\n x1 = model.nodes[idx - 1].x;\n x2 = model.nodes[idx].x;\n\n if (usingLogScale) {\n x1 = Math.log10(x1);\n x2 = Math.log10(x2);\n }\n\n rgb1[0] = model.nodes[idx - 1].r;\n rgb2[0] = model.nodes[idx].r;\n rgb1[1] = model.nodes[idx - 1].g;\n rgb2[1] = model.nodes[idx].g;\n rgb1[2] = model.nodes[idx - 1].b;\n rgb2[2] = model.nodes[idx].b; // We only need the previous midpoint and sharpness\n // since these control this region\n\n midpoint = model.nodes[idx - 1].midpoint;\n sharpness = model.nodes[idx - 1].sharpness; // Move midpoint away from extreme ends of range to avoid\n // degenerate math\n\n if (midpoint < 0.00001) {\n midpoint = 0.00001;\n }\n\n if (midpoint > 0.99999) {\n midpoint = 0.99999;\n }\n }\n } // Are we at or past the end? If so, just use the last value\n\n\n if (x > model.mappingRange[1]) {\n table[tidx] = 0.0;\n table[tidx + 1] = 0.0;\n table[tidx + 2] = 0.0;\n\n if (model.clamping) {\n if (publicAPI.getUseAboveRangeColor()) {\n table[tidx] = model.aboveRangeColor[0];\n table[tidx + 1] = model.aboveRangeColor[1];\n table[tidx + 2] = model.aboveRangeColor[2];\n } else {\n table[tidx] = lastR;\n table[tidx + 1] = lastG;\n table[tidx + 2] = lastB;\n }\n }\n } else if (x < model.mappingRange[0] || vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"isInf\"](x) && x < 0) {\n // we are before the first node? If so, duplicate this node's values.\n // We have to deal with -inf here\n table[tidx] = 0.0;\n table[tidx + 1] = 0.0;\n table[tidx + 2] = 0.0;\n\n if (model.clamping) {\n if (publicAPI.getUseBelowRangeColor()) {\n table[tidx] = model.belowRangeColor[0];\n table[tidx + 1] = model.belowRangeColor[1];\n table[tidx + 2] = model.belowRangeColor[2];\n } else if (numNodes > 0) {\n table[tidx] = model.nodes[0].r;\n table[tidx + 1] = model.nodes[0].g;\n table[tidx + 2] = model.nodes[0].b;\n }\n }\n } else if (idx === 0 && (Math.abs(x - xStart) < 1e-6 || model.discretize)) {\n if (numNodes > 0) {\n table[tidx] = model.nodes[0].r;\n table[tidx + 1] = model.nodes[0].g;\n table[tidx + 2] = model.nodes[0].b;\n } else {\n table[tidx] = 0.0;\n table[tidx + 1] = 0.0;\n table[tidx + 2] = 0.0;\n }\n } else {\n // OK, we are between two nodes - interpolate\n // Our first attempt at a normalized location [0,1] -\n // we will be modifying this based on midpoint and\n // sharpness to get the curve shape we want and to have\n // it pass through (y1+y2)/2 at the midpoint.\n var s = 0.0;\n\n if (usingLogScale) {\n s = (logX - x1) / (x2 - x1);\n } else {\n s = (x - x1) / (x2 - x1);\n } // Readjust based on the midpoint - linear adjustment\n\n\n if (s < midpoint) {\n s = 0.5 * s / midpoint;\n } else {\n s = 0.5 + 0.5 * (s - midpoint) / (1.0 - midpoint);\n } // override for sharpness > 0.99\n // In this case we just want piecewise constant\n\n\n if (sharpness > 0.99) {\n // Use the first value since we are below the midpoint\n if (s < 0.5) {\n table[tidx] = rgb1[0];\n table[tidx + 1] = rgb1[1];\n table[tidx + 2] = rgb1[2];\n continue;\n } else {\n // Use the second value at or above the midpoint\n table[tidx] = rgb2[0];\n table[tidx + 1] = rgb2[1];\n table[tidx + 2] = rgb2[2];\n continue;\n }\n } // Override for sharpness < 0.01\n // In this case we want piecewise linear\n\n\n if (sharpness < 0.01) {\n // Simple linear interpolation\n if (model.colorSpace === ColorSpace.RGB) {\n table[tidx] = (1 - s) * rgb1[0] + s * rgb2[0];\n table[tidx + 1] = (1 - s) * rgb1[1] + s * rgb2[1];\n table[tidx + 2] = (1 - s) * rgb1[2] + s * rgb2[2];\n } else if (model.colorSpace === ColorSpace.HSV) {\n var hsv1 = [];\n var hsv2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2hsv\"](rgb1, hsv1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2hsv\"](rgb2, hsv2);\n\n if (model.hSVWrap && (hsv1[0] - hsv2[0] > 0.5 || hsv2[0] - hsv1[0] > 0.5)) {\n if (hsv1[0] > hsv2[0]) {\n hsv1[0] -= 1.0;\n } else {\n hsv2[0] -= 1.0;\n }\n }\n\n var hsvTmp = [];\n hsvTmp[0] = (1.0 - s) * hsv1[0] + s * hsv2[0];\n\n if (hsvTmp[0] < 0.0) {\n hsvTmp[0] += 1.0;\n }\n\n hsvTmp[1] = (1.0 - s) * hsv1[1] + s * hsv2[1];\n hsvTmp[2] = (1.0 - s) * hsv1[2] + s * hsv2[2]; // Now convert this back to RGB\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"hsv2rgb\"](hsvTmp, tmpVec);\n table[tidx] = tmpVec[0];\n table[tidx + 1] = tmpVec[1];\n table[tidx + 2] = tmpVec[2];\n } else if (model.colorSpace === ColorSpace.LAB) {\n var lab1 = [];\n var lab2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2lab\"](rgb1, lab1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2lab\"](rgb2, lab2);\n var labTmp = [];\n labTmp[0] = (1 - s) * lab1[0] + s * lab2[0];\n labTmp[1] = (1 - s) * lab1[1] + s * lab2[1];\n labTmp[2] = (1 - s) * lab1[2] + s * lab2[2]; // Now convert back to RGB\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"lab2rgb\"](labTmp, tmpVec);\n table[tidx] = tmpVec[0];\n table[tidx + 1] = tmpVec[1];\n table[tidx + 2] = tmpVec[2];\n } else if (model.colorSpace === ColorSpace.DIVERGING) {\n vtkColorTransferFunctionInterpolateDiverging(s, rgb1, rgb2, tmpVec);\n table[tidx] = tmpVec[0];\n table[tidx + 1] = tmpVec[1];\n table[tidx + 2] = tmpVec[2];\n } else {\n vtkErrorMacro('ColorSpace set to invalid value.', model.colorSpace);\n }\n\n continue;\n } // We have a sharpness between [0.01, 0.99] - we will\n // used a modified hermite curve interpolation where we\n // derive the slope based on the sharpness, and we compress\n // the curve non-linearly based on the sharpness\n // First, we will adjust our position based on sharpness in\n // order to make the curve sharper (closer to piecewise constant)\n\n\n if (s < 0.5) {\n s = 0.5 * Math.pow(s * 2.0, 1.0 + 10.0 * sharpness);\n } else if (s > 0.5) {\n s = 1.0 - 0.5 * Math.pow((1.0 - s) * 2, 1 + 10.0 * sharpness);\n } // Compute some coefficients we will need for the hermite curve\n\n\n var ss = s * s;\n var sss = ss * s;\n var h1 = 2.0 * sss - 3 * ss + 1;\n var h2 = -2 * sss + 3 * ss;\n var h3 = sss - 2 * ss + s;\n var h4 = sss - ss;\n var slope = void 0;\n var t = void 0;\n\n if (model.colorSpace === ColorSpace.RGB) {\n for (var j = 0; j < 3; j++) {\n // Use one slope for both end points\n slope = rgb2[j] - rgb1[j];\n t = (1.0 - sharpness) * slope; // Compute the value\n\n table[tidx + j] = h1 * rgb1[j] + h2 * rgb2[j] + h3 * t + h4 * t;\n }\n } else if (model.colorSpace === ColorSpace.HSV) {\n var _hsv = [];\n var _hsv2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2hsv\"](rgb1, _hsv);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2hsv\"](rgb2, _hsv2);\n\n if (model.hSVWrap && (_hsv[0] - _hsv2[0] > 0.5 || _hsv2[0] - _hsv[0] > 0.5)) {\n if (_hsv[0] > _hsv2[0]) {\n _hsv[0] -= 1.0;\n } else {\n _hsv2[0] -= 1.0;\n }\n }\n\n var _hsvTmp = [];\n\n for (var _j = 0; _j < 3; _j++) {\n // Use one slope for both end points\n slope = _hsv2[_j] - _hsv[_j];\n t = (1.0 - sharpness) * slope; // Compute the value\n\n _hsvTmp[_j] = h1 * _hsv[_j] + h2 * _hsv2[_j] + h3 * t + h4 * t;\n\n if (_j === 0 && _hsvTmp[_j] < 0.0) {\n _hsvTmp[_j] += 1.0;\n }\n } // Now convert this back to RGB\n\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"hsv2rgb\"](_hsvTmp, tmpVec);\n table[tidx] = tmpVec[0];\n table[tidx + 1] = tmpVec[1];\n table[tidx + 2] = tmpVec[2];\n } else if (model.colorSpace === ColorSpace.LAB) {\n var _lab = [];\n var _lab2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2lab\"](rgb1, _lab);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2lab\"](rgb2, _lab2);\n var _labTmp = [];\n\n for (var _j2 = 0; _j2 < 3; _j2++) {\n // Use one slope for both end points\n slope = _lab2[_j2] - _lab[_j2];\n t = (1.0 - sharpness) * slope; // Compute the value\n\n _labTmp[_j2] = h1 * _lab[_j2] + h2 * _lab2[_j2] + h3 * t + h4 * t;\n } // Now convert this back to RGB\n\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"lab2rgb\"](_labTmp, tmpVec);\n table[tidx] = tmpVec[0];\n table[tidx + 1] = tmpVec[1];\n table[tidx + 2] = tmpVec[2];\n } else if (model.colorSpace === ColorSpace.DIVERGING) {\n // I have not implemented proper interpolation by a hermite curve for\n // the diverging color map, but I cannot think of a good use case for\n // that anyway.\n vtkColorTransferFunctionInterpolateDiverging(s, rgb1, rgb2, tmpVec);\n table[tidx] = tmpVec[0];\n table[tidx + 1] = tmpVec[1];\n table[tidx + 2] = tmpVec[2];\n } else {\n vtkErrorMacro('ColorSpace set to invalid value.');\n } // Final error check to make sure we don't go outside [0,1]\n\n\n for (var _j3 = 0; _j3 < 3; _j3++) {\n table[tidx + _j3] = table[tidx + _j3] < 0.0 ? 0.0 : table[tidx + _j3];\n table[tidx + _j3] = table[tidx + _j3] > 1.0 ? 1.0 : table[tidx + _j3];\n }\n }\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getUint8Table = function (xStart, xEnd, size) {\n var withAlpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n if (publicAPI.getMTime() <= model.buildTime && model.tableSize === size && model.tableWithAlpha !== withAlpha) {\n return model.table;\n }\n\n if (model.nodes.length === 0) {\n vtkErrorMacro('Attempting to lookup a value with no points in the function');\n return model.table;\n }\n\n var nbChannels = withAlpha ? 4 : 3;\n\n if (model.tableSize !== size || model.tableWithAlpha !== withAlpha) {\n model.table = new Uint8Array(size * nbChannels);\n model.tableSize = size;\n model.tableWithAlpha = withAlpha;\n }\n\n var tmpTable = [];\n publicAPI.getTable(xStart, xEnd, size, tmpTable);\n\n for (var i = 0; i < size; i++) {\n model.table[i * nbChannels + 0] = Math.floor(tmpTable[i * 3 + 0] * 255.0 + 0.5);\n model.table[i * nbChannels + 1] = Math.floor(tmpTable[i * 3 + 1] * 255.0 + 0.5);\n model.table[i * nbChannels + 2] = Math.floor(tmpTable[i * 3 + 2] * 255.0 + 0.5);\n\n if (withAlpha) {\n model.table[i * nbChannels + 3] = 255;\n }\n }\n\n model.buildTime.modified();\n return model.table;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.buildFunctionFromTable = function (xStart, xEnd, size, table) {\n var inc = 0.0;\n publicAPI.removeAllPoints();\n\n if (size > 1) {\n inc = (xEnd - xStart) / (size - 1.0);\n }\n\n for (var i = 0; i < size; i++) {\n var node = {\n x: xStart + inc * i,\n r: table[i * 3],\n g: table[i * 3 + 1],\n b: table[i * 3 + 2],\n sharpness: 0.0,\n midpoint: 0.5\n };\n model.nodes.push(node);\n }\n\n publicAPI.sortAndUpdateRange();\n }; //----------------------------------------------------------------------------\n // For a specified index value, get the node parameters\n\n\n publicAPI.getNodeValue = function (index, val) {\n if (index < 0 || index >= model.nodes.length) {\n vtkErrorMacro('Index out of range!');\n return -1;\n }\n\n val[0] = model.nodes[index].x;\n val[1] = model.nodes[index].r;\n val[2] = model.nodes[index].g;\n val[3] = model.nodes[index].b;\n val[4] = model.nodes[index].midpoint;\n val[5] = model.nodes[index].sharpness;\n return 1;\n }; //----------------------------------------------------------------------------\n // For a specified index value, get the node parameters\n\n\n publicAPI.setNodeValue = function (index, val) {\n if (index < 0 || index >= model.nodes.length) {\n vtkErrorMacro('Index out of range!');\n return -1;\n }\n\n var oldX = model.nodes[index].x;\n model.nodes[index].x = val[0];\n model.nodes[index].r = val[1];\n model.nodes[index].g = val[2];\n model.nodes[index].b = val[3];\n model.nodes[index].midpoint = val[4];\n model.nodes[index].sharpness = val[5];\n\n if (oldX !== val[0]) {\n // The point has been moved, the order of points or the range might have\n // been modified.\n publicAPI.sortAndUpdateRange(); // No need to call Modified() here because SortAndUpdateRange() has done it\n // already.\n } else {\n publicAPI.modified();\n }\n\n return 1;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfAvailableColors = function () {\n if (model.indexedLookup && publicAPI.getSize()) {\n return publicAPI.getSize();\n }\n\n if (model.tableSize) {\n // Not sure if this is correct since it is only set if\n // \"const unsigned char *::GetTable(double xStart, double xEnd,int size)\"\n // has been called.\n return model.tableSize;\n }\n\n return 16777216; // 2^24\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getIndexedColor = function (idx, rgba) {\n var n = publicAPI.getSize();\n\n if (n > 0 && idx >= 0) {\n var nodeValue = [];\n publicAPI.getNodeValue(idx % n, nodeValue);\n\n for (var j = 0; j < 3; ++j) {\n rgba[j] = nodeValue[j + 1];\n }\n\n rgba[3] = 1.0; // NodeColor is RGB-only.\n\n return;\n }\n\n publicAPI.getNanColor(rgba);\n rgba[3] = 1.0; // NanColor is RGB-only.\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.fillFromDataPointer = function (nb, ptr) {\n if (nb <= 0 || !ptr) {\n return;\n }\n\n publicAPI.removeAllPoints();\n\n for (var i = 0; i < nb; i++) {\n publicAPI.addRGBPoint(ptr[i * 4], ptr[i * 4 + 1], ptr[i * 4 + 2], ptr[i * 4 + 3]);\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.setMappingRange = function (min, max) {\n var range = [min, max];\n var originalRange = publicAPI.getRange();\n\n if (originalRange[1] === range[1] && originalRange[0] === range[0]) {\n return;\n }\n\n if (range[1] === range[0]) {\n vtkErrorMacro('attempt to set zero width color range');\n return;\n }\n\n var scale = (range[1] - range[0]) / (originalRange[1] - originalRange[0]);\n var shift = range[0] - originalRange[0] * scale;\n\n for (var i = 0; i < model.nodes.length; ++i) {\n model.nodes[i].x = model.nodes[i].x * scale + shift;\n }\n\n model.mappingRange[0] = range[0];\n model.mappingRange[1] = range[1];\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.adjustRange = function (range) {\n var functionRange = publicAPI.getRange(); // Make sure we have points at each end of the range\n\n var rgb = [];\n\n if (functionRange[0] < range[0]) {\n publicAPI.getColor(range[0], rgb);\n publicAPI.addRGBPoint(range[0], rgb[0], rgb[1], rgb[2]);\n } else {\n publicAPI.getColor(functionRange[0], rgb);\n publicAPI.addRGBPoint(range[0], rgb[0], rgb[1], rgb[2]);\n }\n\n if (functionRange[1] > range[1]) {\n publicAPI.getColor(range[1], rgb);\n publicAPI.addRGBPoint(range[1], rgb[0], rgb[1], rgb[2]);\n } else {\n publicAPI.getColor(functionRange[1], rgb);\n publicAPI.addRGBPoint(range[1], rgb[0], rgb[1], rgb[2]);\n } // Remove all points out-of-range\n\n\n publicAPI.sortAndUpdateRange();\n\n for (var i = 0; i < model.nodes.length;) {\n if (model.nodes[i].x >= range[0] && model.nodes[i].x <= range[1]) {\n model.nodes.splice(i, 1);\n } else {\n ++i;\n }\n }\n\n return 1;\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.estimateMinNumberOfSamples = function (x1, x2) {\n var d = publicAPI.findMinimumXDistance();\n return Math.ceil((x2 - x1) / d);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.findMinimumXDistance = function () {\n if (model.nodes.length < 2) {\n return -1.0;\n }\n\n var distance = Number.MAX_VALUE;\n\n for (var i = 0; i < model.nodes.length - 1; i++) {\n var currentDist = model.nodes[i + 1].x - model.nodes[i].x;\n\n if (currentDist < distance) {\n distance = currentDist;\n }\n }\n\n return distance;\n };\n\n publicAPI.mapScalarsThroughTable = function (input, output, outFormat, inputOffset) {\n if (publicAPI.getSize() === 0) {\n vtkDebugMacro('Transfer Function Has No Points!');\n return;\n }\n\n if (model.indexedLookup) {\n publicAPI.mapDataIndexed(input, output, outFormat, inputOffset);\n } else {\n publicAPI.mapData(input, output, outFormat, inputOffset);\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.mapData = function (input, output, outFormat, inputOffset) {\n if (publicAPI.getSize() === 0) {\n vtkWarningMacro('Transfer Function Has No Points!');\n return;\n }\n\n var alpha = Math.floor(publicAPI.getAlpha() * 255.0 + 0.5);\n var length = input.getNumberOfTuples();\n var inIncr = input.getNumberOfComponents();\n var outputV = output.getData();\n var inputV = input.getData();\n var rgb = [];\n\n if (outFormat === ScalarMappingTarget.RGBA) {\n for (var i = 0; i < length; i++) {\n var x = inputV[i * inIncr + inputOffset];\n publicAPI.getColor(x, rgb);\n outputV[i * 4] = Math.floor(rgb[0] * 255.0 + 0.5);\n outputV[i * 4 + 1] = Math.floor(rgb[1] * 255.0 + 0.5);\n outputV[i * 4 + 2] = Math.floor(rgb[2] * 255.0 + 0.5);\n outputV[i * 4 + 3] = alpha;\n }\n }\n\n if (outFormat === ScalarMappingTarget.RGB) {\n for (var _i2 = 0; _i2 < length; _i2++) {\n var _x = inputV[_i2 * inIncr + inputOffset];\n publicAPI.getColor(_x, rgb);\n outputV[_i2 * 3] = Math.floor(rgb[0] * 255.0 + 0.5);\n outputV[_i2 * 3 + 1] = Math.floor(rgb[1] * 255.0 + 0.5);\n outputV[_i2 * 3 + 2] = Math.floor(rgb[2] * 255.0 + 0.5);\n }\n }\n\n if (outFormat === ScalarMappingTarget.LUMINANCE) {\n for (var _i3 = 0; _i3 < length; _i3++) {\n var _x2 = inputV[_i3 * inIncr + inputOffset];\n publicAPI.getColor(_x2, rgb);\n outputV[_i3] = Math.floor(rgb[0] * 76.5 + rgb[1] * 150.45 + rgb[2] * 28.05 + 0.5);\n }\n }\n\n if (outFormat === ScalarMappingTarget.LUMINANCE_ALPHA) {\n for (var _i4 = 0; _i4 < length; _i4++) {\n var _x3 = inputV[_i4 * inIncr + inputOffset];\n publicAPI.getColor(_x3, rgb);\n outputV[_i4 * 2] = Math.floor(rgb[0] * 76.5 + rgb[1] * 150.45 + rgb[2] * 28.05 + 0.5);\n outputV[_i4 * 2 + 1] = alpha;\n }\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.applyColorMap = function (colorMap) {\n if (colorMap.ColorSpace) {\n model.colorSpace = ColorSpace[colorMap.ColorSpace.toUpperCase()];\n\n if (model.colorSpace === undefined) {\n vtkErrorMacro(\"ColorSpace \".concat(colorMap.ColorSpace, \" not supported, using RGB instead\"));\n model.colorSpace = ColorSpace.RGB;\n }\n }\n\n if (colorMap.NanColor) {\n model.nanColor = [].concat(colorMap.NanColor);\n\n while (model.nanColor.length < 4) {\n model.nanColor.push(1.0);\n }\n }\n\n if (colorMap.RGBPoints) {\n var size = colorMap.RGBPoints.length;\n model.nodes = [];\n var midpoint = 0.5;\n var sharpness = 0.0;\n\n for (var i = 0; i < size; i += 4) {\n model.nodes.push({\n x: colorMap.RGBPoints[i],\n r: colorMap.RGBPoints[i + 1],\n g: colorMap.RGBPoints[i + 2],\n b: colorMap.RGBPoints[i + 3],\n midpoint: midpoint,\n sharpness: sharpness\n });\n }\n } // FIXME: not supported ?\n // if (colorMap.IndexedColors) {\n // }\n // if (colorMap.Annotations) {\n // }\n\n\n publicAPI.sortAndUpdateRange();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n clamping: true,\n colorSpace: ColorSpace.RGB,\n hSVWrap: true,\n scale: Scale.LINEAR,\n nanColor: null,\n belowRangeColor: null,\n aboveRangeColor: null,\n useAboveRangeColor: false,\n useBelowRangeColor: false,\n allowDuplicateScalars: false,\n table: null,\n tableSize: 0,\n buildTime: null,\n nodes: null,\n discretize: false,\n numberOfValues: 256\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Common_Core_ScalarsToColors__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues); // Internal objects initialization\n\n model.table = [];\n model.nodes = [];\n model.nanColor = [0.5, 0.0, 0.0, 1.0];\n model.belowRangeColor = [0.0, 0.0, 0.0, 1.0];\n model.aboveRangeColor = [1.0, 1.0, 1.0, 1.0];\n model.buildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.buildTime); // Create get-only macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['buildTime', 'mappingRange']); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['useAboveRangeColor', 'useBelowRangeColor', 'colorSpace', 'discretize', 'numberOfValues']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setArray(publicAPI, model, ['nanColor', 'belowRangeColor', 'aboveRangeColor'], 4); // Create get macros for array\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['nanColor', 'belowRangeColor', 'aboveRangeColor']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkColorTransferFunction(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkColorTransferFunction'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_Core_ColorTransferFunction_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/Constants.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/Constants.js ***! - \****************************************************************************/ -/*! exports provided: Coordinate, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Coordinate\", function() { return Coordinate; });\nvar Coordinate = {\n DISPLAY: 0,\n NORMALIZED_DISPLAY: 1,\n VIEWPORT: 2,\n NORMALIZED_VIEWPORT: 3,\n PROJECTION: 4,\n VIEW: 5,\n WORLD: 6\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n Coordinate: Coordinate\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/index.js ***! - \************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Coordinate_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Coordinate/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\nvar Coordinate = vtk_js_Sources_Rendering_Core_Coordinate_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Coordinate;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkActor methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCoordinate(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCoordinate');\n\n publicAPI.setValue = function () {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return false;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var array = args; // allow an array passed as a single arg.\n\n if (array.length === 1 && Array.isArray(array[0])) {\n array = array[0];\n }\n\n if (array.length === 2) {\n publicAPI.setValue(array[0], array[1], 0.0);\n return true;\n }\n\n if (array.length !== 3) {\n throw new RangeError('Invalid number of values for array setter');\n }\n\n var changeDetected = false;\n model.value.forEach(function (item, index) {\n if (item !== array[index]) {\n if (changeDetected) {\n return;\n }\n\n changeDetected = true;\n }\n });\n\n if (changeDetected) {\n model.value = [].concat(array);\n publicAPI.modified();\n }\n\n return true;\n };\n\n publicAPI.setCoordinateSystemToDisplay = function () {\n publicAPI.setCoordinateSystem(Coordinate.DISPLAY);\n };\n\n publicAPI.setCoordinateSystemToNormalizedDisplay = function () {\n publicAPI.setCoordinateSystem(Coordinate.NORMALIZED_DISPLAY);\n };\n\n publicAPI.setCoordinateSystemToViewport = function () {\n publicAPI.setCoordinateSystem(Coordinate.VIEWPORT);\n };\n\n publicAPI.setCoordinateSystemToNormalizedViewport = function () {\n publicAPI.setCoordinateSystem(Coordinate.NORMALIZED_VIEWPORT);\n };\n\n publicAPI.setCoordinateSystemToProjection = function () {\n publicAPI.setCoordinateSystem(Coordinate.PROJECTION);\n };\n\n publicAPI.setCoordinateSystemToView = function () {\n publicAPI.setCoordinateSystem(Coordinate.VIEW);\n };\n\n publicAPI.setCoordinateSystemToWorld = function () {\n publicAPI.setCoordinateSystem(Coordinate.WORLD);\n };\n\n publicAPI.getCoordinateSystemAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(Coordinate, model.coordinateSystem);\n };\n\n publicAPI.getComputedWorldValue = function (ren) {\n var val = model.computedWorldValue;\n\n if (model.computing) {\n return val;\n }\n\n model.computing = 1;\n val[0] = model.value[0];\n val[1] = model.value[1];\n val[2] = model.value[2]; // Use our renderer if is defined\n\n var renderer = ren;\n\n if (model.renderer) {\n renderer = model.renderer;\n }\n\n if (!renderer) {\n if (model.coordinateSystem === Coordinate.WORLD) {\n if (model.referenceCoordinate) {\n var refValue = model.referenceCoordinate.getComputedWorldValue(renderer);\n val[0] += refValue[0];\n val[1] += refValue[1];\n val[2] += refValue[2];\n }\n\n model.computing = 0;\n } else {\n vtkErrorMacro('Attempt to compute world coordinates from another coordinate system without a renderer');\n }\n\n return val;\n } // convert to current coordinate system\n\n\n var view = null;\n\n if (renderer && renderer.getRenderWindow().getViews()) {\n view = renderer.getRenderWindow().getViews()[0];\n } else {\n return model.computedWorldValue;\n }\n\n var dims = view.getViewportSize(renderer);\n var aspect = dims[0] / dims[1];\n\n if (model.referenceCoordinate && model.coordinateSystem !== Coordinate.WORLD) {\n var fval = model.referenceCoordinate.getComputedDoubleDisplayValue(renderer);\n var _refValue = [fval[0], fval[1], 0.0];\n\n switch (model.coordinateSystem) {\n case Coordinate.NORMALIZED_DISPLAY:\n _refValue = view.displayToNormalizedDisplay(_refValue[0], _refValue[1], _refValue[2]);\n break;\n\n case Coordinate.VIEWPORT:\n _refValue = view.displayToNormalizedDisplay(_refValue[0], _refValue[1], _refValue[2]);\n _refValue = view.normalizedDisplayToViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n break;\n\n case Coordinate.NORMALIZED_VIEWPORT:\n _refValue = view.displayToNormalizedDisplay(_refValue[0], _refValue[1], _refValue[2]);\n _refValue = view.normalizedDisplayToViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n _refValue = view.viewportToNormalizedViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n break;\n\n case Coordinate.PROJECTION:\n _refValue = view.displayToNormalizedDisplay(_refValue[0], _refValue[1], _refValue[2]);\n _refValue = view.normalizedDisplayToViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n _refValue = view.viewportToNormalizedViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n _refValue = renderer.normalizedViewportToProjection(_refValue[0], _refValue[1], _refValue[2]);\n break;\n\n case Coordinate.VIEW:\n _refValue = view.displayToNormalizedDisplay(_refValue[0], _refValue[1], _refValue[2]);\n _refValue = view.normalizedDisplayToViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n _refValue = view.viewportToNormalizedViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n _refValue = renderer.normalizedViewportToProjection(_refValue[0], _refValue[1], _refValue[2]);\n _refValue = renderer.projectionToView(_refValue[0], _refValue[1], _refValue[2], aspect);\n break;\n\n default:\n break;\n }\n\n val[0] += _refValue[0];\n val[1] += _refValue[1];\n val[2] += _refValue[2];\n }\n\n switch (model.coordinateSystem) {\n case Coordinate.DISPLAY:\n val = view.displayToNormalizedDisplay(val[0], val[1], val[2]);\n val = view.normalizedDisplayToViewport(val[0], val[1], val[2], renderer);\n val = view.viewportToNormalizedViewport(val[0], val[1], val[2], renderer);\n val = renderer.normalizedViewportToProjection(val[0], val[1], val[2]);\n val = renderer.projectionToView(val[0], val[1], val[2], aspect);\n val = renderer.viewToWorld(val[0], val[1], val[2]);\n break;\n\n case Coordinate.NORMALIZED_DISPLAY:\n val = view.normalizedDisplayToViewport(val[0], val[1], val[2], renderer);\n val = view.viewportToNormalizedViewport(val[0], val[1], val[2], renderer);\n val = renderer.normalizedViewportToProjection(val[0], val[1], val[2]);\n val = renderer.projectionToView(val[0], val[1], val[2], aspect);\n val = renderer.viewToWorld(val[0], val[1], val[2]);\n break;\n\n case Coordinate.VIEWPORT:\n val = view.viewportToNormalizedViewport(val[0], val[1], val[2], renderer);\n val = renderer.normalizedViewportToProjection(val[0], val[1], val[2]);\n val = renderer.projectionToView(val[0], val[1], val[2], aspect);\n val = renderer.viewToWorld(val[0], val[1], val[2]);\n break;\n\n case Coordinate.NORMALIZED_VIEWPORT:\n val = renderer.normalizedViewportToProjection(val[0], val[1], val[2]);\n val = renderer.projectionToView(val[0], val[1], val[2], aspect);\n val = renderer.viewToWorld(val[0], val[1], val[2]);\n break;\n\n case Coordinate.PROJECTION:\n val = renderer.projectionToView(val[0], val[1], val[2], aspect);\n val = renderer.viewToWorld(val[0], val[1], val[2]);\n break;\n\n case Coordinate.VIEW:\n val = renderer.viewToWorld(val[0], val[1], val[2]);\n break;\n\n default:\n break;\n }\n\n if (model.referenceCoordinate && model.coordinateSystem === Coordinate.WORLD) {\n var _refValue2 = publicAPI.getComputedWorldValue(renderer);\n\n val[0] += _refValue2[0];\n val[1] += _refValue2[1];\n val[2] += _refValue2[2];\n }\n\n model.computing = 0;\n model.computedWorldValue = val.slice(0);\n return val;\n };\n\n publicAPI.getComputedViewportValue = function (ren) {\n var f = publicAPI.getComputedDoubleViewportValue(ren);\n return [vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"round\"](f[0]), vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"round\"](f[1])];\n };\n\n publicAPI.getComputedDisplayValue = function (ren) {\n var val = publicAPI.getComputedDoubleDisplayValue(ren);\n return [vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"floor\"](val[0]), vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"floor\"](val[1])];\n };\n\n publicAPI.getComputedLocalDisplayValue = function (ren) {\n // Use our renderer if it is defined\n var renderer = ren;\n\n if (model.renderer) {\n renderer = model.renderer;\n }\n\n var val = publicAPI.getComputedDisplayValue(renderer);\n\n if (!renderer) {\n vtkErrorMacro('Attempt to convert to local display coordinates without a renderer');\n return val;\n }\n\n var view = null;\n\n if (renderer && renderer.getRenderWindow().getViews()) {\n view = renderer.getRenderWindow().getViews()[0];\n } else {\n return val;\n }\n\n val = view.displayToLocalDisplay(val[0], val[1], val[2]);\n return [vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"round\"](val[0]), vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"round\"](val[1])];\n };\n\n publicAPI.getComputedDoubleViewportValue = function (ren) {\n var renderer = ren;\n\n if (model.renderer) {\n renderer = model.renderer;\n }\n\n var val = publicAPI.getComputedDoubleDisplayValue(renderer);\n\n if (!renderer) {\n return val;\n }\n\n var view = null;\n\n if (renderer && renderer.getRenderWindow().getViews()) {\n view = renderer.getRenderWindow().getViews()[0];\n } else {\n return val;\n }\n\n val = view.displayToNormalizedDisplay(val[0], val[1], val[2]);\n val = view.normalizedDisplayToViewport(val[0], val[1], val[2], renderer);\n return [val[0], val[1]];\n };\n\n publicAPI.getComputedDoubleDisplayValue = function (ren) {\n if (model.computing) {\n return model.computedDoubleDisplayValue;\n }\n\n model.computing = 1;\n var val = model.value.slice(0);\n var renderer = ren;\n\n if (model.renderer) {\n renderer = model.renderer;\n }\n\n if (!renderer) {\n if (model.coordinateSystem === Coordinate.DISPLAY) {\n model.computedDoubleDisplayValue[0] = val[0];\n model.computedDoubleDisplayValue[1] = val[1];\n\n if (model.referenceCoordinate) {\n var refValue = model.referenceCoordinate.getComputedDoubleDisplayValue();\n model.computedDoubleDisplayValue[0] += refValue[0];\n model.computedDoubleDisplayValue[1] += refValue[1];\n }\n } else {\n model.computedDoubleDisplayValue[0] = Number.MAX_VALUE;\n model.computedDoubleDisplayValue[1] = Number.MAX_VALUE;\n vtkErrorMacro('Request for coordinate transformation without required viewport');\n }\n\n return model.computedDoubleDisplayValue;\n }\n\n var view = null;\n\n if (renderer && renderer.getRenderWindow().getViews()) {\n view = renderer.getRenderWindow().getViews()[0];\n } else {\n return val;\n }\n\n var dims = view.getViewportSize(renderer);\n var aspect = dims[0] / dims[1];\n\n switch (model.coordinateSystem) {\n case Coordinate.WORLD:\n {\n if (model.referenceCoordinate) {\n var _refValue3 = model.referenceCoordinate.getComputedWorldValue(renderer);\n\n val[0] += _refValue3[0];\n val[1] += _refValue3[1];\n val[2] += _refValue3[2];\n }\n\n val = renderer.worldToView(val[0], val[1], val[2]);\n val = renderer.viewToProjection(val[0], val[1], val[2], aspect);\n val = renderer.projectionToNormalizedViewport(val[0], val[1], val[2]);\n val = view.normalizedViewportToViewport(val[0], val[1], val[2]);\n val = view.viewportToNormalizedDisplay(val[0], val[1], val[2], renderer);\n val = view.normalizedDisplayToDisplay(val[0], val[1], val[2]);\n break;\n }\n\n case Coordinate.VIEW:\n {\n val = renderer.viewToProjection(val[0], val[1], val[2], aspect);\n val = renderer.projectionToNormalizedViewport(val[0], val[1], val[2]);\n val = view.normalizedViewportToViewport(val[0], val[1], val[2]);\n val = view.viewportToNormalizedDisplay(val[0], val[1], val[2], renderer);\n val = view.normalizedDisplayToDisplay(val[0], val[1], val[2]);\n break;\n }\n\n case Coordinate.PROJECTION:\n {\n val = renderer.projectionToNormalizedViewport(val[0], val[1], val[2]);\n val = view.normalizedViewportToViewport(val[0], val[1], val[2]);\n val = view.viewportToNormalizedDisplay(val[0], val[1], val[2], renderer);\n val = view.normalizedDisplayToDisplay(val[0], val[1], val[2]);\n break;\n }\n\n case Coordinate.NORMALIZED_VIEWPORT:\n {\n val = view.normalizedViewportToViewport(val[0], val[1], val[2]);\n\n if (model.referenceCoordinate) {\n var _refValue4 = model.referenceCoordinate.getComputedDoubleViewportValue(renderer);\n\n val[0] += _refValue4[0];\n val[1] += _refValue4[1];\n }\n\n val = view.viewportToNormalizedDisplay(val[0], val[1], val[2], renderer);\n val = view.normalizedDisplayToDisplay(val[0], val[1], val[2]);\n break;\n }\n\n case Coordinate.VIEWPORT:\n {\n if (model.referenceCoordinate) {\n var _refValue5 = model.referenceCoordinate.getComputedDoubleViewportValue(renderer);\n\n val[0] += _refValue5[0];\n val[1] += _refValue5[1];\n }\n\n val = view.viewportToNormalizedDisplay(val[0], val[1], val[2], renderer);\n val = view.normalizedDisplayToDisplay(val[0], val[1], val[2]);\n break;\n }\n\n case Coordinate.NORMALIZED_DISPLAY:\n val = view.normalizedDisplayToDisplay(val[0], val[1], val[2]);\n break;\n\n case Coordinate.USERDEFINED:\n val = model.value.slice(0);\n break;\n\n default:\n break;\n } // if we have a reference coordinate and we haven't handled it yet\n\n\n if (model.referenceCoordinate && (model.coordinateSystem === Coordinate.DISPLAY || model.coordinateSystem === Coordinate.NORMALIZED_DISPLAY)) {\n var _refValue6 = model.referenceCoordinate.getComputedDoubleDisplayValue(renderer);\n\n val[0] += _refValue6[0];\n val[1] += _refValue6[1];\n }\n\n model.computedDoubleDisplayValue[0] = val[0];\n model.computedDoubleDisplayValue[1] = val[1];\n model.computing = 0;\n return model.computedDoubleDisplayValue;\n };\n\n publicAPI.getComputedValue = function (ren) {\n var renderer = ren;\n\n if (model.renderer) {\n renderer = model.renderer;\n }\n\n switch (model.coordinateSystem) {\n case Coordinate.WORLD:\n return publicAPI.getComputedWorldValue(renderer);\n\n case Coordinate.VIEW:\n case Coordinate.NORMALIZED_VIEWPORT:\n case Coordinate.VIEWPORT:\n {\n var val = publicAPI.getComputedViewportValue(renderer);\n model.computedWorldValue[0] = val[0];\n model.computedWorldValue[1] = val[1];\n break;\n }\n\n case Coordinate.NORMALIZED_DISPLAY:\n case Coordinate.DISPLAY:\n {\n var _val = model.getComputedDisplayValue(renderer);\n\n model.computedWorldValue[0] = _val[0];\n model.computedWorldValue[1] = _val[1];\n break;\n }\n\n default:\n break;\n }\n\n return model.computedWorldValue;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n coordinateSystem: Coordinate.WORLD,\n value: [0.0, 0.0, 0.0],\n renderer: null,\n referenceCoordinate: null,\n computing: 0,\n computedWorldValue: [0.0, 0.0, 0.0],\n computedDoubleDisplayValue: [0.0, 0.0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].set(publicAPI, model, ['property']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['value']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['coordinateSystem', 'referenceCoordinate', 'renderer']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['value'], 3); // Object methods\n\n vtkCoordinate(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkCoordinate'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_Core_Coordinate_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/Constants.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/Constants.js ***! - \*******************************************************************************/ -/*! exports provided: OrientationModes, ScaleModes, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OrientationModes\", function() { return OrientationModes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ScaleModes\", function() { return ScaleModes; });\nvar OrientationModes = {\n DIRECTION: 0,\n ROTATION: 1,\n MATRIX: 2\n};\nvar ScaleModes = {\n SCALE_BY_CONSTANT: 0,\n SCALE_BY_MAGNITUDE: 1,\n SCALE_BY_COMPONENTS: 2\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n OrientationModes: OrientationModes,\n ScaleModes: ScaleModes\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Glyph3DMapper_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Glyph3DMapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/Constants.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n\nvar OrientationModes = vtk_js_Sources_Rendering_Core_Glyph3DMapper_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].OrientationModes,\n ScaleModes = vtk_js_Sources_Rendering_Core_Glyph3DMapper_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ScaleModes;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// class methods\n// ----------------------------------------------------------------------------\n\nfunction vtkGlyph3DMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkGlyph3DMapper');\n /**\n * An orientation array is a vtkDataArray with 3 components. The first\n * component is the angle of rotation along the X axis. The second\n * component is the angle of rotation along the Y axis. The third\n * component is the angle of rotation along the Z axis. Orientation is\n * specified in X,Y,Z order but the rotations are performed in Z,X an Y.\n * This definition is compliant with SetOrientation method on vtkProp3D.\n * By using vector or normal there is a degree of freedom or rotation\n * left (underconstrained). With the orientation array, there is no degree of\n * freedom left.\n */\n\n publicAPI.getOrientationModeAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].enumToString(OrientationModes, model.orientationMode);\n };\n\n publicAPI.setOrientationModeToDirection = function () {\n return publicAPI.setOrientationMode(OrientationModes.DIRECTION);\n };\n\n publicAPI.setOrientationModeToRotation = function () {\n return publicAPI.setOrientationMode(OrientationModes.ROTATION);\n };\n\n publicAPI.setOrientationModeToMatrix = function () {\n return publicAPI.setOrientationMode(OrientationModes.MATRIX);\n };\n\n publicAPI.getOrientationArrayData = function () {\n var idata = publicAPI.getInputData(0);\n\n if (!idata || !idata.getPointData()) {\n return null;\n }\n\n if (!model.orientationArray) {\n return idata.getPointData().getVectors();\n }\n\n return idata.getPointData().getArray(model.orientationArray);\n };\n\n publicAPI.getScaleModeAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].enumToString(ScaleModes, model.scaleMode);\n };\n\n publicAPI.setScaleModeToScaleByMagnitude = function () {\n return publicAPI.setScaleMode(ScaleModes.SCALE_BY_MAGNITUDE);\n };\n\n publicAPI.setScaleModeToScaleByComponents = function () {\n return publicAPI.setScaleMode(ScaleModes.SCALE_BY_COMPONENTS);\n };\n\n publicAPI.setScaleModeToScaleByConstant = function () {\n return publicAPI.setScaleMode(ScaleModes.SCALE_BY_CONSTANT);\n };\n\n publicAPI.getScaleArrayData = function () {\n var idata = publicAPI.getInputData(0);\n\n if (!idata || !idata.getPointData()) {\n return null;\n }\n\n if (!model.scaleArray) {\n return idata.getPointData().getScalars();\n }\n\n return idata.getPointData().getArray(model.scaleArray);\n };\n\n publicAPI.getBounds = function () {\n var idata = publicAPI.getInputData(0);\n var gdata = publicAPI.getInputData(1);\n\n if (!idata || !gdata) {\n return vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"createUninitializedBounds\"]();\n } // first we build the arrays used for the glyphing\n\n\n publicAPI.buildArrays();\n return model.bounds;\n };\n\n publicAPI.buildArrays = function () {\n // if the mtgime requires it, rebuild\n var idata = publicAPI.getInputData(0);\n var gdata = publicAPI.getInputData(1);\n\n if (model.buildTime.getMTime() < gdata.getMTime() || model.buildTime.getMTime() < idata.getMTime() || model.buildTime.getMTime() < publicAPI.getMTime()) {\n var pts = idata.getPoints().getData();\n var sArray = publicAPI.getScaleArrayData();\n var sData = null;\n var numSComp = 0;\n\n if (sArray) {\n sData = sArray.getData();\n numSComp = sArray.getNumberOfComponents();\n }\n\n if (model.scaling && sArray && model.scaleMode === ScaleModes.SCALE_BY_COMPONENTS && sArray.getNumberOfComponents() !== 3) {\n vtkErrorMacro('Cannot scale by components since scale array does not have 3 components.');\n sArray = null;\n } // get the glyph bounds\n\n\n var gbounds = gdata.getBounds(); // convert them to 8 points so we can compute the\n // overall bounds while building the arrays\n\n var corners = [];\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].getCorners(gbounds, corners);\n model.bounds[0] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].INIT_BOUNDS[0];\n model.bounds[1] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].INIT_BOUNDS[1];\n model.bounds[2] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].INIT_BOUNDS[2];\n model.bounds[3] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].INIT_BOUNDS[3];\n model.bounds[4] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].INIT_BOUNDS[4];\n model.bounds[5] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].INIT_BOUNDS[5];\n var tcorner = new Float64Array(3);\n var oArray = publicAPI.getOrientationArrayData();\n var identity = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n var trans = [];\n var scale = [];\n var numPts = pts.length / 3;\n model.matrixArray = new Float32Array(16 * numPts);\n var mbuff = model.matrixArray.buffer;\n model.normalArray = new Float32Array(9 * numPts);\n var nbuff = model.normalArray.buffer;\n var tuple = [];\n\n for (var i = 0; i < numPts; ++i) {\n var z = new Float32Array(mbuff, i * 64, 16);\n trans[0] = pts[i * 3];\n trans[1] = pts[i * 3 + 1];\n trans[2] = pts[i * 3 + 2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(z, identity, trans);\n\n if (oArray) {\n var orientation = [];\n oArray.getTuple(i, orientation);\n\n switch (model.orientationMode) {\n case OrientationModes.MATRIX:\n {\n // prettier-ignore\n var rotMat4 = [].concat(_toConsumableArray(orientation.slice(0, 3)), [0], _toConsumableArray(orientation.slice(3, 6)), [0], _toConsumableArray(orientation.slice(6, 9)), [0, 0, 0, 0, 1]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(z, z, rotMat4);\n break;\n }\n\n case OrientationModes.ROTATION:\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateZ(z, z, orientation[2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateX(z, z, orientation[0]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateY(z, z, orientation[1]);\n break;\n\n case OrientationModes.DIRECTION:\n if (orientation[1] === 0.0 && orientation[2] === 0.0) {\n if (orientation[0] < 0) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateY(z, z, 3.1415926);\n }\n } else {\n var vMag = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"norm\"](orientation);\n var vNew = [];\n vNew[0] = (orientation[0] + vMag) / 2.0;\n vNew[1] = orientation[1] / 2.0;\n vNew[2] = orientation[2] / 2.0;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(z, z, 3.1415926, vNew);\n }\n\n break;\n\n default:\n break;\n }\n } // scale data if appropriate\n\n\n if (model.scaling) {\n scale[0] = model.scaleFactor;\n scale[1] = model.scaleFactor;\n scale[2] = model.scaleFactor; // Get the scalar and vector data\n\n if (sArray) {\n switch (model.scaleMode) {\n case ScaleModes.SCALE_BY_MAGNITUDE:\n for (var t = 0; t < numSComp; ++t) {\n tuple[t] = sData[i * numSComp + t];\n }\n\n scale[0] *= vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"norm\"](tuple, numSComp);\n scale[1] = scale[0];\n scale[2] = scale[0];\n break;\n\n case ScaleModes.SCALE_BY_COMPONENTS:\n for (var _t = 0; _t < numSComp; ++_t) {\n tuple[_t] = sData[i * numSComp + _t];\n }\n\n scale[0] *= tuple[0];\n scale[1] *= tuple[1];\n scale[2] *= tuple[2];\n break;\n\n case ScaleModes.SCALE_BY_CONSTANT:\n default:\n break;\n }\n }\n\n if (scale[0] === 0.0) {\n scale[0] = 1.0e-10;\n }\n\n if (scale[1] === 0.0) {\n scale[1] = 1.0e-10;\n }\n\n if (scale[2] === 0.0) {\n scale[2] = 1.0e-10;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].scale(z, z, scale);\n } // update bounds\n\n\n for (var p = 0; p < 8; ++p) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(tcorner, corners[p], z);\n\n if (tcorner[0] < model.bounds[0]) {\n model.bounds[0] = tcorner[0];\n }\n\n if (tcorner[1] < model.bounds[2]) {\n model.bounds[2] = tcorner[1];\n }\n\n if (tcorner[2] < model.bounds[4]) {\n model.bounds[4] = tcorner[2];\n }\n\n if (tcorner[0] > model.bounds[1]) {\n model.bounds[1] = tcorner[0];\n }\n\n if (tcorner[1] > model.bounds[3]) {\n model.bounds[3] = tcorner[1];\n }\n\n if (tcorner[2] > model.bounds[5]) {\n model.bounds[5] = tcorner[2];\n }\n }\n\n var n = new Float32Array(nbuff, i * 36, 9);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromMat4(n, z);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].invert(n, n);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].transpose(n, n);\n } // map scalars as well\n\n\n var scalars = publicAPI.getAbstractScalars(idata, model.scalarMode, model.arrayAccessMode, model.arrayId, model.colorByArrayName).scalars;\n\n if (!model.useLookupTableScalarRange) {\n publicAPI.getLookupTable().setRange(model.scalarRange[0], model.scalarRange[1]);\n }\n\n model.colorArray = null;\n var lut = publicAPI.getLookupTable();\n\n if (lut && scalars) {\n // Ensure that the lookup table is built\n lut.build();\n model.colorArray = lut.mapScalars(scalars, model.colorMode, 0);\n }\n\n model.buildTime.modified();\n }\n };\n\n publicAPI.getPrimitiveCount = function () {\n var glyph = publicAPI.getInputData(1);\n var mult = publicAPI.getInputData().getPoints().getNumberOfValues() / 3;\n var pcount = {\n points: mult * glyph.getPoints().getNumberOfValues() / 3,\n verts: mult * (glyph.getVerts().getNumberOfValues() - glyph.getVerts().getNumberOfCells()),\n lines: mult * (glyph.getLines().getNumberOfValues() - 2 * glyph.getLines().getNumberOfCells()),\n triangles: mult * (glyph.getPolys().getNumberOfValues() - 3 * glyph.getLines().getNumberOfCells())\n };\n return pcount;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n orient: true,\n orientationMode: OrientationModes.DIRECTION,\n orientationArray: null,\n scaling: true,\n scaleFactor: 1.0,\n scaleMode: ScaleModes.SCALE_BY_MAGNITUDE,\n scaleArray: null,\n matrixArray: null,\n normalArray: null,\n colorArray: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].algo(publicAPI, model, 2, 0);\n model.buildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].obj(model.buildTime, {\n mtime: 0\n });\n model.boundsTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].obj(model.boundsTime, {\n mtime: 0\n });\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].setGet(publicAPI, model, ['orient', 'orientationMode', 'orientationArray', 'scaleArray', 'scaleFactor', 'scaleMode', 'scaling']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].get(publicAPI, model, ['colorArray', 'matrixArray', 'normalArray', 'buildTime']); // Object methods\n\n vtkGlyph3DMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance(extend, 'vtkGlyph3DMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_Core_Glyph3DMapper_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/HardwareSelector/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/HardwareSelector/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSet */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js\");\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\n\n\nvar FieldAssociations = vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_1__[\"default\"].FieldAssociations; // ----------------------------------------------------------------------------\n// vtkHardwareSelector methods\n// ----------------------------------------------------------------------------\n\nfunction vtkHardwareSelector(publicAPI, model) {\n model.classHierarchy.push('vtkHardwareSelector'); // get the source data that is used for generating a selection. This\n // must be called at least once before calling generateSelection. In\n // raster based backends this method will capture the buffers. You can\n // call this once and then make multiple calls to generateSelection.\n\n publicAPI.getSourceDataAsync = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(renderer, fx1, fy1, fx2, fy2) {\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x, _x2, _x3, _x4, _x5) {\n return _ref.apply(this, arguments);\n };\n }();\n\n publicAPI.selectAsync = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(renderer, fx1, fy1, fx2, fy2) {\n var srcData;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return publicAPI.getSourceDataAsync(renderer, fx1, fy1, fx2, fy2);\n\n case 2:\n srcData = _context2.sent;\n\n if (!srcData) {\n _context2.next = 5;\n break;\n }\n\n return _context2.abrupt(\"return\", srcData.generateSelection(fx1, fy1, fx2, fy2));\n\n case 5:\n return _context2.abrupt(\"return\", []);\n\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function (_x6, _x7, _x8, _x9, _x10) {\n return _ref2.apply(this, arguments);\n };\n }();\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n fieldAssociation: FieldAssociations.FIELD_ASSOCIATION_CELLS,\n captureZValues: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['fieldAssociation', 'captureZValues']); // Object methods\n\n vtkHardwareSelector(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkHardwareSelector'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/HardwareSelector/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/ImageMapper/Constants.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/ImageMapper/Constants.js ***! - \*****************************************************************************/ -/*! exports provided: SlicingMode, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SlicingMode\", function() { return SlicingMode; });\nvar SlicingMode = {\n NONE: -1,\n I: 0,\n J: 1,\n K: 2,\n X: 3,\n Y: 4,\n Z: 5\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n SlicingMode: SlicingMode\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/ImageMapper/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/ImageProperty/Constants.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/ImageProperty/Constants.js ***! - \*******************************************************************************/ -/*! exports provided: InterpolationType, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InterpolationType\", function() { return InterpolationType; });\nvar InterpolationType = {\n NEAREST: 0,\n LINEAR: 1\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n InterpolationType: InterpolationType\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/ImageProperty/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/InteractorObserver/index.js": -/*!********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/InteractorObserver/index.js ***! - \********************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_RenderWindowInteractor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/RenderWindowInteractor */ \"./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro,\n VOID = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].VOID; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n//----------------------------------------------------------------------------\n// Description:\n// Transform from world to display coordinates.\n\nfunction computeWorldToDisplay(renderer, x, y, z) {\n var view = renderer.getRenderWindow().getViews()[0];\n return view.worldToDisplay(x, y, z, renderer);\n} //----------------------------------------------------------------------------\n// Description:\n// Transform from display to world coordinates.\n\n\nfunction computeDisplayToWorld(renderer, x, y, z) {\n var view = renderer.getRenderWindow().getViews()[0];\n return view.displayToWorld(x, y, z, renderer);\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n computeWorldToDisplay: computeWorldToDisplay,\n computeDisplayToWorld: computeDisplayToWorld\n}; // ----------------------------------------------------------------------------\n// vtkInteractorObserver methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorObserver(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkInteractorObserver');\n\n var superClass = _objectSpread({}, publicAPI); //----------------------------------------------------------------------------\n\n\n function unsubscribeFromEvents() {\n while (model.subscribedEvents.length) {\n model.subscribedEvents.pop().unsubscribe();\n }\n } //----------------------------------------------------------------------------\n // Check what events we can handle and register callbacks\n\n\n function subscribeToEvents() {\n vtk_js_Sources_Rendering_Core_RenderWindowInteractor__WEBPACK_IMPORTED_MODULE_1__[\"default\"].handledEvents.forEach(function (eventName) {\n if (publicAPI[\"handle\".concat(eventName)]) {\n model.subscribedEvents.push(model.interactor[\"on\".concat(eventName)](function (callData) {\n if (model.processEvents) {\n return publicAPI[\"handle\".concat(eventName)](callData);\n }\n\n return VOID;\n }, model.priority));\n }\n });\n } //----------------------------------------------------------------------------\n // Public API methods\n //----------------------------------------------------------------------------\n\n\n publicAPI.setInteractor = function (i) {\n if (i === model.interactor) {\n return;\n }\n\n unsubscribeFromEvents();\n model.interactor = i;\n\n if (i && model.enabled) {\n subscribeToEvents();\n }\n\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.setEnabled = function (enable) {\n if (enable === model.enabled) {\n return;\n }\n\n unsubscribeFromEvents();\n\n if (enable) {\n if (model.interactor) {\n subscribeToEvents();\n } else {\n vtkErrorMacro(\"\\n The interactor must be set before subscribing to events\\n \");\n }\n }\n\n model.enabled = enable;\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n // Description:\n // Transform from display to world coordinates.\n\n\n publicAPI.computeDisplayToWorld = function (renderer, x, y, z) {\n if (!renderer) {\n return null;\n }\n\n return model.interactor.getView().displayToWorld(x, y, z, renderer);\n }; //----------------------------------------------------------------------------\n // Description:\n // Transform from world to display coordinates.\n\n\n publicAPI.computeWorldToDisplay = function (renderer, x, y, z) {\n if (!renderer) {\n return null;\n }\n\n return model.interactor.getView().worldToDisplay(x, y, z, renderer);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.setPriority = function (priority) {\n var modified = superClass.setPriority(priority);\n\n if (modified && model.interactor) {\n unsubscribeFromEvents();\n subscribeToEvents();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n enabled: true,\n interactor: null,\n priority: 0.0,\n processEvents: true,\n subscribedEvents: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'InteractionEvent');\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'StartInteractionEvent');\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'EndInteractionEvent'); // Create get-only macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['interactor', 'enabled']); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['priority', 'processEvents']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkInteractorObserver(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkInteractorObserver'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/InteractorObserver/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js ***! - \*********************************************************************************/ -/*! exports provided: States, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"States\", function() { return States; });\nvar States = {\n IS_START: 0,\n IS_NONE: 0,\n IS_ROTATE: 1,\n IS_PAN: 2,\n IS_SPIN: 3,\n IS_DOLLY: 4,\n IS_CAMERA_POSE: 11,\n IS_WINDOW_LEVEL: 1024,\n IS_SLICE: 1025\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n States: States\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/index.js ***! - \*****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorObserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorObserver */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorObserver/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\nvar States = vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].States; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n// Add module-level functions or api that you want to expose statically via\n// the next section...\n\nvar stateNames = {\n Rotate: States.IS_ROTATE,\n Pan: States.IS_PAN,\n Spin: States.IS_SPIN,\n Dolly: States.IS_DOLLY,\n CameraPose: States.IS_CAMERA_POSE,\n WindowLevel: States.IS_WINDOW_LEVEL,\n Slice: States.IS_SLICE\n}; // ----------------------------------------------------------------------------\n// vtkInteractorStyle methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyle(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkInteractorStyle'); // Public API methods\n // create bunch of Start/EndState methods\n\n Object.keys(stateNames).forEach(function (key) {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, \"Start\".concat(key, \"Event\"));\n\n publicAPI[\"start\".concat(key)] = function () {\n if (model.state !== States.IS_NONE) {\n return;\n }\n\n model.state = stateNames[key];\n model.interactor.requestAnimation(publicAPI);\n publicAPI.invokeStartInteractionEvent({\n type: 'StartInteractionEvent'\n });\n publicAPI[\"invokeStart\".concat(key, \"Event\")]({\n type: \"Start\".concat(key, \"Event\")\n });\n };\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, \"End\".concat(key, \"Event\"));\n\n publicAPI[\"end\".concat(key)] = function () {\n if (model.state !== stateNames[key]) {\n return;\n }\n\n model.state = States.IS_NONE;\n model.interactor.cancelAnimation(publicAPI);\n publicAPI.invokeEndInteractionEvent({\n type: 'EndInteractionEvent'\n });\n publicAPI[\"invokeEnd\".concat(key, \"Event\")]({\n type: \"End\".concat(key, \"Event\")\n });\n model.interactor.render();\n };\n }); //----------------------------------------------------------------------------\n\n publicAPI.handleKeyPress = function (callData) {\n var rwi = model.interactor;\n var ac = null;\n\n switch (callData.key) {\n case 'r':\n case 'R':\n callData.pokedRenderer.resetCamera();\n rwi.render();\n break;\n\n case 'w':\n case 'W':\n ac = callData.pokedRenderer.getActors();\n ac.forEach(function (anActor) {\n var prop = anActor.getProperty();\n\n if (prop.setRepresentationToWireframe) {\n prop.setRepresentationToWireframe();\n }\n });\n rwi.render();\n break;\n\n case 's':\n case 'S':\n ac = callData.pokedRenderer.getActors();\n ac.forEach(function (anActor) {\n var prop = anActor.getProperty();\n\n if (prop.setRepresentationToSurface) {\n prop.setRepresentationToSurface();\n }\n });\n rwi.render();\n break;\n\n case 'v':\n case 'V':\n ac = callData.pokedRenderer.getActors();\n ac.forEach(function (anActor) {\n var prop = anActor.getProperty();\n\n if (prop.setRepresentationToPoints) {\n prop.setRepresentationToPoints();\n }\n });\n rwi.render();\n break;\n\n default:\n break;\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n state: States.IS_NONE,\n handleObservers: 1,\n autoAdjustCameraClippingRange: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_InteractorObserver__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object specific methods\n\n vtkInteractorStyle(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkInteractorStyle'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Light/index.js": -/*!*******************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Light/index.js ***! - \*******************************************************************/ -/*! exports provided: LIGHT_TYPES, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LIGHT_TYPES\", function() { return LIGHT_TYPES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n // ----------------------------------------------------------------------------\n\nvar LIGHT_TYPES = ['HeadLight', 'CameraLight', 'SceneLight']; // ----------------------------------------------------------------------------\n// vtkLight methods\n// ----------------------------------------------------------------------------\n\nfunction vtkLight(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkLight');\n\n publicAPI.getTransformedPosition = function () {\n if (model.transformMatrix) {\n return []; // FIXME !!!!\n }\n\n return [].concat(model.position);\n };\n\n publicAPI.getTransformedFocalPoint = function () {\n if (model.transformMatrix) {\n return []; // FIXME !!!!\n }\n\n return [].concat(model.focalPoint);\n };\n\n publicAPI.getDirection = function () {\n if (model.directionMTime < model.mtime) {\n model.direction[0] = model.focalPoint[0] - model.position[0];\n model.direction[1] = model.focalPoint[1] - model.position[1];\n model.direction[2] = model.focalPoint[2] - model.position[2];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"normalize\"](model.direction);\n model.directionMTime = model.mtime;\n }\n\n return model.direction;\n };\n\n publicAPI.setDirectionAngle = function (elevation, azimuth) {\n var elevationRadians = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"radiansFromDegrees\"](elevation);\n var azimuthRadians = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"radiansFromDegrees\"](azimuth);\n publicAPI.setPosition(Math.cos(elevationRadians) * Math.sin(azimuthRadians), Math.sin(elevationRadians), Math.cos(elevationRadians) * Math.cos(azimuthRadians));\n publicAPI.setFocalPoint(0, 0, 0);\n publicAPI.setPositional(0);\n };\n\n publicAPI.setLightTypeToHeadLight = function () {\n publicAPI.setLightType('HeadLight');\n };\n\n publicAPI.setLightTypeToCameraLight = function () {\n publicAPI.setLightType('CameraLight');\n };\n\n publicAPI.setLightTypeToSceneLight = function () {\n publicAPI.setTransformMatrix(null);\n publicAPI.setLightType('SceneLight');\n };\n\n publicAPI.lightTypeIsHeadLight = function () {\n return model.lightType === 'HeadLight';\n };\n\n publicAPI.lightTypeIsSceneLight = function () {\n return model.lightType === 'SceneLight';\n };\n\n publicAPI.lightTypeIsCameraLight = function () {\n return model.lightType === 'CameraLight';\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n switch: true,\n intensity: 1,\n color: [1, 1, 1],\n position: [0, 0, 1],\n focalPoint: [0, 0, 0],\n positional: false,\n exponent: 1,\n coneAngle: 30,\n attenuationValues: [1, 0, 0],\n transformMatrix: null,\n lightType: 'SceneLight',\n shadowAttenuation: 1,\n direction: [0, 0, 0],\n directionMTime: 0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['intensity', 'switch', 'positional', 'exponent', 'coneAngle', 'transformMatrix', 'lightType', 'shadowAttenuation']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['color', 'position', 'focalPoint', 'attenuationValues'], 3); // Object methods\n\n vtkLight(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkLight'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n LIGHT_TYPES: LIGHT_TYPES\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Light/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper.js ***! - \***************************************************************************************/ -/*! exports provided: CATEGORIES, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CATEGORIES\", function() { return CATEGORIES; });\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper_Static__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper/Static */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Static.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* eslint-disable arrow-body-style */\n\n\n\nfunction addCoincidentTopologyMethods(publicAPI, model, nameList) {\n nameList.forEach(function (item) {\n publicAPI[\"get\".concat(item.method)] = function () {\n return model[item.key];\n };\n\n publicAPI[\"set\".concat(item.method)] = function (factor, offset) {\n model[item.key] = {\n factor: factor,\n offset: offset\n };\n };\n });\n}\n\nvar CATEGORIES = ['Polygon', 'Line', 'Point']; // CoincidentTopology static methods ------------------------------------------\n\nvar staticOffsetModel = {\n Polygon: {\n factor: 2,\n offset: 0\n },\n Line: {\n factor: 1,\n offset: -1\n },\n Point: {\n factor: 0,\n offset: -2\n }\n};\nvar staticOffsetAPI = {};\naddCoincidentTopologyMethods(staticOffsetAPI, staticOffsetModel, CATEGORIES.map(function (key) {\n return {\n key: key,\n method: \"ResolveCoincidentTopology\".concat(key, \"OffsetParameters\")\n };\n}));\n\nfunction implementCoincidentTopologyMethods(publicAPI, model) {\n if (model.resolveCoincidentTopology === undefined) {\n model.resolveCoincidentTopology = false;\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['resolveCoincidentTopology']); // Relative methods\n\n model.topologyOffset = {\n Polygon: {\n factor: 0,\n offset: 0\n },\n Line: {\n factor: 0,\n offset: 0\n },\n Point: {\n factor: 0,\n offset: 0\n }\n }; // Add Static methods to our instance\n\n Object.keys(vtk_js_Sources_Rendering_Core_Mapper_Static__WEBPACK_IMPORTED_MODULE_0__[\"default\"]).forEach(function (methodName) {\n publicAPI[methodName] = vtk_js_Sources_Rendering_Core_Mapper_Static__WEBPACK_IMPORTED_MODULE_0__[\"default\"][methodName];\n });\n Object.keys(staticOffsetAPI).forEach(function (methodName) {\n publicAPI[methodName] = staticOffsetAPI[methodName];\n });\n addCoincidentTopologyMethods(publicAPI, model.topologyOffset, CATEGORIES.map(function (key) {\n return {\n key: key,\n method: \"RelativeCoincidentTopology\".concat(key, \"OffsetParameters\")\n };\n }));\n\n publicAPI.getCoincidentTopologyPolygonOffsetParameters = function () {\n var globalValue = staticOffsetAPI.getResolveCoincidentTopologyPolygonOffsetParameters();\n var localValue = publicAPI.getRelativeCoincidentTopologyPolygonOffsetParameters();\n return {\n factor: globalValue.factor + localValue.factor,\n offset: globalValue.offset + localValue.offset\n };\n };\n\n publicAPI.getCoincidentTopologyLineOffsetParameters = function () {\n var globalValue = staticOffsetAPI.getResolveCoincidentTopologyLineOffsetParameters();\n var localValue = publicAPI.getRelativeCoincidentTopologyLineOffsetParameters();\n return {\n factor: globalValue.factor + localValue.factor,\n offset: globalValue.offset + localValue.offset\n };\n };\n\n publicAPI.getCoincidentTopologyPointOffsetParameter = function () {\n var globalValue = staticOffsetAPI.getResolveCoincidentTopologyPointOffsetParameters();\n var localValue = publicAPI.getRelativeCoincidentTopologyPointOffsetParameters();\n return {\n factor: globalValue.factor + localValue.factor,\n offset: globalValue.offset + localValue.offset\n };\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n implementCoincidentTopologyMethods: implementCoincidentTopologyMethods,\n staticOffsetAPI: staticOffsetAPI,\n otherStaticMethods: vtk_js_Sources_Rendering_Core_Mapper_Static__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n CATEGORIES: CATEGORIES\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Constants.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Constants.js ***! - \************************************************************************/ -/*! exports provided: ColorMode, ScalarMode, GetArray, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ColorMode\", function() { return ColorMode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ScalarMode\", function() { return ScalarMode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GetArray\", function() { return GetArray; });\nvar ColorMode = {\n DEFAULT: 0,\n MAP_SCALARS: 1,\n DIRECT_SCALARS: 2\n};\nvar ScalarMode = {\n DEFAULT: 0,\n USE_POINT_DATA: 1,\n USE_CELL_DATA: 2,\n USE_POINT_FIELD_DATA: 3,\n USE_CELL_FIELD_DATA: 4,\n USE_FIELD_DATA: 5\n};\nvar GetArray = {\n BY_ID: 0,\n BY_NAME: 1\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ColorMode: ColorMode,\n GetArray: GetArray,\n ScalarMode: ScalarMode\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Static.js": -/*!*********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Static.js ***! - \*********************************************************************/ -/*! exports provided: RESOLVE_COINCIDENT_TOPOLOGY_MODE, getResolveCoincidentTopologyPolygonOffsetFaces, setResolveCoincidentTopologyPolygonOffsetFaces, getResolveCoincidentTopology, setResolveCoincidentTopology, setResolveCoincidentTopologyToDefault, setResolveCoincidentTopologyToOff, setResolveCoincidentTopologyToPolygonOffset, getResolveCoincidentTopologyAsString, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RESOLVE_COINCIDENT_TOPOLOGY_MODE\", function() { return RESOLVE_COINCIDENT_TOPOLOGY_MODE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getResolveCoincidentTopologyPolygonOffsetFaces\", function() { return getResolveCoincidentTopologyPolygonOffsetFaces; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setResolveCoincidentTopologyPolygonOffsetFaces\", function() { return setResolveCoincidentTopologyPolygonOffsetFaces; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getResolveCoincidentTopology\", function() { return getResolveCoincidentTopology; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setResolveCoincidentTopology\", function() { return setResolveCoincidentTopology; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setResolveCoincidentTopologyToDefault\", function() { return setResolveCoincidentTopologyToDefault; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setResolveCoincidentTopologyToOff\", function() { return setResolveCoincidentTopologyToOff; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setResolveCoincidentTopologyToPolygonOffset\", function() { return setResolveCoincidentTopologyToPolygonOffset; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getResolveCoincidentTopologyAsString\", function() { return getResolveCoincidentTopologyAsString; });\nvar resolveCoincidentTopologyPolygonOffsetFaces = 1;\nvar resolveCoincidentTopology = 0;\nvar RESOLVE_COINCIDENT_TOPOLOGY_MODE = ['VTK_RESOLVE_OFF', 'VTK_RESOLVE_POLYGON_OFFSET'];\nfunction getResolveCoincidentTopologyPolygonOffsetFaces() {\n return resolveCoincidentTopologyPolygonOffsetFaces;\n}\nfunction setResolveCoincidentTopologyPolygonOffsetFaces(value) {\n resolveCoincidentTopologyPolygonOffsetFaces = value;\n}\nfunction getResolveCoincidentTopology() {\n return resolveCoincidentTopology;\n}\nfunction setResolveCoincidentTopology() {\n var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n resolveCoincidentTopology = mode;\n}\nfunction setResolveCoincidentTopologyToDefault() {\n setResolveCoincidentTopology(0); // VTK_RESOLVE_OFF\n}\nfunction setResolveCoincidentTopologyToOff() {\n setResolveCoincidentTopology(0); // VTK_RESOLVE_OFF\n}\nfunction setResolveCoincidentTopologyToPolygonOffset() {\n setResolveCoincidentTopology(1); // VTK_RESOLVE_POLYGON_OFFSET\n}\nfunction getResolveCoincidentTopologyAsString() {\n return RESOLVE_COINCIDENT_TOPOLOGY_MODE[resolveCoincidentTopology];\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getResolveCoincidentTopologyAsString: getResolveCoincidentTopologyAsString,\n getResolveCoincidentTopologyPolygonOffsetFaces: getResolveCoincidentTopologyPolygonOffsetFaces,\n getResolveCoincidentTopology: getResolveCoincidentTopology,\n setResolveCoincidentTopology: setResolveCoincidentTopology,\n setResolveCoincidentTopologyPolygonOffsetFaces: setResolveCoincidentTopologyPolygonOffsetFaces,\n setResolveCoincidentTopologyToDefault: setResolveCoincidentTopologyToDefault,\n setResolveCoincidentTopologyToOff: setResolveCoincidentTopologyToOff,\n setResolveCoincidentTopologyToPolygonOffset: setResolveCoincidentTopologyToPolygonOffset\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Static.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js ***! - \********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_AbstractMapper3D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/AbstractMapper3D */ \"./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper3D/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/ImageData */ \"./node_modules/vtk.js/Sources/Common/DataModel/ImageData/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_LookupTable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/LookupTable */ \"./node_modules/vtk.js/Sources/Common/Core/LookupTable/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/ScalarsToColors/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper_CoincidentTopologyHelper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n\n // Need to go inside Constants otherwise dependency loop\n\n\n\nvar staticOffsetAPI = vtk_js_Sources_Rendering_Core_Mapper_CoincidentTopologyHelper__WEBPACK_IMPORTED_MODULE_7__[\"default\"].staticOffsetAPI,\n otherStaticMethods = vtk_js_Sources_Rendering_Core_Mapper_CoincidentTopologyHelper__WEBPACK_IMPORTED_MODULE_7__[\"default\"].otherStaticMethods;\nvar ColorMode = vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__[\"default\"].ColorMode,\n ScalarMode = vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__[\"default\"].ScalarMode,\n GetArray = vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__[\"default\"].GetArray;\nvar VectorMode = vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_6__[\"default\"].VectorMode;\nvar VtkDataTypes = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].VtkDataTypes; // ----------------------------------------------------------------------------\n\nfunction notImplemented(method) {\n return function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro(\"vtkMapper::\".concat(method, \" - NOT IMPLEMENTED\"));\n };\n} // ----------------------------------------------------------------------------\n// vtkMapper methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkMapper');\n\n publicAPI.getBounds = function () {\n var input = publicAPI.getInputData();\n\n if (!input) {\n model.bounds = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_5__[\"createUninitializedBounds\"]();\n } else {\n if (!model.static) {\n publicAPI.update();\n }\n\n model.bounds = input.getBounds();\n }\n\n return model.bounds;\n };\n\n publicAPI.setForceCompileOnly = function (v) {\n model.forceCompileOnly = v; // make sure we do NOT call modified()\n };\n\n publicAPI.createDefaultLookupTable = function () {\n model.lookupTable = vtk_js_Sources_Common_Core_LookupTable__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n };\n\n publicAPI.getColorModeAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(ColorMode, model.colorMode);\n };\n\n publicAPI.setColorModeToDefault = function () {\n return publicAPI.setColorMode(0);\n };\n\n publicAPI.setColorModeToMapScalars = function () {\n return publicAPI.setColorMode(1);\n };\n\n publicAPI.setColorModeToDirectScalars = function () {\n return publicAPI.setColorMode(2);\n };\n\n publicAPI.getScalarModeAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(ScalarMode, model.scalarMode);\n };\n\n publicAPI.setScalarModeToDefault = function () {\n return publicAPI.setScalarMode(0);\n };\n\n publicAPI.setScalarModeToUsePointData = function () {\n return publicAPI.setScalarMode(1);\n };\n\n publicAPI.setScalarModeToUseCellData = function () {\n return publicAPI.setScalarMode(2);\n };\n\n publicAPI.setScalarModeToUsePointFieldData = function () {\n return publicAPI.setScalarMode(3);\n };\n\n publicAPI.setScalarModeToUseCellFieldData = function () {\n return publicAPI.setScalarMode(4);\n };\n\n publicAPI.setScalarModeToUseFieldData = function () {\n return publicAPI.setScalarMode(5);\n };\n\n publicAPI.getAbstractScalars = function (input, scalarMode, arrayAccessMode, arrayId, arrayName) {\n // make sure we have an input\n if (!input || !model.scalarVisibility) {\n return {\n scalars: null,\n cellFLag: false\n };\n }\n\n var scalars = null;\n var cellFlag = false; // get and scalar data according to scalar mode\n\n if (scalarMode === ScalarMode.DEFAULT) {\n scalars = input.getPointData().getScalars();\n\n if (!scalars) {\n scalars = input.getCellData().getScalars();\n cellFlag = true;\n }\n } else if (scalarMode === ScalarMode.USE_POINT_DATA) {\n scalars = input.getPointData().getScalars();\n } else if (scalarMode === ScalarMode.USE_CELL_DATA) {\n scalars = input.getCellData().getScalars();\n cellFlag = true;\n } else if (scalarMode === ScalarMode.USE_POINT_FIELD_DATA) {\n var pd = input.getPointData();\n\n if (arrayAccessMode === GetArray.BY_ID) {\n scalars = pd.getArrayByIndex(arrayId);\n } else {\n scalars = pd.getArrayByName(arrayName);\n }\n } else if (scalarMode === ScalarMode.USE_CELL_FIELD_DATA) {\n var cd = input.getCellData();\n cellFlag = true;\n\n if (arrayAccessMode === GetArray.BY_ID) {\n scalars = cd.getArrayByIndex(arrayId);\n } else {\n scalars = cd.getArrayByName(arrayName);\n }\n } else if (scalarMode === ScalarMode.USE_FIELD_DATA) {\n var fd = input.getFieldData();\n\n if (arrayAccessMode === GetArray.BY_ID) {\n scalars = fd.getArrayByIndex(arrayId);\n } else {\n scalars = fd.getArrayByName(arrayName);\n }\n }\n\n return {\n scalars: scalars,\n cellFlag: cellFlag\n };\n };\n\n publicAPI.mapScalars = function (input, alpha) {\n var scalars = publicAPI.getAbstractScalars(input, model.scalarMode, model.arrayAccessMode, model.arrayId, model.colorByArrayName).scalars;\n\n if (!scalars) {\n model.colorCoordinates = null;\n model.colorTextureMap = null;\n model.colorMapColors = null;\n return;\n } // we want to only recompute when something has changed\n\n\n var toString = \"\".concat(publicAPI.getMTime()).concat(scalars.getMTime()).concat(alpha);\n if (model.colorBuildString === toString) return;\n\n if (!model.useLookupTableScalarRange) {\n publicAPI.getLookupTable().setRange(model.scalarRange[0], model.scalarRange[1]);\n } // Decide between texture color or vertex color.\n // Cell data always uses vertex color.\n // Only point data can use both texture and vertex coloring.\n\n\n if (publicAPI.canUseTextureMapForColoring(input)) {\n publicAPI.mapScalarsToTexture(scalars, alpha);\n } else {\n model.colorCoordinates = null;\n model.colorTextureMap = null;\n var lut = publicAPI.getLookupTable();\n\n if (lut) {\n // Ensure that the lookup table is built\n lut.build();\n model.colorMapColors = lut.mapScalars(scalars, model.colorMode, -1);\n }\n }\n\n model.colorBuildString = \"\".concat(publicAPI.getMTime()).concat(scalars.getMTime()).concat(alpha);\n }; //-----------------------------------------------------------------------------\n\n\n publicAPI.scalarToTextureCoordinate = function (scalarValue, // Input scalar\n rangeMin, // range[0]\n invRangeWidth) {\n // 1/(range[1]-range[0])\n var texCoordS = 0.5; // Scalar value is arbitrary when NaN\n\n var texCoordT = 1.0; // 1.0 in t coordinate means NaN\n\n if (!vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_5__[\"isNan\"](scalarValue)) {\n // 0.0 in t coordinate means not NaN. So why am I setting it to 0.49?\n // Because when you are mapping scalars and you have a NaN adjacent to\n // anything else, the interpolation everywhere should be NaN. Thus, I\n // want the NaN color everywhere except right on the non-NaN neighbors.\n // To simulate this, I set the t coord for the real numbers close to\n // the threshold so that the interpolation almost immediately looks up\n // the NaN value.\n texCoordT = 0.49;\n texCoordS = (scalarValue - rangeMin) * invRangeWidth; // Some implementations apparently don't handle relatively large\n // numbers (compared to the range [0.0, 1.0]) very well. In fact,\n // values above 1122.0f appear to cause texture wrap-around on\n // some systems even when edge clamping is enabled. Why 1122.0f? I\n // don't know. For safety, we'll clamp at +/- 1000. This will\n // result in incorrect images when the texture value should be\n // above or below 1000, but I don't have a better solution.\n\n if (texCoordS > 1000.0) {\n texCoordS = 1000.0;\n } else if (texCoordS < -1000.0) {\n texCoordS = -1000.0;\n }\n }\n\n return {\n texCoordS: texCoordS,\n texCoordT: texCoordT\n };\n }; //-----------------------------------------------------------------------------\n\n\n publicAPI.createColorTextureCoordinates = function (input, output, numScalars, numComps, component, range, tableRange, tableNumberOfColors, useLogScale) {\n // We have to change the range used for computing texture\n // coordinates slightly to accommodate the special above- and\n // below-range colors that are the first and last texels,\n // respectively.\n var scalarTexelWidth = (range[1] - range[0]) / tableNumberOfColors;\n var paddedRange = [];\n paddedRange[0] = range[0] - scalarTexelWidth;\n paddedRange[1] = range[1] + scalarTexelWidth;\n var invRangeWidth = 1.0 / (paddedRange[1] - paddedRange[0]);\n var outputV = output.getData();\n var inputV = input.getData();\n var count = 0;\n var outputCount = 0;\n\n if (component < 0 || component >= numComps) {\n for (var scalarIdx = 0; scalarIdx < numScalars; ++scalarIdx) {\n var sum = 0;\n\n for (var compIdx = 0; compIdx < numComps; ++compIdx) {\n sum += inputV[count] * inputV[count];\n count++;\n }\n\n var magnitude = Math.sqrt(sum);\n\n if (useLogScale) {\n magnitude = vtk_js_Sources_Common_Core_LookupTable__WEBPACK_IMPORTED_MODULE_4__[\"default\"].applyLogScale(magnitude, tableRange, range);\n }\n\n var outputs = publicAPI.scalarToTextureCoordinate(magnitude, paddedRange[0], invRangeWidth);\n outputV[outputCount] = outputs.texCoordS;\n outputV[outputCount + 1] = outputs.texCoordT;\n outputCount += 2;\n }\n } else {\n count += component;\n\n for (var _scalarIdx = 0; _scalarIdx < numScalars; ++_scalarIdx) {\n var inputValue = inputV[count];\n\n if (useLogScale) {\n inputValue = vtk_js_Sources_Common_Core_LookupTable__WEBPACK_IMPORTED_MODULE_4__[\"default\"].applyLogScale(inputValue, tableRange, range);\n }\n\n var _outputs = publicAPI.scalarToTextureCoordinate(inputValue, paddedRange[0], invRangeWidth);\n\n outputV[outputCount] = _outputs.texCoordS;\n outputV[outputCount + 1] = _outputs.texCoordT;\n outputCount += 2;\n count += numComps;\n }\n }\n };\n\n publicAPI.mapScalarsToTexture = function (scalars, alpha) {\n var range = model.lookupTable.getRange();\n var useLogScale = model.lookupTable.usingLogScale();\n\n if (useLogScale) {\n // convert range to log.\n vtk_js_Sources_Common_Core_LookupTable__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getLogRange(range, range);\n }\n\n var origAlpha = model.lookupTable.getAlpha(); // Get rid of vertex color array. Only texture or vertex coloring\n // can be active at one time. The existence of the array is the\n // signal to use that technique.\n\n model.colorMapColors = null; // If the lookup table has changed, then recreate the color texture map.\n // Set a new lookup table changes this->MTime.\n\n if (model.colorTextureMap == null || publicAPI.getMTime() > model.colorTextureMap.getMTime() || model.lookupTable.getMTime() > model.colorTextureMap.getMTime() || model.lookupTable.getAlpha() !== alpha) {\n model.lookupTable.setAlpha(alpha);\n model.colorTextureMap = null; // Get the texture map from the lookup table.\n // Create a dummy ramp of scalars.\n // In the future, we could extend vtkScalarsToColors.\n\n model.lookupTable.build();\n var numberOfColors = model.lookupTable.getNumberOfAvailableColors();\n\n if (numberOfColors > 4094) {\n numberOfColors = 4094;\n }\n\n numberOfColors += 2;\n var k = (range[1] - range[0]) / (numberOfColors - 1 - 2);\n var newArray = new Float64Array(numberOfColors * 2);\n\n for (var i = 0; i < numberOfColors; ++i) {\n newArray[i] = range[0] + i * k - k; // minus k to start at below range color\n\n if (useLogScale) {\n newArray[i] = Math.pow(10.0, newArray[i]);\n }\n } // Dimension on NaN.\n\n\n for (var _i = 0; _i < numberOfColors; ++_i) {\n newArray[_i + numberOfColors] = NaN;\n }\n\n model.colorTextureMap = vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.colorTextureMap.setExtent(0, numberOfColors - 1, 0, 1, 0, 0);\n var tmp = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 1,\n values: newArray\n });\n model.colorTextureMap.getPointData().setScalars(model.lookupTable.mapScalars(tmp, model.colorMode, 0));\n model.lookupTable.setAlpha(origAlpha);\n } // Create new coordinates if necessary.\n // Need to compare lookup table in case the range has changed.\n\n\n if (!model.colorCoordinates || publicAPI.getMTime() > model.colorCoordinates.getMTime() || publicAPI.getInputData(0).getMTime() > model.colorCoordinates.getMTime() || model.lookupTable.getMTime() > model.colorCoordinates.getMTime()) {\n // Get rid of old colors\n model.colorCoordinates = null; // Now create the color texture coordinates.\n\n var numComps = scalars.getNumberOfComponents();\n var num = scalars.getNumberOfTuples(); // const fArray = new FloatArray(num * 2);\n\n model.colorCoordinates = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 2,\n values: new Float32Array(num * 2)\n });\n var scalarComponent = model.lookupTable.getVectorComponent(); // Although I like the feature of applying magnitude to single component\n // scalars, it is not how the old MapScalars for vertex coloring works.\n\n if (model.lookupTable.getVectorMode() === VectorMode.MAGNITUDE && scalars.getNumberOfComponents() > 1) {\n scalarComponent = -1;\n }\n\n publicAPI.createColorTextureCoordinates(scalars, model.colorCoordinates, num, numComps, scalarComponent, range, model.lookupTable.getRange(), model.colorTextureMap.getPointData().getScalars().getNumberOfTuples() / 2 - 2, useLogScale);\n }\n };\n\n publicAPI.getIsOpaque = function () {\n var lut = publicAPI.getLookupTable();\n\n if (lut) {\n // Ensure that the lookup table is built\n lut.build();\n return lut.isOpaque();\n }\n\n return true;\n };\n\n publicAPI.canUseTextureMapForColoring = function (input) {\n if (!model.interpolateScalarsBeforeMapping) {\n return false; // user doesn't want us to use texture maps at all.\n } // index color does not use textures\n\n\n if (model.lookupTable && model.lookupTable.getIndexedLookup()) {\n return false;\n }\n\n var gasResult = publicAPI.getAbstractScalars(input, model.scalarMode, model.arrayAccessMode, model.arrayId, model.colorByArrayName);\n var scalars = gasResult.scalars;\n\n if (!scalars) {\n // no scalars on this dataset, we don't care if texture is used at all.\n return false;\n }\n\n if (gasResult.cellFlag) {\n return false; // cell data colors, don't use textures.\n }\n\n if (model.colorMode === ColorMode.DEFAULT && scalars.getDataType() === VtkDataTypes.UNSIGNED_CHAR || model.colorMode === ColorMode.DIRECT_SCALARS) {\n // Don't use texture is direct coloring using RGB unsigned chars is\n // requested.\n return false;\n }\n\n return true;\n };\n\n publicAPI.clearColorArrays = function () {\n model.colorMapColors = null;\n model.colorCoordinates = null;\n model.colorTextureMap = null;\n };\n\n publicAPI.getLookupTable = function () {\n if (!model.lookupTable) {\n publicAPI.createDefaultLookupTable();\n }\n\n return model.lookupTable;\n };\n\n publicAPI.getMTime = function () {\n var mt = model.mtime;\n\n if (model.lookupTable !== null) {\n var time = model.lookupTable.getMTime();\n mt = time > mt ? time : mt;\n }\n\n return mt;\n };\n\n publicAPI.getPrimitiveCount = function () {\n var input = publicAPI.getInputData();\n var pcount = {\n points: input.getPoints().getNumberOfValues() / 3,\n verts: input.getVerts().getNumberOfValues() - input.getVerts().getNumberOfCells(),\n lines: input.getLines().getNumberOfValues() - 2 * input.getLines().getNumberOfCells(),\n triangles: input.getPolys().getNumberOfValues() - 3 * input.getLines().getNumberOfCells()\n };\n return pcount;\n };\n\n publicAPI.acquireInvertibleLookupTable = notImplemented('AcquireInvertibleLookupTable');\n publicAPI.valueToColor = notImplemented('ValueToColor');\n publicAPI.colorToValue = notImplemented('ColorToValue');\n publicAPI.useInvertibleColorFor = notImplemented('UseInvertibleColorFor');\n publicAPI.clearInvertibleColor = notImplemented('ClearInvertibleColor');\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n colorMapColors: null,\n // Same as this->Colors\n static: false,\n lookupTable: null,\n scalarVisibility: true,\n scalarRange: [0, 1],\n useLookupTableScalarRange: false,\n colorMode: 0,\n scalarMode: 0,\n arrayAccessMode: 1,\n // By_NAME\n renderTime: 0,\n colorByArrayName: null,\n fieldDataTupleId: -1,\n interpolateScalarsBeforeMapping: false,\n colorCoordinates: null,\n colorTextureMap: null,\n forceCompileOnly: 0,\n useInvertibleColors: false,\n invertibleScalars: null,\n viewSpecificProperties: null,\n customShaderAttributes: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_AbstractMapper3D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['colorCoordinates', 'colorMapColors', 'colorTextureMap']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['colorByArrayName', 'arrayAccessMode', 'colorMode', 'fieldDataTupleId', 'interpolateScalarsBeforeMapping', 'lookupTable', 'renderTime', 'scalarMode', 'scalarVisibility', 'static', 'useLookupTableScalarRange', 'viewSpecificProperties', 'customShaderAttributes' // point data array names that will be transferred to the VBO\n ]);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['scalarRange'], 2);\n\n if (!model.viewSpecificProperties) {\n model.viewSpecificProperties = {};\n }\n\n vtk_js_Sources_Rendering_Core_Mapper_CoincidentTopologyHelper__WEBPACK_IMPORTED_MODULE_7__[\"default\"].implementCoincidentTopologyMethods(publicAPI, model); // Object methods\n\n vtkMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread(_objectSpread(_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, staticOffsetAPI), otherStaticMethods), vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Picker/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Picker/index.js ***! - \********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_AbstractPicker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/AbstractPicker */ \"./node_modules/vtk.js/Sources/Rendering/Core/AbstractPicker/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\nvar vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkWarningMacro; // ----------------------------------------------------------------------------\n// vtkPicker methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPicker(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPicker');\n\n var superClass = _objectSpread({}, publicAPI);\n\n function initialize() {\n superClass.initialize();\n model.actors = [];\n model.pickedPositions = [];\n model.mapperPosition[0] = 0.0;\n model.mapperPosition[1] = 0.0;\n model.mapperPosition[2] = 0.0;\n model.mapper = null;\n model.dataSet = null;\n model.globalTMin = Number.MAX_VALUE;\n } // Intersect data with specified ray.\n // Project the center point of the mapper onto the ray and determine its parametric value\n\n\n publicAPI.intersectWithLine = function (p1, p2, tol, mapper) {\n if (!mapper) {\n return Number.MAX_VALUE;\n }\n\n var center = mapper.getCenter();\n var ray = [];\n\n for (var i = 0; i < 3; i++) {\n ray[i] = p2[i] - p1[i];\n }\n\n var rayFactor = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](ray, ray);\n\n if (rayFactor === 0.0) {\n return 2.0;\n } // Project the center point onto the ray and determine its parametric value\n\n\n var t = (ray[0] * (center[0] - p1[0]) + ray[1] * (center[1] - p1[1]) + ray[2] * (center[2] - p1[2])) / rayFactor;\n return t;\n }; // To be overridden in subclasses\n\n\n publicAPI.pick = function (selection, renderer) {\n if (selection.length !== 3) {\n vtkWarningMacro('vtkPicker::pick: selectionPt needs three components');\n }\n\n var selectionX = selection[0];\n var selectionY = selection[1];\n var selectionZ = selection[2];\n var cameraPos = [];\n var cameraFP = [];\n var displayCoords = [];\n var worldCoords = [];\n var ray = [];\n var cameraDOP = [];\n var clipRange = [];\n var tF;\n var tB;\n var p1World = [];\n var p2World = [];\n var viewport = [];\n var winSize = [];\n var x;\n var y;\n var windowLowerLeft = [];\n var windowUpperRight = [];\n var tol = 0.0;\n var props = [];\n var pickable = false;\n var p1Mapper = new Float64Array(4);\n var p2Mapper = new Float64Array(4);\n var bbox = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n var t = [];\n var hitPosition = [];\n var view = renderer.getRenderWindow().getViews()[0];\n initialize();\n model.renderer = renderer;\n model.selectionPoint[0] = selectionX;\n model.selectionPoint[1] = selectionY;\n model.selectionPoint[2] = selectionZ;\n\n if (!renderer) {\n vtkErrorMacro('Picker::Pick Must specify renderer');\n return;\n } // Get camera focal point and position. Convert to display (screen)\n // coordinates. We need a depth value for z-buffer.\n\n\n var camera = renderer.getActiveCamera();\n cameraPos = camera.getPosition();\n cameraFP = camera.getFocalPoint();\n displayCoords = renderer.worldToNormalizedDisplay(cameraFP[0], cameraFP[1], cameraFP[2]);\n displayCoords = view.normalizedDisplayToDisplay(displayCoords[0], displayCoords[1], displayCoords[2]);\n selectionZ = displayCoords[2]; // Convert the selection point into world coordinates.\n\n var normalizedDisplay = view.displayToNormalizedDisplay(selectionX, selectionY, selectionZ);\n var dims = view.getViewportSize(renderer);\n var aspect = dims[0] / dims[1];\n worldCoords = renderer.normalizedDisplayToWorld(normalizedDisplay[0], normalizedDisplay[1], normalizedDisplay[2], aspect);\n\n for (var i = 0; i < 3; i++) {\n model.pickPosition[i] = worldCoords[i];\n } // Compute the ray endpoints. The ray is along the line running from\n // the camera position to the selection point, starting where this line\n // intersects the front clipping plane, and terminating where this\n // line intersects the back clipping plane.\n\n\n for (var _i = 0; _i < 3; _i++) {\n ray[_i] = model.pickPosition[_i] - cameraPos[_i];\n }\n\n for (var _i2 = 0; _i2 < 3; _i2++) {\n cameraDOP[_i2] = cameraFP[_i2] - cameraPos[_i2];\n }\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"normalize\"](cameraDOP);\n var rayLength = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](cameraDOP, ray);\n\n if (rayLength === 0.0) {\n vtkWarningMacro('Picker::Pick Cannot process points');\n return;\n }\n\n clipRange = camera.getClippingRange();\n\n if (camera.getParallelProjection()) {\n tF = clipRange[0] - rayLength;\n tB = clipRange[1] - rayLength;\n\n for (var _i3 = 0; _i3 < 3; _i3++) {\n p1World[_i3] = model.pickPosition[_i3] + tF * cameraDOP[_i3];\n p2World[_i3] = model.pickPosition[_i3] + tB * cameraDOP[_i3];\n }\n } else {\n tF = clipRange[0] / rayLength;\n tB = clipRange[1] / rayLength;\n\n for (var _i4 = 0; _i4 < 3; _i4++) {\n p1World[_i4] = cameraPos[_i4] + tF * ray[_i4];\n p2World[_i4] = cameraPos[_i4] + tB * ray[_i4];\n }\n }\n\n p1World[3] = 1.0;\n p2World[3] = 1.0; // Compute the tolerance in world coordinates. Do this by\n // determining the world coordinates of the diagonal points of the\n // window, computing the width of the window in world coordinates, and\n // multiplying by the tolerance.\n\n viewport = renderer.getViewport();\n\n if (renderer.getRenderWindow()) {\n winSize = renderer.getRenderWindow().getViews()[0].getSize();\n }\n\n x = winSize[0] * viewport[0];\n y = winSize[1] * viewport[1];\n var normalizedLeftDisplay = view.displayToNormalizedDisplay(x, y, selectionZ);\n windowLowerLeft = renderer.normalizedDisplayToWorld(normalizedLeftDisplay[0], normalizedLeftDisplay[1], normalizedLeftDisplay[2], aspect);\n x = winSize[0] * viewport[2];\n y = winSize[1] * viewport[3];\n var normalizedRightDisplay = view.displayToNormalizedDisplay(x, y, selectionZ);\n windowUpperRight = renderer.normalizedDisplayToWorld(normalizedRightDisplay[0], normalizedRightDisplay[1], normalizedRightDisplay[2], aspect);\n\n for (var _i5 = 0; _i5 < 3; _i5++) {\n tol += (windowUpperRight[_i5] - windowLowerLeft[_i5]) * (windowUpperRight[_i5] - windowLowerLeft[_i5]);\n }\n\n tol = Math.sqrt(tol) * model.tolerance;\n\n if (model.pickFromList) {\n props = model.pickList;\n } else {\n props = renderer.getActors();\n }\n\n var scale = [];\n props.forEach(function (prop) {\n var mapper = prop.getMapper();\n pickable = prop.getPickable() && prop.getVisibility();\n\n if (prop.getProperty().getOpacity() <= 0.0) {\n pickable = false;\n }\n\n if (pickable) {\n model.transformMatrix = prop.getMatrix().slice(0); // Webgl need a transpose matrix but we need the untransposed one to project world points\n // into the right referential\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_4__[\"mat4\"].transpose(model.transformMatrix, model.transformMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_4__[\"mat4\"].invert(model.transformMatrix, model.transformMatrix); // Extract scale\n\n var col1 = [model.transformMatrix[0], model.transformMatrix[1], model.transformMatrix[2]];\n var col2 = [model.transformMatrix[4], model.transformMatrix[5], model.transformMatrix[6]];\n var col3 = [model.transformMatrix[8], model.transformMatrix[9], model.transformMatrix[10]];\n scale[0] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"norm\"](col1);\n scale[1] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"norm\"](col2);\n scale[2] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"norm\"](col3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_4__[\"vec4\"].transformMat4(p1Mapper, p1World, model.transformMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_4__[\"vec4\"].transformMat4(p2Mapper, p2World, model.transformMatrix);\n p1Mapper[0] /= p1Mapper[3];\n p1Mapper[1] /= p1Mapper[3];\n p1Mapper[2] /= p1Mapper[3];\n p2Mapper[0] /= p2Mapper[3];\n p2Mapper[1] /= p2Mapper[3];\n p2Mapper[2] /= p2Mapper[3];\n\n for (var _i6 = 0; _i6 < 3; _i6++) {\n ray[_i6] = p2Mapper[_i6] - p1Mapper[_i6];\n }\n\n if (mapper) {\n bbox.setBounds(mapper.getBounds());\n bbox.inflate(tol);\n } else {\n bbox.reset();\n }\n\n if (bbox.intersectBox(p1Mapper, ray, hitPosition, t)) {\n t[0] = publicAPI.intersectWithLine(p1Mapper, p2Mapper, tol * 0.333 * (scale[0] + scale[1] + scale[2]), mapper);\n\n if (t[0] < Number.MAX_VALUE) {\n var p = [];\n p[0] = (1.0 - t[0]) * p1World[0] + t[0] * p2World[0];\n p[1] = (1.0 - t[0]) * p1World[1] + t[0] * p2World[1];\n p[2] = (1.0 - t[0]) * p1World[2] + t[0] * p2World[2]; // Check if the current actor is already in the list\n\n var actorID = -1;\n\n for (var _i7 = 0; _i7 < model.actors.length; _i7++) {\n if (model.actors[_i7] === prop) {\n actorID = _i7;\n break;\n }\n }\n\n if (actorID === -1) {\n model.actors.push(prop);\n model.pickedPositions.push(p);\n } else {\n var oldPoint = model.pickedPositions[actorID];\n var distOld = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"distance2BetweenPoints\"](p1World, oldPoint);\n var distCurrent = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"distance2BetweenPoints\"](p1World, p);\n\n if (distCurrent < distOld) {\n model.pickedPositions[actorID] = p;\n }\n }\n }\n }\n }\n\n publicAPI.invokePickChange(model.pickedPositions);\n return 1;\n });\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n tolerance: 0.025,\n mapperPosition: [0.0, 0.0, 0.0],\n mapper: null,\n dataSet: null,\n actors: [],\n pickedPositions: [],\n transformMatrix: null,\n globalTMin: Number.MAX_VALUE\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_AbstractPicker__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['tolerance']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['mapperPosition'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['mapper', 'dataSet', 'actors', 'pickedPositions']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'pickChange');\n vtkPicker(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPicker'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Picker/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.js ***! - \**************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkPixelSpaceCallbackMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPixelSpaceCallbackMapper(publicAPI, model) {\n model.classHierarchy.push('vtkPixelSpaceCallbackMapper');\n\n if (!model.callback) {\n model.callback = function () {};\n }\n\n publicAPI.invokeCallback = function (dataset, camera, aspect, windowSize, depthValues) {\n if (!model.callback) {\n return;\n }\n\n var matrix = camera.getCompositeProjectionMatrix(aspect, -1, 1);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(matrix, matrix);\n var dataPoints = dataset.getPoints();\n var result = new Float64Array(3);\n var width = windowSize.usize;\n var height = windowSize.vsize;\n var hw = width / 2;\n var hh = height / 2;\n var coords = [];\n\n for (var pidx = 0; pidx < dataPoints.getNumberOfPoints(); pidx += 1) {\n var point = dataPoints.getPoint(pidx);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(result, point, matrix);\n var coord = [result[0] * hw + hw, result[1] * hh + hh, result[2], 0];\n\n if (depthValues) {\n var linIdx = Math.floor(coord[1]) * width + Math.floor(coord[0]);\n var idx = linIdx * 4;\n var r = depthValues[idx] / 255;\n var g = depthValues[idx + 1] / 255;\n var z = (r * 256 + g) / 257;\n coord[3] = z * 2 - 1;\n }\n\n coords.push(coord);\n }\n\n model.callback(coords, camera, aspect, depthValues, [width, height]);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n callback: null,\n useZValues: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['callback', 'useZValues']); // Object methods\n\n vtkPixelSpaceCallbackMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkPixelSpaceCallbackMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/PointPicker/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/PointPicker/index.js ***! - \*************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Picker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Picker */ \"./node_modules/vtk.js/Sources/Rendering/Core/Picker/index.js\");\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkPointPicker methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPointPicker(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPointPicker');\n\n publicAPI.intersectWithLine = function (p1, p2, tol, mapper) {\n var tMin = Number.MAX_VALUE;\n\n if (mapper.isA('vtkImageMapper')) {\n var pickData = mapper.intersectWithLineForPointPicking(p1, p2);\n\n if (pickData) {\n tMin = pickData.t;\n model.pointIJK = pickData.ijk;\n }\n } else if (mapper.isA('vtkMapper')) {\n tMin = publicAPI.intersectActorWithLine(p1, p2, tol, mapper);\n }\n\n return tMin;\n };\n\n publicAPI.intersectActorWithLine = function (p1, p2, tol, mapper) {\n // Get dataset\n var input = mapper.getInputData(); // Determine appropriate info\n\n var ptId = 0;\n var numPts = input.getPoints().getNumberOfPoints();\n\n if (numPts <= ptId) {\n return 2.0;\n }\n\n var ray = [];\n\n for (var i = 0; i < 3; i++) {\n ray[i] = p2[i] - p1[i];\n }\n\n var rayFactor = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"dot\"](ray, ray);\n\n if (rayFactor === 0.0) {\n vtkErrorMacro('Cannot process points');\n return 2.0;\n }\n\n var t;\n var minPtId = -1;\n var tMin = Number.MAX_VALUE;\n var minPtDist = Number.MAX_VALUE;\n var projXYZ = [];\n var minXYZ = [];\n var x = [];\n var points = input.getPoints();\n\n if (model.useCells) {\n var cellData = input.getPolys().getData();\n var nbPointsPerCell = cellData[0];\n var nbCells = input.getPolys().getNumberOfCells();\n\n for (var cellID = 0; cellID < nbCells; cellID++) {\n var firstPointIndex = cellID * nbPointsPerCell + 1;\n var lastPointIndex = firstPointIndex + nbPointsPerCell;\n\n for (var pointIndex = firstPointIndex; pointIndex < lastPointIndex; pointIndex++) {\n var pointDataIndex = cellData[pointIndex];\n points.getPoint(pointDataIndex, x);\n t = (ray[0] * (x[0] - p1[0]) + ray[1] * (x[1] - p1[1]) + ray[2] * (x[2] - p1[2])) / rayFactor; // If we find a point closer than we currently have, see whether it\n // lies within the pick tolerance and clipping planes. We keep track\n // of the point closest to the line (use a fudge factor for points\n // nearly the same distance away.)\n\n if (t >= 0.0 && t <= 1.0 && t <= tMin + model.tolerance) {\n var maxDist = 0.0;\n\n for (var _i = 0; _i < 3; _i++) {\n projXYZ[_i] = p1[_i] + t * ray[_i];\n var dist = Math.abs(x[_i] - projXYZ[_i]);\n\n if (dist > maxDist) {\n maxDist = dist;\n }\n } // end for i\n\n\n if (maxDist <= tol && maxDist < minPtDist) {\n // within tolerance\n minPtId = ptId;\n minXYZ[0] = x[0];\n minXYZ[1] = x[1];\n minXYZ[2] = x[2];\n minPtDist = maxDist;\n tMin = t;\n }\n }\n } // end for pointIndex\n\n } // end for cellID\n\n } else {\n // end if model.useCells\n for (ptId = 0; ptId < numPts; ptId++) {\n points.getPoint(ptId, x);\n t = (ray[0] * (x[0] - p1[0]) + ray[1] * (x[1] - p1[1]) + ray[2] * (x[2] - p1[2])) / rayFactor; // If we find a point closer than we currently have, see whether it\n // lies within the pick tolerance and clipping planes. We keep track\n // of the point closest to the line (use a fudge factor for points\n // nearly the same distance away.)\n\n if (t >= 0.0 && t <= 1.0 && t <= tMin + model.tolerance) {\n var _maxDist = 0.0;\n\n for (var _i2 = 0; _i2 < 3; _i2++) {\n projXYZ[_i2] = p1[_i2] + t * ray[_i2];\n\n var _dist = Math.abs(x[_i2] - projXYZ[_i2]);\n\n if (_dist > _maxDist) {\n _maxDist = _dist;\n }\n } // end for i\n\n\n if (_maxDist <= tol && _maxDist < minPtDist) {\n // within tolerance\n minPtId = ptId;\n minXYZ[0] = x[0];\n minXYZ[1] = x[1];\n minXYZ[2] = x[2];\n minPtDist = _maxDist;\n tMin = t;\n }\n }\n }\n }\n\n model.pointId = minPtId;\n return tMin;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n pointId: -1,\n pointIJK: [],\n useCells: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Picker__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['pointIJK']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['pointId']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['useCells']);\n vtkPointPicker(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPointPicker'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/PointPicker/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Prop/index.js": -/*!******************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Prop/index.js ***! - \******************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\n\nfunction notImplemented(method) {\n return function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro(\"vtkProp::\".concat(method, \" - NOT IMPLEMENTED\"));\n };\n} // ----------------------------------------------------------------------------\n// vtkProp methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkProp(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkProp');\n\n publicAPI.getMTime = function () {\n var m1 = model.mtime;\n\n for (var index = 0; index < model.textures.length; ++index) {\n var m2 = model.textures[index].getMTime();\n\n if (m2 > m1) {\n m1 = m2;\n }\n }\n\n return m1;\n };\n\n publicAPI.getNestedProps = function () {\n return null;\n };\n\n publicAPI.getActors = function () {\n return [];\n };\n\n publicAPI.getActors2D = function () {\n return [];\n };\n\n publicAPI.getVolumes = function () {\n return [];\n };\n\n publicAPI.pick = notImplemented('pick');\n publicAPI.hasKey = notImplemented('hasKey');\n\n publicAPI.getRedrawMTime = function () {\n return model.mtime;\n };\n\n publicAPI.setEstimatedRenderTime = function (t) {\n model.estimatedRenderTime = t;\n model.savedEstimatedRenderTime = t;\n };\n\n publicAPI.restoreEstimatedRenderTime = function () {\n model.estimatedRenderTime = model.savedEstimatedRenderTime;\n };\n\n publicAPI.addEstimatedRenderTime = function (t) {\n model.estimatedRenderTime += t;\n };\n\n publicAPI.setAllocatedRenderTime = function (t) {\n model.allocatedRenderTime = t;\n model.savedEstimatedRenderTime = model.estimatedRenderTime;\n model.estimatedRenderTime = 0;\n };\n\n publicAPI.getSupportsSelection = function () {\n return false;\n };\n\n publicAPI.getTextures = function () {\n return model.textures;\n };\n\n publicAPI.hasTexture = function (texture) {\n return model.textures.indexOf(texture) !== -1;\n };\n\n publicAPI.addTexture = function (texture) {\n if (texture && !publicAPI.hasTexture(texture)) {\n model.textures = model.textures.concat(texture);\n publicAPI.modified();\n }\n };\n\n publicAPI.removeTexture = function (texture) {\n var newTextureList = model.textures.filter(function (item) {\n return item !== texture;\n });\n\n if (model.textures.length !== newTextureList.length) {\n model.textures = newTextureList;\n publicAPI.modified();\n }\n };\n\n publicAPI.removeAllTextures = function () {\n model.textures = [];\n publicAPI.modified();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n visibility: true,\n pickable: true,\n dragable: true,\n useBounds: true,\n allocatedRenderTime: 10,\n estimatedRenderTime: 0,\n savedEstimatedRenderTime: 0,\n renderTimeMultiplier: 1,\n paths: null,\n textures: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['estimatedRenderTime', 'allocatedRenderTime']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['visibility', 'pickable', 'dragable', 'useBounds', 'renderTimeMultiplier']); // Object methods\n\n vtkProp(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkProp'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Prop/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Prop3D/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Prop3D/index.js ***! - \********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Prop__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Prop */ \"./node_modules/vtk.js/Sources/Rendering/Core/Prop/index.js\");\n\n\n\n\n // ----------------------------------------------------------------------------\n// vtkProp3D methods\n// ----------------------------------------------------------------------------\n\nfunction vtkProp3D(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkProp3D');\n\n publicAPI.addPosition = function (deltaXYZ) {\n model.position = model.position.map(function (value, index) {\n return value + deltaXYZ[index];\n });\n publicAPI.modified();\n };\n\n publicAPI.getOrientationWXYZ = function () {\n var q = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].getRotation(q, model.rotation);\n var oaxis = new Float64Array(3);\n var w = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].getAxisAngle(oaxis, q);\n return [vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"degreesFromRadians\"](w), oaxis[0], oaxis[1], oaxis[2]];\n };\n\n publicAPI.rotateX = function (val) {\n if (val === 0.0) {\n return;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateX(model.rotation, model.rotation, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"radiansFromDegrees\"](val));\n publicAPI.modified();\n };\n\n publicAPI.rotateY = function (val) {\n if (val === 0.0) {\n return;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateY(model.rotation, model.rotation, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"radiansFromDegrees\"](val));\n publicAPI.modified();\n };\n\n publicAPI.rotateZ = function (val) {\n if (val === 0.0) {\n return;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateZ(model.rotation, model.rotation, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"radiansFromDegrees\"](val));\n publicAPI.modified();\n };\n\n publicAPI.rotateWXYZ = function (degrees, x, y, z) {\n if (degrees === 0.0 || x === 0.0 && y === 0.0 && z === 0.0) {\n return;\n } // convert to radians\n\n\n var angle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"radiansFromDegrees\"](degrees);\n var q = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].setAxisAngle(q, [x, y, z], angle);\n var quatMat = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].fromQuat(quatMat, q);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.rotation, model.rotation, quatMat);\n publicAPI.modified();\n };\n\n publicAPI.setOrientation = function (x, y, z) {\n if (x === model.orientation[0] && y === model.orientation[1] && z === model.orientation[2]) {\n return false;\n }\n\n model.orientation = [x, y, z];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(model.rotation);\n publicAPI.rotateZ(z);\n publicAPI.rotateX(x);\n publicAPI.rotateY(y);\n publicAPI.modified();\n return true;\n };\n\n publicAPI.setUserMatrix = function (matrix) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.userMatrix, matrix);\n publicAPI.modified();\n };\n\n publicAPI.getMatrix = function () {\n publicAPI.computeMatrix();\n return model.matrix;\n };\n\n publicAPI.computeMatrix = function () {\n // check whether or not need to rebuild the matrix\n if (publicAPI.getMTime() > model.matrixMTime.getMTime()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(model.matrix);\n\n if (model.userMatrix) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.matrix, model.matrix, model.userMatrix);\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.matrix, model.matrix, model.origin);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.matrix, model.matrix, model.position);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.matrix, model.matrix, model.rotation);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].scale(model.matrix, model.matrix, model.scale);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.matrix, model.matrix, [-model.origin[0], -model.origin[1], -model.origin[2]]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.matrix, model.matrix); // check for identity\n\n model.isIdentity = true;\n\n for (var i = 0; i < 4; ++i) {\n for (var j = 0; j < 4; ++j) {\n if ((i === j ? 1.0 : 0.0) !== model.matrix[i + j * 4]) {\n model.isIdentity = false;\n }\n }\n }\n\n model.matrixMTime.modified();\n }\n };\n\n publicAPI.getCenter = function () {\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getCenter(model.bounds);\n };\n\n publicAPI.getLength = function () {\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getLength(model.bounds);\n };\n\n publicAPI.getXRange = function () {\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getXRange(model.bounds);\n };\n\n publicAPI.getYRange = function () {\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getYRange(model.bounds);\n };\n\n publicAPI.getZRange = function () {\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getZRange(model.bounds);\n };\n\n publicAPI.getUserMatrix = function () {\n return model.userMatrix;\n };\n\n function updateIdentityFlag() {\n publicAPI.computeMatrix();\n }\n\n publicAPI.onModified(updateIdentityFlag);\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n origin: [0, 0, 0],\n position: [0, 0, 0],\n orientation: [0, 0, 0],\n rotation: null,\n scale: [1, 1, 1],\n bounds: [1, -1, 1, -1, 1, -1],\n userMatrix: null,\n userMatrixMTime: null,\n cachedProp3D: null,\n isIdentity: true,\n matrixMTime: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Prop__WEBPACK_IMPORTED_MODULE_4__[\"default\"].extend(publicAPI, model, initialValues);\n model.matrixMTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(model.matrixMTime); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get(publicAPI, model, ['bounds', 'isIdentity']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getArray(publicAPI, model, ['orientation']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGetArray(publicAPI, model, ['origin', 'position', 'scale'], 3); // Object internal instance\n\n model.matrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.rotation = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.userMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.transform = null; // FIXME\n // Object methods\n\n vtkProp3D(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkProp3D'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Prop3D/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js ***! - \**************************************************************************/ -/*! exports provided: Shading, Representation, Interpolation, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Shading\", function() { return Shading; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Representation\", function() { return Representation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Interpolation\", function() { return Interpolation; });\nvar Shading = {\n FLAT: 0,\n GOURAUD: 1,\n PHONG: 2\n};\nvar Representation = {\n POINTS: 0,\n WIREFRAME: 1,\n SURFACE: 2\n};\nvar Interpolation = Shading;\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n Shading: Shading,\n Representation: Representation,\n Interpolation: Interpolation\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar Representation = vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Representation,\n Interpolation = vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Interpolation;\n\nfunction notImplemented(method) {\n return function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro(\"vtkProperty::\".concat(method, \" - NOT IMPLEMENTED\"));\n };\n} // ----------------------------------------------------------------------------\n// vtkProperty methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkProperty(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkProperty');\n\n publicAPI.setColor = function (r, g, b) {\n if (Array.isArray(r)) {\n if (model.color[0] !== r[0] || model.color[1] !== r[1] || model.color[2] !== r[2]) {\n model.color[0] = r[0];\n model.color[1] = r[1];\n model.color[2] = r[2];\n publicAPI.modified();\n }\n } else if (model.color[0] !== r || model.color[1] !== g || model.color[2] !== b) {\n model.color[0] = r;\n model.color[1] = g;\n model.color[2] = b;\n publicAPI.modified();\n }\n\n publicAPI.setDiffuseColor(model.color);\n publicAPI.setAmbientColor(model.color);\n publicAPI.setSpecularColor(model.color);\n };\n\n publicAPI.computeCompositeColor = notImplemented('ComputeCompositeColor');\n\n publicAPI.getColor = function () {\n // Inline computeCompositeColor\n var norm = 0.0;\n\n if (model.ambient + model.diffuse + model.specular > 0) {\n norm = 1.0 / (model.ambient + model.diffuse + model.specular);\n }\n\n for (var i = 0; i < 3; i++) {\n model.color[i] = norm * (model.ambient * model.ambientColor[i] + model.diffuse * model.diffuseColor[i] + model.specular * model.specularColor[i]);\n }\n\n return [].concat(model.color);\n };\n\n publicAPI.addShaderVariable = notImplemented('AddShaderVariable');\n\n publicAPI.setInterpolationToFlat = function () {\n return publicAPI.setInterpolation(Interpolation.FLAT);\n };\n\n publicAPI.setInterpolationToGouraud = function () {\n return publicAPI.setInterpolation(Interpolation.GOURAUD);\n };\n\n publicAPI.setInterpolationToPhong = function () {\n return publicAPI.setInterpolation(Interpolation.PHONG);\n };\n\n publicAPI.getInterpolationAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(Interpolation, model.interpolation);\n };\n\n publicAPI.setRepresentationToWireframe = function () {\n return publicAPI.setRepresentation(Representation.WIREFRAME);\n };\n\n publicAPI.setRepresentationToSurface = function () {\n return publicAPI.setRepresentation(Representation.SURFACE);\n };\n\n publicAPI.setRepresentationToPoints = function () {\n return publicAPI.setRepresentation(Representation.POINTS);\n };\n\n publicAPI.getRepresentationAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(Representation, model.representation);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n color: [1, 1, 1],\n ambientColor: [1, 1, 1],\n diffuseColor: [1, 1, 1],\n specularColor: [1, 1, 1],\n edgeColor: [0, 0, 0],\n ambient: 0,\n diffuse: 1,\n specular: 0,\n specularPower: 1,\n opacity: 1,\n interpolation: Interpolation.GOURAUD,\n representation: Representation.SURFACE,\n edgeVisibility: false,\n backfaceCulling: false,\n frontfaceCulling: false,\n pointSize: 1,\n lineWidth: 1,\n lighting: true,\n shading: false,\n materialName: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['lighting', 'interpolation', 'ambient', 'diffuse', 'specular', 'specularPower', 'opacity', 'edgeVisibility', 'lineWidth', 'pointSize', 'backfaceCulling', 'frontfaceCulling', 'representation']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['ambientColor', 'specularColor', 'diffuseColor', 'edgeColor'], 3); // Object methods\n\n vtkProperty(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkProperty'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/RenderWindow/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/RenderWindow/index.js ***! - \**************************************************************************/ -/*! exports provided: registerViewConstructor, listViewAPIs, newAPISpecificView, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerViewConstructor\", function() { return registerViewConstructor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"listViewAPIs\", function() { return listViewAPIs; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newAPISpecificView\", function() { return newAPISpecificView; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VIEW_API = navigator.gpu ? 'WebGPU' : 'WebGL';\nvar VIEW_CONSTRUCTORS = Object.create(null); // ----------------------------------------------------------------------------\n// static methods\n// ----------------------------------------------------------------------------\n\nfunction registerViewConstructor(name, constructor) {\n VIEW_CONSTRUCTORS[name] = constructor;\n}\nfunction listViewAPIs() {\n return Object.keys(VIEW_CONSTRUCTORS);\n}\nfunction newAPISpecificView(name) {\n var initialValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return VIEW_CONSTRUCTORS[name] && VIEW_CONSTRUCTORS[name](initialValues);\n} // ----------------------------------------------------------------------------\n// vtkRenderWindow methods\n// ----------------------------------------------------------------------------\n\nfunction vtkRenderWindow(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkRenderWindow'); // Add renderer\n\n publicAPI.addRenderer = function (renderer) {\n if (publicAPI.hasRenderer(renderer)) {\n return;\n }\n\n renderer.setRenderWindow(publicAPI);\n model.renderers.push(renderer); // for (this->Renderers->InitTraversal(rsit);\n // (aren = this->Renderers->GetNextRenderer(rsit)); )\n // {\n // aren->SetAllocatedRenderTime\n // (1.0/(this->DesiredUpdateRate*this->Renderers->GetNumberOfItems()));\n // }\n\n publicAPI.modified();\n }; // Remove renderer\n\n\n publicAPI.removeRenderer = function (renderer) {\n model.renderers = model.renderers.filter(function (r) {\n return r !== renderer;\n });\n publicAPI.modified();\n };\n\n publicAPI.hasRenderer = function (ren) {\n return model.renderers.indexOf(ren) !== -1;\n }; // get an API specific view of this data\n\n\n publicAPI.newAPISpecificView = function (name) {\n var initialValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return newAPISpecificView(name || model.defaultViewAPI, initialValues);\n }; // Add renderer\n\n\n publicAPI.addView = function (view) {\n if (publicAPI.hasView(view)) {\n return;\n }\n\n view.setRenderable(publicAPI);\n model.views.push(view);\n publicAPI.modified();\n }; // Remove renderer\n\n\n publicAPI.removeView = function (view) {\n model.views = model.views.filter(function (r) {\n return r !== view;\n });\n publicAPI.modified();\n };\n\n publicAPI.hasView = function (view) {\n return model.views.indexOf(view) !== -1;\n };\n\n publicAPI.render = function () {\n if (model.interactor) {\n model.interactor.render();\n } else {\n model.views.forEach(function (view) {\n return view.traverseAllPasses();\n });\n }\n };\n\n publicAPI.getStatistics = function () {\n var results = {\n propCount: 0,\n invisiblePropCount: 0\n };\n model.renderers.forEach(function (ren) {\n var props = ren.getViewProps();\n props.forEach(function (prop) {\n if (prop.getVisibility()) {\n results.propCount += 1;\n var mpr = prop.getMapper && prop.getMapper();\n\n if (mpr && mpr.getPrimitiveCount) {\n var pcount = mpr.getPrimitiveCount();\n Object.keys(pcount).forEach(function (keyName) {\n if (!results[keyName]) {\n results[keyName] = 0;\n }\n\n results[keyName] += pcount[keyName];\n });\n }\n } else {\n results.invisiblePropCount += 1;\n }\n });\n });\n results.str = Object.keys(results).map(function (keyName) {\n return \"\".concat(keyName, \": \").concat(results[keyName]);\n }).join('\\n');\n return results;\n };\n\n publicAPI.captureImages = function () {\n var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'image/png';\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setImmediate(publicAPI.render);\n return model.views.map(function (view) {\n return view.captureNextImage ? view.captureNextImage(format, opts) : undefined;\n }).filter(function (i) {\n return !!i;\n });\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n defaultViewAPI: DEFAULT_VIEW_API,\n renderers: [],\n views: [],\n interactor: null,\n neverRendered: true,\n numberOfLayers: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['interactor', 'numberOfLayers', 'views', 'defaultViewAPI']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['neverRendered']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['renderers']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'completion'); // Object methods\n\n vtkRenderWindow(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkRenderWindow'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n registerViewConstructor: registerViewConstructor,\n listViewAPIs: listViewAPIs,\n newAPISpecificView: newAPISpecificView\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/RenderWindow/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants.js ***! - \****************************************************************************************/ -/*! exports provided: Device, Input, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Device\", function() { return Device; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Input\", function() { return Input; });\nvar Device = {\n Unknown: 0,\n LeftController: 1,\n RightController: 2\n};\nvar Input = {\n Unknown: 0,\n Trigger: 1,\n TrackPad: 2,\n Grip: 3,\n ApplicationMenu: 4\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n Device: Device,\n Input: Input\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/index.js": -/*!************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/index.js ***! - \************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\nvar Device = vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Device,\n Input = vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Input;\nvar vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkWarningMacro,\n vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro,\n normalizeWheel = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].normalizeWheel,\n vtkOnceErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkOnceErrorMacro; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nvar deviceInputMap = {\n 'OpenVR Gamepad': [Input.TrackPad, Input.Trigger, Input.Grip, Input.ApplicationMenu]\n};\nvar handledEvents = ['StartAnimation', 'Animation', 'EndAnimation', 'MouseEnter', 'MouseLeave', 'StartMouseMove', 'MouseMove', 'EndMouseMove', 'LeftButtonPress', 'LeftButtonRelease', 'MiddleButtonPress', 'MiddleButtonRelease', 'RightButtonPress', 'RightButtonRelease', 'KeyPress', 'KeyDown', 'KeyUp', 'StartMouseWheel', 'MouseWheel', 'EndMouseWheel', 'StartPinch', 'Pinch', 'EndPinch', 'StartPan', 'Pan', 'EndPan', 'StartRotate', 'Rotate', 'EndRotate', 'Button3D', 'Move3D', 'StartPointerLock', 'EndPointerLock', 'StartInteraction', 'Interaction', 'EndInteraction'];\n\nfunction preventDefault(event) {\n event.stopPropagation();\n event.preventDefault();\n return false;\n} // ----------------------------------------------------------------------------\n// vtkRenderWindowInteractor methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkRenderWindowInteractor(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkRenderWindowInteractor'); // Initialize list of requesters\n\n var animationRequesters = new Set(); // track active event listeners to handle simultaneous button tracking\n\n var activeListenerCount = 0; // Public API methods\n //----------------------------------------------------------------------\n\n publicAPI.start = function () {\n // Let the compositing handle the event loop if it wants to.\n // if (publicAPI.HasObserver(vtkCommand::StartEvent) && !publicAPI.HandleEventLoop) {\n // publicAPI.invokeEvent({ type: 'StartEvent' });\n // return;\n // }\n // As a convenience, initialize if we aren't initialized yet.\n if (!model.initialized) {\n publicAPI.initialize();\n\n if (!model.initialized) {\n return;\n }\n } // Pass execution to the subclass which will run the event loop,\n // this will not return until TerminateApp is called.\n\n\n publicAPI.startEventLoop();\n }; //----------------------------------------------------------------------\n\n\n publicAPI.setRenderWindow = function (aren) {\n vtkErrorMacro('you want to call setView(view) instead of setRenderWindow on a vtk.js interactor');\n }; //----------------------------------------------------------------------\n\n\n publicAPI.setInteractorStyle = function (style) {\n if (model.interactorStyle !== style) {\n if (model.interactorStyle != null) {\n model.interactorStyle.setInteractor(null);\n }\n\n model.interactorStyle = style;\n\n if (model.interactorStyle != null) {\n if (model.interactorStyle.getInteractor() !== publicAPI) {\n model.interactorStyle.setInteractor(publicAPI);\n }\n }\n }\n }; //---------------------------------------------------------------------\n\n\n publicAPI.initialize = function () {\n model.initialized = true;\n publicAPI.enable();\n publicAPI.render();\n };\n\n publicAPI.enable = function () {\n return publicAPI.setEnabled(true);\n };\n\n publicAPI.disable = function () {\n return publicAPI.setEnabled(false);\n };\n\n publicAPI.startEventLoop = function () {\n return vtkWarningMacro('empty event loop');\n };\n\n function updateCurrentRenderer(x, y) {\n model.currentRenderer = publicAPI.findPokedRenderer(x, y);\n }\n\n publicAPI.getCurrentRenderer = function () {\n if (model.currentRenderer) {\n return model.currentRenderer;\n }\n\n updateCurrentRenderer(0, 0);\n return model.currentRenderer;\n };\n\n function getScreenEventPositionFor(source) {\n var bounds = model.container.getBoundingClientRect();\n var canvas = model.view.getCanvas();\n var scaleX = canvas.width / bounds.width;\n var scaleY = canvas.height / bounds.height;\n var position = {\n x: scaleX * (source.clientX - bounds.left),\n y: scaleY * (bounds.height - source.clientY + bounds.top),\n z: 0\n };\n updateCurrentRenderer(position.x, position.y);\n return position;\n }\n\n function getTouchEventPositionsFor(touches) {\n var positions = {};\n\n for (var i = 0; i < touches.length; i++) {\n var touch = touches[i];\n positions[touch.identifier] = getScreenEventPositionFor(touch);\n }\n\n return positions;\n }\n\n function getModifierKeysFor(event) {\n return {\n controlKey: event.ctrlKey,\n altKey: event.altKey,\n shiftKey: event.shiftKey\n };\n }\n\n function getKeysFor(event) {\n var modifierKeys = getModifierKeysFor(event);\n\n var keys = _objectSpread({\n key: event.key,\n keyCode: event.charCode\n }, modifierKeys);\n\n return keys;\n }\n\n function interactionRegistration(addListeners) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var rootElm = document;\n var method = addListeners ? 'addEventListener' : 'removeEventListener';\n var invMethod = addListeners ? 'removeEventListener' : 'addEventListener';\n\n if (!force && !addListeners && activeListenerCount > 0) {\n --activeListenerCount;\n } // only add/remove listeners when there are no registered listeners\n\n\n if (!activeListenerCount || force) {\n activeListenerCount = 0;\n\n if (model.container) {\n model.container[invMethod]('mousemove', publicAPI.handleMouseMove);\n }\n\n rootElm[method]('mouseup', publicAPI.handleMouseUp);\n rootElm[method]('mousemove', publicAPI.handleMouseMove);\n rootElm[method]('touchend', publicAPI.handleTouchEnd, false);\n rootElm[method]('touchcancel', publicAPI.handleTouchEnd, false);\n rootElm[method]('touchmove', publicAPI.handleTouchMove, false);\n }\n\n if (!force && addListeners) {\n ++activeListenerCount;\n }\n }\n\n publicAPI.bindEvents = function (container) {\n model.container = container;\n container.addEventListener('contextmenu', preventDefault); // container.addEventListener('click', preventDefault); // Avoid stopping event propagation\n\n container.addEventListener('wheel', publicAPI.handleWheel);\n container.addEventListener('DOMMouseScroll', publicAPI.handleWheel);\n container.addEventListener('mouseenter', publicAPI.handleMouseEnter);\n container.addEventListener('mouseleave', publicAPI.handleMouseLeave);\n container.addEventListener('mousemove', publicAPI.handleMouseMove);\n container.addEventListener('mousedown', publicAPI.handleMouseDown);\n document.addEventListener('keypress', publicAPI.handleKeyPress);\n document.addEventListener('keydown', publicAPI.handleKeyDown);\n document.addEventListener('keyup', publicAPI.handleKeyUp);\n document.addEventListener('pointerlockchange', publicAPI.handlePointerLockChange);\n container.addEventListener('touchstart', publicAPI.handleTouchStart, false);\n };\n\n publicAPI.unbindEvents = function () {\n // force unbinding listeners\n interactionRegistration(false, true);\n model.container.removeEventListener('contextmenu', preventDefault); // model.container.removeEventListener('click', preventDefault); // Avoid stopping event propagation\n\n model.container.removeEventListener('wheel', publicAPI.handleWheel);\n model.container.removeEventListener('DOMMouseScroll', publicAPI.handleWheel);\n model.container.removeEventListener('mouseenter', publicAPI.handleMouseEnter);\n model.container.removeEventListener('mouseleave', publicAPI.handleMouseLeave);\n model.container.removeEventListener('mousemove', publicAPI.handleMouseMove);\n model.container.removeEventListener('mousedown', publicAPI.handleMouseDown);\n document.removeEventListener('keypress', publicAPI.handleKeyPress);\n document.removeEventListener('keydown', publicAPI.handleKeyDown);\n document.removeEventListener('keyup', publicAPI.handleKeyUp);\n document.removeEventListener('pointerlockchange', publicAPI.handlePointerLockChange);\n model.container.removeEventListener('touchstart', publicAPI.handleTouchStart);\n model.container = null;\n };\n\n publicAPI.handleKeyPress = function (event) {\n var data = getKeysFor(event);\n publicAPI.keyPressEvent(data);\n };\n\n publicAPI.handleKeyDown = function (event) {\n var data = getKeysFor(event);\n publicAPI.keyDownEvent(data);\n };\n\n publicAPI.handleKeyUp = function (event) {\n var data = getKeysFor(event);\n publicAPI.keyUpEvent(data);\n };\n\n publicAPI.handleMouseDown = function (event) {\n if (event.button > 2) {\n // ignore events from extra mouse buttons such as `back` and `forward`\n return;\n }\n\n interactionRegistration(true);\n event.stopPropagation();\n event.preventDefault();\n\n var callData = _objectSpread(_objectSpread({}, getModifierKeysFor(event)), {}, {\n position: getScreenEventPositionFor(event)\n });\n\n switch (event.button) {\n case 0:\n publicAPI.leftButtonPressEvent(callData);\n break;\n\n case 1:\n publicAPI.middleButtonPressEvent(callData);\n break;\n\n case 2:\n publicAPI.rightButtonPressEvent(callData);\n break;\n\n default:\n vtkErrorMacro(\"Unknown mouse button pressed: \".concat(event.button));\n break;\n }\n }; //----------------------------------------------------------------------\n\n\n publicAPI.requestPointerLock = function () {\n var canvas = publicAPI.getView().getCanvas();\n canvas.requestPointerLock();\n }; //----------------------------------------------------------------------\n\n\n publicAPI.exitPointerLock = function () {\n return document.exitPointerLock();\n }; //----------------------------------------------------------------------\n\n\n publicAPI.isPointerLocked = function () {\n return !!document.pointerLockElement;\n }; //----------------------------------------------------------------------\n\n\n publicAPI.handlePointerLockChange = function () {\n if (publicAPI.isPointerLocked()) {\n publicAPI.startPointerLockEvent();\n } else {\n publicAPI.endPointerLockEvent();\n }\n }; //----------------------------------------------------------------------\n\n\n function forceRender() {\n if (model.view && model.enabled && model.enableRender) {\n model.inRender = true;\n model.view.traverseAllPasses();\n model.inRender = false;\n } // outside the above test so that third-party code can redirect\n // the render to the appropriate class\n\n\n publicAPI.invokeRenderEvent();\n }\n\n publicAPI.requestAnimation = function (requestor) {\n if (requestor === undefined) {\n vtkErrorMacro(\"undefined requester, can not start animating\");\n return;\n }\n\n if (animationRequesters.has(requestor)) {\n vtkWarningMacro(\"requester is already registered for animating\");\n return;\n }\n\n animationRequesters.add(requestor);\n\n if (animationRequesters.size === 1) {\n model.lastFrameTime = 0.1;\n model.lastFrameStart = Date.now();\n model.animationRequest = requestAnimationFrame(publicAPI.handleAnimation);\n publicAPI.startAnimationEvent();\n }\n };\n\n publicAPI.isAnimating = function () {\n return model.vrAnimation || model.animationRequest !== null;\n };\n\n publicAPI.cancelAnimation = function (requestor) {\n var skipWarning = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!animationRequesters.has(requestor)) {\n if (!skipWarning) {\n var requestStr = requestor && requestor.getClassName ? requestor.getClassName() : requestor;\n vtkWarningMacro(\"\".concat(requestStr, \" did not request an animation\"));\n }\n\n return;\n }\n\n animationRequesters.delete(requestor);\n\n if (model.animationRequest && animationRequesters.size === 0) {\n cancelAnimationFrame(model.animationRequest);\n model.animationRequest = null;\n publicAPI.endAnimationEvent();\n publicAPI.render();\n }\n };\n\n publicAPI.switchToVRAnimation = function () {\n // cancel existing animation if any\n if (model.animationRequest) {\n cancelAnimationFrame(model.animationRequest);\n model.animationRequest = null;\n }\n\n model.vrAnimation = true;\n };\n\n publicAPI.returnFromVRAnimation = function () {\n model.vrAnimation = false;\n\n if (animationRequesters.size !== 0) {\n model.FrameTime = -1;\n model.animationRequest = requestAnimationFrame(publicAPI.handleAnimation);\n }\n };\n\n publicAPI.updateGamepads = function (displayId) {\n var gamepads = navigator.getGamepads(); // watch for when buttons change state and fire events\n\n for (var i = 0; i < gamepads.length; ++i) {\n var gp = gamepads[i];\n\n if (gp && gp.displayId === displayId) {\n if (!(gp.index in model.lastGamepadValues)) {\n model.lastGamepadValues[gp.index] = {\n buttons: {}\n };\n }\n\n for (var b = 0; b < gp.buttons.length; ++b) {\n if (!(b in model.lastGamepadValues[gp.index].buttons)) {\n model.lastGamepadValues[gp.index].buttons[b] = false;\n }\n\n if (model.lastGamepadValues[gp.index].buttons[b] !== gp.buttons[b].pressed) {\n publicAPI.button3DEvent({\n gamepad: gp,\n position: gp.pose.position,\n orientation: gp.pose.orientation,\n pressed: gp.buttons[b].pressed,\n device: gp.hand === 'left' ? Device.LeftController : Device.RightController,\n input: deviceInputMap[gp.id] && deviceInputMap[gp.id][b] ? deviceInputMap[gp.id][b] : Input.Trigger\n });\n model.lastGamepadValues[gp.index].buttons[b] = gp.buttons[b].pressed;\n }\n\n if (model.lastGamepadValues[gp.index].buttons[b]) {\n publicAPI.move3DEvent({\n gamepad: gp,\n position: gp.pose.position,\n orientation: gp.pose.orientation,\n device: gp.hand === 'left' ? Device.LeftController : Device.RightController\n });\n }\n }\n }\n }\n };\n\n publicAPI.handleMouseMove = function (event) {\n // Do not consume event for move\n // event.stopPropagation();\n // event.preventDefault();\n var callData = _objectSpread(_objectSpread({}, getModifierKeysFor(event)), {}, {\n position: getScreenEventPositionFor(event)\n });\n\n if (model.moveTimeoutID === 0) {\n publicAPI.startMouseMoveEvent(callData);\n } else {\n publicAPI.mouseMoveEvent(callData);\n clearTimeout(model.moveTimeoutID);\n } // start a timer to keep us animating while we get mouse move events\n\n\n model.moveTimeoutID = setTimeout(function () {\n publicAPI.endMouseMoveEvent();\n model.moveTimeoutID = 0;\n }, 200);\n };\n\n publicAPI.handleAnimation = function () {\n var currTime = Date.now();\n\n if (model.FrameTime === -1.0) {\n model.lastFrameTime = 0.1;\n } else {\n model.lastFrameTime = (currTime - model.lastFrameStart) / 1000.0;\n }\n\n model.lastFrameTime = Math.max(0.01, model.lastFrameTime);\n model.lastFrameStart = currTime;\n publicAPI.animationEvent();\n forceRender();\n model.animationRequest = requestAnimationFrame(publicAPI.handleAnimation);\n };\n\n publicAPI.handleWheel = function (event) {\n event.stopPropagation();\n event.preventDefault();\n /**\n * wheel event values can vary significantly across browsers, platforms\n * and devices [1]. `normalizeWheel` uses facebook's solution from their\n * fixed-data-table repository [2].\n *\n * [1] https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel\n * [2] https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js\n *\n * This code will return an object with properties:\n *\n * spinX -- normalized spin speed (use for zoom) - x plane\n * spinY -- \" - y plane\n * pixelX -- normalized distance (to pixels) - x plane\n * pixelY -- \" - y plane\n *\n */\n\n var callData = _objectSpread(_objectSpread(_objectSpread({}, normalizeWheel(event)), getModifierKeysFor(event)), {}, {\n position: getScreenEventPositionFor(event)\n });\n\n if (model.wheelTimeoutID === 0) {\n publicAPI.startMouseWheelEvent(callData);\n } else {\n publicAPI.mouseWheelEvent(callData);\n clearTimeout(model.wheelTimeoutID);\n } // start a timer to keep us animating while we get wheel events\n\n\n model.wheelTimeoutID = setTimeout(function () {\n publicAPI.endMouseWheelEvent();\n model.wheelTimeoutID = 0;\n }, 200);\n };\n\n publicAPI.handleMouseEnter = function (event) {\n var callData = _objectSpread(_objectSpread({}, getModifierKeysFor(event)), {}, {\n position: getScreenEventPositionFor(event)\n });\n\n publicAPI.mouseEnterEvent(callData);\n };\n\n publicAPI.handleMouseLeave = function (event) {\n var callData = _objectSpread(_objectSpread({}, getModifierKeysFor(event)), {}, {\n position: getScreenEventPositionFor(event)\n });\n\n publicAPI.mouseLeaveEvent(callData);\n };\n\n publicAPI.handleMouseUp = function (event) {\n interactionRegistration(false);\n event.stopPropagation();\n event.preventDefault();\n\n var callData = _objectSpread(_objectSpread({}, getModifierKeysFor(event)), {}, {\n position: getScreenEventPositionFor(event)\n });\n\n switch (event.button) {\n case 0:\n publicAPI.leftButtonReleaseEvent(callData);\n break;\n\n case 1:\n publicAPI.middleButtonReleaseEvent(callData);\n break;\n\n case 2:\n publicAPI.rightButtonReleaseEvent(callData);\n break;\n\n default:\n vtkErrorMacro(\"Unknown mouse button released: \".concat(event.button));\n break;\n }\n };\n\n publicAPI.handleTouchStart = function (event) {\n interactionRegistration(true);\n event.stopPropagation();\n event.preventDefault(); // If multitouch\n\n if (model.recognizeGestures && event.touches.length > 1) {\n var positions = getTouchEventPositionsFor(event.touches); // did we just transition to multitouch?\n\n if (event.touches.length === 2) {\n var touch = event.touches[0];\n var callData = {\n position: getScreenEventPositionFor(touch),\n shiftKey: false,\n altKey: false,\n controlKey: false\n };\n publicAPI.leftButtonReleaseEvent(callData);\n } // handle the gesture\n\n\n publicAPI.recognizeGesture('TouchStart', positions);\n } else {\n var _touch = event.touches[0];\n var _callData = {\n position: getScreenEventPositionFor(_touch),\n shiftKey: false,\n altKey: false,\n controlKey: false\n };\n publicAPI.leftButtonPressEvent(_callData);\n }\n };\n\n publicAPI.handleTouchMove = function (event) {\n event.stopPropagation();\n event.preventDefault();\n\n if (model.recognizeGestures && event.touches.length > 1) {\n var positions = getTouchEventPositionsFor(event.touches);\n publicAPI.recognizeGesture('TouchMove', positions);\n } else {\n var touch = event.touches[0];\n var callData = {\n position: getScreenEventPositionFor(touch),\n shiftKey: false,\n altKey: false,\n controlKey: false\n };\n publicAPI.mouseMoveEvent(callData);\n }\n };\n\n publicAPI.handleTouchEnd = function (event) {\n event.stopPropagation();\n event.preventDefault();\n\n if (model.recognizeGestures) {\n // No more fingers down\n if (event.touches.length === 0) {\n // If just one finger released, consider as left button\n if (event.changedTouches.length === 1) {\n var touch = event.changedTouches[0];\n var callData = {\n position: getScreenEventPositionFor(touch),\n shiftKey: false,\n altKey: false,\n controlKey: false\n };\n publicAPI.leftButtonReleaseEvent(callData);\n interactionRegistration(false);\n } else {\n // If more than one finger released, recognize touchend\n var positions = getTouchEventPositionsFor(event.changedTouches);\n publicAPI.recognizeGesture('TouchEnd', positions);\n interactionRegistration(false);\n }\n } else if (event.touches.length === 1) {\n // If one finger left, end touch and start button press\n var _positions = getTouchEventPositionsFor(event.changedTouches);\n\n publicAPI.recognizeGesture('TouchEnd', _positions);\n var _touch2 = event.touches[0];\n var _callData2 = {\n position: getScreenEventPositionFor(_touch2),\n shiftKey: false,\n altKey: false,\n controlKey: false\n };\n publicAPI.leftButtonPressEvent(_callData2);\n } else {\n // If more than one finger left, keep touch move\n var _positions2 = getTouchEventPositionsFor(event.touches);\n\n publicAPI.recognizeGesture('TouchMove', _positions2);\n }\n } else {\n var _touch3 = event.changedTouches[0];\n var _callData3 = {\n position: getScreenEventPositionFor(_touch3),\n shiftKey: false,\n altKey: false,\n controlKey: false\n };\n publicAPI.leftButtonReleaseEvent(_callData3);\n interactionRegistration(false);\n }\n };\n\n publicAPI.setView = function (val) {\n if (model.view === val) {\n return;\n }\n\n model.view = val;\n model.view.getRenderable().setInteractor(publicAPI);\n publicAPI.modified();\n };\n\n publicAPI.getFirstRenderer = function () {\n return model.view.getRenderable().getRenderersByReference()[0];\n };\n\n publicAPI.findPokedRenderer = function () {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (!model.view) {\n return null;\n } // The original order of renderers needs to remain as\n // the first one is the one we want to manipulate the camera on.\n\n\n var rc = model.view.getRenderable().getRenderers();\n rc.sort(function (a, b) {\n return a.getLayer() - b.getLayer();\n });\n var interactiveren = null;\n var viewportren = null;\n var currentRenderer = null;\n var count = rc.length;\n\n while (count--) {\n var aren = rc[count];\n\n if (model.view.isInViewport(x, y, aren) && aren.getInteractive()) {\n currentRenderer = aren;\n break;\n }\n\n if (interactiveren === null && aren.getInteractive()) {\n // Save this renderer in case we can't find one in the viewport that\n // is interactive.\n interactiveren = aren;\n }\n\n if (viewportren === null && model.view.isInViewport(x, y, aren)) {\n // Save this renderer in case we can't find one in the viewport that\n // is interactive.\n viewportren = aren;\n }\n } // We must have a value. If we found an interactive renderer before, that's\n // better than a non-interactive renderer.\n\n\n if (currentRenderer === null) {\n currentRenderer = interactiveren;\n } // We must have a value. If we found a renderer that is in the viewport,\n // that is better than any old viewport (but not as good as an interactive\n // one).\n\n\n if (currentRenderer === null) {\n currentRenderer = viewportren;\n } // We must have a value - take anything.\n\n\n if (currentRenderer == null) {\n currentRenderer = rc[0];\n }\n\n return currentRenderer;\n }; // only render if we are not animating. If we are animating\n // then renders will happen naturally anyhow and we definitely\n // do not want extra renders as the make the apparent interaction\n // rate slower.\n\n\n publicAPI.render = function () {\n if (model.animationRequest === null && !model.inRender) {\n forceRender();\n }\n }; // create the generic Event methods\n\n\n handledEvents.forEach(function (eventName) {\n var lowerFirst = eventName.charAt(0).toLowerCase() + eventName.slice(1);\n\n publicAPI[\"\".concat(lowerFirst, \"Event\")] = function (arg) {\n // Check that interactor enabled\n if (!model.enabled) {\n return;\n } // Check that a poked renderer exists\n\n\n var renderer = publicAPI.getCurrentRenderer();\n\n if (!renderer) {\n vtkOnceErrorMacro(\"\\n Can not forward events without a current renderer on the interactor.\\n \");\n return;\n } // Pass the eventName and the poked renderer\n\n\n var callData = _objectSpread({\n type: eventName,\n pokedRenderer: model.currentRenderer,\n firstRenderer: publicAPI.getFirstRenderer()\n }, arg); // Call invoke\n\n\n publicAPI[\"invoke\".concat(eventName)](callData);\n };\n }); // we know we are in multitouch now, so start recognizing\n\n publicAPI.recognizeGesture = function (event, positions) {\n // more than two pointers we ignore\n if (Object.keys(positions).length > 2) {\n return;\n }\n\n if (!model.startingEventPositions) {\n model.startingEventPositions = {};\n } // store the initial positions\n\n\n if (event === 'TouchStart') {\n Object.keys(positions).forEach(function (key) {\n model.startingEventPositions[key] = positions[key];\n }); // we do not know what the gesture is yet\n\n model.currentGesture = 'Start';\n return;\n } // end the gesture if needed\n\n\n if (event === 'TouchEnd') {\n if (model.currentGesture === 'Pinch') {\n publicAPI.render();\n publicAPI.endPinchEvent();\n }\n\n if (model.currentGesture === 'Rotate') {\n publicAPI.render();\n publicAPI.endRotateEvent();\n }\n\n if (model.currentGesture === 'Pan') {\n publicAPI.render();\n publicAPI.endPanEvent();\n }\n\n model.currentGesture = 'Start';\n model.startingEventPositions = {};\n return;\n } // what are the two pointers we are working with\n\n\n var count = 0;\n var posVals = [];\n var startVals = [];\n Object.keys(positions).forEach(function (key) {\n posVals[count] = positions[key];\n startVals[count] = model.startingEventPositions[key];\n count++;\n }); // The meat of the algorithm\n // on move events we analyze them to determine what type\n // of movement it is and then deal with it.\n // calculate the distances\n\n var originalDistance = Math.sqrt((startVals[0].x - startVals[1].x) * (startVals[0].x - startVals[1].x) + (startVals[0].y - startVals[1].y) * (startVals[0].y - startVals[1].y));\n var newDistance = Math.sqrt((posVals[0].x - posVals[1].x) * (posVals[0].x - posVals[1].x) + (posVals[0].y - posVals[1].y) * (posVals[0].y - posVals[1].y)); // calculate rotations\n\n var originalAngle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"degreesFromRadians\"](Math.atan2(startVals[1].y - startVals[0].y, startVals[1].x - startVals[0].x));\n var newAngle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"degreesFromRadians\"](Math.atan2(posVals[1].y - posVals[0].y, posVals[1].x - posVals[0].x)); // angles are cyclic so watch for that, 1 and 359 are only 2 apart :)\n\n var angleDeviation = newAngle - originalAngle;\n newAngle = newAngle + 180.0 >= 360.0 ? newAngle - 180.0 : newAngle + 180.0;\n originalAngle = originalAngle + 180.0 >= 360.0 ? originalAngle - 180.0 : originalAngle + 180.0;\n\n if (Math.abs(newAngle - originalAngle) < Math.abs(angleDeviation)) {\n angleDeviation = newAngle - originalAngle;\n } // calculate the translations\n\n\n var trans = [];\n trans[0] = (posVals[0].x - startVals[0].x + posVals[1].x - startVals[1].x) / 2.0;\n trans[1] = (posVals[0].y - startVals[0].y + posVals[1].y - startVals[1].y) / 2.0;\n\n if (event === 'TouchMove') {\n // OK we want to\n // - immediately respond to the user\n // - allow the user to zoom without panning (saves focal point)\n // - allow the user to rotate without panning (saves focal point)\n // do we know what gesture we are doing yet? If not\n // see if we can figure it out\n if (model.currentGesture === 'Start') {\n // pinch is a move to/from the center point\n // rotate is a move along the circumference\n // pan is a move of the center point\n // compute the distance along each of these axes in pixels\n // the first to break thresh wins\n var thresh = 0.01 * Math.sqrt(model.container.clientWidth * model.container.clientWidth + model.container.clientHeight * model.container.clientHeight);\n\n if (thresh < 15.0) {\n thresh = 15.0;\n }\n\n var pinchDistance = Math.abs(newDistance - originalDistance);\n var rotateDistance = newDistance * 3.1415926 * Math.abs(angleDeviation) / 360.0;\n var panDistance = Math.sqrt(trans[0] * trans[0] + trans[1] * trans[1]);\n\n if (pinchDistance > thresh && pinchDistance > rotateDistance && pinchDistance > panDistance) {\n model.currentGesture = 'Pinch';\n var callData = {\n scale: 1.0,\n touches: positions\n };\n publicAPI.startPinchEvent(callData);\n } else if (rotateDistance > thresh && rotateDistance > panDistance) {\n model.currentGesture = 'Rotate';\n var _callData4 = {\n rotation: 0.0,\n touches: positions\n };\n publicAPI.startRotateEvent(_callData4);\n } else if (panDistance > thresh) {\n model.currentGesture = 'Pan';\n var _callData5 = {\n translation: [0, 0],\n touches: positions\n };\n publicAPI.startPanEvent(_callData5);\n }\n } else {\n // if we have found a specific type of movement then\n // handle it\n if (model.currentGesture === 'Rotate') {\n var _callData6 = {\n rotation: angleDeviation,\n touches: positions\n };\n publicAPI.rotateEvent(_callData6);\n }\n\n if (model.currentGesture === 'Pinch') {\n var _callData7 = {\n scale: newDistance / originalDistance,\n touches: positions\n };\n publicAPI.pinchEvent(_callData7);\n }\n\n if (model.currentGesture === 'Pan') {\n var _callData8 = {\n translation: trans,\n touches: positions\n };\n publicAPI.panEvent(_callData8);\n }\n }\n }\n };\n\n publicAPI.handleVisibilityChange = function () {\n model.lastFrameStart = Date.now();\n }; // Stop animating if the renderWindowInteractor is deleted.\n\n\n var superDelete = publicAPI.delete;\n\n publicAPI.delete = function () {\n while (animationRequesters.size) {\n publicAPI.cancelAnimation(animationRequesters.values().next().value);\n }\n\n if (typeof document.hidden !== 'undefined') {\n document.removeEventListener('visibilitychange', publicAPI.handleVisibilityChange);\n }\n\n superDelete();\n }; // Use the Page Visibility API to detect when we switch away from or back to\n // this tab, and reset the lastFrameStart. When tabs are not active, browsers\n // will stop calling requestAnimationFrame callbacks.\n\n\n if (typeof document.hidden !== 'undefined') {\n document.addEventListener('visibilitychange', publicAPI.handleVisibilityChange, false);\n }\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n renderWindow: null,\n interactorStyle: null,\n picker: null,\n pickingManager: null,\n initialized: false,\n enabled: false,\n enableRender: true,\n currentRenderer: null,\n lightFollowCamera: true,\n desiredUpdateRate: 30.0,\n stillUpdateRate: 2.0,\n container: null,\n view: null,\n recognizeGestures: true,\n currentGesture: 'Start',\n animationRequest: null,\n lastFrameTime: 0.1,\n wheelTimeoutID: 0,\n moveTimeoutID: 0,\n lastGamepadValues: {}\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'RenderEvent');\n handledEvents.forEach(function (eventName) {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, eventName);\n }); // Create get-only macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['initialized', 'container', 'interactorStyle', 'lastFrameTime', 'view']); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['lightFollowCamera', 'enabled', 'enableRender', 'recognizeGestures', 'desiredUpdateRate', 'stillUpdateRate', 'picker']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkRenderWindowInteractor(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkRenderWindowInteractor'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend,\n handledEvents: handledEvents\n}, vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Renderer/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Renderer/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Camera__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Camera */ \"./node_modules/vtk.js/Sources/Rendering/Core/Camera/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Light__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Light */ \"./node_modules/vtk.js/Sources/Rendering/Core/Light/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Viewport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Viewport */ \"./node_modules/vtk.js/Sources/Rendering/Core/Viewport/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\n\n\n\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkDebugMacro\"],\n vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"],\n vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkWarningMacro\"];\n\nfunction notImplemented(method) {\n return function () {\n return vtkErrorMacro(\"vtkRenderer::\".concat(method, \" - NOT IMPLEMENTED\"));\n };\n} // ----------------------------------------------------------------------------\n// vtkRenderer methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkRenderer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkRenderer'); // make sure background has 4 entries. Default to opaque black\n\n if (!model.background) model.background = [0, 0, 0, 1];\n\n while (model.background.length < 3) {\n model.background.push(0);\n }\n\n if (model.background.length === 3) model.background.push(1); // Events\n\n var COMPUTE_VISIBLE_PROP_BOUNDS_EVENT = {\n type: 'ComputeVisiblePropBoundsEvent',\n renderer: publicAPI\n };\n var RESET_CAMERA_CLIPPING_RANGE_EVENT = {\n type: 'ResetCameraClippingRangeEvent',\n renderer: publicAPI\n };\n var RESET_CAMERA_EVENT = {\n type: 'ResetCameraEvent',\n renderer: publicAPI\n };\n\n publicAPI.updateCamera = function () {\n if (!model.activeCamera) {\n vtkDebugMacro('No cameras are on, creating one.'); // the get method will automagically create a camera\n // and reset it since one hasn't been specified yet.\n\n publicAPI.getActiveCameraAndResetIfCreated();\n } // update the viewing transformation\n\n\n model.activeCamera.render(publicAPI);\n return true;\n };\n\n publicAPI.updateLightsGeometryToFollowCamera = function () {\n // only update the light's geometry if this Renderer is tracking\n // this lights. That allows one renderer to view the lights that\n // another renderer is setting up.\n var camera = publicAPI.getActiveCameraAndResetIfCreated();\n model.lights.forEach(function (light) {\n if (light.lightTypeIsSceneLight() || light.lightTypeIsCameraLight()) {// Do nothing. Don't reset the transform matrix because applications\n // may have set a custom matrix. Only reset the transform matrix in\n // vtkLight::SetLightTypeToSceneLight()\n } else if (light.lightTypeIsHeadLight()) {\n // update position and orientation of light to match camera.\n light.setPositionFrom(camera.getPositionByReference());\n light.setFocalPointFrom(camera.getFocalPointByReference());\n light.modified(camera.getMTime());\n } else {\n vtkErrorMacro('light has unknown light type', light.get());\n }\n });\n };\n\n publicAPI.updateLightGeometry = function () {\n if (model.lightFollowCamera) {\n // only update the light's geometry if this Renderer is tracking\n // this lights. That allows one renderer to view the lights that\n // another renderer is setting up.\n return publicAPI.updateLightsGeometryToFollowCamera();\n }\n\n return true;\n };\n\n publicAPI.allocateTime = notImplemented('allocateTime');\n publicAPI.updateGeometry = notImplemented('updateGeometry');\n\n publicAPI.getVTKWindow = function () {\n return model.renderWindow;\n };\n\n publicAPI.setLayer = function (layer) {\n vtkDebugMacro(publicAPI.getClassName(), publicAPI, 'setting Layer to ', layer);\n\n if (model.layer !== layer) {\n model.layer = layer;\n publicAPI.modified();\n }\n\n publicAPI.setPreserveColorBuffer(!!layer);\n };\n\n publicAPI.setActiveCamera = function (camera) {\n if (model.activeCamera === camera) {\n return false;\n }\n\n model.activeCamera = camera;\n publicAPI.modified();\n publicAPI.invokeEvent({\n type: 'ActiveCameraEvent',\n camera: camera\n });\n return true;\n };\n\n publicAPI.makeCamera = function () {\n var camera = vtk_js_Sources_Rendering_Core_Camera__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n publicAPI.invokeEvent({\n type: 'CreateCameraEvent',\n camera: camera\n });\n return camera;\n }; // Replace the set/get macro method\n\n\n publicAPI.getActiveCamera = function () {\n if (!model.activeCamera) {\n model.activeCamera = publicAPI.makeCamera();\n }\n\n return model.activeCamera;\n };\n\n publicAPI.getActiveCameraAndResetIfCreated = function () {\n if (!model.activeCamera) {\n publicAPI.getActiveCamera();\n publicAPI.resetCamera();\n }\n\n return model.activeCamera;\n };\n\n publicAPI.getActors = function () {\n model.actors = [];\n model.props.forEach(function (prop) {\n model.actors = model.actors.concat(prop.getActors());\n });\n return model.actors;\n };\n\n publicAPI.addActor = publicAPI.addViewProp;\n\n publicAPI.removeActor = function (actor) {\n model.actors = model.actors.filter(function (a) {\n return a !== actor;\n });\n publicAPI.removeViewProp(actor);\n publicAPI.modified();\n };\n\n publicAPI.removeAllActors = function () {\n var actors = publicAPI.getActors();\n actors.forEach(function (actor) {\n publicAPI.removeViewProp(actor);\n });\n model.actors = [];\n publicAPI.modified();\n };\n\n publicAPI.getVolumes = function () {\n model.volumes = [];\n model.props.forEach(function (prop) {\n model.volumes = model.volumes.concat(prop.getVolumes());\n });\n return model.volumes;\n };\n\n publicAPI.addVolume = publicAPI.addViewProp;\n\n publicAPI.removeVolume = function (volume) {\n model.volumes = model.volumes.filter(function (v) {\n return v !== volume;\n });\n publicAPI.removeViewProp(volume);\n publicAPI.modified();\n };\n\n publicAPI.removeAllVolumes = function () {\n var volumes = publicAPI.getVolumes();\n volumes.forEach(function (volume) {\n publicAPI.removeViewProp(volume);\n });\n model.volumes = [];\n publicAPI.modified();\n };\n\n publicAPI.addLight = function (light) {\n model.lights = [].concat(model.lights, light);\n publicAPI.modified();\n };\n\n publicAPI.removeLight = function (light) {\n model.lights = model.lights.filter(function (l) {\n return l !== light;\n });\n publicAPI.modified();\n };\n\n publicAPI.removeAllLights = function () {\n model.lights = [];\n publicAPI.modified();\n };\n\n publicAPI.setLightCollection = function (lights) {\n model.lights = lights;\n publicAPI.modified();\n };\n\n publicAPI.makeLight = vtk_js_Sources_Rendering_Core_Light__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance;\n\n publicAPI.createLight = function () {\n if (!model.automaticLightCreation) {\n return;\n }\n\n if (model.createdLight) {\n publicAPI.removeLight(model.createdLight);\n model.createdLight.delete();\n model.createdLight = null;\n }\n\n model.createdLight = publicAPI.makeLight();\n publicAPI.addLight(model.createdLight);\n model.createdLight.setLightTypeToHeadLight(); // set these values just to have a good default should LightFollowCamera\n // be turned off.\n\n model.createdLight.setPosition(publicAPI.getActiveCamera().getPosition());\n model.createdLight.setFocalPoint(publicAPI.getActiveCamera().getFocalPoint());\n }; // requires the aspect ratio of the viewport as X/Y\n\n\n publicAPI.normalizedDisplayToWorld = function (x, y, z, aspect) {\n var vpd = publicAPI.normalizedDisplayToProjection(x, y, z);\n vpd = publicAPI.projectionToView(vpd[0], vpd[1], vpd[2], aspect);\n return publicAPI.viewToWorld(vpd[0], vpd[1], vpd[2]);\n }; // requires the aspect ratio of the viewport as X/Y\n\n\n publicAPI.worldToNormalizedDisplay = function (x, y, z, aspect) {\n var vpd = publicAPI.worldToView(x, y, z);\n vpd = publicAPI.viewToProjection(vpd[0], vpd[1], vpd[2], aspect);\n return publicAPI.projectionToNormalizedDisplay(vpd[0], vpd[1], vpd[2]);\n }; // requires the aspect ratio of the viewport as X/Y\n\n\n publicAPI.viewToWorld = function (x, y, z) {\n if (model.activeCamera === null) {\n vtkErrorMacro('ViewToWorld: no active camera, cannot compute view to world, returning 0,0,0');\n return [0, 0, 0];\n } // get the view matrix from the active camera\n\n\n var matrix = model.activeCamera.getViewMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(matrix, matrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(matrix, matrix); // Transform point to world coordinates\n\n var result = new Float64Array([x, y, z]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(result, result, matrix);\n return result;\n };\n\n publicAPI.projectionToView = function (x, y, z, aspect) {\n if (model.activeCamera === null) {\n vtkErrorMacro('ProjectionToView: no active camera, cannot compute projection to view, returning 0,0,0');\n return [0, 0, 0];\n } // get the projection transformation from the active camera\n\n\n var matrix = model.activeCamera.getProjectionMatrix(aspect, -1.0, 1.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(matrix, matrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(matrix, matrix); // Transform point to world coordinates\n\n var result = new Float64Array([x, y, z]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(result, result, matrix);\n return result;\n }; // Convert world point coordinates to view coordinates.\n\n\n publicAPI.worldToView = function (x, y, z) {\n if (model.activeCamera === null) {\n vtkErrorMacro('WorldToView: no active camera, cannot compute view to world, returning 0,0,0');\n return [0, 0, 0];\n } // get the view transformation from the active camera\n\n\n var matrix = model.activeCamera.getViewMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(matrix, matrix);\n var result = new Float64Array([x, y, z]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(result, result, matrix);\n return result;\n }; // Convert world point coordinates to view coordinates.\n // requires the aspect ratio of the viewport as X/Y\n\n\n publicAPI.viewToProjection = function (x, y, z, aspect) {\n if (model.activeCamera === null) {\n vtkErrorMacro('ViewToProjection: no active camera, cannot compute view to projection, returning 0,0,0');\n return [0, 0, 0];\n } // get the projeciton transformation from the active camera\n\n\n var matrix = model.activeCamera.getProjectionMatrix(aspect, -1.0, 1.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(matrix, matrix);\n var result = new Float64Array([x, y, z]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(result, result, matrix);\n return result;\n };\n\n publicAPI.computeVisiblePropBounds = function () {\n model.allBounds[0] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INIT_BOUNDS[0];\n model.allBounds[1] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INIT_BOUNDS[1];\n model.allBounds[2] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INIT_BOUNDS[2];\n model.allBounds[3] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INIT_BOUNDS[3];\n model.allBounds[4] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INIT_BOUNDS[4];\n model.allBounds[5] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INIT_BOUNDS[5];\n var nothingVisible = true;\n publicAPI.invokeEvent(COMPUTE_VISIBLE_PROP_BOUNDS_EVENT); // loop through all props\n\n for (var index = 0; index < model.props.length; ++index) {\n var prop = model.props[index];\n\n if (prop.getVisibility() && prop.getUseBounds()) {\n var bounds = prop.getBounds();\n\n if (bounds && vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"areBoundsInitialized\"](bounds)) {\n nothingVisible = false;\n\n if (bounds[0] < model.allBounds[0]) {\n model.allBounds[0] = bounds[0];\n }\n\n if (bounds[1] > model.allBounds[1]) {\n model.allBounds[1] = bounds[1];\n }\n\n if (bounds[2] < model.allBounds[2]) {\n model.allBounds[2] = bounds[2];\n }\n\n if (bounds[3] > model.allBounds[3]) {\n model.allBounds[3] = bounds[3];\n }\n\n if (bounds[4] < model.allBounds[4]) {\n model.allBounds[4] = bounds[4];\n }\n\n if (bounds[5] > model.allBounds[5]) {\n model.allBounds[5] = bounds[5];\n }\n }\n }\n }\n\n if (nothingVisible) {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"uninitializeBounds\"](model.allBounds);\n vtkDebugMacro(\"Can't compute bounds, no 3D props are visible\");\n }\n\n return model.allBounds;\n };\n\n publicAPI.resetCamera = function () {\n var bounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var boundsToUse = bounds || publicAPI.computeVisiblePropBounds();\n var center = [0, 0, 0];\n\n if (!vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"areBoundsInitialized\"](boundsToUse)) {\n vtkDebugMacro('Cannot reset camera!');\n return false;\n }\n\n var vn = null;\n\n if (publicAPI.getActiveCamera()) {\n vn = model.activeCamera.getViewPlaneNormal();\n } else {\n vtkErrorMacro('Trying to reset non-existent camera');\n return false;\n } // Reset the perspective zoom factors, otherwise subsequent zooms will cause\n // the view angle to become very small and cause bad depth sorting.\n\n\n model.activeCamera.setViewAngle(30.0);\n center[0] = (boundsToUse[0] + boundsToUse[1]) / 2.0;\n center[1] = (boundsToUse[2] + boundsToUse[3]) / 2.0;\n center[2] = (boundsToUse[4] + boundsToUse[5]) / 2.0;\n var w1 = boundsToUse[1] - boundsToUse[0];\n var w2 = boundsToUse[3] - boundsToUse[2];\n var w3 = boundsToUse[5] - boundsToUse[4];\n w1 *= w1;\n w2 *= w2;\n w3 *= w3;\n var radius = w1 + w2 + w3; // If we have just a single point, pick a radius of 1.0\n\n radius = radius === 0 ? 1.0 : radius; // compute the radius of the enclosing sphere\n\n radius = Math.sqrt(radius) * 0.5; // default so that the bounding sphere fits within the view fustrum\n // compute the distance from the intersection of the view frustum with the\n // bounding sphere. Basically in 2D draw a circle representing the bounding\n // sphere in 2D then draw a horizontal line going out from the center of\n // the circle. That is the camera view. Then draw a line from the camera\n // position to the point where it intersects the circle. (it will be tangent\n // to the circle at this point, this is important, only go to the tangent\n // point, do not draw all the way to the view plane). Then draw the radius\n // from the tangent point to the center of the circle. You will note that\n // this forms a right triangle with one side being the radius, another being\n // the target distance for the camera, then just find the target dist using\n // a sin.\n\n var angle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"radiansFromDegrees\"](model.activeCamera.getViewAngle());\n var parallelScale = radius;\n var distance = radius / Math.sin(angle * 0.5); // check view-up vector against view plane normal\n\n var vup = model.activeCamera.getViewUp();\n\n if (Math.abs(vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"dot\"](vup, vn)) > 0.999) {\n vtkWarningMacro('Resetting view-up since view plane normal is parallel');\n model.activeCamera.setViewUp(-vup[2], vup[0], vup[1]);\n } // update the camera\n\n\n model.activeCamera.setFocalPoint(center[0], center[1], center[2]);\n model.activeCamera.setPosition(center[0] + distance * vn[0], center[1] + distance * vn[1], center[2] + distance * vn[2]);\n publicAPI.resetCameraClippingRange(boundsToUse); // setup default parallel scale\n\n model.activeCamera.setParallelScale(parallelScale); // update reasonable world to physical values\n\n model.activeCamera.setPhysicalScale(radius);\n model.activeCamera.setPhysicalTranslation(-center[0], -center[1], -center[2]); // Here to let parallel/distributed compositing intercept\n // and do the right thing.\n\n publicAPI.invokeEvent(RESET_CAMERA_EVENT);\n return true;\n };\n\n publicAPI.resetCameraClippingRange = function () {\n var bounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var boundsToUse = bounds || publicAPI.computeVisiblePropBounds();\n\n if (!vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"areBoundsInitialized\"](boundsToUse)) {\n vtkDebugMacro('Cannot reset camera clipping range!');\n return false;\n } // Make sure we have an active camera\n\n\n publicAPI.getActiveCameraAndResetIfCreated();\n\n if (!model.activeCamera) {\n vtkErrorMacro('Trying to reset clipping range of non-existent camera');\n return false;\n } // Get the exact range for the bounds\n\n\n var range = model.activeCamera.computeClippingRange(boundsToUse); // do not let far - near be less than 0.1 of the window height\n // this is for cases such as 2D images which may have zero range\n\n var minGap = 0.0;\n\n if (model.activeCamera.getParallelProjection()) {\n minGap = 0.1 * model.activeCamera.getParallelScale();\n } else {\n var angle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"radiansFromDegrees\"](model.activeCamera.getViewAngle());\n minGap = 0.2 * Math.tan(angle / 2.0) * range[1];\n }\n\n if (range[1] - range[0] < minGap) {\n minGap = minGap - range[1] + range[0];\n range[1] += minGap / 2.0;\n range[0] -= minGap / 2.0;\n } // Do not let the range behind the camera throw off the calculation.\n\n\n if (range[0] < 0.0) {\n range[0] = 0.0;\n } // Give ourselves a little breathing room\n\n\n range[0] = 0.99 * range[0] - (range[1] - range[0]) * model.clippingRangeExpansion;\n range[1] = 1.01 * range[1] + (range[1] - range[0]) * model.clippingRangeExpansion; // Make sure near is not bigger than far\n\n range[0] = range[0] >= range[1] ? 0.01 * range[1] : range[0]; // Make sure near is at least some fraction of far - this prevents near\n // from being behind the camera or too close in front. How close is too\n // close depends on the resolution of the depth buffer\n\n if (!model.nearClippingPlaneTolerance) {\n model.nearClippingPlaneTolerance = 0.01;\n } // make sure the front clipping range is not too far from the far clippnig\n // range, this is to make sure that the zbuffer resolution is effectively\n // used\n\n\n if (range[0] < model.nearClippingPlaneTolerance * range[1]) {\n range[0] = model.nearClippingPlaneTolerance * range[1];\n }\n\n model.activeCamera.setClippingRange(range[0], range[1]); // Here to let parallel/distributed compositing intercept\n // and do the right thing.\n\n publicAPI.invokeEvent(RESET_CAMERA_CLIPPING_RANGE_EVENT);\n return false;\n };\n\n publicAPI.setRenderWindow = function (renderWindow) {\n if (renderWindow !== model.renderWindow) {\n model.vtkWindow = renderWindow;\n model.renderWindow = renderWindow;\n }\n };\n\n publicAPI.visibleActorCount = function () {\n return model.props.filter(function (prop) {\n return prop.getVisibility();\n }).length;\n };\n\n publicAPI.visibleVolumeCount = publicAPI.visibleActorCount;\n\n publicAPI.getMTime = function () {\n var m1 = model.mtime;\n var m2 = model.activeCamera ? model.activeCamera.getMTime() : 0;\n\n if (m2 > m1) {\n m1 = m2;\n }\n\n var m3 = model.createdLight ? model.createdLight.getMTime() : 0;\n\n if (m3 > m1) {\n m1 = m3;\n }\n\n return m1;\n };\n\n publicAPI.getTransparent = function () {\n return !!model.preserveColorBuffer;\n };\n\n publicAPI.isActiveCameraCreated = function () {\n return !!model.activeCamera;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n pickedProp: null,\n activeCamera: null,\n allBounds: [],\n ambient: [1, 1, 1],\n allocatedRenderTime: 100,\n timeFactor: 1,\n createdLight: null,\n automaticLightCreation: true,\n twoSidedLighting: true,\n lastRenderTimeInSeconds: -1,\n renderWindow: null,\n lights: [],\n actors: [],\n volumes: [],\n lightFollowCamera: true,\n numberOfPropsRendered: 0,\n propArray: null,\n pathArray: null,\n layer: 0,\n preserveColorBuffer: false,\n preserveDepthBuffer: false,\n computeVisiblePropBounds: vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"createUninitializedBounds\"](),\n interactive: true,\n nearClippingPlaneTolerance: 0,\n clippingRangeExpansion: 0.05,\n erase: true,\n draw: true,\n useShadows: false,\n useDepthPeeling: false,\n occlusionRatio: 0,\n maximumNumberOfPeels: 4,\n selector: null,\n delegate: null,\n texturedBackground: false,\n backgroundTexture: null,\n pass: 0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Viewport__WEBPACK_IMPORTED_MODULE_5__[\"default\"].extend(publicAPI, model, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"get\"](publicAPI, model, ['renderWindow', 'allocatedRenderTime', 'timeFactor', 'lastRenderTimeInSeconds', 'numberOfPropsRendered', 'lastRenderingUsedDepthPeeling', 'selector']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['twoSidedLighting', 'lightFollowCamera', 'automaticLightCreation', 'erase', 'draw', 'nearClippingPlaneTolerance', 'clippingRangeExpansion', 'backingStore', 'interactive', 'layer', 'preserveColorBuffer', 'preserveDepthBuffer', 'useDepthPeeling', 'occlusionRatio', 'maximumNumberOfPeels', 'delegate', 'backgroundTexture', 'texturedBackground', 'useShadows', 'pass']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"getArray\"](publicAPI, model, ['actors', 'volumes', 'lights']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGetArray\"](publicAPI, model, ['background'], 4, 1.0); // Object methods\n\n vtkRenderer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkRenderer'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Renderer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Texture/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Texture/index.js ***! - \*********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkTexture methods\n// ----------------------------------------------------------------------------\n\nfunction vtkTexture(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkTexture');\n\n publicAPI.imageLoaded = function () {\n model.image.removeEventListener('load', publicAPI.imageLoaded);\n model.imageLoaded = true;\n publicAPI.modified();\n };\n\n publicAPI.setImage = function (image) {\n if (model.image === image) {\n return;\n }\n\n if (image !== null) {\n publicAPI.setInputData(null);\n publicAPI.setInputConnection(null);\n }\n\n model.image = image;\n model.imageLoaded = false;\n\n if (image.complete) {\n publicAPI.imageLoaded();\n } else {\n image.addEventListener('load', publicAPI.imageLoaded);\n }\n\n publicAPI.modified();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n repeat: false,\n interpolate: false,\n edgeClamp: false,\n image: null,\n imageLoaded: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].algo(publicAPI, model, 6, 0);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['imageLoaded']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['repeat', 'edgeClamp', 'interpolate', 'image']);\n vtkTexture(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkTexture'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Texture/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Viewport/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Viewport/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\n\nfunction notImplemented(method) {\n return function () {\n return vtkErrorMacro(\"vtkViewport::\".concat(method, \" - NOT IMPLEMENTED\"));\n };\n} // ----------------------------------------------------------------------------\n// vtkViewport methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkViewport(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkViewport'); // Public API methods\n\n publicAPI.getViewProps = function () {\n return model.props;\n };\n\n publicAPI.hasViewProp = function (prop) {\n return !!model.props.filter(function (item) {\n return item === prop;\n }).length;\n };\n\n publicAPI.addViewProp = function (prop) {\n if (prop && !publicAPI.hasViewProp(prop)) {\n model.props = model.props.concat(prop);\n }\n };\n\n publicAPI.removeViewProp = function (prop) {\n var newPropList = model.props.filter(function (item) {\n return item !== prop;\n });\n\n if (model.props.length !== newPropList.length) {\n model.props = newPropList;\n }\n };\n\n publicAPI.removeAllViewProps = function () {\n model.props = [];\n }; // this method get all the props including any nested props\n\n\n function gatherProps(prop) {\n var allProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n allProps.push(prop);\n var children = prop.getNestedProps();\n\n if (children && children.length) {\n for (var i = 0; i < children.length; i++) {\n gatherProps(children[i], allProps);\n }\n }\n\n return allProps;\n }\n\n publicAPI.getViewPropsWithNestedProps = function () {\n var allPropsArray = [];\n\n for (var i = 0; i < model.props.length; i++) {\n gatherProps(model.props[i], allPropsArray);\n }\n\n return allPropsArray;\n };\n\n publicAPI.addActor2D = publicAPI.addViewProp;\n\n publicAPI.removeActor2D = function (prop) {\n // VTK way: model.actors2D.RemoveItem(prop);\n publicAPI.removeViewProp(prop);\n };\n\n publicAPI.getActors2D = function () {\n model.actors2D = [];\n model.props.forEach(function (prop) {\n model.actors2D = model.actors2D.concat(prop.getActors2D());\n });\n return model.actors2D;\n };\n\n publicAPI.displayToView = function () {\n return vtkErrorMacro('call displayToView on your view instead');\n };\n\n publicAPI.viewToDisplay = function () {\n return vtkErrorMacro('callviewtodisplay on your view instead');\n };\n\n publicAPI.getSize = function () {\n return vtkErrorMacro('call getSize on your View instead');\n };\n\n publicAPI.normalizedDisplayToProjection = function (x, y, z) {\n // first to normalized viewport\n var nvp = publicAPI.normalizedDisplayToNormalizedViewport(x, y, z); // then to view\n\n return publicAPI.normalizedViewportToProjection(nvp[0], nvp[1], nvp[2]);\n };\n\n publicAPI.normalizedDisplayToNormalizedViewport = function (x, y, z) {\n var scale = [model.viewport[2] - model.viewport[0], model.viewport[3] - model.viewport[1]];\n return [(x - model.viewport[0]) / scale[0], (y - model.viewport[1]) / scale[1], z];\n };\n\n publicAPI.normalizedViewportToProjection = function (x, y, z) {\n return [x * 2.0 - 1.0, y * 2.0 - 1.0, z * 2.0 - 1.0];\n };\n\n publicAPI.projectionToNormalizedDisplay = function (x, y, z) {\n // first to nvp\n var nvp = publicAPI.projectionToNormalizedViewport(x, y, z); // then to ndp\n\n return publicAPI.normalizedViewportToNormalizedDisplay(nvp[0], nvp[1], nvp[2]);\n };\n\n publicAPI.normalizedViewportToNormalizedDisplay = function (x, y, z) {\n var scale = [model.viewport[2] - model.viewport[0], model.viewport[3] - model.viewport[1]];\n return [x * scale[0] + model.viewport[0], y * scale[1] + model.viewport[1], z];\n };\n\n publicAPI.projectionToNormalizedViewport = function (x, y, z) {\n return [(x + 1.0) * 0.5, (y + 1.0) * 0.5, (z + 1.0) * 0.5];\n };\n\n publicAPI.PickPropFrom = notImplemented('PickPropFrom');\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n vtkWindow: null,\n background: [0, 0, 0],\n background2: [0.2, 0.2, 0.2],\n gradientBackground: false,\n viewport: [0, 0, 1, 1],\n aspect: [1, 1],\n pixelAspect: [1, 1],\n props: [],\n actors2D: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'event');\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['viewport'], 4);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['background', 'background2'], 3);\n vtkViewport(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkViewport'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Viewport/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Volume/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Volume/index.js ***! - \********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Prop3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Prop3D */ \"./node_modules/vtk.js/Sources/Rendering/Core/Prop3D/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_VolumeProperty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/VolumeProperty */ \"./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/index.js\");\n\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkDebugMacro; // ----------------------------------------------------------------------------\n// vtkVolume methods\n// ----------------------------------------------------------------------------\n\nfunction vtkVolume(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkVolume');\n\n publicAPI.getVolumes = function () {\n return publicAPI;\n };\n\n publicAPI.makeProperty = vtk_js_Sources_Rendering_Core_VolumeProperty__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance;\n\n publicAPI.getProperty = function () {\n if (model.property === null) {\n model.property = publicAPI.makeProperty();\n }\n\n return model.property;\n };\n\n publicAPI.getBounds = function () {\n if (model.mapper === null) {\n return model.bounds;\n } // Check for the special case when the mapper's bounds are unknown\n\n\n var bds = model.mapper.getBounds();\n\n if (!bds || bds.length !== 6) {\n return bds;\n } // Check for the special case when the actor is empty.\n\n\n if (bds[0] > bds[1]) {\n model.mapperBounds = bds.concat(); // copy the mapper's bounds\n\n model.bounds = [1, -1, 1, -1, 1, -1];\n model.boundsMTime.modified();\n return bds;\n } // Check if we have cached values for these bounds - we cache the\n // values returned by model.mapper.getBounds() and we store the time\n // of caching. If the values returned this time are different, or\n // the modified time of this class is newer than the cached time,\n // then we need to rebuild.\n\n\n var zip = function zip(rows) {\n return rows[0].map(function (_, c) {\n return rows.map(function (row) {\n return row[c];\n });\n });\n };\n\n if (!model.mapperBounds || !zip([bds, model.mapperBounds]).reduce(function (a, b) {\n return a && b[0] === b[1];\n }, true) || publicAPI.getMTime() > model.boundsMTime.getMTime()) {\n vtkDebugMacro('Recomputing bounds...');\n model.mapperBounds = bds.map(function (x) {\n return x;\n });\n var bbox = [];\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getCorners(bds, bbox);\n publicAPI.computeMatrix();\n var tmp4 = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(tmp4, model.matrix);\n bbox.forEach(function (pt) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(pt, pt, tmp4);\n });\n /* eslint-disable no-multi-assign */\n\n model.bounds[0] = model.bounds[2] = model.bounds[4] = Number.MAX_VALUE;\n model.bounds[1] = model.bounds[3] = model.bounds[5] = -Number.MAX_VALUE;\n /* eslint-enable no-multi-assign */\n\n model.bounds = model.bounds.map(function (d, i) {\n return i % 2 === 0 ? bbox.reduce(function (a, b) {\n return a > b[i / 2] ? b[i / 2] : a;\n }, d) : bbox.reduce(function (a, b) {\n return a < b[(i - 1) / 2] ? b[(i - 1) / 2] : a;\n }, d);\n });\n model.boundsMTime.modified();\n }\n\n return model.bounds;\n };\n\n publicAPI.getMTime = function () {\n var mt = model.mtime;\n\n if (model.property !== null) {\n var time = model.property.getMTime();\n mt = time > mt ? time : mt;\n }\n\n return mt;\n };\n\n publicAPI.getRedrawMTime = function () {\n var mt = model.mtime;\n\n if (model.mapper !== null) {\n var time = model.mapper.getMTime();\n mt = time > mt ? time : mt;\n\n if (model.mapper.getInput() !== null) {\n // FIXME !!! getInputAlgorithm / getInput\n model.mapper.getInputAlgorithm().update();\n time = model.mapper.getInput().getMTime();\n mt = time > mt ? time : mt;\n }\n }\n\n return mt;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n mapper: null,\n property: null,\n bounds: [1, -1, 1, -1, 1, -1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Prop3D__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues); // vtkTimeStamp\n\n model.boundsMTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(model.boundsMTime); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].set(publicAPI, model, ['property']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['mapper']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getArray(publicAPI, model, ['bounds'], 6); // Object methods\n\n vtkVolume(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkVolume'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Volume/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/Constants.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/Constants.js ***! - \******************************************************************************/ -/*! exports provided: BlendMode, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BlendMode\", function() { return BlendMode; });\nvar BlendMode = {\n COMPOSITE_BLEND: 0,\n MAXIMUM_INTENSITY_BLEND: 1,\n MINIMUM_INTENSITY_BLEND: 2,\n AVERAGE_INTENSITY_BLEND: 3\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n BlendMode: BlendMode\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/index.js ***! - \**************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_VolumeMapper_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/VolumeMapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_AbstractMapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/AbstractMapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper/index.js\");\n\n\n\n\nvar BlendMode = vtk_js_Sources_Rendering_Core_VolumeMapper_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].BlendMode; // ----------------------------------------------------------------------------\n// vtkVolumeMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkVolumeMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkVolumeMapper');\n\n publicAPI.getBounds = function () {\n var input = publicAPI.getInputData();\n\n if (!input) {\n model.bounds = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"createUninitializedBounds\"]();\n } else {\n if (!model.static) {\n publicAPI.update();\n }\n\n model.bounds = input.getBounds();\n }\n\n return model.bounds;\n };\n\n publicAPI.update = function () {\n publicAPI.getInputData();\n };\n\n publicAPI.setBlendModeToComposite = function () {\n publicAPI.setBlendMode(BlendMode.COMPOSITE_BLEND);\n };\n\n publicAPI.setBlendModeToMaximumIntensity = function () {\n publicAPI.setBlendMode(BlendMode.MAXIMUM_INTENSITY_BLEND);\n };\n\n publicAPI.setBlendModeToMinimumIntensity = function () {\n publicAPI.setBlendMode(BlendMode.MINIMUM_INTENSITY_BLEND);\n };\n\n publicAPI.setBlendModeToAverageIntensity = function () {\n publicAPI.setBlendMode(BlendMode.AVERAGE_INTENSITY_BLEND);\n };\n\n publicAPI.getBlendModeAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(BlendMode, model.blendMode);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n// TODO: what values to use for averageIPScalarRange to get GLSL to use max / min values like [-Math.inf, Math.inf]?\n\n\nvar DEFAULT_VALUES = {\n bounds: [1, -1, 1, -1, 1, -1],\n sampleDistance: 1.0,\n imageSampleDistance: 1.0,\n maximumSamplesPerRay: 1000,\n autoAdjustSampleDistances: true,\n blendMode: BlendMode.COMPOSITE_BLEND,\n averageIPScalarRange: [-1000000.0, 1000000.0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Rendering_Core_AbstractMapper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].algo(publicAPI, model, 1, 0);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['sampleDistance', 'imageSampleDistance', 'maximumSamplesPerRay', 'autoAdjustSampleDistances', 'blendMode']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['averageIPScalarRange'], 2);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'lightingActivated'); // Object methods\n\n vtkVolumeMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkVolumeMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/Constants.js": -/*!********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/Constants.js ***! - \********************************************************************************/ -/*! exports provided: InterpolationType, OpacityMode, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InterpolationType\", function() { return InterpolationType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OpacityMode\", function() { return OpacityMode; });\nvar InterpolationType = {\n NEAREST: 0,\n LINEAR: 1,\n FAST_LINEAR: 2\n};\nvar OpacityMode = {\n FRACTIONAL: 0,\n PROPORTIONAL: 1\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n InterpolationType: InterpolationType,\n OpacityMode: OpacityMode\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/index.js ***! - \****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ColorTransferFunction */ \"./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PiecewiseFunction */ \"./node_modules/vtk.js/Sources/Common/DataModel/PiecewiseFunction/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/VolumeProperty/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\nvar InterpolationType = vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"].InterpolationType,\n OpacityMode = vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"].OpacityMode;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\nvar VTK_MAX_VRCOMP = 4; // ----------------------------------------------------------------------------\n// vtkVolumeProperty methods\n// ----------------------------------------------------------------------------\n\nfunction vtkVolumeProperty(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkVolumeProperty');\n\n publicAPI.getMTime = function () {\n var mTime = model.mtime;\n var time;\n\n for (var index = 0; index < VTK_MAX_VRCOMP; index++) {\n // Color MTimes\n if (model.componentData[index].colorChannels === 1) {\n if (model.componentData[index].grayTransferFunction) {\n // time that Gray transfer function was last modified\n time = model.componentData[index].grayTransferFunction.getMTime();\n mTime = mTime > time ? mTime : time;\n }\n } else if (model.componentData[index].colorChannels === 3) {\n if (model.componentData[index].rGBTransferFunction) {\n // time that RGB transfer function was last modified\n time = model.componentData[index].rGBTransferFunction.getMTime();\n mTime = mTime > time ? mTime : time;\n }\n } // Opacity MTimes\n\n\n if (model.componentData[index].scalarOpacity) {\n // time that Scalar opacity transfer function was last modified\n time = model.componentData[index].scalarOpacity.getMTime();\n mTime = mTime > time ? mTime : time;\n }\n\n if (model.componentData[index].gradientOpacity) {\n if (!model.componentData[index].disableGradientOpacity) {\n // time that Gradient opacity transfer function was last modified\n time = model.componentData[index].gradientOpacity.getMTime();\n mTime = mTime > time ? mTime : time;\n }\n }\n }\n\n return mTime;\n };\n\n publicAPI.getColorChannels = function (index) {\n if (index < 0 || index > 3) {\n vtkErrorMacro('Bad index - must be between 0 and 3');\n return 0;\n }\n\n return model.componentData[index].colorChannels;\n }; // Set the color of a volume to a gray transfer function\n\n\n publicAPI.setGrayTransferFunction = function (index, func) {\n var modified = false;\n\n if (model.componentData[index].grayTransferFunction !== func) {\n model.componentData[index].grayTransferFunction = func;\n modified = true;\n }\n\n if (model.componentData[index].colorChannels !== 1) {\n model.componentData[index].colorChannels = 1;\n modified = true;\n }\n\n if (modified) {\n publicAPI.modified();\n }\n\n return modified;\n }; // Get the currently set gray transfer function. Create one if none set.\n\n\n publicAPI.getGrayTransferFunction = function (index) {\n if (model.componentData[index].grayTransferFunction === null) {\n model.componentData[index].grayTransferFunction = vtk_js_Sources_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.componentData[index].grayTransferFunction.addPoint(0, 0.0);\n model.componentData[index].grayTransferFunction.addPoint(1024, 1.0);\n\n if (model.componentData[index].colorChannels !== 1) {\n model.componentData[index].colorChannels = 1;\n }\n\n publicAPI.modified();\n }\n\n return model.componentData[index].grayTransferFunction;\n }; // Set the color of a volume to an RGB transfer function\n\n\n publicAPI.setRGBTransferFunction = function (index, func) {\n var modified = false;\n\n if (model.componentData[index].rGBTransferFunction !== func) {\n model.componentData[index].rGBTransferFunction = func;\n modified = true;\n }\n\n if (model.componentData[index].colorChannels !== 3) {\n model.componentData[index].colorChannels = 3;\n modified = true;\n }\n\n if (modified) {\n publicAPI.modified();\n }\n\n return modified;\n }; // Get the currently set RGB transfer function. Create one if none set.\n\n\n publicAPI.getRGBTransferFunction = function (index) {\n if (model.componentData[index].rGBTransferFunction === null) {\n model.componentData[index].rGBTransferFunction = vtk_js_Sources_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.componentData[index].rGBTransferFunction.addRGBPoint(0, 0.0, 0.0, 0.0);\n model.componentData[index].rGBTransferFunction.addRGBPoint(1024, 1.0, 1.0, 1.0);\n\n if (model.componentData[index].colorChannels !== 3) {\n model.componentData[index].colorChannels = 3;\n }\n\n publicAPI.modified();\n }\n\n return model.componentData[index].rGBTransferFunction;\n }; // Set the scalar opacity of a volume to a transfer function\n\n\n publicAPI.setScalarOpacity = function (index, func) {\n if (model.componentData[index].scalarOpacity !== func) {\n model.componentData[index].scalarOpacity = func;\n publicAPI.modified();\n return true;\n }\n\n return false;\n }; // Get the scalar opacity transfer function. Create one if none set.\n\n\n publicAPI.getScalarOpacity = function (index) {\n if (model.componentData[index].scalarOpacity === null) {\n model.componentData[index].scalarOpacity = vtk_js_Sources_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.componentData[index].scalarOpacity.addPoint(0, 1.0);\n model.componentData[index].scalarOpacity.addPoint(1024, 1.0);\n publicAPI.modified();\n }\n\n return model.componentData[index].scalarOpacity;\n };\n\n publicAPI.setComponentWeight = function (index, value) {\n if (index < 0 || index >= VTK_MAX_VRCOMP) {\n vtkErrorMacro('Invalid index');\n return false;\n }\n\n var val = Math.min(1, Math.max(0, value));\n\n if (model.componentData[index].componentWeight !== val) {\n model.componentData[index].componentWeight = val;\n publicAPI.modified();\n return true;\n }\n\n return false;\n };\n\n publicAPI.getComponentWeight = function (index) {\n if (index < 0 || index >= VTK_MAX_VRCOMP) {\n vtkErrorMacro('Invalid index');\n return 0.0;\n }\n\n return model.componentData[index].componentWeight;\n };\n\n publicAPI.setInterpolationTypeToNearest = function () {\n return publicAPI.setInterpolationType(InterpolationType.NEAREST);\n };\n\n publicAPI.setInterpolationTypeToLinear = function () {\n return publicAPI.setInterpolationType(InterpolationType.LINEAR);\n };\n\n publicAPI.setInterpolationTypeToFastLinear = function () {\n return publicAPI.setInterpolationType(InterpolationType.FAST_LINEAR);\n };\n\n publicAPI.getInterpolationTypeAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(InterpolationType, model.interpolationType);\n };\n\n var sets = ['useGradientOpacity', 'scalarOpacityUnitDistance', 'gradientOpacityMinimumValue', 'gradientOpacityMinimumOpacity', 'gradientOpacityMaximumValue', 'gradientOpacityMaximumOpacity', 'opacityMode'];\n sets.forEach(function (val) {\n var cap = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(val);\n\n publicAPI[\"set\".concat(cap)] = function (index, value) {\n if (model.componentData[index][\"\".concat(val)] !== value) {\n model.componentData[index][\"\".concat(val)] = value;\n publicAPI.modified();\n return true;\n }\n\n return false;\n };\n });\n var gets = ['useGradientOpacity', 'scalarOpacityUnitDistance', 'gradientOpacityMinimumValue', 'gradientOpacityMinimumOpacity', 'gradientOpacityMaximumValue', 'gradientOpacityMaximumOpacity', 'opacityMode'];\n gets.forEach(function (val) {\n var cap = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(val);\n\n publicAPI[\"get\".concat(cap)] = function (index) {\n return model.componentData[index][\"\".concat(val)];\n };\n });\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n independentComponents: true,\n interpolationType: InterpolationType.FAST_LINEAR,\n shade: 0,\n ambient: 0.1,\n diffuse: 0.7,\n specular: 0.2,\n specularPower: 10.0,\n useLabelOutline: false,\n labelOutlineThickness: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n\n if (!model.componentData) {\n model.componentData = [];\n\n for (var i = 0; i < VTK_MAX_VRCOMP; ++i) {\n model.componentData.push({\n colorChannels: 1,\n grayTransferFunction: null,\n rGBTransferFunction: null,\n scalarOpacity: null,\n scalarOpacityUnitDistance: 1.0,\n opacityMode: OpacityMode.FRACTIONAL,\n gradientOpacityMinimumValue: 0,\n gradientOpacityMinimumOpacity: 0.0,\n gradientOpacityMaximumValue: 1.0,\n gradientOpacityMaximumOpacity: 1.0,\n useGradientOpacity: false,\n componentWeight: 1.0\n });\n }\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['independentComponents', 'interpolationType', 'shade', 'ambient', 'diffuse', 'specular', 'specularPower', 'useLabelOutline', 'labelOutlineThickness']); // Object methods\n\n vtkVolumeProperty(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkVolumeProperty'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Misc/GenericRenderWindow/index.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Misc/GenericRenderWindow/index.js ***! - \*********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_RenderWindow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/RenderWindow */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/RenderWindow/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Renderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Renderer */ \"./node_modules/vtk.js/Sources/Rendering/Core/Renderer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_RenderWindow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/RenderWindow */ \"./node_modules/vtk.js/Sources/Rendering/Core/RenderWindow/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_RenderWindowInteractor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/RenderWindowInteractor */ \"./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Style_InteractorStyleTrackballCamera__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Style/InteractorStyleTrackballCamera */ \"./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleTrackballCamera/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Points__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Points */ \"./node_modules/vtk.js/Sources/Common/Core/Points/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Actor */ \"./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n // Load basic classes for vtk() factory\n\n\n\n\n\n\n\nfunction vtkGenericRenderWindow(publicAPI, model) {\n // Capture resize trigger method to remove from publicAPI\n var invokeResize = publicAPI.invokeResize;\n delete publicAPI.invokeResize; // VTK renderWindow/renderer\n\n model.renderWindow = vtk_js_Sources_Rendering_Core_RenderWindow__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.renderer = vtk_js_Sources_Rendering_Core_Renderer__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.renderWindow.addRenderer(model.renderer); // OpenGLRenderWindow\n\n model.openGLRenderWindow = vtk_js_Sources_Rendering_OpenGL_RenderWindow__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.renderWindow.addView(model.openGLRenderWindow); // Interactor\n\n model.interactor = vtk_js_Sources_Rendering_Core_RenderWindowInteractor__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n model.interactor.setInteractorStyle(vtk_js_Sources_Interaction_Style_InteractorStyleTrackballCamera__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance());\n model.interactor.setView(model.openGLRenderWindow);\n model.interactor.initialize(); // Expose background\n\n publicAPI.setBackground = model.renderer.setBackground; // Update BG color\n\n publicAPI.setBackground.apply(publicAPI, _toConsumableArray(model.background)); // Handle window resize\n\n publicAPI.resize = function () {\n if (model.container) {\n var dims = model.container.getBoundingClientRect();\n var devicePixelRatio = window.devicePixelRatio || 1;\n model.openGLRenderWindow.setSize(Math.floor(dims.width * devicePixelRatio), Math.floor(dims.height * devicePixelRatio));\n invokeResize();\n model.renderWindow.render();\n }\n }; // Handle DOM container relocation\n\n\n publicAPI.setContainer = function (el) {\n if (model.container) {\n model.interactor.unbindEvents(model.container);\n } // Switch container\n\n\n model.container = el;\n model.openGLRenderWindow.setContainer(model.container); // Bind to new container\n\n if (model.container) {\n model.interactor.bindEvents(model.container);\n }\n }; // Properly release GL context\n\n\n publicAPI.delete = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.setContainer, model.openGLRenderWindow.delete, publicAPI.delete); // Handle size\n\n if (model.listenWindowResize) {\n window.addEventListener('resize', publicAPI.resize);\n }\n\n publicAPI.resize();\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n background: [0.32, 0.34, 0.43],\n listenWindowResize: true,\n container: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['renderWindow', 'renderer', 'openGLRenderWindow', 'interactor', 'container']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'resize'); // Object specific methods\n\n vtkGenericRenderWindow(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Misc/GenericRenderWindow/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor/index.js ***! - \*********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLActor methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLActor(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLActor'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.openGLRenderWindow = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow');\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n model.context = model.openGLRenderWindow.getContext();\n publicAPI.prepareNodes();\n publicAPI.addMissingNodes(model.renderable.getTextures());\n publicAPI.addMissingNode(model.renderable.getMapper());\n publicAPI.removeUnusedNodes(); // we store textures and mapper\n\n model.ogltextures = null;\n model.activeTextures = null;\n\n for (var index = 0; index < model.children.length; index++) {\n var child = model.children[index];\n\n if (child.isA('vtkOpenGLTexture')) {\n if (!model.ogltextures) {\n model.ogltextures = [];\n }\n\n model.ogltextures.push(child);\n } else {\n model.oglmapper = child;\n }\n }\n }\n };\n\n publicAPI.traverseOpaqueZBufferPass = function (renderPass) {\n publicAPI.traverseOpaquePass(renderPass);\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseOpaquePass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || !model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.oglmapper.traverse(renderPass);\n publicAPI.apply(renderPass, false);\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseTranslucentPass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.oglmapper.traverse(renderPass);\n publicAPI.apply(renderPass, false);\n };\n\n publicAPI.activateTextures = function () {\n // always traverse textures first, then mapper\n if (!model.ogltextures) {\n return;\n }\n\n model.activeTextures = [];\n\n for (var index = 0; index < model.ogltextures.length; index++) {\n var child = model.ogltextures[index];\n child.render();\n\n if (child.getHandle()) {\n model.activeTextures.push(child);\n }\n }\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (model.renderable.getIsOpaque()) {\n renderPass.incrementOpaqueActorCount();\n } else {\n renderPass.incrementTranslucentActorCount();\n }\n }\n };\n\n publicAPI.opaqueZBufferPass = function (prepass, renderPass) {\n return publicAPI.opaquePass(prepass, renderPass);\n };\n\n publicAPI.opaquePass = function (prepass, renderPass) {\n if (prepass) {\n model.openGLRenderWindow.enableDepthMask();\n publicAPI.activateTextures();\n } else if (model.activeTextures) {\n for (var index = 0; index < model.activeTextures.length; index++) {\n model.activeTextures[index].deactivate();\n }\n }\n }; // Renders myself\n\n\n publicAPI.translucentPass = function (prepass, renderPass) {\n if (prepass) {\n model.openGLRenderWindow.disableDepthMask();\n publicAPI.activateTextures();\n } else if (model.activeTextures) {\n for (var index = 0; index < model.activeTextures.length; index++) {\n model.activeTextures[index].deactivate();\n }\n }\n };\n\n publicAPI.getKeyMatrices = function () {\n // has the actor changed?\n if (model.renderable.getMTime() > model.keyMatrixTime.getMTime()) {\n model.renderable.computeMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.keyMatrices.mcwc, model.renderable.getMatrix());\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.mcwc, model.keyMatrices.mcwc);\n\n if (model.renderable.getIsIdentity()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(model.keyMatrices.normalMatrix);\n } else {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromMat4(model.keyMatrices.normalMatrix, model.keyMatrices.mcwc);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].invert(model.keyMatrices.normalMatrix, model.keyMatrices.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].transpose(model.keyMatrices.normalMatrix, model.keyMatrices.normalMatrix);\n }\n\n model.keyMatrixTime.modified();\n }\n\n return model.keyMatrices;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n keyMatrixTime: null,\n keyMatrices: null,\n activeTextures: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatrixTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.keyMatrixTime, {\n mtime: 0\n });\n model.keyMatrices = {\n normalMatrix: gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(new Float64Array(9)),\n mcwc: gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16))\n }; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['context']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"get\"](publicAPI, model, ['activeTextures']); // Object methods\n\n vtkOpenGLActor(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkActor', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor2D/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor2D/index.js ***! - \***********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLActor methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLActor2D(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLActor2D'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n if (!model.renderable) {\n return;\n }\n\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n publicAPI.prepareNodes();\n publicAPI.addMissingNodes(model.renderable.getTextures());\n publicAPI.addMissingNode(model.renderable.getMapper());\n publicAPI.removeUnusedNodes();\n }\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseOpaquePass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || !model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.children.forEach(function (child) {\n if (!child.isA('vtkOpenGLTexture')) {\n child.traverse(renderPass);\n }\n });\n publicAPI.apply(renderPass, false);\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseTranslucentPass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.children.forEach(function (child) {\n if (!child.isA('vtkOpenGLTexture')) {\n child.traverse(renderPass);\n }\n });\n publicAPI.apply(renderPass, false);\n };\n\n publicAPI.activateTextures = function () {\n // always traverse textures first, then mapper\n model.activeTextures = [];\n model.children.forEach(function (child) {\n if (child.isA('vtkOpenGLTexture')) {\n child.render();\n\n if (child.getHandle()) {\n model.activeTextures.push(child);\n }\n }\n });\n }; // Renders myself\n\n\n publicAPI.opaquePass = function (prepass, renderPass) {\n if (prepass) {\n model.context = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow').getContext();\n model.context.depthMask(true);\n publicAPI.activateTextures();\n } else {\n // deactivate textures\n model.activeTextures.forEach(function (child) {\n child.deactivate();\n });\n }\n }; // Renders myself\n\n\n publicAPI.translucentPass = function (prepass, renderPass) {\n if (prepass) {\n model.context = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow').getContext();\n model.context.depthMask(false);\n publicAPI.activateTextures();\n } else {\n // deactivate textures\n model.activeTextures.forEach(function (child) {\n child.deactivate();\n });\n model.context.depthMask(true);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n activeTextures: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['context']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"get\"](publicAPI, model, ['activeTextures']); // Object methods\n\n vtkOpenGLActor2D(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__[\"registerOverride\"])('vtkActor2D', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor2D/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants.js": -/*!********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants.js ***! - \********************************************************************************/ -/*! exports provided: ObjectType, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObjectType\", function() { return ObjectType; });\nvar ObjectType = {\n ARRAY_BUFFER: 0,\n ELEMENT_ARRAY_BUFFER: 1,\n TEXTURE_BUFFER: 2\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ObjectType: ObjectType\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/index.js ***! - \****************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar ObjectType = vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ObjectType; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n// ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\nvar STATIC = {}; // ----------------------------------------------------------------------------\n// vtkOpenGLBufferObject methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLBufferObject(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLBufferObject'); // Class-specific private functions\n\n function convertType(type) {\n switch (type) {\n case ObjectType.ELEMENT_ARRAY_BUFFER:\n return model.context.ELEMENT_ARRAY_BUFFER;\n\n case ObjectType.TEXTURE_BUFFER:\n if ('TEXTURE_BUFFER' in model.context) {\n return model.context.TEXTURE_BUFFER;\n }\n\n /* eslint-disable no-fallthrough */\n // Intentional fallthrough in case there is no TEXTURE_BUFFER in WebGL\n\n default:\n /* eslint-enable no-fallthrough */\n\n case ObjectType.ARRAY_BUFFER:\n return model.context.ARRAY_BUFFER;\n }\n }\n\n var internalType = null;\n var internalHandle = null;\n var dirty = true;\n var error = ''; // Public API methods\n\n publicAPI.getType = function () {\n return internalType;\n };\n\n publicAPI.setType = function (value) {\n internalType = value;\n };\n\n publicAPI.getHandle = function () {\n return internalHandle;\n };\n\n publicAPI.isReady = function () {\n return dirty === false;\n };\n\n publicAPI.generateBuffer = function (type) {\n var objectTypeGL = convertType(type);\n\n if (internalHandle === null) {\n internalHandle = model.context.createBuffer();\n internalType = type;\n }\n\n return convertType(internalType) === objectTypeGL;\n };\n\n publicAPI.upload = function (data, type) {\n // buffer, size, type\n var alreadyGenerated = publicAPI.generateBuffer(type);\n\n if (!alreadyGenerated) {\n error = 'Trying to upload array buffer to incompatible buffer.';\n return false;\n }\n\n model.context.bindBuffer(convertType(internalType), internalHandle);\n model.context.bufferData(convertType(internalType), data, model.context.STATIC_DRAW);\n dirty = false;\n return true;\n };\n\n publicAPI.bind = function () {\n if (!internalHandle) {\n return false;\n }\n\n model.context.bindBuffer(convertType(internalType), internalHandle);\n return true;\n };\n\n publicAPI.release = function () {\n if (!internalHandle) {\n return false;\n }\n\n model.context.bindBuffer(convertType(internalType), null);\n return true;\n };\n\n publicAPI.releaseGraphicsResources = function () {\n if (internalHandle !== null) {\n model.context.bindBuffer(convertType(internalType), null);\n model.context.deleteBuffer(internalHandle);\n internalHandle = null;\n }\n };\n\n publicAPI.setOpenGLRenderWindow = function (rw) {\n if (model.openGLRenderWindow === rw) {\n return;\n }\n\n publicAPI.releaseGraphicsResources();\n model.openGLRenderWindow = rw;\n model.context = null;\n\n if (rw) {\n model.context = model.openGLRenderWindow.getContext();\n }\n };\n\n publicAPI.getError = function () {\n return error;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n objectType: ObjectType.ARRAY_BUFFER,\n openGLRenderWindow: null,\n context: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['openGLRenderWindow']);\n vtkOpenGLBufferObject(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread(_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC), vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Camera/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Camera/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLCamera methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLCamera(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLCamera');\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n model.openGLRenderWindow = model.openGLRenderer.getParent();\n model.context = model.openGLRenderWindow.getContext();\n }\n }; // Renders myself\n\n\n publicAPI.opaquePass = function (prepass) {\n if (prepass) {\n var tsize = model.openGLRenderer.getTiledSizeAndOrigin();\n model.context.viewport(tsize.lowerLeftU, tsize.lowerLeftV, tsize.usize, tsize.vsize);\n model.context.scissor(tsize.lowerLeftU, tsize.lowerLeftV, tsize.usize, tsize.vsize);\n }\n };\n\n publicAPI.translucentPass = publicAPI.opaquePass;\n publicAPI.opaqueZBufferPass = publicAPI.opaquePass;\n publicAPI.volumePass = publicAPI.opaquePass;\n\n publicAPI.getKeyMatrices = function (ren) {\n // has the camera changed?\n if (ren !== model.lastRenderer || model.openGLRenderWindow.getMTime() > model.keyMatrixTime.getMTime() || publicAPI.getMTime() > model.keyMatrixTime.getMTime() || ren.getMTime() > model.keyMatrixTime.getMTime() || model.renderable.getMTime() > model.keyMatrixTime.getMTime()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.keyMatrices.wcvc, model.renderable.getViewMatrix());\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromMat4(model.keyMatrices.normalMatrix, model.keyMatrices.wcvc);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].invert(model.keyMatrices.normalMatrix, model.keyMatrices.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.wcvc, model.keyMatrices.wcvc);\n var aspectRatio = model.openGLRenderer.getAspectRatio();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.keyMatrices.vcpc, model.renderable.getProjectionMatrix(aspectRatio, -1, 1));\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.vcpc, model.keyMatrices.vcpc);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.keyMatrices.wcpc, model.keyMatrices.vcpc, model.keyMatrices.wcvc);\n model.keyMatrixTime.modified();\n model.lastRenderer = ren;\n }\n\n return model.keyMatrices;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n lastRenderer: null,\n keyMatrixTime: null,\n keyMatrices: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatrixTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.keyMatrixTime); // values always get set by the get method\n\n model.keyMatrices = {\n normalMatrix: new Float64Array(9),\n vcpc: new Float64Array(16),\n wcvc: new Float64Array(16),\n wcpc: new Float64Array(16)\n }; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['context', 'keyMatrixTime']); // Object methods\n\n vtkOpenGLCamera(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkCamera', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Camera/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/CellArrayBufferObject/index.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/CellArrayBufferObject/index.js ***! - \*************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/BufferObject */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js\");\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// Static functions\n// ----------------------------------------------------------------------------\n\nfunction computeInverseShiftAndScaleMatrix(coordShift, coordScale) {\n var inverseScale = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].inverse(inverseScale, coordScale);\n var matrix = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].fromRotationTranslationScale(matrix, gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].create(), coordShift, inverseScale);\n return matrix;\n}\n\nfunction shouldApplyCoordShiftAndScale(coordShift, coordScale) {\n if (coordShift === null || coordScale === null) {\n return false;\n }\n\n return !(gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].exactEquals(coordShift, [0, 0, 0]) && gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].exactEquals(coordScale, [1, 1, 1]));\n} // ----------------------------------------------------------------------------\n// vtkOpenGLCellArrayBufferObject methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkOpenGLCellArrayBufferObject(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLCellArrayBufferObject');\n publicAPI.setType(vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_3__[\"ObjectType\"].ARRAY_BUFFER);\n\n publicAPI.createVBO = function (cellArray, inRep, outRep, options) {\n if (!cellArray.getData() || !cellArray.getData().length) {\n model.elementCount = 0;\n return 0;\n } // Figure out how big each block will be, currently 6 or 7 floats.\n\n\n model.blockSize = 3;\n model.vertexOffset = 0;\n model.normalOffset = 0;\n model.tCoordOffset = 0;\n model.tCoordComponents = 0;\n model.colorComponents = 0;\n model.colorOffset = 0;\n model.customData = [];\n var pointData = options.points.getData();\n var normalData = null;\n var tcoordData = null;\n var colorData = null;\n var colorComponents = options.colors ? options.colors.getNumberOfComponents() : 0;\n var textureComponents = options.tcoords ? options.tcoords.getNumberOfComponents() : 0; // the values of 4 below are because floats are 4 bytes\n\n if (options.normals) {\n model.normalOffset = 4 * model.blockSize;\n model.blockSize += 3;\n normalData = options.normals.getData();\n }\n\n if (options.customAttributes) {\n options.customAttributes.forEach(function (a) {\n if (a) {\n model.customData.push({\n data: a.getData(),\n offset: 4 * model.blockSize,\n components: a.getNumberOfComponents(),\n name: a.getName()\n });\n model.blockSize += a.getNumberOfComponents();\n }\n });\n }\n\n if (options.tcoords) {\n model.tCoordOffset = 4 * model.blockSize;\n model.tCoordComponents = textureComponents;\n model.blockSize += textureComponents;\n tcoordData = options.tcoords.getData();\n }\n\n if (options.colors) {\n model.colorComponents = options.colors.getNumberOfComponents();\n model.colorOffset = 0;\n colorData = options.colors.getData();\n\n if (!model.colorBO) {\n model.colorBO = vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n }\n\n model.colorBO.setOpenGLRenderWindow(model.openGLRenderWindow);\n } else {\n model.colorBO = null;\n }\n\n model.stride = 4 * model.blockSize;\n var pointIdx = 0;\n var normalIdx = 0;\n var tcoordIdx = 0;\n var colorIdx = 0;\n var custIdx = 0;\n var cellCount = 0;\n var addAPoint;\n var cellBuilders = {\n // easy, every input point becomes an output point\n anythingToPoints: function anythingToPoints(numPoints, cellPts, offset) {\n for (var i = 0; i < numPoints; ++i) {\n addAPoint(cellPts[offset + i]);\n }\n },\n linesToWireframe: function linesToWireframe(numPoints, cellPts, offset) {\n // for lines we add a bunch of segments\n for (var i = 0; i < numPoints - 1; ++i) {\n addAPoint(cellPts[offset + i]);\n addAPoint(cellPts[offset + i + 1]);\n }\n },\n polysToWireframe: function polysToWireframe(numPoints, cellPts, offset) {\n // for polys we add a bunch of segments and close it\n if (numPoints > 2) {\n for (var i = 0; i < numPoints; ++i) {\n addAPoint(cellPts[offset + i]);\n addAPoint(cellPts[offset + (i + 1) % numPoints]);\n }\n }\n },\n stripsToWireframe: function stripsToWireframe(numPoints, cellPts, offset) {\n if (numPoints > 2) {\n // for strips we add a bunch of segments and close it\n for (var i = 0; i < numPoints - 1; ++i) {\n addAPoint(cellPts[offset + i]);\n addAPoint(cellPts[offset + i + 1]);\n }\n\n for (var _i = 0; _i < numPoints - 2; _i++) {\n addAPoint(cellPts[offset + _i]);\n addAPoint(cellPts[offset + _i + 2]);\n }\n }\n },\n polysToSurface: function polysToSurface(npts, cellPts, offset) {\n for (var i = 0; i < npts - 2; i++) {\n addAPoint(cellPts[offset + 0]);\n addAPoint(cellPts[offset + i + 1]);\n addAPoint(cellPts[offset + i + 2]);\n }\n },\n stripsToSurface: function stripsToSurface(npts, cellPts, offset) {\n for (var i = 0; i < npts - 2; i++) {\n addAPoint(cellPts[offset + i]);\n addAPoint(cellPts[offset + i + 1 + i % 2]);\n addAPoint(cellPts[offset + i + 1 + (i + 1) % 2]);\n }\n }\n };\n var cellCounters = {\n // easy, every input point becomes an output point\n anythingToPoints: function anythingToPoints(numPoints, cellPts) {\n return numPoints;\n },\n linesToWireframe: function linesToWireframe(numPoints, cellPts) {\n if (numPoints > 1) {\n return (numPoints - 1) * 2;\n }\n\n return 0;\n },\n polysToWireframe: function polysToWireframe(numPoints, cellPts) {\n if (numPoints > 2) {\n return numPoints * 2;\n }\n\n return 0;\n },\n stripsToWireframe: function stripsToWireframe(numPoints, cellPts) {\n if (numPoints > 2) {\n return numPoints * 4 - 6;\n }\n\n return 0;\n },\n polysToSurface: function polysToSurface(npts, cellPts) {\n if (npts > 2) {\n return (npts - 2) * 3;\n }\n\n return 0;\n },\n stripsToSurface: function stripsToSurface(npts, cellPts, offset) {\n if (npts > 2) {\n return (npts - 2) * 3;\n }\n\n return 0;\n }\n };\n var func = null;\n var countFunc = null;\n\n if (outRep === vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_4__[\"Representation\"].POINTS || inRep === 'verts') {\n func = cellBuilders.anythingToPoints;\n countFunc = cellCounters.anythingToPoints;\n } else if (outRep === vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_4__[\"Representation\"].WIREFRAME || inRep === 'lines') {\n func = cellBuilders[\"\".concat(inRep, \"ToWireframe\")];\n countFunc = cellCounters[\"\".concat(inRep, \"ToWireframe\")];\n } else {\n func = cellBuilders[\"\".concat(inRep, \"ToSurface\")];\n countFunc = cellCounters[\"\".concat(inRep, \"ToSurface\")];\n }\n\n var array = cellArray.getData();\n var size = array.length;\n var caboCount = 0;\n\n for (var index = 0; index < size;) {\n caboCount += countFunc(array[index], array);\n index += array[index] + 1;\n }\n\n var packedUCVBO = null;\n var packedVBO = new Float32Array(caboCount * model.blockSize);\n\n if (colorData) {\n packedUCVBO = new Uint8Array(caboCount * 4);\n }\n\n var vboidx = 0;\n var ucidx = 0; // Find out if shift scale should be used\n // Compute squares of diagonal size and distance from the origin\n\n var diagSq = 0.0;\n var distSq = 0.0;\n\n for (var i = 0; i < 3; ++i) {\n var range = options.points.getRange(i);\n var delta = range[1] - range[0];\n diagSq += delta * delta;\n var distShift = 0.5 * (range[1] + range[0]);\n distSq += distShift * distShift;\n }\n\n var useShiftAndScale = diagSq > 0 && (Math.abs(distSq) / diagSq > 1.0e6 || // If data is far from the origin relative to its size\n Math.abs(Math.log10(diagSq)) > 3.0 || // If the size is huge when not far from the origin\n diagSq === 0 && distSq > 1.0e6); // If data is a point, but far from the origin\n\n if (useShiftAndScale) {\n // Compute shift and scale vectors\n var coordShift = new Float64Array(3);\n var coordScale = new Float64Array(3);\n\n for (var _i2 = 0; _i2 < 3; ++_i2) {\n var _range = options.points.getRange(_i2);\n\n var _delta = _range[1] - _range[0];\n\n coordShift[_i2] = 0.5 * (_range[1] + _range[0]);\n coordScale[_i2] = _delta > 0 ? 1.0 / _delta : 1.0;\n }\n\n publicAPI.setCoordShiftAndScale(coordShift, coordScale);\n } else if (model.coordShiftAndScaleEnabled === true) {\n // Make sure to reset\n publicAPI.setCoordShiftAndScale(null, null);\n }\n\n addAPoint = function addAPointFunc(i) {\n // Vertices\n pointIdx = i * 3;\n\n if (!model.coordShiftAndScaleEnabled) {\n packedVBO[vboidx++] = pointData[pointIdx++];\n packedVBO[vboidx++] = pointData[pointIdx++];\n packedVBO[vboidx++] = pointData[pointIdx++];\n } else {\n // Apply shift and scale\n packedVBO[vboidx++] = (pointData[pointIdx++] - model.coordShift[0]) * model.coordScale[0];\n packedVBO[vboidx++] = (pointData[pointIdx++] - model.coordShift[1]) * model.coordScale[1];\n packedVBO[vboidx++] = (pointData[pointIdx++] - model.coordShift[2]) * model.coordScale[2];\n }\n\n if (normalData !== null) {\n if (options.haveCellNormals) {\n normalIdx = (cellCount + options.cellOffset) * 3;\n } else {\n normalIdx = i * 3;\n }\n\n packedVBO[vboidx++] = normalData[normalIdx++];\n packedVBO[vboidx++] = normalData[normalIdx++];\n packedVBO[vboidx++] = normalData[normalIdx++];\n }\n\n model.customData.forEach(function (attr) {\n custIdx = i * attr.components;\n\n for (var j = 0; j < attr.components; ++j) {\n packedVBO[vboidx++] = attr.data[custIdx++];\n }\n });\n\n if (tcoordData !== null) {\n tcoordIdx = i * textureComponents;\n\n for (var j = 0; j < textureComponents; ++j) {\n packedVBO[vboidx++] = tcoordData[tcoordIdx++];\n }\n }\n\n if (colorData !== null) {\n if (options.haveCellScalars) {\n colorIdx = (cellCount + options.cellOffset) * colorComponents;\n } else {\n colorIdx = i * colorComponents;\n }\n\n packedUCVBO[ucidx++] = colorData[colorIdx++];\n packedUCVBO[ucidx++] = colorData[colorIdx++];\n packedUCVBO[ucidx++] = colorData[colorIdx++];\n packedUCVBO[ucidx++] = colorComponents === 4 ? colorData[colorIdx++] : 255;\n }\n };\n\n for (var _index = 0; _index < size;) {\n func(array[_index], array, _index + 1);\n _index += array[_index] + 1;\n cellCount++;\n }\n\n model.elementCount = caboCount;\n publicAPI.upload(packedVBO, vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_3__[\"ObjectType\"].ARRAY_BUFFER);\n\n if (model.colorBO) {\n model.colorBOStride = 4;\n model.colorBO.upload(packedUCVBO, vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_3__[\"ObjectType\"].ARRAY_BUFFER);\n }\n\n return cellCount;\n };\n\n publicAPI.setCoordShiftAndScale = function (coordShift, coordScale) {\n if (coordShift !== null && (coordShift.constructor !== Float64Array || coordShift.length !== 3)) {\n vtkErrorMacro('Wrong type for coordShift, expected vec3 or null');\n return;\n }\n\n if (coordScale !== null && (coordScale.constructor !== Float64Array || coordScale.length !== 3)) {\n vtkErrorMacro('Wrong type for coordScale, expected vec3 or null');\n return;\n }\n\n if (model.coordShift === null || coordShift === null || !gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].equals(coordShift, model.coordShift)) {\n model.coordShift = coordShift;\n }\n\n if (model.coordScale === null || coordScale === null || !gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].equals(coordScale, model.coordScale)) {\n model.coordScale = coordScale;\n }\n\n model.coordShiftAndScaleEnabled = shouldApplyCoordShiftAndScale(model.coordShift, model.coordScale);\n\n if (model.coordShiftAndScaleEnabled) {\n model.inverseShiftAndScaleMatrix = computeInverseShiftAndScaleMatrix(model.coordShift, model.coordScale);\n } else {\n model.inverseShiftAndScaleMatrix = null;\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n elementCount: 0,\n stride: 0,\n colorBOStride: 0,\n vertexOffset: 0,\n normalOffset: 0,\n tCoordOffset: 0,\n tCoordComponents: 0,\n colorOffset: 0,\n colorComponents: 0,\n tcoordBO: null,\n customData: [],\n coordShift: null,\n coordScale: null,\n coordShiftAndScaleEnabled: false,\n inverseShiftAndScaleMatrix: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['colorBO', 'elementCount', 'stride', 'colorBOStride', 'vertexOffset', 'normalOffset', 'tCoordOffset', 'tCoordComponents', 'colorOffset', 'colorComponents', 'customData']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get(publicAPI, model, ['coordShift', 'coordScale', 'coordShiftAndScaleEnabled', 'inverseShiftAndScaleMatrix']); // Object specific methods\n\n vtkOpenGLCellArrayBufferObject(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/CellArrayBufferObject/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ForwardPass/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ForwardPass/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Framebuffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Framebuffer */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Framebuffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_RenderPass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/RenderPass */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderPass/index.js\");\n\n\n // ----------------------------------------------------------------------------\n\nfunction vtkForwardPass(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkForwardPass'); // this pass implements a forward rendering pipeline\n // if both volumes and opaque geometry are present\n // it will mix the two together by capturing a zbuffer\n // first\n\n publicAPI.traverse = function (viewNode) {\n var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (model.deleted) {\n return;\n } // we just render our delegates in order\n\n\n model.currentParent = parent; // build\n\n publicAPI.setCurrentOperation('buildPass');\n viewNode.traverse(publicAPI);\n var numlayers = viewNode.getRenderable().getNumberOfLayers(); // iterate over renderers\n\n var renderers = viewNode.getChildren();\n\n for (var i = 0; i < numlayers; i++) {\n for (var index = 0; index < renderers.length; index++) {\n var renNode = renderers[index];\n var ren = viewNode.getRenderable().getRenderers()[index];\n\n if (ren.getDraw() && ren.getLayer() === i) {\n // check for both opaque and volume actors\n model.opaqueActorCount = 0;\n model.translucentActorCount = 0;\n model.volumeCount = 0;\n publicAPI.setCurrentOperation('queryPass');\n renNode.traverse(publicAPI); // do we need to capture a zbuffer?\n\n if (model.opaqueActorCount > 0 && model.volumeCount > 0 || model.depthRequested) {\n var size = viewNode.getFramebufferSize(); // make sure the framebuffer is setup\n\n if (model.framebuffer === null) {\n model.framebuffer = vtk_js_Sources_Rendering_OpenGL_Framebuffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n }\n\n model.framebuffer.setOpenGLRenderWindow(viewNode);\n model.framebuffer.saveCurrentBindingsAndBuffers();\n var fbSize = model.framebuffer.getSize();\n\n if (fbSize === null || fbSize[0] !== size[0] || fbSize[1] !== size[1]) {\n model.framebuffer.create(size[0], size[1]);\n model.framebuffer.populateFramebuffer();\n }\n\n model.framebuffer.bind();\n publicAPI.setCurrentOperation('opaqueZBufferPass');\n renNode.traverse(publicAPI);\n model.framebuffer.restorePreviousBindingsAndBuffers(); // reset now that we have done it\n\n model.depthRequested = false;\n }\n\n publicAPI.setCurrentOperation('cameraPass');\n renNode.traverse(publicAPI);\n\n if (model.opaqueActorCount > 0) {\n publicAPI.setCurrentOperation('opaquePass');\n renNode.traverse(publicAPI);\n }\n\n if (model.translucentActorCount > 0) {\n publicAPI.setCurrentOperation('translucentPass');\n renNode.traverse(publicAPI);\n }\n\n if (model.volumeCount > 0) {\n publicAPI.setCurrentOperation('volumePass');\n renNode.traverse(publicAPI);\n }\n }\n }\n }\n };\n\n publicAPI.getZBufferTexture = function () {\n if (model.framebuffer) {\n return model.framebuffer.getColorTexture();\n }\n\n return null;\n };\n\n publicAPI.requestDepth = function () {\n model.depthRequested = true;\n };\n\n publicAPI.incrementOpaqueActorCount = function () {\n return model.opaqueActorCount++;\n };\n\n publicAPI.incrementTranslucentActorCount = function () {\n return model.translucentActorCount++;\n };\n\n publicAPI.incrementVolumeCount = function () {\n return model.volumeCount++;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n opaqueActorCount: 0,\n translucentActorCount: 0,\n volumeCount: 0,\n framebuffer: null,\n depthRequested: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_Rendering_SceneGraph_RenderPass__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['framebuffer']); // Object methods\n\n vtkForwardPass(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkForwardPass'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ForwardPass/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Framebuffer/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Framebuffer/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkFramebuffer methods\n// ----------------------------------------------------------------------------\n\nfunction vtkFramebuffer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkFramebuffer');\n\n publicAPI.getBothMode = function () {\n return model.context.FRAMEBUFFER;\n }; // publicAPI.getDrawMode = () => model.context.DRAW_FRAMEBUFFER;\n // publicAPI.getReadMode = () => model.context.READ_FRAMEBUFFER;\n\n\n publicAPI.saveCurrentBindingsAndBuffers = function (modeIn) {\n var mode = typeof modeIn !== 'undefined' ? modeIn : publicAPI.getBothMode();\n publicAPI.saveCurrentBindings(mode);\n publicAPI.saveCurrentBuffers(mode);\n };\n\n publicAPI.saveCurrentBindings = function (modeIn) {\n var gl = model.context;\n model.previousDrawBinding = gl.getParameter(model.context.FRAMEBUFFER_BINDING);\n model.previousActiveFramebuffer = model.openGLRenderWindow.getActiveFramebuffer();\n };\n\n publicAPI.saveCurrentBuffers = function (modeIn) {// noop on webgl 1\n };\n\n publicAPI.restorePreviousBindingsAndBuffers = function (modeIn) {\n var mode = typeof modeIn !== 'undefined' ? modeIn : publicAPI.getBothMode();\n publicAPI.restorePreviousBindings(mode);\n publicAPI.restorePreviousBuffers(mode);\n };\n\n publicAPI.restorePreviousBindings = function (modeIn) {\n var gl = model.context;\n gl.bindFramebuffer(gl.FRAMEBUFFER, model.previousDrawBinding);\n model.openGLRenderWindow.setActiveFramebuffer(model.previousActiveFramebuffer);\n };\n\n publicAPI.restorePreviousBuffers = function (modeIn) {// currently a noop on webgl1\n };\n\n publicAPI.bind = function () {\n model.context.bindFramebuffer(model.context.FRAMEBUFFER, model.glFramebuffer);\n\n if (model.colorTexture) {\n model.colorTexture.bind();\n }\n\n model.openGLRenderWindow.setActiveFramebuffer(publicAPI);\n };\n\n publicAPI.create = function (width, height) {\n model.glFramebuffer = model.context.createFramebuffer();\n model.glFramebuffer.width = width;\n model.glFramebuffer.height = height;\n };\n\n publicAPI.setColorBuffer = function (texture) {\n var attachment = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var gl = model.context;\n var glAttachment = gl.COLOR_ATTACHMENT0;\n\n if (attachment > 0) {\n if (model.openGLRenderWindow.getWebgl2()) {\n glAttachment += attachment;\n } else {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"]('Using multiple framebuffer attachments requires WebGL 2');\n return;\n }\n }\n\n model.colorTexture = texture;\n gl.framebufferTexture2D(gl.FRAMEBUFFER, glAttachment, gl.TEXTURE_2D, texture.getHandle(), 0);\n };\n\n publicAPI.removeColorBuffer = function () {\n var attachment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var gl = model.context;\n var glAttachment = gl.COLOR_ATTACHMENT0;\n\n if (attachment > 0) {\n if (model.openGLRenderWindow.getWebgl2()) {\n glAttachment += attachment;\n } else {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"]('Using multiple framebuffer attachments requires WebGL 2');\n return;\n }\n }\n\n gl.framebufferTexture2D(gl.FRAMEBUFFER, glAttachment, gl.TEXTURE_2D, null, 0);\n };\n\n publicAPI.setDepthBuffer = function (texture) {\n if (model.openGLRenderWindow.getWebgl2()) {\n var gl = model.context;\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, texture.getHandle(), 0);\n } else {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"]('Attaching depth buffer textures to fbo requires WebGL 2');\n }\n };\n\n publicAPI.removeDepthBuffer = function () {\n if (model.openGLRenderWindow.getWebgl2()) {\n var gl = model.context;\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, null, 0);\n } else {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"]('Attaching depth buffer textures to framebuffers requires WebGL 2');\n }\n };\n\n publicAPI.getGLFramebuffer = function () {\n return model.glFramebuffer;\n };\n\n publicAPI.setOpenGLRenderWindow = function (rw) {\n if (model.openGLRenderWindow === rw) {\n return;\n }\n\n publicAPI.releaseGraphicsResources();\n model.openGLRenderWindow = rw;\n model.context = null;\n\n if (rw) {\n model.context = model.openGLRenderWindow.getContext();\n }\n };\n\n publicAPI.releaseGraphicsResources = function () {\n if (model.glFramebuffer) {\n model.context.deleteFramebuffer(model.glFramebuffer);\n }\n\n if (model.colorTexture) {\n model.colorTexture.releaseGraphicsResources();\n }\n };\n\n publicAPI.getSize = function () {\n var size = [0, 0];\n\n if (model.glFramebuffer !== null) {\n size[0] = model.glFramebuffer.width;\n size[1] = model.glFramebuffer.height;\n }\n\n return size;\n };\n\n publicAPI.populateFramebuffer = function () {\n publicAPI.bind();\n var gl = model.context;\n var texture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n texture.setOpenGLRenderWindow(model.openGLRenderWindow);\n texture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_3__[\"Filter\"].LINEAR);\n texture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_3__[\"Filter\"].LINEAR);\n texture.create2DFromRaw(model.glFramebuffer.width, model.glFramebuffer.height, 4, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__[\"VtkDataTypes\"].UNSIGNED_CHAR, null);\n publicAPI.setColorBuffer(texture); // for now do not count on having a depth buffer texture\n // as they are not standard webgl 1\n\n model.depthTexture = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, model.depthTexture);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, model.glFramebuffer.width, model.glFramebuffer.height);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, model.depthTexture);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n openGLRenderWindow: null,\n glFramebuffer: null,\n colorTexture: null,\n depthTexture: null,\n previousDrawBinding: 0,\n previousReadBinding: 0,\n previousDrawBuffer: 0,\n previousReadBuffer: 0,\n previousActiveFramebuffer: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"obj\"](publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['colorTexture']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkFramebuffer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkFramebuffer'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Framebuffer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Glyph3DMapper/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Glyph3DMapper/index.js ***! - \*****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/BufferObject */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_HardwareSelector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/HardwareSelector */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_PolyDataMapper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/PolyDataMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/PolyDataMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"];\nvar Representation = vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Representation;\nvar ObjectType = vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ObjectType;\nvar PassTypes = vtk_js_Sources_Rendering_OpenGL_HardwareSelector__WEBPACK_IMPORTED_MODULE_3__[\"default\"].PassTypes;\nvar StartEvent = {\n type: 'StartEvent'\n};\nvar EndEvent = {\n type: 'EndEvent'\n}; // ----------------------------------------------------------------------------\n// vtkOpenGLSphereMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLGlyph3DMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLGlyph3DMapper'); // Capture 'parentClass' api for internal use\n\n var superClass = _objectSpread({}, publicAPI);\n\n publicAPI.renderPiece = function (ren, actor) {\n publicAPI.invokeEvent(StartEvent);\n\n if (!model.renderable.getStatic()) {\n model.renderable.update();\n }\n\n model.currentInput = model.renderable.getInputData(1);\n publicAPI.invokeEvent(EndEvent);\n\n if (!model.currentInput) {\n vtkErrorMacro('No input!');\n return;\n } // if there are no points then we are done\n\n\n if (!model.currentInput.getPoints || !model.currentInput.getPoints().getNumberOfValues()) {\n return;\n } // apply faceCulling\n\n\n var gl = model.context;\n\n if (model.openGLRenderWindow.getWebgl2()) {\n model.hardwareSupport = true;\n model.extension = null;\n } else if (!model.extension) {\n model.extension = model.context.getExtension('ANGLE_instanced_arrays');\n model.hardwareSupport = !!model.extension;\n } // to test without extension support uncomment the next two lines\n // model.extension = null;\n // model.hardwareSupport = !!model.extension;\n\n\n var backfaceCulling = actor.getProperty().getBackfaceCulling();\n var frontfaceCulling = actor.getProperty().getFrontfaceCulling();\n\n if (!backfaceCulling && !frontfaceCulling) {\n model.openGLRenderWindow.disableCullFace();\n } else if (frontfaceCulling) {\n model.openGLRenderWindow.enableCullFace();\n gl.cullFace(gl.FRONT);\n } else {\n model.openGLRenderWindow.enableCullFace();\n gl.cullFace(gl.BACK);\n }\n\n publicAPI.renderPieceStart(ren, actor);\n publicAPI.renderPieceDraw(ren, actor);\n publicAPI.renderPieceFinish(ren, actor);\n };\n\n publicAPI.multiply4x4WithOffset = function (out, a, b, off) {\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n var a30 = a[12];\n var a31 = a[13];\n var a32 = a[14];\n var a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[off];\n var b1 = b[off + 1];\n var b2 = b[off + 2];\n var b3 = b[off + 3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[off + 4];\n b1 = b[off + 5];\n b2 = b[off + 6];\n b3 = b[off + 7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[off + 8];\n b1 = b[off + 9];\n b2 = b[off + 10];\n b3 = b[off + 11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[off + 12];\n b1 = b[off + 13];\n b2 = b[off + 14];\n b3 = b[off + 15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n };\n\n publicAPI.replaceShaderNormal = function (shaders, ren, actor) {\n if (model.hardwareSupport) {\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (lastLightComplexity > 0) {\n var VSSource = shaders.Vertex;\n\n if (model.lastBoundBO.getCABO().getNormalOffset()) {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Normal::Dec', ['attribute vec3 normalMC;', 'attribute mat3 gNormal;', 'uniform mat3 normalMatrix;', 'varying vec3 normalVCVSOutput;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Normal::Impl', ['normalVCVSOutput = normalMatrix * gNormal * normalMC;']).result;\n }\n\n shaders.Vertex = VSSource;\n }\n }\n\n superClass.replaceShaderNormal(shaders, ren, actor);\n };\n\n publicAPI.replaceShaderColor = function (shaders, ren, actor) {\n if (model.hardwareSupport && model.renderable.getColorArray()) {\n var VSSource = shaders.Vertex;\n var GSSource = shaders.Geometry;\n var FSSource = shaders.Fragment;\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity'); // create the material/color property declarations, and VS implementation\n // these are always defined\n\n var colorDec = ['uniform float ambient;', 'uniform float diffuse;', 'uniform float specular;', 'uniform float opacityUniform; // the fragment opacity']; // add more for specular\n\n if (lastLightComplexity) {\n colorDec = colorDec.concat(['uniform vec3 specularColorUniform;', 'uniform float specularPowerUniform;']);\n } // now handle the more complex fragment shader implementation\n // the following are always defined variables. We start\n // by assigning a default value from the uniform\n\n\n var colorImpl = ['vec3 ambientColor;', ' vec3 diffuseColor;', ' float opacity;'];\n\n if (lastLightComplexity) {\n colorImpl = colorImpl.concat([' vec3 specularColor;', ' float specularPower;']);\n }\n\n colorImpl = colorImpl.concat([' opacity = opacityUniform;']);\n\n if (lastLightComplexity) {\n colorImpl = colorImpl.concat([' specularColor = specularColorUniform;', ' specularPower = specularPowerUniform;']);\n }\n\n if (!model.drawingEdges) {\n colorDec = colorDec.concat(['varying vec4 vertexColorVSOutput;']);\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Color::Dec', ['attribute vec4 gColor;', 'varying vec4 vertexColorVSOutput;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Color::Impl', ['vertexColorVSOutput = gColor;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(GSSource, '//VTK::Color::Dec', ['in vec4 vertexColorVSOutput[];', 'out vec4 vertexColorGSOutput;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(GSSource, '//VTK::Color::Impl', ['vertexColorGSOutput = vertexColorVSOutput[i];']).result;\n colorImpl = colorImpl.concat([' diffuseColor = vertexColorVSOutput.rgb;', ' ambientColor = vertexColorVSOutput.rgb;', ' opacity = opacity*vertexColorVSOutput.a;']);\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(FSSource, '//VTK::Color::Impl', colorImpl).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(FSSource, '//VTK::Color::Dec', colorDec).result;\n shaders.Vertex = VSSource;\n shaders.Geometry = GSSource;\n shaders.Fragment = FSSource;\n }\n\n superClass.replaceShaderColor(shaders, ren, actor);\n };\n\n publicAPI.replaceShaderPositionVC = function (shaders, ren, actor) {\n if (model.hardwareSupport) {\n var VSSource = shaders.Vertex; // do we need the vertex in the shader in View Coordinates\n\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (lastLightComplexity > 0) {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Impl', ['vec4 gVertexMC = gMatrix * vertexMC;', 'vertexVCVSOutput = MCVCMatrix * gVertexMC;', ' gl_Position = MCPCMatrix * gVertexMC;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Camera::Dec', ['attribute mat4 gMatrix;', 'uniform mat4 MCPCMatrix;', 'uniform mat4 MCVCMatrix;']).result;\n } else {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Camera::Dec', ['attribute mat4 gMatrix;', 'uniform mat4 MCPCMatrix;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Impl', ['vec4 gVertexMC = gMatrix * vertexMC;', ' gl_Position = MCPCMatrix * gVertexMC;']).result;\n }\n\n shaders.Vertex = VSSource;\n }\n\n superClass.replaceShaderPositionVC(shaders, ren, actor);\n };\n\n publicAPI.replaceShaderPicking = function (shaders, ren, actor) {\n if (model.hardwareSupport) {\n var FSSource = shaders.Fragment;\n var VSSource = shaders.Vertex;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Picking::Dec', ['attribute vec3 mapperIndexVS;', 'varying vec3 mapperIndexVSOutput;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Picking::Impl', ' mapperIndexVSOutput = mapperIndexVS;').result;\n shaders.Vertex = VSSource;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(FSSource, '//VTK::Picking::Dec', ['varying vec3 mapperIndexVSOutput;', 'uniform vec3 mapperIndex;', 'uniform int picking;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(FSSource, '//VTK::Picking::Impl', [' vec4 pickColor = picking == 2 ? vec4(mapperIndexVSOutput,1.0) : vec4(mapperIndex,1.0);', ' gl_FragData[0] = picking != 0 ? pickColor : gl_FragData[0];']).result;\n shaders.Fragment = FSSource;\n } else {\n superClass.replaceShaderPicking(shaders, ren, actor);\n }\n };\n\n publicAPI.updateGlyphShaderParameters = function (normalMatrixUsed, mcvcMatrixUsed, cellBO, carray, garray, narray, p, selector) {\n var program = cellBO.getProgram();\n\n if (normalMatrixUsed) {\n var a = model.normalMatrix;\n var b = narray;\n var ofs = p * 9;\n var out = model.tmpMat3;\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a10 = a[3];\n var a11 = a[4];\n var a12 = a[5];\n var a20 = a[6];\n var a21 = a[7];\n var a22 = a[8];\n var b00 = b[ofs];\n var b01 = b[ofs + 1];\n var b02 = b[ofs + 2];\n var b10 = b[ofs + 3];\n var b11 = b[ofs + 4];\n var b12 = b[ofs + 5];\n var b20 = b[ofs + 6];\n var b21 = b[ofs + 7];\n var b22 = b[ofs + 8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n program.setUniformMatrix3x3('normalMatrix', model.tmpMat3);\n }\n\n publicAPI.multiply4x4WithOffset(model.tmpMat4, model.mcpcMatrix, garray, p * 16);\n program.setUniformMatrix('MCPCMatrix', model.tmpMat4);\n\n if (mcvcMatrixUsed) {\n publicAPI.multiply4x4WithOffset(model.tmpMat4, model.mcvcMatrix, garray, p * 16);\n program.setUniformMatrix('MCVCMatrix', model.tmpMat4);\n } // set color\n\n\n if (carray) {\n var cdata = carray.getData();\n model.tmpColor[0] = cdata[p * 4] / 255.0;\n model.tmpColor[1] = cdata[p * 4 + 1] / 255.0;\n model.tmpColor[2] = cdata[p * 4 + 2] / 255.0;\n program.setUniform3fArray('ambientColorUniform', model.tmpColor);\n program.setUniform3fArray('diffuseColorUniform', model.tmpColor);\n }\n\n if (selector) {\n program.setUniform3fArray('mapperIndex', selector.getPropColorValue());\n }\n };\n\n publicAPI.renderPieceDraw = function (ren, actor) {\n var representation = actor.getProperty().getRepresentation();\n var gl = model.context;\n var drawSurfaceWithEdges = actor.getProperty().getEdgeVisibility() && representation === Representation.SURFACE; // [WMVP]C == {world, model, view, projection} coordinates\n // E.g., WCPC == world to projection coordinate transformation\n\n var keyMats = model.openGLCamera.getKeyMatrices(ren);\n var actMats = model.openGLActor.getKeyMatrices(); // precompute the actor+camera mats once\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(model.normalMatrix, keyMats.normalMatrix, actMats.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.mcpcMatrix, keyMats.wcpc, actMats.mcwc);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.mcvcMatrix, keyMats.wcvc, actMats.mcwc);\n var garray = model.renderable.getMatrixArray();\n var narray = model.renderable.getNormalArray();\n var carray = model.renderable.getColorArray();\n var numPts = garray.length / 16;\n var compositePass = false;\n\n if (model.openGLRenderer.getSelector()) {\n if (model.openGLRenderer.getSelector().getCurrentPass() === PassTypes.COMPOSITE_INDEX_PASS) {\n compositePass = true;\n }\n } // for every primitive type\n\n\n for (var i = model.primTypes.Start; i < model.primTypes.End; i++) {\n // if there are entries\n var cabo = model.primitives[i].getCABO();\n\n if (cabo.getElementCount()) {\n // are we drawing edges\n model.drawingEdges = drawSurfaceWithEdges && (i === model.primTypes.TrisEdges || i === model.primTypes.TriStripsEdges);\n publicAPI.updateShaders(model.primitives[i], ren, actor);\n var program = model.primitives[i].getProgram();\n var mode = publicAPI.getOpenGLMode(representation, i);\n var normalMatrixUsed = program.isUniformUsed('normalMatrix');\n var mcvcMatrixUsed = program.isUniformUsed('MCVCMatrix');\n\n if (model.hardwareSupport) {\n if (model.extension) {\n model.extension.drawArraysInstancedANGLE(mode, 0, cabo.getElementCount(), numPts);\n } else {\n gl.drawArraysInstanced(mode, 0, cabo.getElementCount(), numPts);\n }\n } else {\n // draw the array multiple times with different cam matrix\n for (var p = 0; p < numPts; ++p) {\n if (compositePass) {\n model.openGLRenderer.getSelector().renderCompositeIndex(p);\n }\n\n publicAPI.updateGlyphShaderParameters(normalMatrixUsed, mcvcMatrixUsed, model.primitives[i], carray, garray, narray, p, compositePass ? model.openGLRenderer.getSelector() : null);\n gl.drawArrays(mode, 0, cabo.getElementCount());\n }\n }\n }\n }\n };\n\n publicAPI.setMapperShaderParameters = function (cellBO, ren, actor) {\n if (cellBO.getCABO().getElementCount() && (model.glyphBOBuildTime.getMTime() > cellBO.getAttributeUpdateTime().getMTime() || cellBO.getShaderSourceTime().getMTime() > cellBO.getAttributeUpdateTime().getMTime())) {\n if (cellBO.getProgram().isAttributeUsed('gMatrix')) {\n if (!cellBO.getVAO().addAttributeMatrixWithDivisor(cellBO.getProgram(), model.matrixBuffer, 'gMatrix', 0, 64, model.context.FLOAT, 4, false, 1)) {\n vtkErrorMacro('Error setting gMatrix in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('gMatrix');\n }\n\n if (cellBO.getProgram().isAttributeUsed('gNormal')) {\n if (!cellBO.getVAO().addAttributeMatrixWithDivisor(cellBO.getProgram(), model.normalBuffer, 'gNormal', 0, 36, model.context.FLOAT, 3, false, 1)) {\n vtkErrorMacro('Error setting gNormal in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('gNormal');\n }\n\n if (cellBO.getProgram().isAttributeUsed('gColor')) {\n if (!cellBO.getVAO().addAttributeArrayWithDivisor(cellBO.getProgram(), model.colorBuffer, 'gColor', 0, 4, model.context.UNSIGNED_BYTE, 4, true, 1, false)) {\n vtkErrorMacro('Error setting gColor in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('gColor');\n }\n\n if (cellBO.getProgram().isAttributeUsed('mapperIndexVS')) {\n if (!cellBO.getVAO().addAttributeArrayWithDivisor(cellBO.getProgram(), model.pickBuffer, 'mapperIndexVS', 0, 4, model.context.UNSIGNED_BYTE, 4, true, 1, false)) {\n vtkErrorMacro('Error setting mapperIndexVS in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('mapperIndexVS');\n }\n\n superClass.setMapperShaderParameters(cellBO, ren, actor);\n cellBO.getAttributeUpdateTime().modified();\n return;\n }\n\n superClass.setMapperShaderParameters(cellBO, ren, actor);\n };\n\n publicAPI.getNeedToRebuildBufferObjects = function (ren, actor) {\n model.renderable.buildArrays(); // first do a coarse check\n // Note that the actor's mtime includes it's properties mtime\n\n var vmtime = model.VBOBuildTime.getMTime();\n\n if (vmtime < model.renderable.getBuildTime().getMTime()) {\n return true;\n }\n\n return superClass.getNeedToRebuildBufferObjects(ren, actor);\n };\n\n publicAPI.buildBufferObjects = function (ren, actor) {\n if (model.hardwareSupport) {\n // update the buffer objects if needed\n var garray = model.renderable.getMatrixArray();\n var narray = model.renderable.getNormalArray();\n var carray = model.renderable.getColorArray();\n\n if (!model.matrixBuffer) {\n model.matrixBuffer = vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.matrixBuffer.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.normalBuffer = vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.normalBuffer.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.colorBuffer = vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.colorBuffer.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.pickBuffer = vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.pickBuffer.setOpenGLRenderWindow(model.openGLRenderWindow);\n }\n\n if (model.renderable.getBuildTime().getMTime() > model.glyphBOBuildTime.getMTime()) {\n model.matrixBuffer.upload(garray, ObjectType.ARRAY_BUFFER);\n model.normalBuffer.upload(narray, ObjectType.ARRAY_BUFFER);\n\n if (carray) {\n model.colorBuffer.upload(carray.getData(), ObjectType.ARRAY_BUFFER);\n } else {\n model.colorBuffer.releaseGraphicsResources();\n }\n\n var numPts = garray.length / 16;\n var parray = new Uint8Array(4 * numPts);\n\n for (var i = 0; i < numPts; ++i) {\n var value = i + 1;\n var offset = i * 4;\n parray[offset] = value % 256;\n value -= parray[offset];\n value /= 256;\n parray[offset + 1] = value % 256;\n value -= parray[offset + 1];\n value /= 256;\n parray[offset + 2] = value % 256;\n parray[offset + 3] = 255;\n }\n\n model.pickBuffer.upload(parray, ObjectType.ARRAY_BUFFER);\n model.glyphBOBuildTime.modified();\n }\n }\n\n return superClass.buildBufferObjects(ren, actor);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n normalMatrix: null,\n mcpcMatrix: null,\n mcwcMatrix: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_OpenGL_PolyDataMapper__WEBPACK_IMPORTED_MODULE_5__[\"default\"].extend(publicAPI, model, initialValues);\n model.tmpMat3 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(new Float64Array(9));\n model.normalMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(new Float64Array(9));\n model.mcpcMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.mcvcMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.tmpColor = [];\n model.glyphBOBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.glyphBOBuildTime, {\n mtime: 0\n }); // Object methods\n\n vtkOpenGLGlyph3DMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkOpenGLGlyph3DMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_7__[\"registerOverride\"])('vtkGlyph3DMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Glyph3DMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/Constants.js": -/*!************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/Constants.js ***! - \************************************************************************************/ -/*! exports provided: PassTypes, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PassTypes\", function() { return PassTypes; });\nvar PassTypes = {\n MIN_KNOWN_PASS: 0,\n ACTOR_PASS: 0,\n COMPOSITE_INDEX_PASS: 1,\n ID_LOW24: 2,\n MAX_KNOWN_PASS: 2\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n PassTypes: PassTypes\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/index.js": -/*!********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/index.js ***! - \********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_HardwareSelector_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/HardwareSelector/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_HardwareSelector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/HardwareSelector */ \"./node_modules/vtk.js/Sources/Rendering/Core/HardwareSelector/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Framebuffer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Framebuffer */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Framebuffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_SelectionNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/SelectionNode */ \"./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSet */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\n\n\n\n\n\n\nvar PassTypes = vtk_js_Sources_Rendering_OpenGL_HardwareSelector_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].PassTypes;\nvar SelectionContent = vtk_js_Sources_Common_DataModel_SelectionNode__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SelectionContent,\n SelectionField = vtk_js_Sources_Common_DataModel_SelectionNode__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SelectionField;\nvar FieldAssociations = vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_5__[\"default\"].FieldAssociations;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\nvar idOffset = 1;\n\nfunction getInfoHash(info) {\n return \"\".concat(info.propID, \" \").concat(info.compositeID);\n}\n\nfunction convert(xx, yy, pb, area) {\n if (!pb) {\n return 0;\n }\n\n var offset = (yy * (area[2] - area[0] + 1) + xx) * 4;\n var rgb = [];\n rgb[0] = pb[offset];\n rgb[1] = pb[offset + 1];\n rgb[2] = pb[offset + 2];\n var val = rgb[2];\n val *= 256;\n val += rgb[1];\n val *= 256;\n val += rgb[0];\n return val;\n}\n\nfunction getPixelInformationWithData(buffdata, inDisplayPosition, maxDistance, outSelectedPosition) {\n // Base case\n var maxDist = maxDistance < 0 ? 0 : maxDistance;\n\n if (maxDist === 0) {\n outSelectedPosition[0] = inDisplayPosition[0];\n outSelectedPosition[1] = inDisplayPosition[1];\n\n if (inDisplayPosition[0] < buffdata.area[0] || inDisplayPosition[0] > buffdata.area[2] || inDisplayPosition[1] < buffdata.area[1] || inDisplayPosition[1] > buffdata.area[3]) {\n return null;\n } // offset inDisplayPosition based on the lower-left-corner of the Area.\n\n\n var displayPosition = [inDisplayPosition[0] - buffdata.area[0], inDisplayPosition[1] - buffdata.area[1]];\n var actorid = convert(displayPosition[0], displayPosition[1], buffdata.pixBuffer[PassTypes.ACTOR_PASS], buffdata.area);\n\n if (actorid <= 0) {\n // the pixel did not hit any actor.\n return null;\n }\n\n var _info = {};\n _info.valid = true;\n _info.propID = actorid - idOffset;\n _info.prop = buffdata.props[_info.propID];\n var compositeID = convert(displayPosition[0], displayPosition[1], buffdata.pixBuffer[PassTypes.COMPOSITE_INDEX_PASS], buffdata.area);\n\n if (compositeID < 0 || compositeID > 0xffffff) {\n compositeID = 0;\n }\n\n _info.compositeID = compositeID - idOffset;\n\n if (buffdata.captureZValues) {\n var offset = (displayPosition[1] * (buffdata.area[2] - buffdata.area[0] + 1) + displayPosition[0]) * 4;\n _info.zValue = (256 * buffdata.zBuffer[offset] + buffdata.zBuffer[offset + 1]) / 65535.0;\n _info.displayPosition = inDisplayPosition;\n }\n\n return _info;\n } // Iterate over successively growing boxes.\n // They recursively call the base case to handle single pixels.\n\n\n var dispPos = [inDisplayPosition[0], inDisplayPosition[1]];\n var curPos = [0, 0];\n var info = getPixelInformationWithData(buffdata, inDisplayPosition, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n\n for (var dist = 1; dist < maxDist; ++dist) {\n // Vertical sides of box.\n for (var y = dispPos[1] > dist ? dispPos[1] - dist : 0; y <= dispPos[1] + dist; ++y) {\n curPos[1] = y;\n\n if (dispPos[0] >= dist) {\n curPos[0] = dispPos[0] - dist;\n info = getPixelInformationWithData(buffdata, curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n }\n\n curPos[0] = dispPos[0] + dist;\n info = getPixelInformationWithData(buffdata, curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n } // Horizontal sides of box.\n\n\n for (var x = dispPos[0] >= dist ? dispPos[0] - (dist - 1) : 0; x <= dispPos[0] + (dist - 1); ++x) {\n curPos[0] = x;\n\n if (dispPos[1] >= dist) {\n curPos[1] = dispPos[1] - dist;\n info = getPixelInformationWithData(buffdata, curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n }\n\n curPos[1] = dispPos[1] + dist;\n info = getPixelInformationWithData(buffdata, curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n }\n } // nothing hit.\n\n\n outSelectedPosition[0] = inDisplayPosition[0];\n outSelectedPosition[1] = inDisplayPosition[1];\n return null;\n} //-----------------------------------------------------------------------------\n\n\nfunction convertSelection(fieldassociation, dataMap, captureZValues, renderer, openGLRenderWindow) {\n var sel = [];\n var count = 0;\n dataMap.forEach(function (value, key) {\n var child = vtk_js_Sources_Common_DataModel_SelectionNode__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n child.setContentType(SelectionContent.INDICES);\n\n switch (fieldassociation) {\n case FieldAssociations.FIELD_ASSOCIATION_CELLS:\n child.setFieldType(SelectionField.CELL);\n break;\n\n case FieldAssociations.FIELD_ASSOCIATION_POINTS:\n child.setFieldType(SelectionField.POINT);\n break;\n\n default:\n vtkErrorMacro('Unknown field association');\n }\n\n child.getProperties().propID = value.info.propID;\n child.getProperties().prop = value.info.prop;\n child.getProperties().compositeID = value.info.compositeID;\n child.getProperties().pixelCount = value.pixelCount;\n\n if (captureZValues) {\n child.getProperties().displayPosition = [value.info.displayPosition[0], value.info.displayPosition[1], value.info.zValue];\n child.getProperties().worldPosition = openGLRenderWindow.displayToWorld(value.info.displayPosition[0], value.info.displayPosition[1], value.info.zValue, renderer);\n }\n\n child.setSelectionList(value.attributeIDs);\n sel[count] = child;\n count++;\n });\n return sel;\n} //----------------------------------------------------------------------------\n\n\nfunction generateSelectionWithData(buffdata, fx1, fy1, fx2, fy2) {\n var x1 = Math.floor(fx1);\n var y1 = Math.floor(fy1);\n var x2 = Math.floor(fx2);\n var y2 = Math.floor(fy2);\n var dataMap = new Map();\n var outSelectedPosition = [0, 0];\n\n for (var yy = y1; yy <= y2; yy++) {\n for (var xx = x1; xx <= x2; xx++) {\n var pos = [xx, yy];\n var info = getPixelInformationWithData(buffdata, pos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n var hash = getInfoHash(info);\n\n if (!dataMap.has(hash)) {\n dataMap.set(hash, {\n info: info,\n pixelCount: 1,\n attributeIDs: [info.attributeID]\n });\n } else {\n var dmv = dataMap.get(hash);\n dmv.pixelCount++;\n\n if (buffdata.captureZValues) {\n if (info.zValue < dmv.info.zValue) {\n dmv.info = info;\n }\n }\n\n if (dmv.attributeIDs.indexOf(info.attributeID) === -1) {\n dmv.attributeIDs.push(info.attributeID);\n }\n }\n }\n }\n }\n\n return convertSelection(buffdata.fieldAssociation, dataMap, buffdata.captureZValues, buffdata.renderer, buffdata.openGLRenderWindow);\n} // ----------------------------------------------------------------------------\n// vtkOpenGLHardwareSelector methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkOpenGLHardwareSelector(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLHardwareSelector'); //----------------------------------------------------------------------------\n\n publicAPI.releasePixBuffers = function () {\n model.pixBuffer = [];\n model.zBuffer = null;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.beginSelection = function () {\n model.openGLRenderer = model.openGLRenderWindow.getViewNodeFor(model.renderer);\n model.maxAttributeId = 0;\n var size = model.openGLRenderWindow.getSize();\n\n if (!model.framebuffer) {\n model.framebuffer = vtk_js_Sources_Rendering_OpenGL_Framebuffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.framebuffer.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.framebuffer.saveCurrentBindingsAndBuffers();\n model.framebuffer.create(size[0], size[1]); // this calls model.framebuffer.bind()\n\n model.framebuffer.populateFramebuffer();\n } else {\n model.framebuffer.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.framebuffer.saveCurrentBindingsAndBuffers();\n var fbSize = model.framebuffer.getSize();\n\n if (fbSize[0] !== size[0] || fbSize[1] !== size[1]) {\n model.framebuffer.create(size[0], size[1]); // this calls model.framebuffer.bind()\n\n model.framebuffer.populateFramebuffer();\n } else {\n model.framebuffer.bind();\n }\n }\n\n model.openGLRenderer.clear();\n model.openGLRenderer.setSelector(publicAPI);\n model.hitProps = {};\n model.props = [];\n publicAPI.releasePixBuffers();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.endSelection = function () {\n model.hitProps = {};\n model.openGLRenderer.setSelector(null);\n model.framebuffer.restorePreviousBindingsAndBuffers();\n };\n\n publicAPI.preCapturePass = function () {};\n\n publicAPI.postCapturePass = function () {}; //----------------------------------------------------------------------------\n\n\n publicAPI.select = function () {\n var sel = null;\n\n if (publicAPI.captureBuffers()) {\n sel = publicAPI.generateSelection(model.area[0], model.area[1], model.area[2], model.area[3]);\n publicAPI.releasePixBuffers();\n }\n\n return sel;\n };\n\n publicAPI.getSourceDataAsync = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(renderer, fx1, fy1, fx2, fy2) {\n var size, result;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // assign the renderer\n model.renderer = renderer; // set area to all if no arguments provided\n\n if (fx1 === undefined) {\n size = model.openGLRenderWindow.getSize();\n publicAPI.setArea(0, 0, size[0] - 1, size[1] - 1);\n } else {\n publicAPI.setArea(fx1, fy1, fx2, fy2);\n } // just do capture buffers and package up the result\n\n\n if (publicAPI.captureBuffers()) {\n _context.next = 4;\n break;\n }\n\n return _context.abrupt(\"return\", false);\n\n case 4:\n result = {\n area: _toConsumableArray(model.area),\n pixBuffer: _toConsumableArray(model.pixBuffer),\n captureZValues: model.captureZValues,\n zBuffer: model.zBuffer,\n props: _toConsumableArray(model.props),\n fieldAssociation: model.fieldAssociation,\n renderer: renderer,\n openGLRenderWindow: model.openGLRenderWindow\n };\n\n result.generateSelection = function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return generateSelectionWithData.apply(void 0, [result].concat(args));\n };\n\n return _context.abrupt(\"return\", result);\n\n case 7:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x, _x2, _x3, _x4, _x5) {\n return _ref.apply(this, arguments);\n };\n }(); //----------------------------------------------------------------------------\n\n\n publicAPI.captureBuffers = function () {\n if (!model.renderer || !model.openGLRenderWindow) {\n vtkErrorMacro('Renderer and view must be set before calling Select.');\n return false;\n }\n\n model.openGLRenderer = model.openGLRenderWindow.getViewNodeFor(model.renderer); // int rgba[4];\n // rwin.getColorBufferSizes(rgba);\n // if (rgba[0] < 8 || rgba[1] < 8 || rgba[2] < 8) {\n // vtkErrorMacro(\"Color buffer depth must be at least 8 bit. \"\n // \"Currently: \" << rgba[0] << \", \" << rgba[1] << \", \" < 0) {\n val--;\n\n if (!(val in model.hitProps)) {\n model.hitProps[val] = true;\n }\n }\n }\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.renderProp = function (prop) {\n if (model.currentPass === PassTypes.ACTOR_PASS) {\n publicAPI.setPropColorValueFromInt(model.props.length + idOffset);\n model.props.push(prop);\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.renderCompositeIndex = function (index) {\n if (model.currentPass === PassTypes.COMPOSITE_INDEX_PASS) {\n publicAPI.setPropColorValueFromInt(index + idOffset);\n }\n }; //----------------------------------------------------------------------------\n // TODO: make inline\n\n\n publicAPI.renderAttributeId = function (attribid) {\n if (attribid < 0) {\n // negative attribid is valid. It happens when rendering higher order\n // elements where new points are added for rendering smooth surfaces.\n return;\n }\n\n model.maxAttributeId = attribid > model.maxAttributeId ? attribid : model.maxAttributeId; // if (model.currentPass < PassTypes.ID_LOW24) {\n // return; // useless...\n // }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.passTypeToString = function (type) {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(PassTypes, type);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.isPropHit = function (id) {\n return Boolean(model.hitProps[id]);\n };\n\n publicAPI.setPropColorValueFromInt = function (val) {\n model.propColorValue[0] = val % 256 / 255.0;\n model.propColorValue[1] = Math.floor(val / 256) % 256 / 255.0;\n model.propColorValue[2] = Math.floor(val / 65536) % 256 / 255.0;\n }; // info has\n // valid\n // propId\n // prop\n // compositeID\n // attributeID\n //----------------------------------------------------------------------------\n\n\n publicAPI.getPixelInformation = function (inDisplayPosition, maxDistance, outSelectedPosition) {\n // Base case\n var maxDist = maxDistance < 0 ? 0 : maxDistance;\n\n if (maxDist === 0) {\n outSelectedPosition[0] = inDisplayPosition[0];\n outSelectedPosition[1] = inDisplayPosition[1];\n\n if (inDisplayPosition[0] < model.area[0] || inDisplayPosition[0] > model.area[2] || inDisplayPosition[1] < model.area[1] || inDisplayPosition[1] > model.area[3]) {\n return null;\n } // offset inDisplayPosition based on the lower-left-corner of the Area.\n\n\n var displayPosition = [inDisplayPosition[0] - model.area[0], inDisplayPosition[1] - model.area[1]];\n var actorid = convert(displayPosition[0], displayPosition[1], model.pixBuffer[PassTypes.ACTOR_PASS], model.area);\n\n if (actorid <= 0) {\n // the pixel did not hit any actor.\n return null;\n }\n\n var _info2 = {};\n _info2.valid = true;\n _info2.propID = actorid - idOffset;\n _info2.prop = model.props[_info2.propID];\n var compositeID = convert(displayPosition[0], displayPosition[1], model.pixBuffer[PassTypes.COMPOSITE_INDEX_PASS], model.area);\n\n if (compositeID < 0 || compositeID > 0xffffff) {\n compositeID = 0;\n }\n\n _info2.compositeID = compositeID - idOffset;\n\n if (model.captureZValues) {\n var offset = (displayPosition[1] * (model.area[2] - model.area[0] + 1) + displayPosition[0]) * 4;\n _info2.zValue = (256 * model.zBuffer[offset] + model.zBuffer[offset + 1]) / 65535.0;\n _info2.displayPosition = inDisplayPosition;\n }\n\n return _info2;\n } // Iterate over successively growing boxes.\n // They recursively call the base case to handle single pixels.\n\n\n var dispPos = [inDisplayPosition[0], inDisplayPosition[1]];\n var curPos = [0, 0];\n var info = publicAPI.getPixelInformation(inDisplayPosition, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n\n for (var dist = 1; dist < maxDist; ++dist) {\n // Vertical sides of box.\n for (var y = dispPos[1] > dist ? dispPos[1] - dist : 0; y <= dispPos[1] + dist; ++y) {\n curPos[1] = y;\n\n if (dispPos[0] >= dist) {\n curPos[0] = dispPos[0] - dist;\n info = publicAPI.getPixelInformation(curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n }\n\n curPos[0] = dispPos[0] + dist;\n info = publicAPI.getPixelInformation(curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n } // Horizontal sides of box.\n\n\n for (var x = dispPos[0] >= dist ? dispPos[0] - (dist - 1) : 0; x <= dispPos[0] + (dist - 1); ++x) {\n curPos[0] = x;\n\n if (dispPos[1] >= dist) {\n curPos[1] = dispPos[1] - dist;\n info = publicAPI.getPixelInformation(curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n }\n\n curPos[1] = dispPos[1] + dist;\n info = publicAPI.getPixelInformation(curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n }\n } // nothing hit.\n\n\n outSelectedPosition[0] = inDisplayPosition[0];\n outSelectedPosition[1] = inDisplayPosition[1];\n return null;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.generateSelection = function (fx1, fy1, fx2, fy2) {\n var x1 = Math.floor(fx1);\n var y1 = Math.floor(fy1);\n var x2 = Math.floor(fx2);\n var y2 = Math.floor(fy2);\n var dataMap = new Map();\n var outSelectedPosition = [0, 0];\n\n for (var yy = y1; yy <= y2; yy++) {\n for (var xx = x1; xx <= x2; xx++) {\n var pos = [xx, yy];\n var info = publicAPI.getPixelInformation(pos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n var hash = getInfoHash(info);\n\n if (!dataMap.has(hash)) {\n dataMap.set(hash, {\n info: info,\n pixelCount: 1,\n attributeIDs: [info.attributeID]\n });\n } else {\n var dmv = dataMap.get(hash);\n dmv.pixelCount++;\n\n if (model.captureZValues) {\n if (info.zValue < dmv.info.zValue) {\n dmv.info = info;\n }\n }\n\n if (dmv.attributeIDs.indexOf(info.attributeID) === -1) {\n dmv.attributeIDs.push(info.attributeID);\n }\n }\n }\n }\n }\n\n return convertSelection(model.fieldAssociation, dataMap, model.captureZValues, model.renderer, model.openGLRenderWindow);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.attach = function (w, r) {\n model.openGLRenderWindow = w;\n model.renderer = r;\n }; // override\n\n\n var superSetArea = publicAPI.setArea;\n\n publicAPI.setArea = function () {\n if (superSetArea.apply(void 0, arguments)) {\n model.area[0] = Math.floor(model.area[0]);\n model.area[1] = Math.floor(model.area[1]);\n model.area[2] = Math.floor(model.area[2]);\n model.area[3] = Math.floor(model.area[3]);\n return true;\n }\n\n return false;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n area: undefined,\n renderer: null,\n openGLRenderWindow: null,\n openGLRenderer: null,\n currentPass: -1,\n propColorValue: null,\n props: null,\n idOffset: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_Rendering_Core_HardwareSelector__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.propColorValue = [0, 0, 0];\n model.props = [];\n\n if (!model.area) {\n model.area = [0, 0, 0, 0];\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['area'], 4);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['renderer', 'currentPass', 'openGLRenderWindow']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['propColorValue'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'event'); // Object methods\n\n vtkOpenGLHardwareSelector(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkOpenGLHardwareSelector'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_OpenGL_HardwareSelector_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_CellArrayBufferObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/CellArrayBufferObject */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/CellArrayBufferObject/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_VertexArrayObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/VertexArrayObject */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/VertexArrayObject/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLHelper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLHelper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLHelper');\n\n publicAPI.setOpenGLRenderWindow = function (win) {\n model.program.setContext(win.getContext());\n model.VAO.setOpenGLRenderWindow(win);\n model.CABO.setOpenGLRenderWindow(win);\n };\n\n publicAPI.releaseGraphicsResources = function (oglwin) {\n model.VAO.releaseGraphicsResources();\n model.CABO.releaseGraphicsResources();\n model.CABO.setElementCount(0);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n program: null,\n shaderSourceTime: null,\n VAO: null,\n attributeUpdateTime: null,\n CABO: null,\n primitiveType: 0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.shaderSourceTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.shaderSourceTime);\n model.attributeUpdateTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.attributeUpdateTime);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['program', 'shaderSourceTime', 'VAO', 'attributeUpdateTime', 'CABO', 'primitiveType']);\n model.program = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.VAO = vtk_js_Sources_Rendering_OpenGL_VertexArrayObject__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.CABO = vtk_js_Sources_Rendering_OpenGL_CellArrayBufferObject__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(); // Object methods\n\n vtkOpenGLHelper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageMapper/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageMapper/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ImageMapper_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ImageMapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/ImageMapper/Constants.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Helper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ImageProperty_Constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ImageProperty/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/ImageProperty/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ReplacementShaderMapper__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"vtkErrorMacro\"];\nvar SlicingMode = vtk_js_Sources_Rendering_Core_ImageMapper_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].SlicingMode; // ----------------------------------------------------------------------------\n// helper methods\n// ----------------------------------------------------------------------------\n\nfunction computeFnToString(property, fn, numberOfComponents) {\n var pwfun = fn.apply(property);\n\n if (pwfun) {\n var iComps = property.getIndependentComponents();\n return \"\".concat(property.getMTime(), \"-\").concat(iComps, \"-\").concat(numberOfComponents);\n }\n\n return '0';\n} // ----------------------------------------------------------------------------\n// vtkOpenGLImageMapper methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkOpenGLImageMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLImageMapper');\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.openGLImageSlice = publicAPI.getFirstAncestorOfType('vtkOpenGLImageSlice');\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n model.openGLRenderWindow = model.openGLRenderer.getParent();\n model.context = model.openGLRenderWindow.getContext();\n model.tris.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.openGLTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.colorTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.pwfTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n var ren = model.openGLRenderer.getRenderable();\n model.openGLCamera = model.openGLRenderer.getViewNodeFor(ren.getActiveCamera()); // is slice set by the camera\n\n if (model.renderable.getSliceAtFocalPoint()) {\n model.renderable.setSliceFromCamera(ren.getActiveCamera());\n }\n }\n };\n\n publicAPI.translucentPass = function (prepass) {\n if (prepass) {\n publicAPI.render();\n }\n };\n\n publicAPI.opaqueZBufferPass = function (prepass) {\n if (prepass) {\n model.haveSeenDepthRequest = true;\n model.renderDepth = true;\n publicAPI.render();\n model.renderDepth = false;\n }\n };\n\n publicAPI.opaquePass = function (prepass) {\n if (prepass) {\n publicAPI.render();\n }\n };\n\n publicAPI.getCoincidentParameters = function (ren, actor) {\n if (model.renderable.getResolveCoincidentTopology()) {\n return model.renderable.getCoincidentTopologyPolygonOffsetParameters();\n }\n\n return null;\n }; // Renders myself\n\n\n publicAPI.render = function () {\n var actor = model.openGLImageSlice.getRenderable();\n var ren = model.openGLRenderer.getRenderable();\n publicAPI.renderPiece(ren, actor);\n };\n\n publicAPI.buildShaders = function (shaders, ren, actor) {\n publicAPI.getShaderTemplate(shaders, ren, actor);\n publicAPI.replaceShaderValues(shaders, ren, actor);\n };\n\n publicAPI.getShaderTemplate = function (shaders, ren, actor) {\n shaders.Vertex = vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_13___default.a;\n shaders.Fragment = vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_14___default.a;\n shaders.Geometry = '';\n };\n\n publicAPI.replaceShaderValues = function (shaders, ren, actor) {\n var VSSource = shaders.Vertex;\n var FSSource = shaders.Fragment;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(VSSource, '//VTK::Camera::Dec', ['uniform mat4 MCPCMatrix;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Impl', [' gl_Position = MCPCMatrix * vertexMC;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(VSSource, '//VTK::TCoord::Impl', 'tcoordVCVSOutput = tcoordMC;').result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(VSSource, '//VTK::TCoord::Dec', 'attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;').result;\n var tNumComp = model.openGLTexture.getComponents();\n var iComps = actor.getProperty().getIndependentComponents();\n var tcoordDec = ['varying vec2 tcoordVCVSOutput;', // color shift and scale\n 'uniform float cshift0;', 'uniform float cscale0;', // pwf shift and scale\n 'uniform float pwfshift0;', 'uniform float pwfscale0;', 'uniform sampler2D texture1;', 'uniform sampler2D colorTexture1;', 'uniform sampler2D pwfTexture1;', 'uniform float opacity;'];\n\n if (iComps) {\n for (var comp = 1; comp < tNumComp; comp++) {\n tcoordDec = tcoordDec.concat([// color shift and scale\n \"uniform float cshift\".concat(comp, \";\"), \"uniform float cscale\".concat(comp, \";\"), // weighting shift and scale\n \"uniform float pwfshift\".concat(comp, \";\"), \"uniform float pwfscale\".concat(comp, \";\")]);\n } // the heights defined below are the locations\n // for the up to four components of the tfuns\n // the tfuns have a height of 2XnumComps pixels so the\n // values are computed to hit the middle of the two rows\n // for that component\n\n\n switch (tNumComp) {\n case 1:\n tcoordDec = tcoordDec.concat(['uniform float mix0;', '#define height0 0.5']);\n break;\n\n case 2:\n tcoordDec = tcoordDec.concat(['uniform float mix0;', 'uniform float mix1;', '#define height0 0.25', '#define height1 0.75']);\n break;\n\n case 3:\n tcoordDec = tcoordDec.concat(['uniform float mix0;', 'uniform float mix1;', 'uniform float mix2;', '#define height0 0.17', '#define height1 0.5', '#define height2 0.83']);\n break;\n\n case 4:\n tcoordDec = tcoordDec.concat(['uniform float mix0;', 'uniform float mix1;', 'uniform float mix2;', 'uniform float mix3;', '#define height0 0.125', '#define height1 0.375', '#define height2 0.625', '#define height3 0.875']);\n break;\n\n default:\n vtkErrorMacro('Unsupported number of independent coordinates.');\n }\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::TCoord::Dec', tcoordDec).result;\n\n if (iComps) {\n var rgba = ['r', 'g', 'b', 'a'];\n var tcoordImpl = ['vec4 tvalue = texture2D(texture1, tcoordVCVSOutput);'];\n\n for (var _comp = 0; _comp < tNumComp; _comp++) {\n tcoordImpl = tcoordImpl.concat([\"vec3 tcolor\".concat(_comp, \" = mix\").concat(_comp, \" * texture2D(colorTexture1, vec2(tvalue.\").concat(rgba[_comp], \" * cscale\").concat(_comp, \" + cshift\").concat(_comp, \", height\").concat(_comp, \")).rgb;\"), \"float compWeight\".concat(_comp, \" = mix\").concat(_comp, \" * texture2D(pwfTexture1, vec2(tvalue.\").concat(rgba[_comp], \" * pwfscale\").concat(_comp, \" + pwfshift\").concat(_comp, \", height\").concat(_comp, \")).r;\")]);\n }\n\n switch (tNumComp) {\n case 1:\n tcoordImpl = tcoordImpl.concat(['gl_FragData[0] = vec4(tcolor0.rgb, opacity);']);\n break;\n\n case 2:\n tcoordImpl = tcoordImpl.concat(['float weightSum = compWeight0 + compWeight1;', 'gl_FragData[0] = vec4(vec3((tcolor0.rgb * (compWeight0 / weightSum)) + (tcolor1.rgb * (compWeight1 / weightSum))), opacity);']);\n break;\n\n case 3:\n tcoordImpl = tcoordImpl.concat(['float weightSum = compWeight0 + compWeight1 + compWeight2;', 'gl_FragData[0] = vec4(vec3((tcolor0.rgb * (compWeight0 / weightSum)) + (tcolor1.rgb * (compWeight1 / weightSum)) + (tcolor2.rgb * (compWeight2 / weightSum))), opacity);']);\n break;\n\n case 4:\n tcoordImpl = tcoordImpl.concat(['float weightSum = compWeight0 + compWeight1 + compWeight2 + compWeight3;', 'gl_FragData[0] = vec4(vec3((tcolor0.rgb * (compWeight0 / weightSum)) + (tcolor1.rgb * (compWeight1 / weightSum)) + (tcolor2.rgb * (compWeight2 / weightSum)) + (tcolor3.rgb * (compWeight3 / weightSum))), opacity);']);\n break;\n\n default:\n vtkErrorMacro('Unsupported number of independent coordinates.');\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', tcoordImpl).result;\n } else {\n // dependent components\n switch (tNumComp) {\n case 1:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['float intensity = texture2D(texture1, tcoordVCVSOutput).r;', 'vec3 tcolor = texture2D(colorTexture1, vec2(intensity * cscale0 + cshift0, 0.5)).rgb;', 'float scalarOpacity = texture2D(pwfTexture1, vec2(intensity * pwfscale0 + pwfshift0, 0.5)).r;', 'gl_FragData[0] = vec4(tcolor, scalarOpacity * opacity);']).result;\n break;\n\n case 2:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);', 'float intensity = tcolor.r*cscale0 + cshift0;', 'gl_FragData[0] = vec4(texture2D(colorTexture1, vec2(intensity, 0.5)).rgb, pwfscale0*tcolor.g + pwfshift0);']).result;\n break;\n\n default:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = cscale0*texture2D(texture1, tcoordVCVSOutput.st) + cshift0;', 'gl_FragData[0] = vec4(texture2D(colorTexture1, vec2(tcolor.r,0.5)).r,', ' texture2D(colorTexture1, vec2(tcolor.g,0.5)).r,', ' texture2D(colorTexture1, vec2(tcolor.b,0.5)).r, tcolor.a);']).result;\n }\n }\n\n if (model.haveSeenDepthRequest) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ZBuffer::Dec', 'uniform int depthRequest;').result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ZBuffer::Impl', ['if (depthRequest == 1) {', 'float iz = floor(gl_FragCoord.z*65535.0 + 0.1);', 'float rf = floor(iz/256.0)/255.0;', 'float gf = mod(iz,256.0)/255.0;', 'gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }']).result;\n }\n\n shaders.Vertex = VSSource;\n shaders.Fragment = FSSource;\n publicAPI.replaceShaderCoincidentOffset(shaders, ren, actor);\n };\n\n publicAPI.getNeedToRebuildShaders = function (cellBO, ren, actor) {\n // has something changed that would require us to recreate the shader?\n // candidates are\n // property modified (representation interpolation and lighting)\n // input modified\n // light complexity changed\n var tNumComp = model.openGLTexture.getComponents();\n var iComp = actor.getProperty().getIndependentComponents();\n\n if (model.lastHaveSeenDepthRequest !== model.haveSeenDepthRequest || cellBO.getProgram() === 0 || model.lastTextureComponents !== tNumComp || model.lastIndependentComponents !== iComp) {\n model.lastHaveSeenDepthRequest = model.haveSeenDepthRequest;\n model.lastTextureComponents = tNumComp;\n model.lastIndependentComponents = iComp;\n return true;\n }\n\n return false;\n };\n\n publicAPI.updateShaders = function (cellBO, ren, actor) {\n model.lastBoundBO = cellBO; // has something changed that would require us to recreate the shader?\n\n if (publicAPI.getNeedToRebuildShaders(cellBO, ren, actor)) {\n var shaders = {\n Vertex: null,\n Fragment: null,\n Geometry: null\n };\n publicAPI.buildShaders(shaders, ren, actor); // compile and bind the program if needed\n\n var newShader = model.openGLRenderWindow.getShaderCache().readyShaderProgramArray(shaders.Vertex, shaders.Fragment, shaders.Geometry); // if the shader changed reinitialize the VAO\n\n if (newShader !== cellBO.getProgram()) {\n cellBO.setProgram(newShader); // reset the VAO as the shader has changed\n\n cellBO.getVAO().releaseGraphicsResources();\n }\n\n cellBO.getShaderSourceTime().modified();\n } else {\n model.openGLRenderWindow.getShaderCache().readyShaderProgram(cellBO.getProgram());\n }\n\n cellBO.getVAO().bind();\n publicAPI.setMapperShaderParameters(cellBO, ren, actor);\n publicAPI.setCameraShaderParameters(cellBO, ren, actor);\n publicAPI.setPropertyShaderParameters(cellBO, ren, actor);\n };\n\n publicAPI.setMapperShaderParameters = function (cellBO, ren, actor) {\n // Now to update the VAO too, if necessary.\n if (cellBO.getCABO().getElementCount() && (model.VBOBuildTime > cellBO.getAttributeUpdateTime().getMTime() || cellBO.getShaderSourceTime().getMTime() > cellBO.getAttributeUpdateTime().getMTime())) {\n if (cellBO.getProgram().isAttributeUsed('vertexMC')) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO(), 'vertexMC', cellBO.getCABO().getVertexOffset(), cellBO.getCABO().getStride(), model.context.FLOAT, 3, model.context.FALSE)) {\n vtkErrorMacro('Error setting vertexMC in shader VAO.');\n }\n }\n\n if (cellBO.getProgram().isAttributeUsed('tcoordMC') && cellBO.getCABO().getTCoordOffset()) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO(), 'tcoordMC', cellBO.getCABO().getTCoordOffset(), cellBO.getCABO().getStride(), model.context.FLOAT, cellBO.getCABO().getTCoordComponents(), model.context.FALSE)) {\n vtkErrorMacro('Error setting tcoordMC in shader VAO.');\n }\n }\n\n cellBO.getAttributeUpdateTime().modified();\n }\n\n var texUnit = model.openGLTexture.getTextureUnit();\n cellBO.getProgram().setUniformi('texture1', texUnit);\n var numComp = model.openGLTexture.getComponents();\n var iComps = actor.getProperty().getIndependentComponents();\n\n if (iComps) {\n for (var i = 0; i < numComp; i++) {\n cellBO.getProgram().setUniformf(\"mix\".concat(i), actor.getProperty().getComponentWeight(i));\n }\n }\n\n var oglShiftScale = model.openGLTexture.getShiftAndScale(); // three levels of shift scale combined into one\n // for performance in the fragment shader\n\n for (var _i = 0; _i < numComp; _i++) {\n var cw = actor.getProperty().getColorWindow();\n var cl = actor.getProperty().getColorLevel();\n var target = iComps ? _i : 0;\n var cfun = actor.getProperty().getRGBTransferFunction(target);\n\n if (cfun) {\n var cRange = cfun.getRange();\n cw = cRange[1] - cRange[0];\n cl = 0.5 * (cRange[1] + cRange[0]);\n }\n\n var scale = oglShiftScale.scale / cw;\n var shift = (oglShiftScale.shift - cl) / cw + 0.5;\n cellBO.getProgram().setUniformf(\"cshift\".concat(_i), shift);\n cellBO.getProgram().setUniformf(\"cscale\".concat(_i), scale);\n } // pwf shift/scale\n\n\n for (var _i2 = 0; _i2 < numComp; _i2++) {\n var pwfScale = 1.0;\n var pwfShift = 0.0;\n\n var _target = iComps ? _i2 : 0;\n\n var pwfun = actor.getProperty().getPiecewiseFunction(_target);\n\n if (pwfun) {\n var pwfRange = pwfun.getRange();\n var length = pwfRange[1] - pwfRange[0];\n var mid = 0.5 * (pwfRange[0] + pwfRange[1]);\n pwfScale = oglShiftScale.scale / length;\n pwfShift = (oglShiftScale.shift - mid) / length + 0.5;\n }\n\n cellBO.getProgram().setUniformf(\"pwfshift\".concat(_i2), pwfShift);\n cellBO.getProgram().setUniformf(\"pwfscale\".concat(_i2), pwfScale);\n }\n\n if (model.haveSeenDepthRequest) {\n cellBO.getProgram().setUniformi('depthRequest', model.renderDepth ? 1 : 0);\n } // handle coincident\n\n\n if (cellBO.getProgram().isUniformUsed('coffset')) {\n var cp = publicAPI.getCoincidentParameters(ren, actor);\n cellBO.getProgram().setUniformf('coffset', cp.offset); // cfactor isn't always used when coffset is.\n\n if (cellBO.getProgram().isUniformUsed('cfactor')) {\n cellBO.getProgram().setUniformf('cfactor', cp.factor);\n }\n }\n\n var texColorUnit = model.colorTexture.getTextureUnit();\n cellBO.getProgram().setUniformi('colorTexture1', texColorUnit);\n var texOpacityUnit = model.pwfTexture.getTextureUnit();\n cellBO.getProgram().setUniformi('pwfTexture1', texOpacityUnit);\n };\n\n publicAPI.setCameraShaderParameters = function (cellBO, ren, actor) {\n var program = cellBO.getProgram();\n var actMats = model.openGLImageSlice.getKeyMatrices();\n var image = model.currentInput;\n var i2wmat4 = image.getIndexToWorld();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.imagemat, actMats.mcwc, i2wmat4);\n var keyMats = model.openGLCamera.getKeyMatrices(ren);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.imagemat, keyMats.wcpc, model.imagemat);\n\n if (cellBO.getCABO().getCoordShiftAndScaleEnabled()) {\n var inverseShiftScaleMat = cellBO.getCABO().getInverseShiftAndScaleMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.imagemat, model.imagemat, inverseShiftScaleMat);\n }\n\n program.setUniformMatrix('MCPCMatrix', model.imagemat);\n };\n\n publicAPI.setPropertyShaderParameters = function (cellBO, ren, actor) {\n var program = cellBO.getProgram();\n var ppty = actor.getProperty();\n var opacity = ppty.getOpacity();\n program.setUniformf('opacity', opacity);\n };\n\n publicAPI.renderPieceStart = function (ren, actor) {\n // make sure the BOs are up to date\n publicAPI.updateBufferObjects(ren, actor); // Bind the OpenGL, this is shared between the different primitive/cell types.\n\n model.lastBoundBO = null;\n };\n\n publicAPI.renderPieceDraw = function (ren, actor) {\n var gl = model.context; // activate the texture\n\n model.openGLTexture.activate();\n model.colorTexture.activate();\n model.pwfTexture.activate(); // draw polygons\n\n if (model.tris.getCABO().getElementCount()) {\n // First we do the triangles, update the shader, set uniforms, etc.\n publicAPI.updateShaders(model.tris, ren, actor);\n gl.drawArrays(gl.TRIANGLES, 0, model.tris.getCABO().getElementCount());\n model.tris.getVAO().release();\n }\n\n model.openGLTexture.deactivate();\n model.colorTexture.deactivate();\n model.pwfTexture.deactivate();\n };\n\n publicAPI.renderPieceFinish = function (ren, actor) {};\n\n publicAPI.renderPiece = function (ren, actor) {\n // Make sure that we have been properly initialized.\n // if (ren.getRenderWindow().checkAbortStatus()) {\n // return;\n // }\n publicAPI.invokeEvent({\n type: 'StartEvent'\n });\n model.renderable.update();\n model.currentInput = model.renderable.getInputData();\n publicAPI.invokeEvent({\n type: 'EndEvent'\n });\n\n if (!model.currentInput) {\n vtkErrorMacro('No input!');\n return;\n }\n\n publicAPI.renderPieceStart(ren, actor);\n publicAPI.renderPieceDraw(ren, actor);\n publicAPI.renderPieceFinish(ren, actor);\n };\n\n publicAPI.computeBounds = function (ren, actor) {\n if (!publicAPI.getInput()) {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_6__[\"uninitializeBounds\"](model.bounds);\n return;\n }\n\n model.bounds = publicAPI.getInput().getBounds();\n };\n\n publicAPI.updateBufferObjects = function (ren, actor) {\n // Rebuild buffers if needed\n if (publicAPI.getNeedToRebuildBufferObjects(ren, actor)) {\n publicAPI.buildBufferObjects(ren, actor);\n }\n };\n\n publicAPI.getNeedToRebuildBufferObjects = function (ren, actor) {\n // first do a coarse check\n if (model.VBOBuildTime.getMTime() < publicAPI.getMTime() || model.VBOBuildTime.getMTime() < actor.getMTime() || model.VBOBuildTime.getMTime() < model.renderable.getMTime() || model.VBOBuildTime.getMTime() < actor.getProperty().getMTime() || model.VBOBuildTime.getMTime() < model.currentInput.getMTime()) {\n return true;\n }\n\n return false;\n };\n\n publicAPI.buildBufferObjects = function (ren, actor) {\n var image = model.currentInput;\n\n if (!image) {\n return;\n }\n\n var imgScalars = image.getPointData() && image.getPointData().getScalars();\n\n if (!imgScalars) {\n return;\n }\n\n var actorProperty = actor.getProperty(); // set interpolation on the texture based on property setting\n\n var iType = actorProperty.getInterpolationType();\n\n if (iType === vtk_js_Sources_Rendering_Core_ImageProperty_Constants__WEBPACK_IMPORTED_MODULE_12__[\"InterpolationType\"].NEAREST) {\n model.colorTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n model.colorTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n model.pwfTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n model.pwfTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n } else {\n model.colorTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR);\n model.colorTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR);\n model.pwfTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR);\n model.pwfTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR);\n }\n\n var numComp = imgScalars.getNumberOfComponents();\n var iComps = actorProperty.getIndependentComponents();\n var numIComps = iComps ? numComp : 1;\n var textureHeight = iComps ? 2 * numIComps : 1;\n var cfunToString = computeFnToString(actorProperty, actorProperty.getRGBTransferFunction, numIComps);\n\n if (model.colorTextureString !== cfunToString) {\n var cWidth = 1024;\n var cSize = cWidth * textureHeight * 3;\n var cTable = new Uint8Array(cSize);\n var cfun = actorProperty.getRGBTransferFunction();\n\n if (cfun) {\n var tmpTable = new Float32Array(cWidth * 3);\n\n for (var c = 0; c < numIComps; c++) {\n cfun = actorProperty.getRGBTransferFunction(c);\n var cRange = cfun.getRange();\n cfun.getTable(cRange[0], cRange[1], cWidth, tmpTable, 1);\n\n if (iComps) {\n for (var i = 0; i < cWidth * 3; i++) {\n cTable[c * cWidth * 6 + i] = 255.0 * tmpTable[i];\n cTable[c * cWidth * 6 + i + cWidth * 3] = 255.0 * tmpTable[i];\n }\n } else {\n for (var _i3 = 0; _i3 < cWidth * 3; _i3++) {\n cTable[c * cWidth * 6 + _i3] = 255.0 * tmpTable[_i3];\n }\n }\n }\n\n model.colorTexture.create2DFromRaw(cWidth, textureHeight, 3, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__[\"VtkDataTypes\"].UNSIGNED_CHAR, cTable);\n } else {\n for (var _i4 = 0; _i4 < cWidth * 3; ++_i4) {\n cTable[_i4] = 255.0 * _i4 / ((cWidth - 1) * 3);\n cTable[_i4 + 1] = 255.0 * _i4 / ((cWidth - 1) * 3);\n cTable[_i4 + 2] = 255.0 * _i4 / ((cWidth - 1) * 3);\n }\n\n model.colorTexture.create2DFromRaw(cWidth, 1, 3, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__[\"VtkDataTypes\"].UNSIGNED_CHAR, cTable);\n }\n\n model.colorTextureString = cfunToString;\n } // Build piecewise function buffer. This buffer is used either\n // for component weighting or opacity, depending on whether we're\n // rendering components independently or not.\n\n\n var pwfunToString = computeFnToString(actorProperty, actorProperty.getPiecewiseFunction, numIComps);\n\n if (model.pwfTextureString !== pwfunToString) {\n var pwfWidth = 1024;\n var pwfSize = pwfWidth * textureHeight;\n var pwfTable = new Uint8Array(pwfSize);\n var pwfun = actorProperty.getPiecewiseFunction(); // support case where pwfun is added/removed\n\n model.pwfTexture.resetFormatAndType();\n\n if (pwfun) {\n var pwfFloatTable = new Float32Array(pwfSize);\n\n var _tmpTable = new Float32Array(pwfWidth);\n\n for (var _c = 0; _c < numIComps; ++_c) {\n pwfun = actorProperty.getPiecewiseFunction(_c);\n\n if (pwfun === null) {\n // Piecewise constant max if no function supplied for this component\n pwfFloatTable.fill(1.0);\n } else {\n var pwfRange = pwfun.getRange();\n pwfun.getTable(pwfRange[0], pwfRange[1], pwfWidth, _tmpTable, 1); // adjust for sample distance etc\n\n if (iComps) {\n for (var _i5 = 0; _i5 < pwfWidth; _i5++) {\n pwfFloatTable[_c * pwfWidth * 2 + _i5] = _tmpTable[_i5];\n pwfFloatTable[_c * pwfWidth * 2 + _i5 + pwfWidth] = _tmpTable[_i5];\n }\n } else {\n for (var _i6 = 0; _i6 < pwfWidth; _i6++) {\n pwfFloatTable[_c * pwfWidth * 2 + _i6] = _tmpTable[_i6];\n }\n }\n }\n }\n\n model.pwfTexture.create2DFromRaw(pwfWidth, textureHeight, 1, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__[\"VtkDataTypes\"].FLOAT, pwfFloatTable);\n } else {\n // default is opaque\n pwfTable.fill(255.0);\n model.pwfTexture.create2DFromRaw(pwfWidth, 1, 1, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__[\"VtkDataTypes\"].UNSIGNED_CHAR, pwfTable);\n }\n\n model.pwfTextureString = pwfunToString;\n } // Find what IJK axis and what direction to slice along\n\n\n var _model$renderable$get = model.renderable.getClosestIJKAxis(),\n ijkMode = _model$renderable$get.ijkMode; // Find the IJK slice\n\n\n var nSlice = model.renderable.getSlice();\n\n if (ijkMode !== model.renderable.getSlicingMode()) {\n // If not IJK slicing, get the IJK slice from the XYZ position/slice\n nSlice = model.renderable.getSliceAtPosition(nSlice);\n } // Find sliceOffset\n\n\n var ext = image.getExtent();\n var sliceOffset;\n\n if (ijkMode === SlicingMode.I) {\n sliceOffset = nSlice - ext[0];\n }\n\n if (ijkMode === SlicingMode.J) {\n sliceOffset = nSlice - ext[2];\n }\n\n if (ijkMode === SlicingMode.K || ijkMode === SlicingMode.NONE) {\n sliceOffset = nSlice - ext[4];\n } // rebuild the VBO if the data has changed\n\n\n var toString = \"\".concat(nSlice, \"A\").concat(image.getMTime(), \"A\").concat(imgScalars.getMTime(), \"B\").concat(publicAPI.getMTime(), \"C\").concat(model.renderable.getSlicingMode(), \"D\").concat(actor.getProperty().getMTime());\n\n if (model.VBOBuildString !== toString) {\n // Build the VBOs\n var dims = image.getDimensions();\n\n if (iType === vtk_js_Sources_Rendering_Core_ImageProperty_Constants__WEBPACK_IMPORTED_MODULE_12__[\"InterpolationType\"].NEAREST) {\n if (numComp === 4) {\n model.openGLTexture.setGenerateMipmap(true);\n model.openGLTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n } else {\n model.openGLTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n }\n\n model.openGLTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n } else {\n if (numComp === 4) {\n model.openGLTexture.setGenerateMipmap(true);\n model.openGLTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR_MIPMAP_LINEAR);\n } else {\n model.openGLTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR);\n }\n\n model.openGLTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR);\n }\n\n model.openGLTexture.setWrapS(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Wrap\"].CLAMP_TO_EDGE);\n model.openGLTexture.setWrapT(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Wrap\"].CLAMP_TO_EDGE);\n var sliceSize = dims[0] * dims[1] * numComp;\n var ptsArray = new Float32Array(12);\n var tcoordArray = new Float32Array(8);\n\n for (var _i7 = 0; _i7 < 4; _i7++) {\n tcoordArray[_i7 * 2] = _i7 % 2 ? 1.0 : 0.0;\n tcoordArray[_i7 * 2 + 1] = _i7 > 1 ? 1.0 : 0.0;\n }\n\n var basicScalars = imgScalars.getData();\n var scalars = null; // Get right scalars according to slicing mode\n\n if (ijkMode === SlicingMode.I) {\n scalars = new basicScalars.constructor(dims[2] * dims[1] * numComp);\n var id = 0;\n\n for (var k = 0; k < dims[2]; k++) {\n for (var j = 0; j < dims[1]; j++) {\n var bsIdx = (sliceOffset + j * dims[0] + k * dims[0] * dims[1]) * numComp;\n id = (k * dims[1] + j) * numComp;\n scalars.set(basicScalars.subarray(bsIdx, bsIdx + numComp), id);\n }\n }\n\n dims[0] = dims[1];\n dims[1] = dims[2];\n ptsArray[0] = nSlice;\n ptsArray[1] = ext[2];\n ptsArray[2] = ext[4];\n ptsArray[3] = nSlice;\n ptsArray[4] = ext[3];\n ptsArray[5] = ext[4];\n ptsArray[6] = nSlice;\n ptsArray[7] = ext[2];\n ptsArray[8] = ext[5];\n ptsArray[9] = nSlice;\n ptsArray[10] = ext[3];\n ptsArray[11] = ext[5];\n } else if (ijkMode === SlicingMode.J) {\n scalars = new basicScalars.constructor(dims[2] * dims[0] * numComp);\n var _id = 0;\n\n for (var _k = 0; _k < dims[2]; _k++) {\n for (var _i8 = 0; _i8 < dims[0]; _i8++) {\n var _bsIdx = (_i8 + sliceOffset * dims[0] + _k * dims[0] * dims[1]) * numComp;\n\n _id = (_k * dims[0] + _i8) * numComp;\n scalars.set(basicScalars.subarray(_bsIdx, _bsIdx + numComp), _id);\n }\n }\n\n dims[1] = dims[2];\n ptsArray[0] = ext[0];\n ptsArray[1] = nSlice;\n ptsArray[2] = ext[4];\n ptsArray[3] = ext[1];\n ptsArray[4] = nSlice;\n ptsArray[5] = ext[4];\n ptsArray[6] = ext[0];\n ptsArray[7] = nSlice;\n ptsArray[8] = ext[5];\n ptsArray[9] = ext[1];\n ptsArray[10] = nSlice;\n ptsArray[11] = ext[5];\n } else if (ijkMode === SlicingMode.K || ijkMode === SlicingMode.NONE) {\n scalars = basicScalars.subarray(sliceOffset * sliceSize, (sliceOffset + 1) * sliceSize);\n ptsArray[0] = ext[0];\n ptsArray[1] = ext[2];\n ptsArray[2] = nSlice;\n ptsArray[3] = ext[1];\n ptsArray[4] = ext[2];\n ptsArray[5] = nSlice;\n ptsArray[6] = ext[0];\n ptsArray[7] = ext[3];\n ptsArray[8] = nSlice;\n ptsArray[9] = ext[1];\n ptsArray[10] = ext[3];\n ptsArray[11] = nSlice;\n } else {\n vtkErrorMacro('Reformat slicing not yet supported.');\n }\n\n model.openGLTexture.create2DFromRaw(dims[0], dims[1], numComp, imgScalars.getDataType(), scalars);\n model.openGLTexture.activate();\n model.openGLTexture.sendParameters();\n model.openGLTexture.deactivate();\n var points = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n numberOfComponents: 3,\n values: ptsArray\n });\n points.setName('points');\n var tcoords = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n numberOfComponents: 2,\n values: tcoordArray\n });\n tcoords.setName('tcoords');\n var cellArray = new Uint16Array(8);\n cellArray[0] = 3;\n cellArray[1] = 0;\n cellArray[2] = 1;\n cellArray[3] = 3;\n cellArray[4] = 3;\n cellArray[5] = 0;\n cellArray[6] = 3;\n cellArray[7] = 2;\n var cells = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n numberOfComponents: 1,\n values: cellArray\n });\n model.tris.getCABO().createVBO(cells, 'polys', vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_10__[\"Representation\"].SURFACE, {\n points: points,\n tcoords: tcoords,\n cellOffset: 0\n });\n model.VBOBuildTime.modified();\n model.VBOBuildString = toString;\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n VBOBuildTime: 0,\n VBOBuildString: null,\n openGLTexture: null,\n tris: null,\n imagemat: null,\n colorTexture: null,\n pwfTexture: null,\n lastHaveSeenDepthRequest: false,\n haveSeenDepthRequest: false,\n lastTextureComponents: 0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_9__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_Rendering_OpenGL_ReplacementShaderMapper__WEBPACK_IMPORTED_MODULE_15__[\"default\"].implementReplaceShaderCoincidentOffset(publicAPI, model, initialValues);\n model.tris = vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n model.openGLTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.colorTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.pwfTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.imagemat = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16)); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"setGet\"](publicAPI, model, []);\n model.VBOBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"obj\"](model.VBOBuildTime); // Object methods\n\n vtkOpenGLImageMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"newInstance\"](extend, 'vtkOpenGLImageMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_16__[\"registerOverride\"])('vtkImageMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageSlice/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageSlice/index.js ***! - \**************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLImageSlice methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLImageSlice(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLImageSlice'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (prepass) {\n if (!model.renderable) {\n return;\n }\n\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getMapper());\n publicAPI.removeUnusedNodes();\n }\n };\n\n publicAPI.traverseOpaqueZBufferPass = function (renderPass) {\n publicAPI.traverseOpaquePass(renderPass);\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseOpaquePass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || !model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.children.forEach(function (child) {\n child.traverse(renderPass);\n });\n publicAPI.apply(renderPass, false);\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseTranslucentPass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.children.forEach(function (child) {\n child.traverse(renderPass);\n });\n publicAPI.apply(renderPass, false);\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (model.renderable.getIsOpaque()) {\n renderPass.incrementOpaqueActorCount();\n } else {\n renderPass.incrementTranslucentActorCount();\n }\n }\n };\n\n publicAPI.opaqueZBufferPass = function (prepass, renderPass) {\n return publicAPI.opaquePass(prepass, renderPass);\n }; // Renders myself\n\n\n publicAPI.opaquePass = function (prepass, renderPass) {\n if (prepass) {\n model.context = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow').getContext();\n model.context.depthMask(true);\n }\n }; // Renders myself\n\n\n publicAPI.translucentPass = function (prepass, renderPass) {\n if (prepass) {\n model.context = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow').getContext();\n model.context.depthMask(false);\n } else {\n model.context.depthMask(true);\n }\n };\n\n publicAPI.getKeyMatrices = function () {\n // has the actor changed?\n if (model.renderable.getMTime() > model.keyMatrixTime.getMTime()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.keyMatrices.mcwc, model.renderable.getMatrix());\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.mcwc, model.keyMatrices.mcwc);\n model.keyMatrixTime.modified();\n }\n\n return model.keyMatrices;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n keyMatrixTime: null,\n keyMatrices: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatrixTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.keyMatrixTime, {\n mtime: 0\n });\n model.keyMatrices = {\n mcwc: gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16))\n }; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['context']); // Object methods\n\n vtkOpenGLImageSlice(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkOpenGLImageSlice'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkImageSlice', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageSlice/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper/index.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper/index.js ***! - \****************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n// import { mat4, vec3 } from 'gl-matrix';\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkDebugMacro\"]; // ----------------------------------------------------------------------------\n// vtkOpenGLPixelSpaceCallbackMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLPixelSpaceCallbackMapper(publicAPI, model) {\n model.classHierarchy.push('vtkOpenGLPixelSpaceCallbackMapper');\n\n publicAPI.opaquePass = function (prepass, renderPass) {\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n model.openGLRenderWindow = model.openGLRenderer.getParent();\n var aspectRatio = model.openGLRenderer.getAspectRatio();\n var camera = model.openGLRenderer ? model.openGLRenderer.getRenderable().getActiveCamera() : null;\n var tsize = model.openGLRenderer.getTiledSizeAndOrigin();\n var texels = null;\n\n if (model.renderable.getUseZValues()) {\n var zbt = renderPass.getZBufferTexture();\n var width = Math.floor(zbt.getWidth());\n var height = Math.floor(zbt.getHeight());\n var gl = model.openGLRenderWindow.getContext();\n zbt.bind(); // Here we need to use vtkFramebuffer to save current settings (bindings/buffers)\n\n var fb = renderPass.getFramebuffer();\n\n if (!fb) {\n vtkDebugMacro('No framebuffer to save/restore');\n } else {\n // save framebuffer settings\n fb.saveCurrentBindingsAndBuffers();\n }\n\n var framebuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, zbt.getHandle(), 0);\n\n if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE) {\n texels = new Uint8Array(width * height * 4);\n gl.viewport(0, 0, width, height);\n gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, texels);\n } // Now we need to restore framebuffer bindings/buffers\n\n\n if (fb) {\n fb.restorePreviousBindingsAndBuffers();\n }\n\n gl.deleteFramebuffer(framebuffer);\n }\n\n model.renderable.invokeCallback(model.renderable.getInputData(), camera, aspectRatio, tsize, texels);\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (model.renderable.getUseZValues()) {\n renderPass.requestDepth();\n }\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object methods\n\n vtkOpenGLPixelSpaceCallbackMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkOpenGLPixelSpaceCallbackMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__[\"registerOverride\"])('vtkPixelSpaceCallbackMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/PolyDataMapper/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/PolyDataMapper/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Helper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ReplacementShaderMapper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* eslint-disable no-lonely-if */\n\nvar primTypes = {\n Start: 0,\n Points: 0,\n Lines: 1,\n Tris: 2,\n TriStrips: 3,\n TrisEdges: 4,\n TriStripsEdges: 5,\n End: 6\n};\nvar Representation = vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_6__[\"default\"].Representation,\n Shading = vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_6__[\"default\"].Shading;\nvar ScalarMode = vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ScalarMode;\nvar Filter = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_5__[\"default\"].Filter,\n Wrap = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_5__[\"default\"].Wrap;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"];\nvar StartEvent = {\n type: 'StartEvent'\n};\nvar EndEvent = {\n type: 'EndEvent'\n}; // ----------------------------------------------------------------------------\n// vtkOpenGLPolyDataMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLPolyDataMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLPolyDataMapper');\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.openGLActor = publicAPI.getFirstAncestorOfType('vtkOpenGLActor');\n model.openGLRenderer = model.openGLActor.getFirstAncestorOfType('vtkOpenGLRenderer');\n model.openGLRenderWindow = model.openGLRenderer.getParent();\n model.openGLCamera = model.openGLRenderer.getViewNodeFor(model.openGLRenderer.getRenderable().getActiveCamera());\n }\n }; // Renders myself\n\n\n publicAPI.translucentPass = function (prepass) {\n if (prepass) {\n publicAPI.render();\n }\n };\n\n publicAPI.opaqueZBufferPass = function (prepass) {\n if (prepass) {\n model.haveSeenDepthRequest = true;\n model.renderDepth = true;\n publicAPI.render();\n model.renderDepth = false;\n }\n };\n\n publicAPI.opaquePass = function (prepass) {\n if (prepass) {\n publicAPI.render();\n }\n };\n\n publicAPI.render = function () {\n var ctx = model.openGLRenderWindow.getContext();\n\n if (model.context !== ctx) {\n model.context = ctx;\n\n for (var i = primTypes.Start; i < primTypes.End; i++) {\n model.primitives[i].setOpenGLRenderWindow(model.openGLRenderWindow);\n }\n }\n\n var actor = model.openGLActor.getRenderable();\n var ren = model.openGLRenderer.getRenderable();\n publicAPI.renderPiece(ren, actor);\n };\n\n publicAPI.buildShaders = function (shaders, ren, actor) {\n publicAPI.getShaderTemplate(shaders, ren, actor); // user specified pre replacements\n\n var openGLSpec = model.renderable.getViewSpecificProperties().OpenGL;\n var shaderReplacements = null;\n\n if (openGLSpec) {\n shaderReplacements = openGLSpec.ShaderReplacements;\n }\n\n if (shaderReplacements) {\n for (var i = 0; i < shaderReplacements.length; i++) {\n var currReplacement = shaderReplacements[i];\n\n if (currReplacement.replaceFirst) {\n var shaderType = currReplacement.shaderType;\n var ssrc = shaders[shaderType];\n var substituteRes = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(ssrc, currReplacement.originalValue, currReplacement.replacementValue, currReplacement.replaceAll);\n shaders[shaderType] = substituteRes.result;\n }\n }\n }\n\n publicAPI.replaceShaderValues(shaders, ren, actor); // user specified post replacements\n\n if (shaderReplacements) {\n for (var _i = 0; _i < shaderReplacements.length; _i++) {\n var _currReplacement = shaderReplacements[_i];\n\n if (!_currReplacement.replaceFirst) {\n var _shaderType = _currReplacement.shaderType;\n var _ssrc = shaders[_shaderType];\n\n var _substituteRes = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(_ssrc, _currReplacement.originalValue, _currReplacement.replacementValue, _currReplacement.replaceAll);\n\n shaders[_shaderType] = _substituteRes.result;\n }\n }\n }\n };\n\n publicAPI.getShaderTemplate = function (shaders, ren, actor) {\n var openGLSpecProp = model.renderable.getViewSpecificProperties().OpenGL;\n var vertexShaderCode = vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_9___default.a;\n\n if (openGLSpecProp) {\n var vertexSpecProp = openGLSpecProp.VertexShaderCode;\n\n if (vertexSpecProp !== undefined && vertexSpecProp !== '') {\n vertexShaderCode = vertexSpecProp;\n }\n }\n\n shaders.Vertex = vertexShaderCode;\n var fragmentShaderCode = vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_10___default.a;\n\n if (openGLSpecProp) {\n var fragmentSpecProp = openGLSpecProp.FragmentShaderCode;\n\n if (fragmentSpecProp !== undefined && fragmentSpecProp !== '') {\n fragmentShaderCode = fragmentSpecProp;\n }\n }\n\n shaders.Fragment = fragmentShaderCode;\n var geometryShaderCode = '';\n\n if (openGLSpecProp) {\n var geometrySpecProp = openGLSpecProp.GeometryShaderCode;\n\n if (geometrySpecProp !== undefined) {\n geometryShaderCode = geometrySpecProp;\n }\n }\n\n shaders.Geometry = geometryShaderCode;\n };\n\n publicAPI.replaceShaderColor = function (shaders, ren, actor) {\n var VSSource = shaders.Vertex;\n var GSSource = shaders.Geometry;\n var FSSource = shaders.Fragment;\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity'); // create the material/color property declarations, and VS implementation\n // these are always defined\n\n var colorDec = ['uniform float ambient;', 'uniform float diffuse;', 'uniform float specular;', 'uniform float opacityUniform; // the fragment opacity', 'uniform vec3 ambientColorUniform;', 'uniform vec3 diffuseColorUniform;']; // add more for specular\n\n if (lastLightComplexity) {\n colorDec = colorDec.concat(['uniform vec3 specularColorUniform;', 'uniform float specularPowerUniform;']);\n } // now handle the more complex fragment shader implementation\n // the following are always defined variables. We start\n // by assigning a default value from the uniform\n\n\n var colorImpl = ['vec3 ambientColor;', ' vec3 diffuseColor;', ' float opacity;'];\n\n if (lastLightComplexity) {\n colorImpl = colorImpl.concat([' vec3 specularColor;', ' float specularPower;']);\n }\n\n colorImpl = colorImpl.concat([' ambientColor = ambientColorUniform;', ' diffuseColor = diffuseColorUniform;', ' opacity = opacityUniform;']);\n\n if (lastLightComplexity) {\n colorImpl = colorImpl.concat([' specularColor = specularColorUniform;', ' specularPower = specularPowerUniform;']);\n } // add scalar vertex coloring\n\n\n if (model.lastBoundBO.getCABO().getColorComponents() !== 0 && !model.drawingEdges) {\n colorDec = colorDec.concat(['varying vec4 vertexColorVSOutput;']);\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Color::Dec', ['attribute vec4 scalarColor;', 'varying vec4 vertexColorVSOutput;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Color::Impl', ['vertexColorVSOutput = scalarColor;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::Color::Dec', ['in vec4 vertexColorVSOutput[];', 'out vec4 vertexColorGSOutput;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::Color::Impl', ['vertexColorGSOutput = vertexColorVSOutput[i];']).result;\n }\n\n if (model.lastBoundBO.getCABO().getColorComponents() !== 0 && !model.drawingEdges) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Color::Impl', colorImpl.concat([' diffuseColor = vertexColorVSOutput.rgb;', ' ambientColor = vertexColorVSOutput.rgb;', ' opacity = opacity*vertexColorVSOutput.a;'])).result;\n } else {\n if (model.renderable.getInterpolateScalarsBeforeMapping() && model.renderable.getColorCoordinates() && !model.drawingEdges) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Color::Impl', colorImpl.concat([' vec4 texColor = texture2D(texture1, tcoordVCVSOutput.st);', ' diffuseColor = texColor.rgb;', ' ambientColor = texColor.rgb;', ' opacity = opacity*texColor.a;'])).result;\n } else {\n if (actor.getBackfaceProperty() && !model.drawingEdges) {\n colorDec = colorDec.concat(['uniform float opacityUniformBF; // the fragment opacity', 'uniform float ambientIntensityBF; // the material ambient', 'uniform float diffuseIntensityBF; // the material diffuse', 'uniform vec3 ambientColorUniformBF; // ambient material color', 'uniform vec3 diffuseColorUniformBF; // diffuse material color']);\n\n if (lastLightComplexity) {\n colorDec = colorDec.concat(['uniform float specularIntensityBF; // the material specular intensity', 'uniform vec3 specularColorUniformBF; // intensity weighted color', 'uniform float specularPowerUniformBF;']);\n colorImpl = colorImpl.concat(['if (gl_FrontFacing == false) {', ' ambientColor = ambientIntensityBF * ambientColorUniformBF;', ' diffuseColor = diffuseIntensityBF * diffuseColorUniformBF;', ' specularColor = specularIntensityBF * specularColorUniformBF;', ' specularPower = specularPowerUniformBF;', ' opacity = opacityUniformBF; }']);\n } else {\n colorImpl = colorImpl.concat(['if (gl_FrontFacing == false) {', ' ambientColor = ambientIntensityBF * ambientColorUniformBF;', ' diffuseColor = diffuseIntensityBF * diffuseColorUniformBF;', ' opacity = opacityUniformBF; }']);\n }\n }\n\n if (model.haveCellScalars && !model.drawingEdges) {\n colorDec = colorDec.concat(['uniform samplerBuffer texture1;']);\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Color::Impl', colorImpl).result;\n }\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Color::Dec', colorDec).result;\n shaders.Vertex = VSSource;\n shaders.Geometry = GSSource;\n shaders.Fragment = FSSource;\n };\n\n publicAPI.replaceShaderLight = function (shaders, ren, actor) {\n var FSSource = shaders.Fragment; // check for shadow maps\n\n var shadowFactor = '';\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n var lastLightCount = model.lastBoundBO.getReferenceByName('lastLightCount');\n var sstring = [];\n\n switch (lastLightComplexity) {\n case 0:\n // no lighting or RENDER_VALUES\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Light::Impl', [' gl_FragData[0] = vec4(ambientColor * ambient + diffuseColor * diffuse, opacity);', ' //VTK::Light::Impl'], false).result;\n break;\n\n case 1:\n // headlight\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Light::Impl', [' float df = max(0.0, normalVCVSOutput.z);', ' float sf = pow(df, specularPower);', ' vec3 diffuseL = df * diffuseColor;', ' vec3 specularL = sf * specularColor;', ' gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);', ' //VTK::Light::Impl'], false).result;\n break;\n\n case 2:\n // light kit\n for (var lc = 0; lc < lastLightCount; ++lc) {\n sstring = sstring.concat([\"uniform vec3 lightColor\".concat(lc, \";\"), \"uniform vec3 lightDirectionVC\".concat(lc, \"; // normalized\"), \"uniform vec3 lightHalfAngleVC\".concat(lc, \"; // normalized\")]);\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Light::Dec', sstring).result;\n sstring = ['vec3 diffuseL = vec3(0,0,0);', ' vec3 specularL = vec3(0,0,0);', ' float df;'];\n\n for (var _lc = 0; _lc < lastLightCount; ++_lc) {\n sstring = sstring.concat([\" df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC\".concat(_lc, \"));\"), \" diffuseL += ((df\".concat(shadowFactor, \") * lightColor\").concat(_lc, \");\"), \" if (dot(normalVCVSOutput, lightDirectionVC\".concat(_lc, \") < 0.0)\"), ' {', \" float sf = pow( max(0.0, dot(lightHalfAngleVC\".concat(_lc, \",normalVCVSOutput)), specularPower);\"), \" specularL += ((sf\".concat(shadowFactor, \") * lightColor\").concat(_lc, \");\"), ' }']);\n }\n\n sstring = sstring.concat([' diffuseL = diffuseL * diffuseColor;', ' specularL = specularL * specularColor;', ' gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);', ' //VTK::Light::Impl']);\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Light::Impl', sstring, false).result;\n break;\n\n case 3:\n // positional\n for (var _lc2 = 0; _lc2 < lastLightCount; ++_lc2) {\n sstring = sstring.concat([\"uniform vec3 lightColor\".concat(_lc2, \";\"), \"uniform vec3 lightDirectionVC\".concat(_lc2, \"; // normalized\"), \"uniform vec3 lightHalfAngleVC\".concat(_lc2, \"; // normalized\"), \"uniform vec3 lightPositionVC\".concat(_lc2, \";\"), \"uniform vec3 lightAttenuation\".concat(_lc2, \";\"), \"uniform float lightConeAngle\".concat(_lc2, \";\"), \"uniform float lightExponent\".concat(_lc2, \";\"), \"uniform int lightPositional\".concat(_lc2, \";\")]);\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Light::Dec', sstring).result;\n sstring = ['vec3 diffuseL = vec3(0,0,0);', ' vec3 specularL = vec3(0,0,0);', ' vec3 vertLightDirectionVC;', ' float attenuation;', ' float df;'];\n\n for (var _lc3 = 0; _lc3 < lastLightCount; ++_lc3) {\n sstring = sstring.concat([' attenuation = 1.0;', \" if (lightPositional\".concat(_lc3, \" == 0)\"), ' {', \" vertLightDirectionVC = lightDirectionVC\".concat(_lc3, \";\"), ' }', ' else', ' {', \" vertLightDirectionVC = vertexVC.xyz - lightPositionVC\".concat(_lc3, \";\"), ' float distanceVC = length(vertLightDirectionVC);', ' vertLightDirectionVC = normalize(vertLightDirectionVC);', ' attenuation = 1.0 /', \" (lightAttenuation\".concat(_lc3, \".x\"), \" + lightAttenuation\".concat(_lc3, \".y * distanceVC\"), \" + lightAttenuation\".concat(_lc3, \".z * distanceVC * distanceVC);\"), ' // per OpenGL standard cone angle is 90 or less for a spot light', \" if (lightConeAngle\".concat(_lc3, \" <= 90.0)\"), ' {', \" float coneDot = dot(vertLightDirectionVC, lightDirectionVC\".concat(_lc3, \");\"), ' // if inside the cone', \" if (coneDot >= cos(radians(lightConeAngle\".concat(_lc3, \")))\"), ' {', \" attenuation = attenuation * pow(coneDot, lightExponent\".concat(_lc3, \");\"), ' }', ' else', ' {', ' attenuation = 0.0;', ' }', ' }', ' }', ' df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));', \" diffuseL += ((df\".concat(shadowFactor, \") * lightColor\").concat(_lc3, \");\"), ' if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)', ' {', \" float sf = attenuation*pow( max(0.0, dot(lightHalfAngleVC\".concat(_lc3, \",normalVCVSOutput)), specularPower);\"), \" specularL += ((sf\".concat(shadowFactor, \") * lightColor\").concat(_lc3, \");\"), ' }']);\n }\n\n sstring = sstring.concat([' diffuseL = diffuseL * diffuseColor;', ' specularL = specularL * specularColor;', ' gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);', ' //VTK::Light::Impl']);\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Light::Impl', sstring, false).result;\n break;\n\n default:\n vtkErrorMacro('bad light complexity');\n }\n\n shaders.Fragment = FSSource;\n };\n\n publicAPI.replaceShaderNormal = function (shaders, ren, actor) {\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (lastLightComplexity > 0) {\n var VSSource = shaders.Vertex;\n var GSSource = shaders.Geometry;\n var FSSource = shaders.Fragment;\n\n if (model.lastBoundBO.getCABO().getNormalOffset()) {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Normal::Dec', ['attribute vec3 normalMC;', 'uniform mat3 normalMatrix;', 'varying vec3 normalVCVSOutput;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Normal::Impl', ['normalVCVSOutput = normalMatrix * normalMC;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::Normal::Dec', ['in vec3 normalVCVSOutput[];', 'out vec3 normalVCGSOutput;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::Normal::Impl', ['normalVCGSOutput = normalVCVSOutput[i];']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Dec', ['varying vec3 normalVCVSOutput;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Impl', ['vec3 normalVCVSOutput = normalize(normalVCVSOutput);', // if (!gl_FrontFacing) does not work in intel hd4000 mac\n // if (int(gl_FrontFacing) == 0) does not work on mesa\n ' if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }']).result;\n } else {\n if (model.haveCellNormals) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Dec', ['uniform mat3 normalMatrix;', 'uniform samplerBuffer textureN;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Impl', ['vec3 normalVCVSOutput = normalize(normalMatrix *', ' texelFetchBuffer(textureN, gl_PrimitiveID + PrimitiveIDOffset).xyz);', ' if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }']).result;\n } else {\n if (publicAPI.getOpenGLMode(actor.getProperty().getRepresentation(), model.lastBoundBO.getPrimitiveType()) === model.context.LINES) {\n // generate a normal for lines, it will be perpendicular to the line\n // and maximally aligned with the camera view direction\n // no clue if this is the best way to do this.\n // the code below has been optimized a bit so what follows is\n // an explanation of the basic approach. Compute the gradient of the line\n // with respect to x and y, the the larger of the two\n // cross that with the camera view direction. That gives a vector\n // orthogonal to the camera view and the line. Note that the line and the camera\n // view are probably not orthogonal. Which is why when we cross result that with\n // the line gradient again we get a reasonable normal. It will be othogonal to\n // the line (which is a plane but maximally aligned with the camera view.\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::UniformFlow::Impl', [' vec3 fdx = vec3(dFdx(vertexVC.x),dFdx(vertexVC.y),dFdx(vertexVC.z));', ' vec3 fdy = vec3(dFdy(vertexVC.x),dFdy(vertexVC.y),dFdy(vertexVC.z));', ' //VTK::UniformFlow::Impl'] // For further replacements\n ).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Impl', ['vec3 normalVCVSOutput;', ' fdx = normalize(fdx);', ' fdy = normalize(fdy);', ' if (abs(fdx.x) > 0.0)', ' { normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }', ' else { normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}']).result;\n } else {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Dec', ['uniform int cameraParallel;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::UniformFlow::Impl', [// ' vec3 fdx = vec3(dFdx(vertexVC.x),dFdx(vertexVC.y),dFdx(vertexVC.z));',\n // ' vec3 fdy = vec3(dFdy(vertexVC.x),dFdy(vertexVC.y),dFdy(vertexVC.z));',\n ' vec3 fdx = dFdx(vertexVC.xyz);', ' vec3 fdy = dFdy(vertexVC.xyz);', ' //VTK::UniformFlow::Impl'] // For further replacements\n ).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Impl', [' fdx = normalize(fdx);', ' fdy = normalize(fdy);', ' vec3 normalVCVSOutput = normalize(cross(fdx,fdy));', // the code below is faster, but does not work on some devices\n // 'vec3 normalVC = normalize(cross(dFdx(vertexVC.xyz), dFdy(vertexVC.xyz)));',\n ' if (cameraParallel == 1 && normalVCVSOutput.z < 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }', ' if (cameraParallel == 0 && dot(normalVCVSOutput,vertexVC.xyz) > 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }']).result;\n }\n }\n }\n\n shaders.Vertex = VSSource;\n shaders.Geometry = GSSource;\n shaders.Fragment = FSSource;\n }\n };\n\n publicAPI.replaceShaderPositionVC = function (shaders, ren, actor) {\n var VSSource = shaders.Vertex;\n var GSSource = shaders.Geometry;\n var FSSource = shaders.Fragment; // for points make sure to add in the point size\n\n if (actor.getProperty().getRepresentation() === Representation.POINTS || model.lastBoundBO.getPrimitiveType() === primTypes.Points) {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Impl', ['//VTK::PositionVC::Impl', \" gl_PointSize = \".concat(actor.getProperty().getPointSize(), \".0;\")], false).result;\n } // do we need the vertex in the shader in View Coordinates\n\n\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (lastLightComplexity > 0) {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Dec', ['varying vec4 vertexVCVSOutput;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Impl', ['vertexVCVSOutput = MCVCMatrix * vertexMC;', ' gl_Position = MCPCMatrix * vertexMC;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Camera::Dec', ['uniform mat4 MCPCMatrix;', 'uniform mat4 MCVCMatrix;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::PositionVC::Dec', ['in vec4 vertexVCVSOutput[];', 'out vec4 vertexVCGSOutput;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::PositionVC::Impl', ['vertexVCGSOutput = vertexVCVSOutput[i];']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::PositionVC::Dec', ['varying vec4 vertexVCVSOutput;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::PositionVC::Impl', ['vec4 vertexVC = vertexVCVSOutput;']).result;\n } else {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Camera::Dec', ['uniform mat4 MCPCMatrix;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Impl', [' gl_Position = MCPCMatrix * vertexMC;']).result;\n }\n\n shaders.Vertex = VSSource;\n shaders.Geometry = GSSource;\n shaders.Fragment = FSSource;\n };\n\n publicAPI.replaceShaderTCoord = function (shaders, ren, actor) {\n if (model.lastBoundBO.getCABO().getTCoordOffset()) {\n var VSSource = shaders.Vertex;\n var GSSource = shaders.Geometry;\n var FSSource = shaders.Fragment;\n\n if (model.drawingEdges) {\n return;\n }\n\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::TCoord::Impl', 'tcoordVCVSOutput = tcoordMC;').result; // we only handle the first texture by default\n // additional textures are activated and we set the uniform\n // for the texture unit they are assigned to, but you have to\n // add in the shader code to do something with them\n\n var tus = model.openGLActor.getActiveTextures();\n var tNumComp = 2;\n var tcdim = 2;\n\n if (tus && tus.length > 0) {\n tNumComp = tus[0].getComponents();\n\n if (tus[0].getTarget() === model.context.TEXTURE_CUBE_MAP) {\n tcdim = 3;\n }\n }\n\n if (model.renderable.getColorTextureMap()) {\n tNumComp = model.renderable.getColorTextureMap().getPointData().getScalars().getNumberOfComponents();\n tcdim = 2;\n }\n\n if (tcdim === 2) {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::TCoord::Dec', 'attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;').result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::TCoord::Dec', ['in vec2 tcoordVCVSOutput[];', 'out vec2 tcoordVCGSOutput;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::TCoord::Impl', 'tcoordVCGSOutput = tcoordVCVSOutput[i];').result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Dec', ['varying vec2 tcoordVCVSOutput;', 'uniform sampler2D texture1;']).result;\n\n if (tus && tus.length >= 1) {\n switch (tNumComp) {\n case 1:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);', 'gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*', ' vec4(tcolor.r,tcolor.r,tcolor.r,1.0);']).result;\n break;\n\n case 2:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);', 'gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*', ' vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);']).result;\n break;\n\n default:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', 'gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*texture2D(texture1, tcoordVCVSOutput.st);').result;\n }\n }\n } else {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::TCoord::Dec', 'attribute vec3 tcoordMC; varying vec3 tcoordVCVSOutput;').result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::TCoord::Dec', ['in vec3 tcoordVCVSOutput[];', 'out vec3 tcoordVCGSOutput;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::TCoord::Impl', 'tcoordVCGSOutput = tcoordVCVSOutput[i];').result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Dec', ['varying vec3 tcoordVCVSOutput;', 'uniform samplerCube texture1;']).result;\n\n switch (tNumComp) {\n case 1:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);', 'gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*', ' vec4(tcolor.r,tcolor.r,tcolor.r,1.0);']).result;\n break;\n\n case 2:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);', 'gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*', ' vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);']).result;\n break;\n\n default:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', 'gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*textureCube(texture1, tcoordVCVSOutput);').result;\n }\n }\n\n shaders.Vertex = VSSource;\n shaders.Geometry = GSSource;\n shaders.Fragment = FSSource;\n }\n };\n\n publicAPI.replaceShaderClip = function (shaders, ren, actor) {\n var VSSource = shaders.Vertex;\n var FSSource = shaders.Fragment;\n\n if (model.renderable.getNumberOfClippingPlanes()) {\n var numClipPlanes = model.renderable.getNumberOfClippingPlanes();\n\n if (numClipPlanes > 6) {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"]('OpenGL has a limit of 6 clipping planes');\n numClipPlanes = 6;\n }\n\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Clip::Dec', ['uniform int numClipPlanes;', 'uniform vec4 clipPlanes[6];', 'varying float clipDistancesVSOutput[6];']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Clip::Impl', ['for (int planeNum = 0; planeNum < 6; planeNum++)', ' {', ' if (planeNum >= numClipPlanes)', ' {', ' break;', ' }', ' clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);', ' }']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Clip::Dec', ['uniform int numClipPlanes;', 'varying float clipDistancesVSOutput[6];']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Clip::Impl', ['for (int planeNum = 0; planeNum < 6; planeNum++)', ' {', ' if (planeNum >= numClipPlanes)', ' {', ' break;', ' }', ' if (clipDistancesVSOutput[planeNum] < 0.0) discard;', ' }']).result;\n }\n\n shaders.Vertex = VSSource;\n shaders.Fragment = FSSource;\n };\n\n publicAPI.getCoincidentParameters = function (ren, actor) {\n // 1. ResolveCoincidentTopology is On and non zero for this primitive\n // type\n var cp = null;\n var prop = actor.getProperty();\n\n if (model.renderable.getResolveCoincidentTopology() || prop.getEdgeVisibility() && prop.getRepresentation() === Representation.SURFACE) {\n var primType = model.lastBoundBO.getPrimitiveType();\n\n if (primType === primTypes.Points || prop.getRepresentation() === Representation.POINTS) {\n cp = model.renderable.getCoincidentTopologyPointOffsetParameter();\n } else if (primType === primTypes.Lines || prop.getRepresentation() === Representation.WIREFRAME) {\n cp = model.renderable.getCoincidentTopologyLineOffsetParameters();\n } else if (primType === primTypes.Tris || primType === primTypes.TriStrips) {\n cp = model.renderable.getCoincidentTopologyPolygonOffsetParameters();\n }\n\n if (primType === primTypes.TrisEdges || primType === primTypes.TriStripsEdges) {\n cp = model.renderable.getCoincidentTopologyPolygonOffsetParameters();\n cp.factor /= 2.0;\n cp.offset /= 2.0;\n }\n } // hardware picking always offset due to saved zbuffer\n // This gets you above the saved surface depth buffer.\n // vtkHardwareSelector* selector = ren->GetSelector();\n // if (selector &&\n // selector->GetFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_POINTS)\n // {\n // offset -= 2.0;\n // return;\n // }\n\n\n return cp;\n };\n\n publicAPI.replaceShaderPicking = function (shaders, ren, actor) {\n var FSSource = shaders.Fragment;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Picking::Dec', ['uniform vec3 mapperIndex;', 'uniform int picking;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Picking::Impl', ' gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];').result;\n shaders.Fragment = FSSource;\n };\n\n publicAPI.replaceShaderValues = function (shaders, ren, actor) {\n publicAPI.replaceShaderColor(shaders, ren, actor);\n publicAPI.replaceShaderNormal(shaders, ren, actor);\n publicAPI.replaceShaderLight(shaders, ren, actor);\n publicAPI.replaceShaderTCoord(shaders, ren, actor);\n publicAPI.replaceShaderPicking(shaders, ren, actor);\n publicAPI.replaceShaderClip(shaders, ren, actor);\n publicAPI.replaceShaderCoincidentOffset(shaders, ren, actor);\n publicAPI.replaceShaderPositionVC(shaders, ren, actor);\n\n if (model.haveSeenDepthRequest) {\n var FSSource = shaders.Fragment;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::ZBuffer::Dec', 'uniform int depthRequest;').result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::ZBuffer::Impl', ['if (depthRequest == 1) {', 'float iz = floor(gl_FragCoord.z*65535.0 + 0.1);', 'float rf = floor(iz/256.0)/255.0;', 'float gf = mod(iz,256.0)/255.0;', 'gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }']).result;\n shaders.Fragment = FSSource;\n }\n };\n\n publicAPI.getNeedToRebuildShaders = function (cellBO, ren, actor) {\n var lightComplexity = 0;\n var numberOfLights = 0;\n var primType = cellBO.getPrimitiveType();\n var poly = model.currentInput; // different algo from C++ as of 5/2019\n\n var needLighting = false;\n var pointNormals = poly.getPointData().getNormals();\n var cellNormals = poly.getCellData().getNormals();\n var flat = actor.getProperty().getInterpolation() === Shading.FLAT;\n var representation = actor.getProperty().getRepresentation();\n var mode = publicAPI.getOpenGLMode(representation, primType); // 1) all surfaces need lighting\n\n if (mode === model.context.TRIANGLES) {\n needLighting = true; // 2) all cell normals without point normals need lighting\n } else if (cellNormals && !pointNormals) {\n needLighting = true; // 3) Phong + pointNormals need lighting\n } else if (!flat && pointNormals) {\n needLighting = true; // 4) Phong Lines need lighting\n } else if (!flat && mode === model.context.LINES) {\n needLighting = true;\n } // 5) everything else is unlit\n // do we need lighting?\n\n\n if (actor.getProperty().getLighting() && needLighting) {\n // consider the lighting complexity to determine which case applies\n // simple headlight, Light Kit, the whole feature set of VTK\n lightComplexity = 0;\n var lights = ren.getLightsByReference();\n\n for (var index = 0; index < lights.length; ++index) {\n var light = lights[index];\n var status = light.getSwitch();\n\n if (status > 0) {\n numberOfLights++;\n\n if (lightComplexity === 0) {\n lightComplexity = 1;\n }\n }\n\n if (lightComplexity === 1 && (numberOfLights > 1 || light.getIntensity() !== 1.0 || !light.lightTypeIsHeadLight())) {\n lightComplexity = 2;\n }\n\n if (lightComplexity < 3 && light.getPositional()) {\n lightComplexity = 3;\n }\n }\n }\n\n var needRebuild = false;\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n var lastLightCount = model.lastBoundBO.getReferenceByName('lastLightCount');\n\n if (lastLightComplexity !== lightComplexity || lastLightCount !== numberOfLights) {\n model.lastBoundBO.set({\n lastLightComplexity: lightComplexity\n }, true);\n model.lastBoundBO.set({\n lastLightCount: numberOfLights\n }, true);\n needRebuild = true;\n } // has something changed that would require us to recreate the shader?\n // candidates are\n // property modified (representation interpolation and lighting)\n // input modified\n // light complexity changed\n\n\n if (model.lastHaveSeenDepthRequest !== model.haveSeenDepthRequest || cellBO.getProgram() === 0 || cellBO.getShaderSourceTime().getMTime() < publicAPI.getMTime() || cellBO.getShaderSourceTime().getMTime() < actor.getMTime() || cellBO.getShaderSourceTime().getMTime() < model.renderable.getMTime() || cellBO.getShaderSourceTime().getMTime() < model.currentInput.getMTime() || needRebuild) {\n model.lastHaveSeenDepthRequest = model.haveSeenDepthRequest;\n return true;\n }\n\n return false;\n };\n\n publicAPI.updateShaders = function (cellBO, ren, actor) {\n model.lastBoundBO = cellBO; // has something changed that would require us to recreate the shader?\n\n if (publicAPI.getNeedToRebuildShaders(cellBO, ren, actor)) {\n var shaders = {\n Vertex: null,\n Fragment: null,\n Geometry: null\n };\n publicAPI.buildShaders(shaders, ren, actor); // compile and bind the program if needed\n\n var newShader = model.openGLRenderWindow.getShaderCache().readyShaderProgramArray(shaders.Vertex, shaders.Fragment, shaders.Geometry); // if the shader changed reinitialize the VAO\n\n if (newShader !== cellBO.getProgram()) {\n cellBO.setProgram(newShader); // reset the VAO as the shader has changed\n\n cellBO.getVAO().releaseGraphicsResources();\n }\n\n cellBO.getShaderSourceTime().modified();\n } else {\n model.openGLRenderWindow.getShaderCache().readyShaderProgram(cellBO.getProgram());\n }\n\n cellBO.getVAO().bind();\n publicAPI.setMapperShaderParameters(cellBO, ren, actor);\n publicAPI.setPropertyShaderParameters(cellBO, ren, actor);\n publicAPI.setCameraShaderParameters(cellBO, ren, actor);\n publicAPI.setLightingShaderParameters(cellBO, ren, actor);\n var listCallbacks = model.renderable.getViewSpecificProperties().ShadersCallbacks;\n\n if (listCallbacks) {\n listCallbacks.forEach(function (object) {\n object.callback(object.userData, cellBO, ren, actor);\n });\n }\n };\n\n publicAPI.setMapperShaderParameters = function (cellBO, ren, actor) {\n // Now to update the VAO too, if necessary.\n if (cellBO.getProgram().isUniformUsed('PrimitiveIDOffset')) {\n cellBO.getProgram().setUniformi('PrimitiveIDOffset', model.primitiveIDOffset);\n }\n\n if (cellBO.getCABO().getElementCount() && (model.VBOBuildTime.getMTime() > cellBO.getAttributeUpdateTime().getMTime() || cellBO.getShaderSourceTime().getMTime() > cellBO.getAttributeUpdateTime().getMTime())) {\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (cellBO.getProgram().isAttributeUsed('vertexMC')) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO(), 'vertexMC', cellBO.getCABO().getVertexOffset(), cellBO.getCABO().getStride(), model.context.FLOAT, 3, false)) {\n vtkErrorMacro('Error setting vertexMC in shader VAO.');\n }\n }\n\n if (cellBO.getProgram().isAttributeUsed('normalMC') && cellBO.getCABO().getNormalOffset() && lastLightComplexity > 0) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO(), 'normalMC', cellBO.getCABO().getNormalOffset(), cellBO.getCABO().getStride(), model.context.FLOAT, 3, false)) {\n vtkErrorMacro('Error setting normalMC in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('normalMC');\n }\n\n model.renderable.getCustomShaderAttributes().forEach(function (attrName, idx) {\n if (cellBO.getProgram().isAttributeUsed(\"\".concat(attrName, \"MC\"))) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO(), \"\".concat(attrName, \"MC\"), cellBO.getCABO().getCustomData()[idx].offset, cellBO.getCABO().getStride(), model.context.FLOAT, cellBO.getCABO().getCustomData()[idx].components, false)) {\n vtkErrorMacro(\"Error setting \".concat(attrName, \"MC in shader VAO.\"));\n }\n }\n });\n\n if (cellBO.getProgram().isAttributeUsed('tcoordMC') && cellBO.getCABO().getTCoordOffset()) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO(), 'tcoordMC', cellBO.getCABO().getTCoordOffset(), cellBO.getCABO().getStride(), model.context.FLOAT, cellBO.getCABO().getTCoordComponents(), false)) {\n vtkErrorMacro('Error setting tcoordMC in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('tcoordMC');\n }\n\n if (cellBO.getProgram().isAttributeUsed('scalarColor') && cellBO.getCABO().getColorComponents()) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO().getColorBO(), 'scalarColor', cellBO.getCABO().getColorOffset(), cellBO.getCABO().getColorBOStride(), model.context.UNSIGNED_BYTE, 4, true)) {\n vtkErrorMacro('Error setting scalarColor in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('scalarColor');\n }\n\n cellBO.getAttributeUpdateTime().modified();\n }\n\n if (model.renderable.getNumberOfClippingPlanes()) {\n // add all the clipping planes\n var numClipPlanes = model.renderable.getNumberOfClippingPlanes();\n\n if (numClipPlanes > 6) {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"]('OpenGL has a limit of 6 clipping planes');\n numClipPlanes = 6;\n }\n\n var planeEquations = [];\n\n for (var i = 0; i < numClipPlanes; i++) {\n var planeEquation = [];\n model.renderable.getClippingPlaneInDataCoords(actor.getMatrix(), i, planeEquation);\n\n for (var j = 0; j < 4; j++) {\n planeEquations.push(planeEquation[j]);\n }\n }\n\n cellBO.getProgram().setUniformi('numClipPlanes', numClipPlanes);\n cellBO.getProgram().setUniform4fv('clipPlanes', 6, planeEquations);\n }\n\n if (model.internalColorTexture && cellBO.getProgram().isUniformUsed('texture1')) {\n cellBO.getProgram().setUniformi('texture1', model.internalColorTexture.getTextureUnit());\n }\n\n var tus = model.openGLActor.getActiveTextures();\n\n if (tus) {\n for (var index = 0; index < tus.length; ++index) {\n var tex = tus[index];\n var texUnit = tex.getTextureUnit();\n var tname = \"texture\".concat(texUnit + 1);\n\n if (cellBO.getProgram().isUniformUsed(tname)) {\n cellBO.getProgram().setUniformi(tname, texUnit);\n }\n }\n } // handle depth requests\n\n\n if (model.haveSeenDepthRequest) {\n cellBO.getProgram().setUniformi('depthRequest', model.renderDepth ? 1 : 0);\n } // handle coincident\n\n\n if (cellBO.getProgram().isUniformUsed('coffset')) {\n var cp = publicAPI.getCoincidentParameters(ren, actor);\n cellBO.getProgram().setUniformf('coffset', cp.offset); // cfactor isn't always used when coffset is.\n\n if (cellBO.getProgram().isUniformUsed('cfactor')) {\n cellBO.getProgram().setUniformf('cfactor', cp.factor);\n }\n }\n\n var selector = model.openGLRenderer.getSelector();\n cellBO.getProgram().setUniform3fArray('mapperIndex', selector ? selector.getPropColorValue() : [0.0, 0.0, 0.0]);\n cellBO.getProgram().setUniformi('picking', selector ? selector.getCurrentPass() + 1 : 0);\n };\n\n publicAPI.setLightingShaderParameters = function (cellBO, ren, actor) {\n // for unlit and headlight there are no lighting parameters\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (lastLightComplexity < 2) {\n return;\n }\n\n var program = cellBO.getProgram(); // bind some light settings\n\n var numberOfLights = 0;\n var lights = ren.getLightsByReference();\n\n for (var index = 0; index < lights.length; ++index) {\n var light = lights[index];\n var status = light.getSwitch();\n\n if (status > 0.0) {\n var dColor = light.getColorByReference();\n var intensity = light.getIntensity();\n model.lightColor[0] = dColor[0] * intensity;\n model.lightColor[1] = dColor[1] * intensity;\n model.lightColor[2] = dColor[2] * intensity; // get required info from light\n\n var ld = light.getDirection();\n var transform = ren.getActiveCamera().getViewMatrix();\n\n var newLightDirection = _toConsumableArray(ld);\n\n if (light.lightTypeIsSceneLight()) {\n newLightDirection[0] = transform[0] * ld[0] + transform[1] * ld[1] + transform[2] * ld[2];\n newLightDirection[1] = transform[4] * ld[0] + transform[5] * ld[1] + transform[6] * ld[2];\n newLightDirection[2] = transform[8] * ld[0] + transform[9] * ld[1] + transform[10] * ld[2];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"normalize\"](newLightDirection);\n }\n\n model.lightDirection[0] = newLightDirection[0];\n model.lightDirection[1] = newLightDirection[1];\n model.lightDirection[2] = newLightDirection[2];\n model.lightHalfAngle[0] = -model.lightDirection[0];\n model.lightHalfAngle[1] = -model.lightDirection[1];\n model.lightHalfAngle[2] = -model.lightDirection[2] + 1.0;\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"normalize\"](model.lightDirection);\n program.setUniform3fArray(\"lightColor\".concat(numberOfLights), model.lightColor);\n program.setUniform3fArray(\"lightDirectionVC\".concat(numberOfLights), model.lightDirection);\n program.setUniform3fArray(\"lightHalfAngleVC\".concat(numberOfLights), model.lightHalfAngle);\n numberOfLights++;\n }\n } // we are done unless we have positional lights\n\n\n if (lastLightComplexity < 3) {\n return;\n } // for lightkit case there are some parameters to set\n\n\n var cam = ren.getActiveCamera();\n var viewTF = cam.getViewMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(viewTF, viewTF);\n numberOfLights = 0;\n\n for (var _index = 0; _index < lights.length; ++_index) {\n var _light = lights[_index];\n\n var _status = _light.getSwitch();\n\n if (_status > 0.0) {\n var lp = _light.getTransformedPosition();\n\n var np = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(np, lp, viewTF);\n program.setUniform3fArray(\"lightAttenuation\".concat(numberOfLights), _light.getAttenuationValuesByReference());\n program.setUniformi(\"lightPositional\".concat(numberOfLights), _light.getPositional());\n program.setUniformf(\"lightExponent\".concat(numberOfLights), _light.getExponent());\n program.setUniformf(\"lightConeAngle\".concat(numberOfLights), _light.getConeAngle());\n program.setUniform3fArray(\"lightPositionVC\".concat(numberOfLights), [np[0], np[1], np[2]]);\n numberOfLights++;\n }\n }\n };\n\n function safeMatrixMultiply(matrixArray, matrixType, tmpMat) {\n matrixType.identity(tmpMat);\n return matrixArray.reduce(function (res, matrix, index) {\n if (index === 0) {\n return matrix ? matrixType.copy(res, matrix) : matrixType.identity(res);\n }\n\n return matrix ? matrixType.multiply(res, res, matrix) : res;\n }, tmpMat);\n }\n\n publicAPI.setCameraShaderParameters = function (cellBO, ren, actor) {\n var program = cellBO.getProgram(); // [WMVP]C == {world, model, view, projection} coordinates\n // E.g., WCPC == world to projection coordinate transformation\n\n var keyMats = model.openGLCamera.getKeyMatrices(ren);\n var cam = ren.getActiveCamera();\n var camm = model.openGLCamera.getKeyMatrixTime().getMTime();\n var progm = program.getLastCameraMTime();\n var shiftScaleEnabled = cellBO.getCABO().getCoordShiftAndScaleEnabled();\n var inverseShiftScaleMatrix = shiftScaleEnabled ? cellBO.getCABO().getInverseShiftAndScaleMatrix() : null;\n var actorIsIdentity = actor.getIsIdentity();\n var actMats = actorIsIdentity ? {\n mcwc: null,\n normalMatrix: null\n } : model.openGLActor.getKeyMatrices();\n program.setUniformMatrix('MCPCMatrix', safeMatrixMultiply([keyMats.wcpc, actMats.mcwc, inverseShiftScaleMatrix], gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"], model.tmpMat4));\n\n if (program.isUniformUsed('MCVCMatrix')) {\n program.setUniformMatrix('MCVCMatrix', safeMatrixMultiply([keyMats.wcvc, actMats.mcwc, inverseShiftScaleMatrix], gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"], model.tmpMat4));\n }\n\n if (program.isUniformUsed('normalMatrix')) {\n program.setUniformMatrix3x3('normalMatrix', safeMatrixMultiply([keyMats.normalMatrix, actMats.normalMatrix], gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"], model.tmpMat3));\n }\n\n if (progm !== camm) {\n if (program.isUniformUsed('cameraParallel')) {\n program.setUniformi('cameraParallel', cam.getParallelProjection());\n }\n\n program.setLastCameraMTime(camm);\n }\n\n if (!actorIsIdentity) {\n // reset the cam mtime as actor modified the shader values\n program.setLastCameraMTime(0);\n }\n };\n\n publicAPI.setPropertyShaderParameters = function (cellBO, ren, actor) {\n var program = cellBO.getProgram();\n var ppty = actor.getProperty();\n var opacity = ppty.getOpacity();\n var aColor = model.drawingEdges ? ppty.getEdgeColorByReference() : ppty.getAmbientColorByReference();\n var dColor = model.drawingEdges ? ppty.getEdgeColorByReference() : ppty.getDiffuseColorByReference();\n var aIntensity = model.drawingEdges ? 1.0 : ppty.getAmbient();\n var dIntensity = model.drawingEdges ? 0.0 : ppty.getDiffuse();\n var sIntensity = model.drawingEdges ? 0.0 : ppty.getSpecular();\n var specularPower = ppty.getSpecularPower();\n program.setUniformf('opacityUniform', opacity);\n program.setUniform3fArray('ambientColorUniform', aColor);\n program.setUniform3fArray('diffuseColorUniform', dColor);\n program.setUniformf('ambient', aIntensity);\n program.setUniformf('diffuse', dIntensity); // we are done unless we have lighting\n\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (lastLightComplexity < 1) {\n return;\n }\n\n var sColor = ppty.getSpecularColorByReference();\n program.setUniform3fArray('specularColorUniform', sColor);\n program.setUniformf('specularPowerUniform', specularPower); // now set the backface properties if we have them\n\n if (program.isUniformUsed('ambientIntensityBF')) {\n ppty = actor.getBackfaceProperty();\n opacity = ppty.getOpacity();\n aColor = ppty.getAmbientColor();\n aIntensity = ppty.getAmbient();\n dColor = ppty.getDiffuseColor();\n dIntensity = ppty.getDiffuse();\n sColor = ppty.getSpecularColor();\n sIntensity = ppty.getSpecular();\n program.setUniformf('ambientIntensityBF', aIntensity);\n program.setUniformf('diffuseIntensityBF', dIntensity);\n program.setUniformf('opacityUniformBF', opacity);\n program.setUniform3fArray('ambientColorUniformBF', aColor);\n program.setUniform3fArray('diffuseColorUniformBF', dColor); // we are done unless we have lighting\n\n if (lastLightComplexity < 1) {\n return;\n }\n\n program.setUniformf('specularIntensityBF', sIntensity);\n program.setUniform3fArray('specularColorUniformBF', sColor);\n program.setUniformf('specularPowerUniformBF', specularPower);\n }\n };\n\n publicAPI.renderPieceStart = function (ren, actor) {\n model.primitiveIDOffset = 0;\n\n if (model.openGLRenderer.getSelector()) {\n switch (model.openGLRenderer.getSelector().getCurrentPass()) {\n default:\n model.openGLRenderer.getSelector().renderProp(actor);\n }\n } // make sure the BOs are up to date\n\n\n publicAPI.updateBufferObjects(ren, actor); // If we are coloring by texture, then load the texture map.\n // Use Map as indicator, because texture hangs around.\n\n if (model.renderable.getColorTextureMap()) {\n model.internalColorTexture.activate();\n } // Bind the OpenGL, this is shared between the different primitive/cell types.\n\n\n model.lastBoundBO = null;\n };\n\n publicAPI.renderPieceDraw = function (ren, actor) {\n var representation = actor.getProperty().getRepresentation();\n var gl = model.context;\n var drawSurfaceWithEdges = actor.getProperty().getEdgeVisibility() && representation === Representation.SURFACE;\n gl.lineWidth(actor.getProperty().getLineWidth()); // for every primitive type\n\n for (var i = primTypes.Start; i < primTypes.End; i++) {\n // if there are entries\n var cabo = model.primitives[i].getCABO();\n\n if (cabo.getElementCount()) {\n // are we drawing edges\n model.drawingEdges = drawSurfaceWithEdges && (i === primTypes.TrisEdges || i === primTypes.TriStripsEdges);\n var mode = publicAPI.getOpenGLMode(representation, i);\n\n if (!model.drawingEdges || !model.renderDepth) {\n publicAPI.updateShaders(model.primitives[i], ren, actor);\n gl.drawArrays(mode, 0, cabo.getElementCount());\n }\n\n var stride = (mode === gl.POINTS ? 1 : 0) || (mode === gl.LINES ? 2 : 3);\n model.primitiveIDOffset += cabo.getElementCount() / stride;\n }\n } // reset the line width\n\n\n gl.lineWidth(1);\n };\n\n publicAPI.getOpenGLMode = function (rep, type) {\n if (rep === Representation.POINTS || type === primTypes.Points) {\n return model.context.POINTS;\n }\n\n if (rep === Representation.WIREFRAME || type === primTypes.Lines || type === primTypes.TrisEdges || type === primTypes.TriStripsEdges) {\n return model.context.LINES;\n }\n\n return model.context.TRIANGLES;\n };\n\n publicAPI.renderPieceFinish = function (ren, actor) {\n if (model.LastBoundBO) {\n model.LastBoundBO.getVAO().release();\n }\n\n if (model.renderable.getColorTextureMap()) {\n model.internalColorTexture.deactivate();\n }\n };\n\n publicAPI.renderPiece = function (ren, actor) {\n // Make sure that we have been properly initialized.\n // if (ren.getRenderWindow().checkAbortStatus()) {\n // return;\n // }\n publicAPI.invokeEvent(StartEvent);\n\n if (!model.renderable.getStatic()) {\n model.renderable.update();\n }\n\n model.currentInput = model.renderable.getInputData();\n publicAPI.invokeEvent(EndEvent);\n\n if (!model.currentInput) {\n vtkErrorMacro('No input!');\n return;\n } // if there are no points then we are done\n\n\n if (!model.currentInput.getPoints || !model.currentInput.getPoints().getNumberOfValues()) {\n return;\n } // apply faceCulling\n\n\n var gl = model.context;\n var backfaceCulling = actor.getProperty().getBackfaceCulling();\n var frontfaceCulling = actor.getProperty().getFrontfaceCulling();\n\n if (!backfaceCulling && !frontfaceCulling) {\n model.openGLRenderWindow.disableCullFace();\n } else if (frontfaceCulling) {\n model.openGLRenderWindow.enableCullFace();\n gl.cullFace(gl.FRONT);\n } else {\n model.openGLRenderWindow.enableCullFace();\n gl.cullFace(gl.BACK);\n }\n\n publicAPI.renderPieceStart(ren, actor);\n publicAPI.renderPieceDraw(ren, actor);\n publicAPI.renderPieceFinish(ren, actor);\n };\n\n publicAPI.computeBounds = function (ren, actor) {\n if (!publicAPI.getInput()) {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"uninitializeBounds\"](model.bounds);\n return;\n }\n\n model.bounds = publicAPI.getInput().getBounds();\n };\n\n publicAPI.updateBufferObjects = function (ren, actor) {\n // Rebuild buffers if needed\n if (publicAPI.getNeedToRebuildBufferObjects(ren, actor)) {\n publicAPI.buildBufferObjects(ren, actor);\n }\n };\n\n publicAPI.getNeedToRebuildBufferObjects = function (ren, actor) {\n // first do a coarse check\n // Note that the actor's mtime includes it's properties mtime\n var vmtime = model.VBOBuildTime.getMTime();\n\n if (vmtime < publicAPI.getMTime() || vmtime < model.renderable.getMTime() || vmtime < actor.getMTime() || vmtime < model.currentInput.getMTime()) {\n return true;\n }\n\n return false;\n };\n\n publicAPI.buildBufferObjects = function (ren, actor) {\n var poly = model.currentInput;\n\n if (poly === null) {\n return;\n }\n\n model.renderable.mapScalars(poly, 1.0);\n var c = model.renderable.getColorMapColors();\n model.haveCellScalars = false;\n var scalarMode = model.renderable.getScalarMode();\n\n if (model.renderable.getScalarVisibility()) {\n // We must figure out how the scalars should be mapped to the polydata.\n if ((scalarMode === ScalarMode.USE_CELL_DATA || scalarMode === ScalarMode.USE_CELL_FIELD_DATA || scalarMode === ScalarMode.USE_FIELD_DATA || !poly.getPointData().getScalars()) && scalarMode !== ScalarMode.USE_POINT_FIELD_DATA && c) {\n model.haveCellScalars = true;\n }\n } // Do we have normals?\n\n\n var n = actor.getProperty().getInterpolation() !== Shading.FLAT ? poly.getPointData().getNormals() : null;\n\n if (n === null && poly.getCellData().getNormals()) {\n model.haveCellNormals = true;\n n = poly.getCellData().getNormals();\n } // rebuild the VBO if the data has changed we create a string for the VBO what\n // can change the VBO? points normals tcoords colors so what can change those?\n // the input data is clearly one as it can change all four items tcoords may\n // haveTextures or not colors may change based on quite a few mapping\n // parameters in the mapper\n\n\n var representation = actor.getProperty().getRepresentation();\n var tcoords = poly.getPointData().getTCoords();\n\n if (!model.openGLActor.getActiveTextures()) {\n tcoords = null;\n } // handle color mapping via texture\n\n\n if (model.renderable.getColorCoordinates()) {\n tcoords = model.renderable.getColorCoordinates();\n\n if (!model.internalColorTexture) {\n model.internalColorTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n }\n\n var tex = model.internalColorTexture; // the following 4 lines allow for NPOT textures\n\n tex.setMinificationFilter(Filter.NEAREST);\n tex.setMagnificationFilter(Filter.NEAREST);\n tex.setWrapS(Wrap.CLAMP_TO_EDGE);\n tex.setWrapT(Wrap.CLAMP_TO_EDGE);\n tex.setOpenGLRenderWindow(model.openGLRenderWindow);\n var input = model.renderable.getColorTextureMap();\n var ext = input.getExtent();\n var inScalars = input.getPointData().getScalars();\n tex.create2DFromRaw(ext[1] - ext[0] + 1, ext[3] - ext[2] + 1, inScalars.getNumberOfComponents(), inScalars.getDataType(), inScalars.getData());\n tex.activate();\n tex.sendParameters();\n tex.deactivate();\n }\n\n var toString = \"\".concat(poly.getMTime(), \"A\").concat(representation, \"B\").concat(poly.getMTime()) + \"C\".concat(n ? n.getMTime() : 1, \"D\").concat(c ? c.getMTime() : 1) + \"E\".concat(actor.getProperty().getEdgeVisibility()) + \"F\".concat(tcoords ? tcoords.getMTime() : 1);\n\n if (model.VBOBuildString !== toString) {\n // Build the VBOs\n var points = poly.getPoints();\n var options = {\n points: points,\n normals: n,\n tcoords: tcoords,\n colors: c,\n cellOffset: 0,\n haveCellScalars: model.haveCellScalars,\n haveCellNormals: model.haveCellNormals,\n customAttributes: model.renderable.getCustomShaderAttributes().map(function (arrayName) {\n return poly.getPointData().getArrayByName(arrayName);\n })\n };\n options.cellOffset += model.primitives[primTypes.Points].getCABO().createVBO(poly.getVerts(), 'verts', representation, options);\n options.cellOffset += model.primitives[primTypes.Lines].getCABO().createVBO(poly.getLines(), 'lines', representation, options);\n options.cellOffset += model.primitives[primTypes.Tris].getCABO().createVBO(poly.getPolys(), 'polys', representation, options);\n options.cellOffset += model.primitives[primTypes.TriStrips].getCABO().createVBO(poly.getStrips(), 'strips', representation, options);\n var drawSurfaceWithEdges = actor.getProperty().getEdgeVisibility() && representation === Representation.SURFACE; // if we have edge visibility build the edge VBOs\n\n if (drawSurfaceWithEdges) {\n model.primitives[primTypes.TrisEdges].getCABO().createVBO(poly.getPolys(), 'polys', Representation.WIREFRAME, {\n points: points,\n normals: n,\n tcoords: null,\n colors: null,\n cellOffset: 0,\n haveCellScalars: false,\n haveCellNormals: false\n });\n model.primitives[primTypes.TriStripsEdges].getCABO().createVBO(poly.getStrips(), 'strips', Representation.WIREFRAME, {\n points: points,\n normals: n,\n tcoords: null,\n colors: null,\n cellOffset: 0,\n haveCellScalars: false,\n haveCellNormals: false\n });\n } else {\n // otherwise free them\n model.primitives[primTypes.TrisEdges].releaseGraphicsResources(model.openGLRenderWindow);\n model.primitives[primTypes.TriStripsEdges].releaseGraphicsResources(model.openGLRenderWindow);\n }\n\n model.VBOBuildTime.modified();\n model.VBOBuildString = toString;\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n VBOBuildTime: 0,\n VBOBuildString: null,\n primitives: null,\n primTypes: null,\n shaderRebuildString: null,\n tmpMat4: null,\n ambientColor: [],\n // used internally\n diffuseColor: [],\n // used internally\n specularColor: [],\n // used internally\n lightColor: [],\n // used internally\n lightHalfAngle: [],\n // used internally\n lightDirection: [],\n // used internally\n lastHaveSeenDepthRequest: false,\n haveSeenDepthRequest: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_8__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_Rendering_OpenGL_ReplacementShaderMapper__WEBPACK_IMPORTED_MODULE_11__[\"default\"].implementReplaceShaderCoincidentOffset(publicAPI, model, initialValues);\n model.primitives = [];\n model.primTypes = primTypes;\n model.tmpMat3 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(new Float64Array(9));\n model.tmpMat4 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n\n for (var i = primTypes.Start; i < primTypes.End; i++) {\n model.primitives[i] = vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.primitives[i].setPrimitiveType(i);\n model.primitives[i].set({\n lastLightComplexity: 0,\n lastLightCount: 0,\n lastSelectionPass: false\n }, true);\n } // Build VTK API\n\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['context']);\n model.VBOBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.VBOBuildTime, {\n mtime: 0\n }); // Object methods\n\n vtkOpenGLPolyDataMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkOpenGLPolyDataMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_12__[\"registerOverride\"])('vtkMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/PolyDataMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Geometry.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Geometry.js ***! - \***************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Camera__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Camera */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Camera/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Renderer */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Renderer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Actor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Actor */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Actor2D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Actor2D */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor2D/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_PolyDataMapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/PolyDataMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/PolyDataMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Skybox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Skybox */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Skybox/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper/index.js\");\n// Common\n\n // Geometry\n\n\n\n\n\n // Pixel mapping\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Geometry.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Glyph.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Glyph.js ***! - \************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Glyph3DMapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Glyph3DMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Glyph3DMapper/index.js\");\n// Geometry advanced\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Glyph.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Volume.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Volume.js ***! - \*************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Camera__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Camera */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Camera/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Renderer */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Renderer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ImageMapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ImageMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ImageSlice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ImageSlice */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageSlice/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Volume__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Volume */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Volume/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_VolumeMapper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/VolumeMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/VolumeMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper/index.js\");\n// Common\n\n // Volume\n\n\n\n\n // Pixel mapping\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Volume.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/RenderWindow/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/RenderWindow/index.js ***! - \****************************************************************************/ -/*! exports provided: pushMonitorGLContextCount, popMonitorGLContextCount, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pushMonitorGLContextCount\", function() { return pushMonitorGLContextCount; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"popMonitorGLContextCount\", function() { return popMonitorGLContextCount; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_RenderWindow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/RenderWindow */ \"./node_modules/vtk.js/Sources/Rendering/Core/RenderWindow/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ForwardPass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ForwardPass */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ForwardPass/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_RenderPass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/RenderPass */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderPass/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderCache__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderCache */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderCache/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_RenderWindowViewNode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/RenderWindowViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderWindowViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_TextureUnitManager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/TextureUnitManager */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/TextureUnitManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_HardwareSelector__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/HardwareSelector */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkDebugMacro,\n vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\nvar IS_CHROME = navigator.userAgent.indexOf('Chrome') !== -1;\nvar SCREENSHOT_PLACEHOLDER = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%'\n};\n\nfunction checkRenderTargetSupport(gl, format, type) {\n // create temporary frame buffer and texture\n var framebuffer = gl.createFramebuffer();\n var texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, format, 2, 2, 0, format, type, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); // check frame buffer status\n\n var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER); // clean up\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.bindTexture(gl.TEXTURE_2D, null);\n return status === gl.FRAMEBUFFER_COMPLETE;\n} // ----------------------------------------------------------------------------\n// Monitor the usage of GL context across vtkOpenGLRenderWindow instances\n// ----------------------------------------------------------------------------\n\n\nvar GL_CONTEXT_COUNT = 0;\nvar GL_CONTEXT_LISTENERS = [];\n\nfunction createGLContext() {\n GL_CONTEXT_COUNT++;\n GL_CONTEXT_LISTENERS.forEach(function (cb) {\n return cb(GL_CONTEXT_COUNT);\n });\n}\n\nfunction deleteGLContext() {\n GL_CONTEXT_COUNT--;\n GL_CONTEXT_LISTENERS.forEach(function (cb) {\n return cb(GL_CONTEXT_COUNT);\n });\n}\n\nfunction pushMonitorGLContextCount(cb) {\n GL_CONTEXT_LISTENERS.push(cb);\n}\nfunction popMonitorGLContextCount(cb) {\n return GL_CONTEXT_LISTENERS.pop();\n} // ----------------------------------------------------------------------------\n// vtkOpenGLRenderWindow methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLRenderWindow(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLRenderWindow');\n\n publicAPI.getViewNodeFactory = function () {\n return model.myFactory;\n }; // Auto update style\n\n\n var previousSize = [0, 0];\n\n function updateWindow() {\n // Canvas size\n if (model.renderable) {\n if (model.size[0] !== previousSize[0] || model.size[1] !== previousSize[1]) {\n previousSize[0] = model.size[0];\n previousSize[1] = model.size[1];\n model.canvas.setAttribute('width', model.size[0]);\n model.canvas.setAttribute('height', model.size[1]);\n }\n } // ImageStream size\n\n\n if (model.viewStream) {\n // If same size that's a NoOp\n model.viewStream.setSize(model.size[0], model.size[1]);\n } // Offscreen ?\n\n\n model.canvas.style.display = model.useOffScreen ? 'none' : 'block'; // Cursor type\n\n if (model.el) {\n model.el.style.cursor = model.cursorVisibility ? model.cursor : 'none';\n } // Invalidate cached DOM container size\n\n\n model.containerSize = null;\n }\n\n publicAPI.onModified(updateWindow); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n if (!model.renderable) {\n return;\n }\n\n publicAPI.prepareNodes();\n publicAPI.addMissingNodes(model.renderable.getRenderersByReference());\n publicAPI.removeUnusedNodes();\n publicAPI.initialize();\n model.children.forEach(function (child) {\n child.setOpenGLRenderWindow(publicAPI);\n });\n }\n };\n\n publicAPI.initialize = function () {\n if (!model.initialized) {\n model.context = publicAPI.get3DContext();\n model.textureUnitManager = vtk_js_Sources_Rendering_OpenGL_TextureUnitManager__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.textureUnitManager.setContext(model.context);\n model.shaderCache.setContext(model.context); // initialize blending for transparency\n\n var gl = model.context;\n gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n gl.depthFunc(gl.LEQUAL);\n gl.enable(gl.BLEND);\n model.initialized = true;\n }\n };\n\n publicAPI.makeCurrent = function () {\n model.context.makeCurrent();\n };\n\n publicAPI.setContainer = function (el) {\n if (model.el && model.el !== el) {\n if (model.canvas.parentNode !== model.el) {\n vtkErrorMacro('Error: canvas parent node does not match container');\n } // Remove canvas from previous container\n\n\n model.el.removeChild(model.canvas); // If the renderer has previously added\n // a background image, remove it from the DOM.\n\n if (model.el.contains(model.bgImage)) {\n model.el.removeChild(model.bgImage);\n }\n }\n\n if (model.el !== el) {\n model.el = el;\n\n if (model.el) {\n model.el.appendChild(model.canvas); // If the renderer is set to use a background\n // image, attach it to the DOM.\n\n if (model.useBackgroundImage) {\n model.el.appendChild(model.bgImage);\n }\n } // Trigger modified()\n\n\n publicAPI.modified();\n }\n };\n\n publicAPI.getContainer = function () {\n return model.el;\n };\n\n publicAPI.getContainerSize = function () {\n if (!model.containerSize && model.el) {\n var _model$el$getBounding = model.el.getBoundingClientRect(),\n width = _model$el$getBounding.width,\n height = _model$el$getBounding.height;\n\n model.containerSize = [width, height];\n }\n\n return model.containerSize || model.size;\n };\n\n publicAPI.getFramebufferSize = function () {\n if (model.activeFramebuffer) {\n return model.activeFramebuffer.getSize();\n }\n\n return model.size;\n };\n\n publicAPI.getPixelData = function (x1, y1, x2, y2) {\n var pixels = new Uint8Array((x2 - x1 + 1) * (y2 - y1 + 1) * 4);\n model.context.readPixels(x1, y1, x2 - x1 + 1, y2 - y1 + 1, model.context.RGBA, model.context.UNSIGNED_BYTE, pixels);\n return pixels;\n };\n\n publicAPI.get3DContext = function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n preserveDrawingBuffer: false,\n depth: true,\n alpha: true\n };\n var result = null;\n var webgl2Supported = typeof WebGL2RenderingContext !== 'undefined';\n model.webgl2 = false;\n\n if (model.defaultToWebgl2 && webgl2Supported) {\n result = model.canvas.getContext('webgl2', options);\n\n if (result) {\n model.webgl2 = true;\n vtkDebugMacro('using webgl2');\n }\n }\n\n if (!result) {\n vtkDebugMacro('using webgl1');\n result = model.canvas.getContext('webgl', options) || model.canvas.getContext('experimental-webgl', options);\n } // Do we have webvr support\n\n\n if (navigator.getVRDisplays) {\n navigator.getVRDisplays().then(function (displays) {\n if (displays.length > 0) {\n // take the first display for now\n model.vrDisplay = displays[0]; // set the clipping ranges\n\n model.vrDisplay.depthNear = 0.01; // meters\n\n model.vrDisplay.depthFar = 100.0; // meters\n\n publicAPI.invokeHaveVRDisplay();\n }\n });\n } // prevent default context lost handler\n\n\n model.canvas.addEventListener('webglcontextlost', function (event) {\n event.preventDefault();\n }, false);\n model.canvas.addEventListener('webglcontextrestored', publicAPI.restoreContext, false);\n return result;\n };\n\n publicAPI.startVR = function () {\n model.oldCanvasSize = model.size.slice();\n\n if (model.vrDisplay.capabilities.canPresent) {\n model.vrDisplay.requestPresent([{\n source: model.canvas\n }]).then(function () {\n if (model.el && model.vrDisplay.capabilities.hasExternalDisplay && model.hideCanvasInVR) {\n model.el.style.display = 'none';\n }\n\n if (model.queryVRSize) {\n var leftEye = model.vrDisplay.getEyeParameters('left');\n var rightEye = model.vrDisplay.getEyeParameters('right');\n var width = Math.floor(leftEye.renderWidth + rightEye.renderWidth);\n var height = Math.floor(Math.max(leftEye.renderHeight, rightEye.renderHeight));\n publicAPI.setSize(width, height);\n } else {\n publicAPI.setSize(model.vrResolution);\n }\n\n var ren = model.renderable.getRenderers()[0];\n ren.resetCamera();\n model.vrFrameData = new VRFrameData();\n model.renderable.getInteractor().switchToVRAnimation();\n model.vrSceneFrame = model.vrDisplay.requestAnimationFrame(publicAPI.vrRender); // If Broswer is chrome we need to request animation again to canvas update\n\n if (IS_CHROME) {\n model.vrSceneFrame = model.vrDisplay.requestAnimationFrame(publicAPI.vrRender);\n }\n }).catch(function () {\n console.error('failed to requestPresent');\n });\n } else {\n vtkErrorMacro('vrDisplay is not connected');\n }\n };\n\n publicAPI.stopVR = function () {\n model.renderable.getInteractor().returnFromVRAnimation();\n model.vrDisplay.exitPresent();\n model.vrDisplay.cancelAnimationFrame(model.vrSceneFrame);\n publicAPI.setSize.apply(publicAPI, _toConsumableArray(model.oldCanvasSize));\n\n if (model.el && model.vrDisplay.capabilities.hasExternalDisplay) {\n model.el.style.display = 'block';\n }\n\n var ren = model.renderable.getRenderers()[0];\n ren.getActiveCamera().setProjectionMatrix(null);\n ren.setViewport(0.0, 0, 1.0, 1.0);\n publicAPI.traverseAllPasses();\n };\n\n publicAPI.vrRender = function () {\n // If not presenting for any reason, we do not submit frame\n if (!model.vrDisplay.isPresenting) {\n return;\n }\n\n model.renderable.getInteractor().updateGamepads(model.vrDisplay.displayId);\n model.vrSceneFrame = model.vrDisplay.requestAnimationFrame(publicAPI.vrRender);\n model.vrDisplay.getFrameData(model.vrFrameData); // get the first renderer\n\n var ren = model.renderable.getRenderers()[0]; // do the left eye\n\n ren.setViewport(0, 0, 0.5, 1.0);\n ren.getActiveCamera().computeViewParametersFromPhysicalMatrix(model.vrFrameData.leftViewMatrix);\n ren.getActiveCamera().setProjectionMatrix(model.vrFrameData.leftProjectionMatrix);\n publicAPI.traverseAllPasses();\n ren.setViewport(0.5, 0, 1.0, 1.0);\n ren.getActiveCamera().computeViewParametersFromPhysicalMatrix(model.vrFrameData.rightViewMatrix);\n ren.getActiveCamera().setProjectionMatrix(model.vrFrameData.rightProjectionMatrix);\n publicAPI.traverseAllPasses();\n model.vrDisplay.submitFrame();\n };\n\n publicAPI.restoreContext = function () {\n var rp = vtk_js_Sources_Rendering_SceneGraph_RenderPass__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n rp.setCurrentOperation('Release');\n rp.traverse(publicAPI, null);\n };\n\n publicAPI.activateTexture = function (texture) {\n // Only add if it isn't already there\n var result = model._textureResourceIds.get(texture);\n\n if (result !== undefined) {\n model.context.activeTexture(model.context.TEXTURE0 + result);\n return;\n }\n\n var activeUnit = publicAPI.getTextureUnitManager().allocate();\n\n if (activeUnit < 0) {\n vtkErrorMacro('Hardware does not support the number of textures defined.');\n return;\n }\n\n model._textureResourceIds.set(texture, activeUnit);\n\n model.context.activeTexture(model.context.TEXTURE0 + activeUnit);\n };\n\n publicAPI.deactivateTexture = function (texture) {\n // Only deactivate if it isn't already there\n var result = model._textureResourceIds.get(texture);\n\n if (result !== undefined) {\n publicAPI.getTextureUnitManager().free(result);\n delete model._textureResourceIds.delete(texture);\n }\n };\n\n publicAPI.getTextureUnitForTexture = function (texture) {\n var result = model._textureResourceIds.get(texture);\n\n if (result !== undefined) {\n return result;\n }\n\n return -1;\n };\n\n publicAPI.getDefaultTextureInternalFormat = function (vtktype, numComps, useFloat) {\n if (model.webgl2) {\n switch (vtktype) {\n case vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_9__[\"VtkDataTypes\"].UNSIGNED_CHAR:\n switch (numComps) {\n case 1:\n return model.context.R8;\n\n case 2:\n return model.context.RG8;\n\n case 3:\n return model.context.RGB8;\n\n case 4:\n default:\n return model.context.RGBA8;\n }\n\n default:\n case vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_9__[\"VtkDataTypes\"].FLOAT:\n switch (numComps) {\n case 1:\n return model.context.R16F;\n\n case 2:\n return model.context.RG16F;\n\n case 3:\n return model.context.RGB16F;\n\n case 4:\n default:\n return model.context.RGBA16F;\n }\n\n }\n } // webgl1 only supports four types\n\n\n switch (numComps) {\n case 1:\n return model.context.LUMINANCE;\n\n case 2:\n return model.context.LUMINANCE_ALPHA;\n\n case 3:\n return model.context.RGB;\n\n case 4:\n default:\n return model.context.RGBA;\n }\n };\n\n publicAPI.setBackgroundImage = function (img) {\n model.bgImage.src = img.src;\n };\n\n publicAPI.setUseBackgroundImage = function (value) {\n model.useBackgroundImage = value; // Add or remove the background image from the\n // DOM as specified.\n\n if (model.useBackgroundImage && !model.el.contains(model.bgImage)) {\n model.el.appendChild(model.bgImage);\n } else if (!model.useBackgroundImage && model.el.contains(model.bgImage)) {\n model.el.removeChild(model.bgImage);\n }\n };\n\n function getCanvasDataURL() {\n var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : model.imageFormat;\n // Copy current canvas to not modify the original\n var temporaryCanvas = document.createElement('canvas');\n var temporaryContext = temporaryCanvas.getContext('2d');\n temporaryCanvas.width = model.canvas.width;\n temporaryCanvas.height = model.canvas.height;\n temporaryContext.drawImage(model.canvas, 0, 0); // Get current client rect to place canvas\n\n var mainBoundingClientRect = model.canvas.getBoundingClientRect();\n var renderWindow = model.renderable;\n var renderers = renderWindow.getRenderers();\n renderers.forEach(function (renderer) {\n var viewProps = renderer.getViewProps();\n viewProps.forEach(function (viewProp) {\n // Check if the prop has a container that should have canvas\n if (viewProp.getContainer) {\n var container = viewProp.getContainer();\n var canvasList = container.getElementsByTagName('canvas'); // Go throughout all canvas and copy it into temporary main canvas\n\n for (var i = 0; i < canvasList.length; i++) {\n var currentCanvas = canvasList[i];\n var boundingClientRect = currentCanvas.getBoundingClientRect();\n var newXPosition = boundingClientRect.x - mainBoundingClientRect.x;\n var newYPosition = boundingClientRect.y - mainBoundingClientRect.y;\n temporaryContext.drawImage(currentCanvas, newXPosition, newYPosition);\n }\n }\n });\n });\n var screenshot = temporaryCanvas.toDataURL(format);\n temporaryCanvas.remove();\n publicAPI.invokeImageReady(screenshot);\n }\n\n publicAPI.captureNextImage = function () {\n var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'image/png';\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$resetCamera = _ref.resetCamera,\n resetCamera = _ref$resetCamera === void 0 ? false : _ref$resetCamera,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? null : _ref$size,\n _ref$scale = _ref.scale,\n scale = _ref$scale === void 0 ? 1 : _ref$scale;\n\n if (model.deleted) {\n return null;\n }\n\n model.imageFormat = format;\n var previous = model.notifyStartCaptureImage;\n model.notifyStartCaptureImage = true;\n model._screenshot = {\n size: !!size || scale !== 1 ? size || model.size.map(function (val) {\n return val * scale;\n }) : null\n };\n return new Promise(function (resolve, reject) {\n var subscription = publicAPI.onImageReady(function (imageURL) {\n if (model._screenshot.size === null) {\n model.notifyStartCaptureImage = previous;\n subscription.unsubscribe();\n\n if (model._screenshot.placeHolder) {\n // resize the main canvas back to its original size and show it\n model.size = model._screenshot.originalSize; // process the resize\n\n publicAPI.modified(); // restore the saved camera parameters, if applicable\n\n if (model._screenshot.cameras) {\n model._screenshot.cameras.forEach(function (_ref2) {\n var restoreParamsFn = _ref2.restoreParamsFn,\n arg = _ref2.arg;\n return restoreParamsFn(arg);\n });\n } // Trigger a render at the original size\n\n\n publicAPI.traverseAllPasses(); // Remove and clean up the placeholder, revealing the original\n\n model.el.removeChild(model._screenshot.placeHolder);\n\n model._screenshot.placeHolder.remove();\n\n model._screenshot = null;\n }\n\n resolve(imageURL);\n } else {\n // Create a placeholder image overlay while we resize and render\n var tmpImg = document.createElement('img');\n tmpImg.style = SCREENSHOT_PLACEHOLDER;\n tmpImg.src = imageURL;\n model._screenshot.placeHolder = model.el.appendChild(tmpImg); // hide the main canvas\n\n model.canvas.style.display = 'none'; // remember the main canvas original size, then resize it\n\n model._screenshot.originalSize = model.size;\n model.size = model._screenshot.size;\n model._screenshot.size = null; // process the resize\n\n publicAPI.modified();\n\n if (resetCamera) {\n // If resetCamera was requested, we first save camera parameters\n // from all the renderers, so we can restore them later\n model._screenshot.cameras = model.renderable.getRenderers().map(function (renderer) {\n var camera = renderer.getActiveCamera();\n var params = camera.get('focalPoint', 'position', 'parallelScale');\n return {\n resetCameraFn: renderer.resetCamera,\n restoreParamsFn: camera.set,\n // \"clone\" the params so we don't keep refs to properties\n arg: JSON.parse(JSON.stringify(params))\n };\n }); // Perform the resetCamera() on each renderer only after capturing\n // the params from all active cameras, in case there happen to be\n // linked cameras among the renderers.\n\n model._screenshot.cameras.forEach(function (_ref3) {\n var resetCameraFn = _ref3.resetCameraFn;\n return resetCameraFn();\n });\n } // Trigger a render at the custom size\n\n\n publicAPI.traverseAllPasses();\n }\n });\n });\n };\n\n publicAPI.getGLInformations = function () {\n var gl = publicAPI.get3DContext();\n var glTextureFloat = gl.getExtension('OES_texture_float');\n var glTextureHalfFloat = gl.getExtension('OES_texture_half_float');\n var glDebugRendererInfo = gl.getExtension('WEBGL_debug_renderer_info');\n var glDrawBuffers = gl.getExtension('WEBGL_draw_buffers');\n var glAnisotropic = gl.getExtension('EXT_texture_filter_anisotropic') || gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic');\n var params = [['Max Vertex Attributes', 'MAX_VERTEX_ATTRIBS', gl.getParameter(gl.MAX_VERTEX_ATTRIBS)], ['Max Varying Vectors', 'MAX_VARYING_VECTORS', gl.getParameter(gl.MAX_VARYING_VECTORS)], ['Max Vertex Uniform Vectors', 'MAX_VERTEX_UNIFORM_VECTORS', gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS)], ['Max Fragment Uniform Vectors', 'MAX_FRAGMENT_UNIFORM_VECTORS', gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS)], ['Max Fragment Texture Image Units', 'MAX_TEXTURE_IMAGE_UNITS', gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)], ['Max Vertex Texture Image Units', 'MAX_VERTEX_TEXTURE_IMAGE_UNITS', gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS)], ['Max Combined Texture Image Units', 'MAX_COMBINED_TEXTURE_IMAGE_UNITS', gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS)], ['Max 2D Texture Size', 'MAX_TEXTURE_SIZE', gl.getParameter(gl.MAX_TEXTURE_SIZE)], ['Max Cube Texture Size', 'MAX_CUBE_MAP_TEXTURE_SIZE', gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)], ['Max Texture Anisotropy', 'MAX_TEXTURE_MAX_ANISOTROPY_EXT', glAnisotropic && gl.getParameter(glAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)], ['Point Size Range', 'ALIASED_POINT_SIZE_RANGE', gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE).join(' - ')], ['Line Width Range', 'ALIASED_LINE_WIDTH_RANGE', gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE).join(' - ')], ['Max Viewport Dimensions', 'MAX_VIEWPORT_DIMS', gl.getParameter(gl.MAX_VIEWPORT_DIMS).join(' - ')], ['Max Renderbuffer Size', 'MAX_RENDERBUFFER_SIZE', gl.getParameter(gl.MAX_RENDERBUFFER_SIZE)], ['Framebuffer Red Bits', 'RED_BITS', gl.getParameter(gl.RED_BITS)], ['Framebuffer Green Bits', 'GREEN_BITS', gl.getParameter(gl.GREEN_BITS)], ['Framebuffer Blue Bits', 'BLUE_BITS', gl.getParameter(gl.BLUE_BITS)], ['Framebuffer Alpha Bits', 'ALPHA_BITS', gl.getParameter(gl.ALPHA_BITS)], ['Framebuffer Depth Bits', 'DEPTH_BITS', gl.getParameter(gl.DEPTH_BITS)], ['Framebuffer Stencil Bits', 'STENCIL_BITS', gl.getParameter(gl.STENCIL_BITS)], ['Framebuffer Subpixel Bits', 'SUBPIXEL_BITS', gl.getParameter(gl.SUBPIXEL_BITS)], ['MSAA Samples', 'SAMPLES', gl.getParameter(gl.SAMPLES)], ['MSAA Sample Buffers', 'SAMPLE_BUFFERS', gl.getParameter(gl.SAMPLE_BUFFERS)], ['Supported Formats for UByte Render Targets ', 'UNSIGNED_BYTE RENDER TARGET FORMATS', [glTextureFloat && checkRenderTargetSupport(gl, gl.RGBA, gl.UNSIGNED_BYTE) ? 'RGBA' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.RGB, gl.UNSIGNED_BYTE) ? 'RGB' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.LUMINANCE, gl.UNSIGNED_BYTE) ? 'LUMINANCE' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.ALPHA, gl.UNSIGNED_BYTE) ? 'ALPHA' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.LUMINANCE_ALPHA, gl.UNSIGNED_BYTE) ? 'LUMINANCE_ALPHA' : ''].join(' ')], ['Supported Formats for Half Float Render Targets', 'HALF FLOAT RENDER TARGET FORMATS', [glTextureHalfFloat && checkRenderTargetSupport(gl, gl.RGBA, glTextureHalfFloat.HALF_FLOAT_OES) ? 'RGBA' : '', glTextureHalfFloat && checkRenderTargetSupport(gl, gl.RGB, glTextureHalfFloat.HALF_FLOAT_OES) ? 'RGB' : '', glTextureHalfFloat && checkRenderTargetSupport(gl, gl.LUMINANCE, glTextureHalfFloat.HALF_FLOAT_OES) ? 'LUMINANCE' : '', glTextureHalfFloat && checkRenderTargetSupport(gl, gl.ALPHA, glTextureHalfFloat.HALF_FLOAT_OES) ? 'ALPHA' : '', glTextureHalfFloat && checkRenderTargetSupport(gl, gl.LUMINANCE_ALPHA, glTextureHalfFloat.HALF_FLOAT_OES) ? 'LUMINANCE_ALPHA' : ''].join(' ')], ['Supported Formats for Full Float Render Targets', 'FLOAT RENDER TARGET FORMATS', [glTextureFloat && checkRenderTargetSupport(gl, gl.RGBA, gl.FLOAT) ? 'RGBA' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.RGB, gl.FLOAT) ? 'RGB' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.LUMINANCE, gl.FLOAT) ? 'LUMINANCE' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.ALPHA, gl.FLOAT) ? 'ALPHA' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.LUMINANCE_ALPHA, gl.FLOAT) ? 'LUMINANCE_ALPHA' : ''].join(' ')], ['Max Multiple Render Targets Buffers', 'MAX_DRAW_BUFFERS_WEBGL', glDrawBuffers ? gl.getParameter(glDrawBuffers.MAX_DRAW_BUFFERS_WEBGL) : 0], ['High Float Precision in Vertex Shader', 'HIGH_FLOAT VERTEX_SHADER', [gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).rangeMax, ')'].join('')], ['Medium Float Precision in Vertex Shader', 'MEDIUM_FLOAT VERTEX_SHADER', [gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).rangeMax, ')'].join('')], ['Low Float Precision in Vertex Shader', 'LOW_FLOAT VERTEX_SHADER', [gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT).rangeMax, ')'].join('')], ['High Float Precision in Fragment Shader', 'HIGH_FLOAT FRAGMENT_SHADER', [gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).rangeMax, ')'].join('')], ['Medium Float Precision in Fragment Shader', 'MEDIUM_FLOAT FRAGMENT_SHADER', [gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).rangeMax, ')'].join('')], ['Low Float Precision in Fragment Shader', 'LOW_FLOAT FRAGMENT_SHADER', [gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT).rangeMax, ')'].join('')], ['High Int Precision in Vertex Shader', 'HIGH_INT VERTEX_SHADER', [gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT).rangeMax, ')'].join('')], ['Medium Int Precision in Vertex Shader', 'MEDIUM_INT VERTEX_SHADER', [gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT).rangeMax, ')'].join('')], ['Low Int Precision in Vertex Shader', 'LOW_INT VERTEX_SHADER', [gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT).rangeMax, ')'].join('')], ['High Int Precision in Fragment Shader', 'HIGH_INT FRAGMENT_SHADER', [gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT).rangeMax, ')'].join('')], ['Medium Int Precision in Fragment Shader', 'MEDIUM_INT FRAGMENT_SHADER', [gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT).rangeMax, ')'].join('')], ['Low Int Precision in Fragment Shader', 'LOW_INT FRAGMENT_SHADER', [gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).rangeMax, ')'].join('')], ['Supported Extensions', 'EXTENSIONS', gl.getSupportedExtensions().join('
\\t\\t\\t\\t\\t ')], ['WebGL Renderer', 'RENDERER', gl.getParameter(gl.RENDERER)], ['WebGL Vendor', 'VENDOR', gl.getParameter(gl.VENDOR)], ['WebGL Version', 'VERSION', gl.getParameter(gl.VERSION)], ['Shading Language Version', 'SHADING_LANGUAGE_VERSION', gl.getParameter(gl.SHADING_LANGUAGE_VERSION)], ['Unmasked Renderer', 'UNMASKED_RENDERER', glDebugRendererInfo && gl.getParameter(glDebugRendererInfo.UNMASKED_RENDERER_WEBGL)], ['Unmasked Vendor', 'UNMASKED_VENDOR', glDebugRendererInfo && gl.getParameter(glDebugRendererInfo.UNMASKED_VENDOR_WEBGL)], ['WebGL Version', 'WEBGL_VERSION', model.webgl2 ? 2 : 1]];\n var result = {};\n\n while (params.length) {\n var _params$pop = params.pop(),\n _params$pop2 = _slicedToArray(_params$pop, 3),\n label = _params$pop2[0],\n key = _params$pop2[1],\n value = _params$pop2[2];\n\n if (key) {\n result[key] = {\n label: label,\n value: value\n };\n }\n }\n\n return result;\n };\n\n publicAPI.traverseAllPasses = function () {\n if (model.renderPasses) {\n for (var index = 0; index < model.renderPasses.length; ++index) {\n model.renderPasses[index].traverse(publicAPI, null);\n }\n }\n\n if (model.notifyStartCaptureImage) {\n getCanvasDataURL();\n }\n };\n\n publicAPI.disableDepthMask = function () {\n if (model.depthMaskEnabled) {\n model.context.depthMask(false);\n model.depthMaskEnabled = false;\n }\n };\n\n publicAPI.enableDepthMask = function () {\n if (!model.depthMaskEnabled) {\n model.context.depthMask(true);\n model.depthMaskEnabled = true;\n }\n };\n\n publicAPI.disableCullFace = function () {\n if (model.cullFaceEnabled) {\n model.context.disable(model.context.CULL_FACE);\n model.cullFaceEnabled = false;\n }\n };\n\n publicAPI.enableCullFace = function () {\n if (!model.cullFaceEnabled) {\n model.context.enable(model.context.CULL_FACE);\n model.cullFaceEnabled = true;\n }\n };\n\n publicAPI.setViewStream = function (stream) {\n if (model.viewStream === stream) {\n return false;\n }\n\n if (model.subscription) {\n model.subscription.unsubscribe();\n model.subscription = null;\n }\n\n model.viewStream = stream;\n\n if (model.viewStream) {\n // Force background to be transparent + render\n var mainRenderer = model.renderable.getRenderers()[0];\n mainRenderer.getBackgroundByReference()[3] = 0; // Enable display of the background image\n\n publicAPI.setUseBackgroundImage(true); // Bind to remote stream\n\n model.subscription = model.viewStream.onImageReady(function (e) {\n return publicAPI.setBackgroundImage(e.image);\n });\n model.viewStream.setSize(model.size[0], model.size[1]);\n model.viewStream.invalidateCache();\n model.viewStream.render();\n publicAPI.modified();\n }\n\n return true;\n };\n\n publicAPI.delete = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.delete, publicAPI.setViewStream, deleteGLContext);\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n cullFaceEnabled: false,\n depthMaskEnabled: true,\n shaderCache: null,\n initialized: false,\n context: null,\n canvas: null,\n cursorVisibility: true,\n cursor: 'pointer',\n textureUnitManager: null,\n textureResourceIds: null,\n containerSize: null,\n renderPasses: [],\n notifyStartCaptureImage: false,\n webgl2: false,\n defaultToWebgl2: true,\n // attempt webgl2 on by default\n vrResolution: [2160, 1200],\n queryVRSize: false,\n hideCanvasInVR: true,\n activeFramebuffer: null,\n vrDisplay: null,\n imageFormat: 'image/png',\n useOffScreen: false,\n useBackgroundImage: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_RenderWindowViewNode__WEBPACK_IMPORTED_MODULE_6__[\"default\"].extend(publicAPI, model, initialValues); // Create internal instances\n\n model.canvas = document.createElement('canvas');\n model.canvas.style.width = '100%';\n createGLContext();\n\n if (!model.selector) {\n model.selector = vtk_js_Sources_Rendering_OpenGL_HardwareSelector__WEBPACK_IMPORTED_MODULE_8__[\"default\"].newInstance();\n model.selector.setOpenGLRenderWindow(publicAPI);\n } // Create internal bgImage\n\n\n model.bgImage = new Image();\n model.bgImage.style.position = 'absolute';\n model.bgImage.style.left = '0';\n model.bgImage.style.top = '0';\n model.bgImage.style.width = '100%';\n model.bgImage.style.height = '100%';\n model.bgImage.style.zIndex = '-1';\n model._textureResourceIds = new Map();\n model.myFactory = vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n /* eslint-disable no-use-before-define */\n\n model.myFactory.registerOverride('vtkRenderWindow', newInstance);\n /* eslint-enable no-use-before-define */\n\n model.shaderCache = vtk_js_Sources_Rendering_OpenGL_ShaderCache__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n model.shaderCache.setOpenGLRenderWindow(publicAPI); // setup default forward pass rendering\n\n model.renderPasses[0] = vtk_js_Sources_Rendering_OpenGL_ForwardPass__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'imageReady');\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'haveVRDisplay'); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['shaderCache', 'textureUnitManager', 'webgl2', 'vrDisplay', 'useBackgroundImage']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['initialized', 'context', 'canvas', 'renderPasses', 'notifyStartCaptureImage', 'defaultToWebgl2', 'cursor', 'queryVRSize', 'hideCanvasInVR', 'useOffScreen', // might want to make this not call modified as\n // we change the active framebuffer a lot. Or maybe\n // only mark modified if the size or depth\n // of the buffer has changed\n 'activeFramebuffer']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['size', 'vrResolution'], 2); // Object methods\n\n vtkOpenGLRenderWindow(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkOpenGLRenderWindow'); // ----------------------------------------------------------------------------\n// Register API specific RenderWindow implementation\n// ----------------------------------------------------------------------------\n\nObject(vtk_js_Sources_Rendering_Core_RenderWindow__WEBPACK_IMPORTED_MODULE_1__[\"registerViewConstructor\"])('WebGL', newInstance); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n pushMonitorGLContextCount: pushMonitorGLContextCount,\n popMonitorGLContextCount: popMonitorGLContextCount\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/RenderWindow/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Renderer/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Renderer/index.js ***! - \************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkDebugMacro\"]; // ----------------------------------------------------------------------------\n// vtkOpenGLRenderer methods\n// ----------------------------------------------------------------------------\n\n/* eslint-disable no-bitwise */\n\nfunction vtkOpenGLRenderer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLRenderer'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n if (!model.renderable) {\n return;\n } // make sure we have a camera\n\n\n if (!model.renderable.isActiveCameraCreated()) {\n model.renderable.resetCamera();\n }\n\n publicAPI.updateLights();\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getActiveCamera());\n publicAPI.addMissingNodes(model.renderable.getViewPropsWithNestedProps());\n publicAPI.removeUnusedNodes();\n }\n };\n\n publicAPI.updateLights = function () {\n var count = 0;\n var lights = model.renderable.getLightsByReference();\n\n for (var index = 0; index < lights.length; ++index) {\n if (lights[index].getSwitch() > 0.0) {\n count++;\n }\n }\n\n if (!count) {\n vtkDebugMacro('No lights are on, creating one.');\n model.renderable.createLight();\n }\n\n return count;\n };\n\n publicAPI.opaqueZBufferPass = function (prepass) {\n if (prepass) {\n var clearMask = 0;\n var gl = model.context;\n\n if (!model.renderable.getTransparent()) {\n model.context.clearColor(1.0, 0.0, 0.0, 1.0);\n clearMask |= gl.COLOR_BUFFER_BIT;\n }\n\n if (!model.renderable.getPreserveDepthBuffer()) {\n gl.clearDepth(1.0);\n clearMask |= gl.DEPTH_BUFFER_BIT;\n gl.depthMask(true);\n }\n\n var ts = publicAPI.getTiledSizeAndOrigin();\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.viewport(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.colorMask(true, true, true, true);\n gl.clear(clearMask);\n gl.enable(gl.DEPTH_TEST);\n }\n }; // Renders myself\n\n\n publicAPI.cameraPass = function (prepass) {\n if (prepass) {\n publicAPI.clear();\n }\n };\n\n publicAPI.getAspectRatio = function () {\n var size = model.parent.getSizeByReference();\n var viewport = model.renderable.getViewportByReference();\n return size[0] * (viewport[2] - viewport[0]) / ((viewport[3] - viewport[1]) * size[1]);\n };\n\n publicAPI.getTiledSizeAndOrigin = function () {\n var vport = model.renderable.getViewportByReference(); // if there is no window assume 0 1\n\n var tileViewPort = [0.0, 0.0, 1.0, 1.0]; // find the lower left corner of the viewport, taking into account the\n // lower left boundary of this tile\n\n var vpu = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[0] - tileViewPort[0], 0.0, 1.0);\n var vpv = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[1] - tileViewPort[1], 0.0, 1.0); // store the result as a pixel value\n\n var ndvp = model.parent.normalizedDisplayToDisplay(vpu, vpv);\n var lowerLeftU = Math.round(ndvp[0]);\n var lowerLeftV = Math.round(ndvp[1]); // find the upper right corner of the viewport, taking into account the\n // lower left boundary of this tile\n\n var vpu2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[2] - tileViewPort[0], 0.0, 1.0);\n var vpv2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[3] - tileViewPort[1], 0.0, 1.0); // also watch for the upper right boundary of the tile\n\n if (vpu2 > tileViewPort[2] - tileViewPort[0]) {\n vpu2 = tileViewPort[2] - tileViewPort[0];\n }\n\n if (vpv2 > tileViewPort[3] - tileViewPort[1]) {\n vpv2 = tileViewPort[3] - tileViewPort[1];\n }\n\n var ndvp2 = model.parent.normalizedDisplayToDisplay(vpu2, vpv2); // now compute the size of the intersection of the viewport with the\n // current tile\n\n var usize = Math.round(ndvp2[0]) - lowerLeftU;\n var vsize = Math.round(ndvp2[1]) - lowerLeftV;\n\n if (usize < 0) {\n usize = 0;\n }\n\n if (vsize < 0) {\n vsize = 0;\n }\n\n return {\n usize: usize,\n vsize: vsize,\n lowerLeftU: lowerLeftU,\n lowerLeftV: lowerLeftV\n };\n };\n\n publicAPI.clear = function () {\n var clearMask = 0;\n var gl = model.context;\n\n if (!model.renderable.getTransparent()) {\n var background = model.renderable.getBackgroundByReference(); // renderable ensures that background has 4 entries.\n\n model.context.clearColor(background[0], background[1], background[2], background[3]);\n clearMask |= gl.COLOR_BUFFER_BIT;\n }\n\n if (!model.renderable.getPreserveDepthBuffer()) {\n gl.clearDepth(1.0);\n clearMask |= gl.DEPTH_BUFFER_BIT;\n gl.depthMask(true);\n }\n\n gl.colorMask(true, true, true, true);\n var ts = publicAPI.getTiledSizeAndOrigin();\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.viewport(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.clear(clearMask);\n gl.enable(gl.DEPTH_TEST);\n /* eslint-enable no-bitwise */\n };\n\n publicAPI.releaseGraphicsResources = function () {\n if (model.selector !== null) {\n model.selector.releaseGraphicsResources();\n }\n };\n\n publicAPI.setOpenGLRenderWindow = function (rw) {\n if (model.openGLRenderWindow === rw) {\n return;\n }\n\n publicAPI.releaseGraphicsResources();\n model.openGLRenderWindow = rw;\n model.context = null;\n\n if (rw) {\n model.context = model.openGLRenderWindow.getContext();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n openGLRenderWindow: null,\n selector: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"get\"](publicAPI, model, ['shaderCache']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['selector']); // Object methods\n\n vtkOpenGLRenderer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkOpenGLRenderer'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkRenderer', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Renderer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper/index.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper/index.js ***! - \***************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n\n\nfunction implementReplaceShaderCoincidentOffset(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n publicAPI.replaceShaderCoincidentOffset = function (shaders, ren, actor) {\n var cp = publicAPI.getCoincidentParameters(ren, actor); // if we need an offset handle it here\n // The value of .000016 is suitable for depth buffers\n // of at least 16 bit depth. We do not query the depth\n // right now because we would need some mechanism to\n // cache the result taking into account FBO changes etc.\n\n if (cp && (cp.factor !== 0.0 || cp.offset !== 0.0)) {\n var FSSource = shaders.Fragment;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::Coincident::Dec', ['uniform float cfactor;', 'uniform float coffset;']).result;\n\n if (model.context.getExtension('EXT_frag_depth')) {\n if (cp.factor !== 0.0) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::UniformFlow::Impl', ['float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));', '//VTK::UniformFlow::Impl'], false).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::Depth::Impl', 'gl_FragDepthEXT = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;').result;\n } else {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::Depth::Impl', 'gl_FragDepthEXT = gl_FragCoord.z + 0.000016*coffset;').result;\n }\n }\n\n if (model.openGLRenderWindow.getWebgl2()) {\n if (cp.factor !== 0.0) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::UniformFlow::Impl', ['float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));', '//VTK::UniformFlow::Impl'], false).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::Depth::Impl', 'gl_FragDepth = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;').result;\n } else {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::Depth::Impl', 'gl_FragDepth = gl_FragCoord.z + 0.000016*coffset;').result;\n }\n }\n\n shaders.Fragment = FSSource;\n }\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n implementReplaceShaderCoincidentOffset: implementReplaceShaderCoincidentOffset\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Shader/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Shader/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // export const SHADER_TYPES = ['Vertex', 'Fragment', 'Geometry', 'Unknown'];\n// ----------------------------------------------------------------------------\n// vtkShader methods\n// ----------------------------------------------------------------------------\n\nfunction vtkShader(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkShader');\n\n publicAPI.compile = function () {\n var stype = model.context.VERTEX_SHADER;\n\n if (!model.source || !model.source.length || model.shaderType === 'Unknown') {\n return false;\n } // Ensure we delete the previous shader if necessary.\n\n\n if (model.handle !== 0) {\n model.context.deleteShader(model.handle);\n model.handle = 0;\n }\n\n switch (model.shaderType) {\n // case vtkShader::Geometry:\n // type = GL_GEOMETRY_SHADER;\n // break;\n case 'Fragment':\n stype = model.context.FRAGMENT_SHADER;\n break;\n\n case 'Vertex':\n default:\n stype = model.context.VERTEX_SHADER;\n break;\n }\n\n model.handle = model.context.createShader(stype);\n model.context.shaderSource(model.handle, model.source);\n model.context.compileShader(model.handle);\n var isCompiled = model.context.getShaderParameter(model.handle, model.context.COMPILE_STATUS);\n\n if (!isCompiled) {\n var lastError = model.context.getShaderInfoLog(model.handle);\n vtkErrorMacro(\"Error compiling shader '\".concat(model.source, \"': \").concat(lastError));\n model.context.deleteShader(model.handle);\n model.handle = 0;\n return false;\n } // The shader compiled, store its handle and return success.\n\n\n return true;\n };\n\n publicAPI.cleanup = function () {\n if (model.shaderType === 'Unknown' || model.handle === 0) {\n return;\n }\n\n model.context.deleteShader(model.handle);\n model.handle = 0;\n model.dirty = true;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n shaderType: 'Unknown',\n source: '',\n error: '',\n handle: 0,\n dirty: false,\n context: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['shaderType', 'source', 'error', 'handle', 'context']); // Object methods\n\n vtkShader(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkShader'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Shader/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderCache/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderCache/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var blueimp_md5__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! blueimp-md5 */ \"./node_modules/blueimp-md5/js/md5.js\");\n/* harmony import */ var blueimp_md5__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(blueimp_md5__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n\n\n // ----------------------------------------------------------------------------\n\nvar SET_GET_FIELDS = ['lastShaderBound', 'context', 'openGLRenderWindow']; // ----------------------------------------------------------------------------\n// vtkShaderCache methods\n// ----------------------------------------------------------------------------\n\nfunction vtkShaderCache(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkShaderCache');\n\n publicAPI.replaceShaderValues = function (VSSource, FSSource, GSSource) {\n // first handle renaming any Fragment shader inputs\n // if we have a geometry shader. By default fragment shaders\n // assume their inputs come from a Vertex Shader. When we\n // have a Geometry shader we rename the frament shader inputs\n // to come from the geometry shader\n var nFSSource = FSSource;\n\n if (GSSource.length > 0) {\n nFSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(nFSSource, 'VSOut', 'GSOut').result;\n }\n\n var gl2 = model.openGLRenderWindow.getWebgl2();\n var fragDepthString = '\\n';\n var version = '#version 100\\n';\n\n if (gl2) {\n version = '#version 300 es\\n' + '#define attribute in\\n' + '#define textureCube texture\\n' + '#define texture2D texture\\n' + '#define textureCubeLod textureLod\\n' + '#define texture2DLod textureLod\\n';\n } else {\n model.context.getExtension('OES_standard_derivatives');\n\n if (model.context.getExtension('EXT_frag_depth')) {\n fragDepthString = '#extension GL_EXT_frag_depth : enable\\n';\n }\n\n if (model.context.getExtension('EXT_shader_texture_lod')) {\n fragDepthString += '#extension GL_EXT_shader_texture_lod : enable\\n' + '#define textureCubeLod textureCubeLodEXT\\n' + '#define texture2DLod texture2DLodEXT';\n }\n }\n\n nFSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(nFSSource, '//VTK::System::Dec', [\"\".concat(version, \"\\n\"), gl2 ? '' : '#extension GL_OES_standard_derivatives : enable\\n', fragDepthString, '#ifdef GL_FRAGMENT_PRECISION_HIGH', 'precision highp float;', 'precision highp int;', '#else', 'precision mediump float;', 'precision mediump int;', '#endif']).result;\n var nVSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(VSSource, '//VTK::System::Dec', [\"\".concat(version, \"\\n\"), '#ifdef GL_FRAGMENT_PRECISION_HIGH', 'precision highp float;', 'precision highp int;', '#else', 'precision mediump float;', 'precision mediump int;', '#endif']).result;\n\n if (gl2) {\n nVSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(nVSSource, 'varying', 'out').result;\n nFSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(nFSSource, 'varying', 'in').result;\n nFSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(nFSSource, 'gl_FragData\\\\[0\\\\]', 'fragOutput0').result;\n nFSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(nFSSource, '//VTK::Output::Dec', 'layout(location = 0) out vec4 fragOutput0;').result;\n } // nFSSource = ShaderProgram.substitute(nFSSource, 'gl_FragData\\\\[0\\\\]',\n // 'gl_FragColor').result;\n\n\n var nGSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(GSSource, '//VTK::System::Dec', version).result;\n return {\n VSSource: nVSSource,\n FSSource: nFSSource,\n GSSource: nGSSource\n };\n }; // return NULL if there is an issue\n\n\n publicAPI.readyShaderProgramArray = function (vertexCode, fragmentCode, geometryCode) {\n var data = publicAPI.replaceShaderValues(vertexCode, fragmentCode, geometryCode);\n var shader = publicAPI.getShaderProgram(data.VSSource, data.FSSource, data.GSSource);\n return publicAPI.readyShaderProgram(shader);\n };\n\n publicAPI.readyShaderProgram = function (shader) {\n if (!shader) {\n return null;\n } // compile if needed\n\n\n if (!shader.getCompiled() && !shader.compileShader()) {\n return null;\n } // bind if needed\n\n\n if (!publicAPI.bindShader(shader)) {\n return null;\n }\n\n return shader;\n };\n\n publicAPI.getShaderProgram = function (vertexCode, fragmentCode, geometryCode) {\n // compute the MD5 and the check the map\n var hashInput = \"\".concat(vertexCode).concat(fragmentCode).concat(geometryCode);\n var result = blueimp_md5__WEBPACK_IMPORTED_MODULE_0___default()(hashInput); // does it already exist?\n\n var loc = Object.keys(model.shaderPrograms).indexOf(result);\n\n if (loc === -1) {\n // create one\n var sps = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n sps.setContext(model.context);\n sps.getVertexShader().setSource(vertexCode);\n sps.getFragmentShader().setSource(fragmentCode);\n\n if (geometryCode) {\n sps.getGeometryShader().setSource(geometryCode);\n }\n\n sps.setMd5Hash(result);\n model.shaderPrograms[result] = sps;\n return sps;\n }\n\n return model.shaderPrograms[result];\n };\n\n publicAPI.releaseGraphicsResources = function (win) {\n // NOTE:\n // In the current implementation as of October 26th, if a shader\n // program is created by ShaderCache then it should make sure\n // that it releases the graphics resources used by these programs.\n // It is not wisely for callers to do that since then they would\n // have to loop over all the programs were in use and invoke\n // release graphics resources individually.\n publicAPI.releaseCurrentShader();\n Object.keys(model.shaderPrograms).map(function (key) {\n return model.shaderPrograms[key];\n }).forEach(function (sp) {\n return sp.releaseGraphicsResources(win);\n });\n };\n\n publicAPI.releaseGraphicsResources = function () {\n // release prior shader\n if (model.astShaderBound) {\n model.lastShaderBound.release();\n model.lastShaderBound = null;\n }\n };\n\n publicAPI.bindShader = function (shader) {\n if (model.lastShaderBound === shader) {\n return 1;\n } // release prior shader\n\n\n if (model.lastShaderBound) {\n model.lastShaderBound.release();\n }\n\n shader.bind();\n model.lastShaderBound = shader;\n return 1;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n lastShaderBound: null,\n shaderPrograms: null,\n context: null,\n openGLRenderWindow: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Internal objects\n\n model.shaderPrograms = {}; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, SET_GET_FIELDS); // Object methods\n\n vtkShaderCache(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkShaderCache'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderCache/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js ***! - \*****************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Shader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Shader */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Shader/index.js\");\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // perform in place string substitutions, indicate if a substitution was done\n// this is useful for building up shader strings which typically involve\n// lots of string substitutions. Return true if a substitution was done.\n\nfunction substitute(source, search, replace) {\n var all = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var replaceStr = Array.isArray(replace) ? replace.join('\\n') : replace;\n var replaced = false;\n\n if (source.search(search) !== -1) {\n replaced = true;\n }\n\n var gflag = '';\n\n if (all) {\n gflag = 'g';\n }\n\n var regex = new RegExp(search, gflag);\n var resultstr = source.replace(regex, replaceStr);\n return {\n replace: replaced,\n result: resultstr\n };\n} // ----------------------------------------------------------------------------\n// vtkShaderProgram methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkShaderProgram(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkShaderProgram');\n\n publicAPI.compileShader = function () {\n if (!model.vertexShader.compile()) {\n vtkErrorMacro(model.vertexShader.getSource().split('\\n').map(function (line, index) {\n return \"\".concat(index, \": \").concat(line);\n }).join('\\n'));\n vtkErrorMacro(model.vertexShader.getError());\n return 0;\n }\n\n if (!model.fragmentShader.compile()) {\n vtkErrorMacro(model.fragmentShader.getSource().split('\\n').map(function (line, index) {\n return \"\".concat(index, \": \").concat(line);\n }).join('\\n'));\n vtkErrorMacro(model.fragmentShader.getError());\n return 0;\n } // skip geometry for now\n\n\n if (!publicAPI.attachShader(model.vertexShader)) {\n vtkErrorMacro(model.error);\n return 0;\n }\n\n if (!publicAPI.attachShader(model.fragmentShader)) {\n vtkErrorMacro(model.error);\n return 0;\n }\n\n if (!publicAPI.link()) {\n vtkErrorMacro(\"Links failed: \".concat(model.error));\n return 0;\n }\n\n publicAPI.setCompiled(true);\n return 1;\n };\n\n publicAPI.cleanup = function () {\n if (model.shaderType === 'Unknown' || model.handle === 0) {\n return;\n }\n\n model.context.deleteShader(model.handle);\n model.handle = 0;\n };\n\n publicAPI.bind = function () {\n if (!model.linked && !publicAPI.link()) {\n return false;\n }\n\n model.context.useProgram(model.handle);\n publicAPI.setBound(true);\n return true;\n };\n\n publicAPI.isBound = function () {\n return !!model.bound;\n };\n\n publicAPI.release = function () {\n model.context.useProgram(null);\n publicAPI.setBound(false);\n };\n\n publicAPI.setContext = function (ctx) {\n model.vertexShader.setContext(ctx);\n model.fragmentShader.setContext(ctx);\n model.geometryShader.setContext(ctx);\n };\n\n publicAPI.link = function () {\n if (model.inked) {\n return true;\n }\n\n if (model.handle === 0) {\n model.error = 'Program has not been initialized, and/or does not have shaders.';\n return false;\n } // clear out the list of uniforms used\n\n\n model.uniformLocs = {};\n model.context.linkProgram(model.handle);\n var isCompiled = model.context.getProgramParameter(model.handle, model.context.LINK_STATUS);\n\n if (!isCompiled) {\n var lastError = model.context.getProgramInfoLog(model.handle);\n vtkErrorMacro(\"Error linking shader \".concat(lastError));\n model.handle = 0;\n return false;\n }\n\n publicAPI.setLinked(true);\n model.attributeLocs = {};\n return true;\n };\n\n publicAPI.setUniformMatrix = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n var f32 = new Float32Array(v);\n model.context.uniformMatrix4fv(location, false, f32);\n return true;\n };\n\n publicAPI.setUniformMatrix3x3 = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n var f32 = new Float32Array(v);\n model.context.uniformMatrix3fv(location, false, f32);\n return true;\n };\n\n publicAPI.setUniformf = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform1f(location, v);\n return true;\n };\n\n publicAPI.setUniformfv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform1fv(location, v);\n return true;\n };\n\n publicAPI.setUniformi = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform1i(location, v);\n return true;\n };\n\n publicAPI.setUniformiv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform1iv(location, v);\n return true;\n };\n\n publicAPI.setUniform2f = function (name, v1, v2) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n if (v2 === undefined) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform2f(location, v1, v2);\n return true;\n };\n\n publicAPI.setUniform2fv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform2fv(location, v);\n return true;\n };\n\n publicAPI.setUniform2i = function (name, v1, v2) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n if (v2 === undefined) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform2i(location, v1, v2);\n return true;\n };\n\n publicAPI.setUniform2iv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform2iv(location, v);\n return true;\n };\n\n publicAPI.setUniform3f = function (name, a1, a2, a3) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n if (a3 === undefined) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform3f(location, a1, a2, a3);\n return true;\n };\n\n publicAPI.setUniform3fArray = function (name, a) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n if (!Array.isArray(a) || a.length !== 3) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform3f(location, a[0], a[1], a[2]);\n return true;\n };\n\n publicAPI.setUniform3fv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform3fv(location, v);\n return true;\n };\n\n publicAPI.setUniform3i = function (name) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var array = args; // allow an array passed as a single argument\n\n if (array.length === 1 && Array.isArray(array[0])) {\n array = array[0];\n }\n\n if (array.length !== 3) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform3i(location, array[0], array[1], array[2]);\n return true;\n };\n\n publicAPI.setUniform3iv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform3iv(location, v);\n return true;\n };\n\n publicAPI.setUniform4f = function (name) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n var array = args; // allow an array passed as a single argument\n\n if (array.length === 1 && Array.isArray(array[0])) {\n array = array[0];\n }\n\n if (array.length !== 4) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform4f(location, array[0], array[1], array[2], array[3]);\n return true;\n };\n\n publicAPI.setUniform4fv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform4fv(location, v);\n return true;\n };\n\n publicAPI.setUniform4i = function (name) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n\n var array = args; // allow an array passed as a single argument\n\n if (array.length === 1 && Array.isArray(array[0])) {\n array = array[0];\n }\n\n if (array.length !== 4) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform4i(location, array[0], array[1], array[2], array[3]);\n return true;\n };\n\n publicAPI.setUniform4iv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform4iv(location, v);\n return true;\n };\n\n publicAPI.setUniform4fv = function (name, count, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform4fv(location, v);\n return true;\n };\n\n publicAPI.findUniform = function (name) {\n if (!name || !model.linked) {\n return -1;\n } // see if we have cached the result\n\n\n var loc = model.uniformLocs[name];\n\n if (loc !== undefined) {\n return loc;\n }\n\n loc = model.context.getUniformLocation(model.handle, name);\n\n if (loc === null) {\n model.error = \"Uniform \".concat(name, \" not found in current shader program.\");\n model.uniformLocs[name] = -1;\n return -1;\n }\n\n model.uniformLocs[name] = loc;\n return loc;\n };\n\n publicAPI.isUniformUsed = function (name) {\n if (!name) {\n return false;\n } // see if we have cached the result\n\n\n var loc = model.uniformLocs[name];\n\n if (loc !== undefined) {\n return loc !== null;\n }\n\n if (!model.linked) {\n vtkErrorMacro('attempt to find uniform when the shader program is not linked');\n return false;\n }\n\n loc = model.context.getUniformLocation(model.handle, name);\n model.uniformLocs[name] = loc;\n\n if (loc === null) {\n return false;\n }\n\n return true;\n };\n\n publicAPI.isAttributeUsed = function (name) {\n if (!name) {\n return false;\n } // see if we have cached the result\n\n\n var loc = Object.keys(model.attributeLocs).indexOf(name);\n\n if (loc !== -1) {\n return true;\n }\n\n if (!model.linked) {\n vtkErrorMacro('attempt to find uniform when the shader program is not linked');\n return false;\n }\n\n loc = model.context.getAttribLocation(model.handle, name);\n\n if (loc === -1) {\n return false;\n }\n\n model.attributeLocs[name] = loc;\n return true;\n };\n\n publicAPI.attachShader = function (shader) {\n if (shader.getHandle() === 0) {\n model.error = 'Shader object was not initialized, cannot attach it.';\n return false;\n }\n\n if (shader.getShaderType() === 'Unknown') {\n model.error = 'Shader object is of type Unknown and cannot be used.';\n return false;\n }\n\n if (model.handle === 0) {\n var thandle = model.context.createProgram();\n\n if (thandle === 0) {\n model.error = 'Could not create shader program.';\n return false;\n }\n\n model.handle = thandle;\n model.linked = false;\n }\n\n if (shader.getShaderType() === 'Vertex') {\n if (model.vertexShaderHandle !== 0) {\n model.comntext.detachShader(model.handle, model.vertexShaderHandle);\n }\n\n model.vertexShaderHandle = shader.getHandle();\n }\n\n if (shader.getShaderType() === 'Fragment') {\n if (model.fragmentShaderHandle !== 0) {\n model.context.detachShader(model.handle, model.fragmentShaderHandle);\n }\n\n model.fragmentShaderHandle = shader.getHandle();\n }\n\n model.context.attachShader(model.handle, shader.getHandle());\n publicAPI.setLinked(false);\n return true;\n };\n\n publicAPI.detachShader = function (shader) {\n if (shader.getHandle() === 0) {\n model.error = 'shader object was not initialized, cannot attach it.';\n return false;\n }\n\n if (shader.getShaderType() === 'Unknown') {\n model.error = 'Shader object is of type Unknown and cannot be used.';\n return false;\n }\n\n if (model.handle === 0) {\n model.error = 'This shader program has not been initialized yet.';\n }\n\n switch (shader.getShaderType()) {\n case 'Vertex':\n if (model.vertexShaderHandle !== shader.getHandle()) {\n model.error = 'The supplied shader was not attached to this program.';\n return false;\n }\n\n model.context.detachShader(model.handle, shader.getHandle());\n model.vertexShaderHandle = 0;\n model.linked = false;\n return true;\n\n case 'Fragment':\n if (model.fragmentShaderHandle !== shader.getHandle()) {\n model.error = 'The supplied shader was not attached to this program.';\n return false;\n }\n\n model.context.detachShader(model.handle, shader.getHandle());\n model.fragmentShaderHandle = 0;\n model.linked = false;\n return true;\n\n default:\n return false;\n }\n };\n\n publicAPI.setContext = function (ctx) {\n model.context = ctx;\n model.vertexShader.setContext(ctx);\n model.fragmentShader.setContext(ctx);\n model.geometryShader.setContext(ctx);\n };\n\n publicAPI.setLastCameraMTime = function (mtime) {\n model.lastCameraMTime = mtime;\n }; // publicAPI.enableAttributeArray = (name) => {\n // const location = publicAPI.findAttributeArray(name);\n // if (location === -1) {\n // model.error = `Could not enable attribute ${name} No such attribute.`;\n // return false;\n // }\n // model.context.enableVertexAttribArray(location);\n // return true;\n // };\n // publicAPI.disableAttributeArray = (name) => {\n // const location = publicAPI.findAttributeArray(name);\n // if (location === -1) {\n // model.error = `Could not enable attribute ${name} No such attribute.`;\n // return false;\n // }\n // model.context.disableVertexAttribArray(location);\n // return true;\n // };\n\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n vertexShaderHandle: 0,\n fragmentShaderHandle: 0,\n geometryShaderHandle: 0,\n vertexShader: null,\n fragmentShader: null,\n geometryShader: null,\n linked: false,\n bound: false,\n compiled: false,\n error: '',\n handle: 0,\n numberOfOutputs: 0,\n attributesLocs: null,\n uniformLocs: null,\n md5Hash: 0,\n context: null,\n lastCameraMTime: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Instantiate internal objects\n\n model.attributesLocs = {};\n model.uniformLocs = {};\n model.vertexShader = vtk_js_Sources_Rendering_OpenGL_Shader__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.vertexShader.setShaderType('Vertex');\n model.fragmentShader = vtk_js_Sources_Rendering_OpenGL_Shader__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.fragmentShader.setShaderType('Fragment');\n model.geometryShader = vtk_js_Sources_Rendering_OpenGL_Shader__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.geometryShader.setShaderType('Geometry'); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['lastCameraMTime']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['error', 'handle', 'compiled', 'bound', 'md5Hash', 'vertexShader', 'fragmentShader', 'geometryShader', 'linked']); // Object methods\n\n vtkShaderProgram(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkShaderProgram'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n substitute: substitute\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Skybox/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Skybox/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Helper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"]; // ----------------------------------------------------------------------------\n// vtkOpenGLSkybox methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLSkybox(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLSkybox'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n model.openGLRenderWindow = model.openGLRenderer.getParent();\n model.context = model.openGLRenderWindow.getContext();\n model.tris.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.openGLTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n var ren = model.openGLRenderer.getRenderable();\n model.openGLCamera = model.openGLRenderer.getViewNodeFor(ren.getActiveCamera());\n }\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n renderPass.incrementOpaqueActorCount();\n }\n };\n\n publicAPI.opaquePass = function (prepass, renderPass) {\n if (prepass && !model.openGLRenderer.getSelector()) {\n publicAPI.updateBufferObjects();\n model.openGLRenderWindow.enableDepthMask();\n model.openGLRenderWindow.getShaderCache().readyShaderProgram(model.tris.getProgram());\n model.openGLTexture.render(model.openGLRenderWindow);\n var texUnit = model.openGLTexture.getTextureUnit();\n model.tris.getProgram().setUniformi('sbtexture', texUnit);\n var ren = model.openGLRenderer.getRenderable();\n var keyMats = model.openGLCamera.getKeyMatrices(ren);\n var imat = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(imat, keyMats.wcpc);\n model.tris.getProgram().setUniformMatrix('IMCPCMatrix', imat);\n\n if (model.lastFormat === 'box') {\n var camPos = ren.getActiveCamera().getPosition();\n model.tris.getProgram().setUniform3f('camPos', camPos[0], camPos[1], camPos[2]);\n }\n\n model.tris.getVAO().bind(); // draw polygons\n\n model.context.drawArrays(model.context.TRIANGLES, 0, model.tris.getCABO().getElementCount());\n model.tris.getVAO().release();\n model.openGLTexture.deactivate();\n }\n };\n\n publicAPI.updateBufferObjects = function () {\n // build the VBO if needed, only happens once\n if (!model.tris.getCABO().getElementCount()) {\n var ptsArray = new Float32Array(12);\n\n for (var i = 0; i < 4; i++) {\n ptsArray[i * 3] = i % 2 * 2 - 1.0;\n ptsArray[i * 3 + 1] = i > 1 ? 1.0 : -1.0;\n ptsArray[i * 3 + 2] = 1.0;\n }\n\n var points = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 3,\n values: ptsArray\n });\n points.setName('points');\n var cellArray = new Uint16Array(8);\n cellArray[0] = 3;\n cellArray[1] = 0;\n cellArray[2] = 1;\n cellArray[3] = 3;\n cellArray[4] = 3;\n cellArray[5] = 0;\n cellArray[6] = 3;\n cellArray[7] = 2;\n var cells = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 1,\n values: cellArray\n });\n model.tris.getCABO().createVBO(cells, 'polys', vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_6__[\"Representation\"].SURFACE, {\n points: points,\n cellOffset: 0\n });\n } // update the program?\n\n\n if (model.renderable.getFormat() !== model.lastFormat) {\n model.lastFormat = model.renderable.getFormat();\n\n if (model.lastFormat === 'box') {\n // we invert Y below because opengl is messed up!\n // Cube Maps have been specified to follow the RenderMan\n // specification (for whatever reason), and RenderMan\n // assumes the images' origin being in the upper left,\n // contrary to the usual OpenGL behaviour of having the\n // image origin in the lower left. That's why things get\n // swapped in the Y direction. It totally breaks with the usual\n // OpenGL semantics and doesn't make sense at all.\n // But now we're stuck with it. From\n // https://stackoverflow.com/questions/11685608/convention-of-faces-in-opengl-cubemapping\n //\n model.tris.setProgram(model.openGLRenderWindow.getShaderCache().readyShaderProgramArray(\"//VTK::System::Dec\\n attribute vec3 vertexMC;\\n uniform mat4 IMCPCMatrix;\\n varying vec3 TexCoords;\\n void main () {\\n gl_Position = vec4(vertexMC.xyz, 1.0);\\n vec4 wpos = IMCPCMatrix * gl_Position;\\n TexCoords = wpos.xyz/wpos.w;\\n }\", \"//VTK::System::Dec\\n //VTK::Output::Dec\\n varying vec3 TexCoords;\\n uniform samplerCube sbtexture;\\n uniform vec3 camPos;\\n void main () {\\n // skybox looks from inside out\\n // which means we have to adjust\\n // our tcoords. Otherwise text would\\n // be flipped\\n vec3 tc = normalize(TexCoords - camPos);\\n if (abs(tc.z) < max(abs(tc.x),abs(tc.y)))\\n {\\n tc = vec3(1.0, 1.0, -1.0) * tc;\\n }\\n else\\n {\\n tc = vec3(-1.0, 1.0, 1.0) * tc;\\n }\\n gl_FragData[0] = textureCube(sbtexture, tc);\\n }\", ''));\n }\n\n if (model.lastFormat === 'background') {\n // maps the texture to the window\n model.tris.setProgram(model.openGLRenderWindow.getShaderCache().readyShaderProgramArray(\"//VTK::System::Dec\\n attribute vec3 vertexMC;\\n uniform mat4 IMCPCMatrix;\\n varying vec2 TexCoords;\\n void main () {\\n gl_Position = vec4(vertexMC.xyz, 1.0);\\n vec4 wpos = IMCPCMatrix * gl_Position;\\n TexCoords = vec2(vertexMC.x, vertexMC.y)*0.5 + 0.5;\\n }\", \"//VTK::System::Dec\\n //VTK::Output::Dec\\n varying vec2 TexCoords;\\n uniform sampler2D sbtexture;\\n void main () {\\n gl_FragData[0] = texture2D(sbtexture, TexCoords);\\n }\", ''));\n }\n\n model.tris.getShaderSourceTime().modified();\n model.tris.getVAO().bind();\n\n if (!model.tris.getVAO().addAttributeArray(model.tris.getProgram(), model.tris.getCABO(), 'vertexMC', model.tris.getCABO().getVertexOffset(), model.tris.getCABO().getStride(), model.context.FLOAT, 3, model.context.FALSE)) {\n vtkErrorMacro('Error setting vertexMC in shader VAO.');\n }\n } // set/update the texture map if needed\n\n\n var tmaps = model.renderable.getTextures();\n\n if (!tmaps.length) {\n vtkErrorMacro('vtkSkybox requires a texture map');\n }\n\n if (model.openGLTexture.getRenderable() !== tmaps[0]) {\n model.openGLTexture.releaseGraphicsResources(model.openGLRenderWindow);\n model.openGLTexture.setRenderable(tmaps[0]);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_4__[\"default\"].extend(publicAPI, model, initialValues);\n model.openGLTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n model.tris = vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.keyMatrixTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.keyMatrixTime, {\n mtime: 0\n });\n model.keyMatrices = {\n normalMatrix: gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(new Float64Array(9)),\n mcwc: gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16))\n }; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['context']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"get\"](publicAPI, model, ['activeTextures']); // Object methods\n\n vtkOpenGLSkybox(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_7__[\"registerOverride\"])('vtkSkybox', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Skybox/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js ***! - \***************************************************************************/ -/*! exports provided: Wrap, Filter, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Wrap\", function() { return Wrap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Filter\", function() { return Filter; });\nvar Wrap = {\n CLAMP_TO_EDGE: 0,\n REPEAT: 1,\n MIRRORED_REPEAT: 2\n};\nvar Filter = {\n NEAREST: 0,\n LINEAR: 1,\n NEAREST_MIPMAP_NEAREST: 2,\n NEAREST_MIPMAP_LINEAR: 3,\n LINEAR_MIPMAP_NEAREST: 4,\n LINEAR_MIPMAP_LINEAR: 5\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n Wrap: Wrap,\n Filter: Filter\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js ***! - \***********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n\nvar Wrap = vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Wrap,\n Filter = vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Filter;\nvar VtkDataTypes = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].VtkDataTypes;\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkDebugMacro\"],\n vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"],\n vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkWarningMacro\"]; // ----------------------------------------------------------------------------\n// vtkOpenGLTexture methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLTexture(publicAPI, model) {\n var _this = this;\n\n // Set our className\n model.classHierarchy.push('vtkOpenGLTexture'); // Renders myself\n\n publicAPI.render = function () {\n var renWin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n if (renWin) {\n model.openGLRenderWindow = renWin;\n } else {\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer'); // sync renderable properties\n\n model.openGLRenderWindow = model.openGLRenderer.getParent();\n }\n\n model.context = model.openGLRenderWindow.getContext();\n\n if (model.renderable.getInterpolate()) {\n if (model.generateMipmap) {\n publicAPI.setMinificationFilter(Filter.LINEAR_MIPMAP_LINEAR);\n } else {\n publicAPI.setMinificationFilter(Filter.LINEAR);\n }\n\n publicAPI.setMagnificationFilter(Filter.LINEAR);\n } else {\n publicAPI.setMinificationFilter(Filter.NEAREST);\n publicAPI.setMagnificationFilter(Filter.NEAREST);\n }\n\n if (model.renderable.getRepeat()) {\n publicAPI.setWrapR(Wrap.REPEAT);\n publicAPI.setWrapS(Wrap.REPEAT);\n publicAPI.setWrapT(Wrap.REPEAT);\n } // clear image if input data is set\n\n\n if (model.renderable.getInputData()) {\n model.renderable.setImage(null);\n } // create the texture if it is not done already\n\n\n if (!model.handle || model.renderable.getMTime() > model.textureBuildTime.getMTime()) {\n // if we have an Image\n if (model.renderable.getImage() !== null) {\n if (model.renderable.getInterpolate()) {\n model.generateMipmap = true;\n publicAPI.setMinificationFilter(Filter.LINEAR_MIPMAP_LINEAR);\n } // Have an Image which may not be complete\n\n\n if (model.renderable.getImage() && model.renderable.getImageLoaded()) {\n publicAPI.create2DFromImage(model.renderable.getImage());\n publicAPI.activate();\n publicAPI.sendParameters();\n model.textureBuildTime.modified();\n }\n } // if we have Inputdata\n\n\n var input = model.renderable.getInputData(0);\n\n if (input && input.getPointData().getScalars()) {\n var ext = input.getExtent();\n var inScalars = input.getPointData().getScalars(); // do we have a cube map? Six inputs\n\n var data = [];\n\n for (var i = 0; i < model.renderable.getNumberOfInputPorts(); ++i) {\n var indata = model.renderable.getInputData(i);\n var scalars = indata ? indata.getPointData().getScalars().getData() : null;\n\n if (scalars) {\n data.push(scalars);\n }\n }\n\n if (model.renderable.getInterpolate() && inScalars.getNumberOfComponents() === 4) {\n model.generateMipmap = true;\n publicAPI.setMinificationFilter(Filter.LINEAR_MIPMAP_LINEAR);\n }\n\n if (data.length % 6 === 0) {\n publicAPI.createCubeFromRaw(ext[1] - ext[0] + 1, ext[3] - ext[2] + 1, inScalars.getNumberOfComponents(), inScalars.getDataType(), data);\n } else {\n publicAPI.create2DFromRaw(ext[1] - ext[0] + 1, ext[3] - ext[2] + 1, inScalars.getNumberOfComponents(), inScalars.getDataType(), inScalars.getData());\n }\n\n publicAPI.activate();\n publicAPI.sendParameters();\n model.textureBuildTime.modified();\n }\n }\n\n if (model.handle) {\n publicAPI.activate();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.destroyTexture = function () {\n // deactivate it first\n publicAPI.deactivate();\n\n if (model.context && model.handle) {\n model.context.deleteTexture(model.handle);\n }\n\n model.handle = 0;\n model.numberOfDimensions = 0;\n model.target = 0;\n model.components = 0;\n model.width = 0;\n model.height = 0;\n model.depth = 0;\n publicAPI.resetFormatAndType();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.createTexture = function () {\n // reuse the existing handle if we have one\n if (!model.handle) {\n model.handle = model.context.createTexture();\n\n if (model.target) {\n model.context.bindTexture(model.target, model.handle); // See: http://www.openmodel.context..org/wiki/Common_Mistakes#Creating_a_complete_texture\n // turn off mip map filter or set the base and max level correctly. here\n // both are done.\n\n model.context.texParameteri(model.target, model.context.TEXTURE_MIN_FILTER, publicAPI.getOpenGLFilterMode(model.minificationFilter));\n model.context.texParameteri(model.target, model.context.TEXTURE_MAG_FILTER, publicAPI.getOpenGLFilterMode(model.magnificationFilter));\n model.context.texParameteri(model.target, model.context.TEXTURE_WRAP_S, publicAPI.getOpenGLWrapMode(model.wrapS));\n model.context.texParameteri(model.target, model.context.TEXTURE_WRAP_T, publicAPI.getOpenGLWrapMode(model.wrapT));\n\n if (model.openGLRenderWindow.getWebgl2()) {\n model.context.texParameteri(model.target, model.context.TEXTURE_WRAP_R, publicAPI.getOpenGLWrapMode(model.wrapR));\n }\n\n model.context.bindTexture(model.target, null);\n }\n }\n }; //---------------------------------------------------------------------------\n\n\n publicAPI.getTextureUnit = function () {\n if (model.openGLRenderWindow) {\n return model.openGLRenderWindow.getTextureUnitForTexture(publicAPI);\n }\n\n return -1;\n }; //---------------------------------------------------------------------------\n\n\n publicAPI.activate = function () {\n // activate a free texture unit for this texture\n model.openGLRenderWindow.activateTexture(publicAPI);\n publicAPI.bind();\n }; //---------------------------------------------------------------------------\n\n\n publicAPI.deactivate = function () {\n if (model.openGLRenderWindow) {\n model.openGLRenderWindow.deactivateTexture(publicAPI);\n }\n }; //---------------------------------------------------------------------------\n\n\n publicAPI.releaseGraphicsResources = function (rwin) {\n if (rwin && model.handle) {\n rwin.activateTexture(publicAPI);\n rwin.deactivateTexture(publicAPI);\n model.context.deleteTexture(model.handle);\n model.handle = 0;\n model.numberOfDimensions = 0;\n model.target = 0;\n model.internalFormat = 0;\n model.format = 0;\n model.openGLDataType = 0;\n model.components = 0;\n model.width = 0;\n model.height = 0;\n model.depth = 0;\n }\n\n if (model.shaderProgram) {\n model.shaderProgram.releaseGraphicsResources(rwin);\n model.shaderProgram = null;\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.bind = function () {\n model.context.bindTexture(model.target, model.handle);\n\n if (model.autoParameters && publicAPI.getMTime() > model.sendParametersTime.getMTime()) {\n publicAPI.sendParameters();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.isBound = function () {\n var result = false;\n\n if (model.context && model.handle) {\n var target = 0;\n\n switch (model.target) {\n case model.context.TEXTURE_2D:\n target = model.context.TEXTURE_BINDING_2D;\n break;\n\n default:\n vtkWarningMacro('impossible case');\n break;\n }\n\n var oid = model.context.getIntegerv(target);\n result = oid === model.handle;\n }\n\n return result;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.sendParameters = function () {\n model.context.texParameteri(model.target, model.context.TEXTURE_WRAP_S, publicAPI.getOpenGLWrapMode(model.wrapS));\n model.context.texParameteri(model.target, model.context.TEXTURE_WRAP_T, publicAPI.getOpenGLWrapMode(model.wrapT));\n\n if (model.openGLRenderWindow.getWebgl2()) {\n model.context.texParameteri(model.target, model.context.TEXTURE_WRAP_R, publicAPI.getOpenGLWrapMode(model.wrapR));\n }\n\n model.context.texParameteri(model.target, model.context.TEXTURE_MIN_FILTER, publicAPI.getOpenGLFilterMode(model.minificationFilter));\n model.context.texParameteri(model.target, model.context.TEXTURE_MAG_FILTER, publicAPI.getOpenGLFilterMode(model.magnificationFilter));\n\n if (model.openGLRenderWindow.getWebgl2()) {\n model.context.texParameteri(model.target, model.context.TEXTURE_BASE_LEVEL, model.baseLevel);\n model.context.texParameteri(model.target, model.context.TEXTURE_MAX_LEVEL, model.maxLevel);\n } // model.context.texParameterf(model.target, model.context.TEXTURE_MIN_LOD, model.minLOD);\n // model.context.texParameterf(model.target, model.context.TEXTURE_MAX_LOD, model.maxLOD);\n\n\n model.sendParametersTime.modified();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getInternalFormat = function (vtktype, numComps) {\n if (!model.internalFormat) {\n model.internalFormat = publicAPI.getDefaultInternalFormat(vtktype, numComps);\n }\n\n if (!model.internalFormat) {\n vtkDebugMacro(\"Unable to find suitable internal format for T=\".concat(vtktype, \" NC= \").concat(numComps));\n }\n\n return model.internalFormat;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getDefaultInternalFormat = function (vtktype, numComps) {\n var result = 0; // try default next\n\n result = model.openGLRenderWindow.getDefaultTextureInternalFormat(vtktype, numComps, false);\n\n if (result) {\n return result;\n } // try floating point\n\n\n result = _this.openGLRenderWindow.getDefaultTextureInternalFormat(vtktype, numComps, true);\n\n if (!result) {\n vtkDebugMacro('Unsupported internal texture type!');\n vtkDebugMacro(\"Unable to find suitable internal format for T=\".concat(vtktype, \" NC= \").concat(numComps));\n }\n\n return result;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.setInternalFormat = function (iFormat) {\n if (iFormat !== model.internalFormat) {\n model.internalFormat = iFormat;\n publicAPI.modified();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getFormat = function (vtktype, numComps) {\n model.format = publicAPI.getDefaultFormat(vtktype, numComps);\n return model.format;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getDefaultFormat = function (vtktype, numComps) {\n if (model.openGLRenderWindow.getWebgl2()) {\n switch (numComps) {\n case 1:\n return model.context.RED;\n\n case 2:\n return model.context.RG;\n\n case 3:\n return model.context.RGB;\n\n case 4:\n return model.context.RGBA;\n\n default:\n return model.context.RGB;\n }\n } else {\n // webgl1\n switch (numComps) {\n case 1:\n return model.context.LUMINANCE;\n\n case 2:\n return model.context.LUMINANCE_ALPHA;\n\n case 3:\n return model.context.RGB;\n\n case 4:\n return model.context.RGBA;\n\n default:\n return model.context.RGB;\n }\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.resetFormatAndType = function () {\n model.format = 0;\n model.internalFormat = 0;\n model.openGLDataType = 0;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getDefaultDataType = function (vtkScalarType) {\n // DON'T DEAL with VTK_CHAR as this is platform dependent.\n if (model.openGLRenderWindow.getWebgl2()) {\n switch (vtkScalarType) {\n // case VtkDataTypes.SIGNED_CHAR:\n // return model.context.BYTE;\n case VtkDataTypes.UNSIGNED_CHAR:\n return model.context.UNSIGNED_BYTE;\n // case VtkDataTypes.SHORT:\n // return model.context.SHORT;\n // case VtkDataTypes.UNSIGNED_SHORT:\n // return model.context.UNSIGNED_SHORT;\n // case VtkDataTypes.INT:\n // return model.context.INT;\n // case VtkDataTypes.UNSIGNED_INT:\n // return model.context.UNSIGNED_INT;\n\n case VtkDataTypes.FLOAT:\n case VtkDataTypes.VOID: // used for depth component textures.\n\n default:\n return model.context.FLOAT;\n }\n }\n\n switch (vtkScalarType) {\n // case VtkDataTypes.SIGNED_CHAR:\n // return model.context.BYTE;\n case VtkDataTypes.UNSIGNED_CHAR:\n return model.context.UNSIGNED_BYTE;\n // case VtkDataTypes.SHORT:\n // return model.context.SHORT;\n // case VtkDataTypes.UNSIGNED_SHORT:\n // return model.context.UNSIGNED_SHORT;\n // case VtkDataTypes.INT:\n // return model.context.INT;\n // case VtkDataTypes.UNSIGNED_INT:\n // return model.context.UNSIGNED_INT;\n\n case VtkDataTypes.FLOAT:\n case VtkDataTypes.VOID: // used for depth component textures.\n\n default:\n if (model.context.getExtension('OES_texture_float') && model.context.getExtension('OES_texture_float_linear')) {\n return model.context.FLOAT;\n }\n\n return model.context.UNSIGNED_BYTE;\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getOpenGLDataType = function (vtkScalarType) {\n model.openGLDataType = publicAPI.getDefaultDataType(vtkScalarType);\n return model.openGLDataType;\n };\n\n publicAPI.getShiftAndScale = function () {\n var shift = 0.0;\n var scale = 1.0; // for all float type internal formats\n\n switch (model.openGLDataType) {\n case model.context.BYTE:\n scale = 127.5;\n shift = scale - 128.0;\n break;\n\n case model.context.UNSIGNED_BYTE:\n scale = 255.0;\n shift = 0.0;\n break;\n\n case model.context.SHORT:\n scale = 32767.5;\n shift = scale - 32768.0;\n break;\n\n case model.context.UNSIGNED_SHORT:\n scale = 65536.0;\n shift = 0.0;\n break;\n\n case model.context.INT:\n scale = 2147483647.5;\n shift = scale - 2147483648.0;\n break;\n\n case model.context.UNSIGNED_INT:\n scale = 4294967295.0;\n shift = 0.0;\n break;\n\n case model.context.FLOAT:\n default:\n break;\n }\n\n return {\n shift: shift,\n scale: scale\n };\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getOpenGLFilterMode = function (emode) {\n switch (emode) {\n case Filter.NEAREST:\n return model.context.NEAREST;\n\n case Filter.LINEAR:\n return model.context.LINEAR;\n\n case Filter.NEAREST_MIPMAP_NEAREST:\n return model.context.NEAREST_MIPMAP_NEAREST;\n\n case Filter.NEAREST_MIPMAP_LINEAR:\n return model.context.NEAREST_MIPMAP_LINEAR;\n\n case Filter.LINEAR_MIPMAP_NEAREST:\n return model.context.LINEAR_MIPMAP_NEAREST;\n\n case Filter.LINEAR_MIPMAP_LINEAR:\n return model.context.LINEAR_MIPMAP_LINEAR;\n\n default:\n return model.context.NEAREST;\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getOpenGLWrapMode = function (vtktype) {\n switch (vtktype) {\n case Wrap.CLAMP_TO_EDGE:\n return model.context.CLAMP_TO_EDGE;\n\n case Wrap.REPEAT:\n return model.context.REPEAT;\n\n case Wrap.MIRRORED_REPEAT:\n return model.context.MIRRORED_REPEAT;\n\n default:\n return model.context.CLAMP_TO_EDGE;\n }\n }; //----------------------------------------------------------------------------\n\n\n function updateArrayDataType(dataType, data) {\n var pixData = []; // if the opengl data type is float\n // then the data array must be float\n\n if (dataType !== VtkDataTypes.FLOAT && model.openGLDataType === model.context.FLOAT) {\n var pixCount = model.width * model.height * model.components;\n\n for (var idx = 0; idx < data.length; idx++) {\n var newArray = new Float32Array(pixCount);\n\n for (var i = 0; i < pixCount; i++) {\n newArray[i] = data[idx][i];\n }\n\n pixData.push(newArray);\n }\n } // if the opengl data type is ubyte\n // then the data array must be u8, we currently simply truncate the data\n\n\n if (dataType !== VtkDataTypes.UNSIGNED_CHAR && model.openGLDataType === model.context.UNSIGNED_BYTE) {\n var _pixCount = model.width * model.height * model.components;\n\n for (var _idx = 0; _idx < data.length; _idx++) {\n var _newArray = new Uint8Array(_pixCount);\n\n for (var _i = 0; _i < _pixCount; _i++) {\n _newArray[_i] = data[_idx][_i];\n }\n\n pixData.push(_newArray);\n }\n } // The output has to be filled\n\n\n if (pixData.length === 0) {\n for (var _i2 = 0; _i2 < data.length; _i2++) {\n pixData.push(data[_i2]);\n }\n }\n\n return pixData;\n } //----------------------------------------------------------------------------\n\n\n function scaleTextureToHighestPowerOfTwo(data) {\n if (model.openGLRenderWindow.getWebgl2()) {\n // No need if webGL2\n return data;\n }\n\n var pixData = [];\n var width = model.width;\n var height = model.height;\n var numComps = model.components;\n\n if (data && (!vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"isPowerOfTwo\"](width) || !vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"isPowerOfTwo\"](height))) {\n // Scale up the texture to the next highest power of two dimensions.\n var newWidth = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"nearestPowerOfTwo\"](width);\n var newHeight = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"nearestPowerOfTwo\"](height);\n var pixCount = newWidth * newHeight * model.components;\n\n for (var idx = 0; idx < data.length; idx++) {\n if (data[idx] !== null) {\n var newArray = null;\n\n switch (model.openGLDataType) {\n case model.context.FLOAT:\n newArray = new Float32Array(pixCount);\n break;\n\n default:\n case model.context.UNSIGNED_BYTE:\n newArray = new Uint8Array(pixCount);\n break;\n }\n\n var jFactor = height / newHeight;\n var iFactor = width / newWidth;\n\n for (var j = 0; j < newHeight; j++) {\n var joff = j * newWidth * numComps;\n var jidx = j * jFactor;\n var jlow = Math.floor(jidx);\n var jhi = Math.ceil(jidx);\n\n if (jhi >= height) {\n jhi = height - 1;\n }\n\n var jmix = jidx - jlow;\n var jmix1 = 1.0 - jmix;\n jlow = jlow * width * numComps;\n jhi = jhi * width * numComps;\n\n for (var i = 0; i < newWidth; i++) {\n var ioff = i * numComps;\n var iidx = i * iFactor;\n var ilow = Math.floor(iidx);\n var ihi = Math.ceil(iidx);\n\n if (ihi >= width) {\n ihi = width - 1;\n }\n\n var imix = iidx - ilow;\n ilow *= numComps;\n ihi *= numComps;\n\n for (var c = 0; c < numComps; c++) {\n newArray[joff + ioff + c] = data[idx][jlow + ilow + c] * jmix1 * (1.0 - imix) + data[idx][jlow + ihi + c] * jmix1 * imix + data[idx][jhi + ilow + c] * jmix * (1.0 - imix) + data[idx][jhi + ihi + c] * jmix * imix;\n }\n }\n }\n\n pixData.push(newArray);\n model.width = newWidth;\n model.height = newHeight;\n } else {\n pixData.push(null);\n }\n }\n } // The output has to be filled\n\n\n if (pixData.length === 0) {\n for (var _i3 = 0; _i3 < data.length; _i3++) {\n pixData.push(data[_i3]);\n }\n }\n\n return pixData;\n } //----------------------------------------------------------------------------\n\n\n publicAPI.create2DFromRaw = function (width, height, numComps, dataType, data) {\n // Now determine the texture parameters using the arguments.\n publicAPI.getOpenGLDataType(dataType);\n publicAPI.getInternalFormat(dataType, numComps);\n publicAPI.getFormat(dataType, numComps);\n\n if (!model.internalFormat || !model.format || !model.openGLDataType) {\n vtkErrorMacro('Failed to determine texture parameters.');\n return false;\n }\n\n model.target = model.context.TEXTURE_2D;\n model.components = numComps;\n model.width = width;\n model.height = height;\n model.depth = 1;\n model.numberOfDimensions = 2;\n model.openGLRenderWindow.activateTexture(publicAPI);\n publicAPI.createTexture();\n publicAPI.bind(); // Create an array of texture with one texture\n\n var dataArray = [data];\n var pixData = updateArrayDataType(dataType, dataArray);\n var scaledData = scaleTextureToHighestPowerOfTwo(pixData); // Source texture data from the PBO.\n // model.context.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n\n model.context.pixelStorei(model.context.UNPACK_ALIGNMENT, 1);\n model.context.texImage2D(model.target, 0, model.internalFormat, model.width, model.height, 0, model.format, model.openGLDataType, scaledData[0]);\n\n if (model.generateMipmap) {\n model.context.generateMipmap(model.target);\n }\n\n publicAPI.deactivate();\n return true;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.createCubeFromRaw = function (width, height, numComps, dataType, data) {\n // Now determine the texture parameters using the arguments.\n publicAPI.getOpenGLDataType(dataType);\n publicAPI.getInternalFormat(dataType, numComps);\n publicAPI.getFormat(dataType, numComps);\n\n if (!model.internalFormat || !model.format || !model.openGLDataType) {\n vtkErrorMacro('Failed to determine texture parameters.');\n return false;\n }\n\n model.target = model.context.TEXTURE_CUBE_MAP;\n model.components = numComps;\n model.width = width;\n model.height = height;\n model.depth = 1;\n model.numberOfDimensions = 2;\n model.openGLRenderWindow.activateTexture(publicAPI);\n model.maxLevel = data.length / 6 - 1;\n publicAPI.createTexture();\n publicAPI.bind();\n var pixData = updateArrayDataType(dataType, data);\n var scaledData = scaleTextureToHighestPowerOfTwo(pixData); // invert the data because opengl is messed up with cube maps\n // and uses the old renderman standard with Y going down\n // even though it is completely at odds with OpenGL standards\n\n var invertedData = [];\n var widthLevel = model.width;\n var heightLevel = model.height;\n\n for (var i = 0; i < scaledData.length; i++) {\n if (i % 6 === 0 && i !== 0) {\n widthLevel /= 2;\n heightLevel /= 2;\n }\n\n invertedData[i] = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newTypedArray\"](dataType, heightLevel * widthLevel * model.components);\n\n for (var y = 0; y < heightLevel; ++y) {\n var row1 = y * widthLevel * model.components;\n var row2 = (heightLevel - y - 1) * widthLevel * model.components;\n invertedData[i].set(scaledData[i].slice(row2, row2 + widthLevel * model.components), row1);\n }\n } // Source texture data from the PBO.\n\n\n model.context.pixelStorei(model.context.UNPACK_ALIGNMENT, 1); // We get the 6 images\n\n for (var _i4 = 0; _i4 < 6; _i4++) {\n // For each mipmap level\n var j = 0;\n var w = model.width;\n var h = model.height;\n\n while (w >= 1 && h >= 1) {\n // In webgl 1, all levels need to be defined. So if the latest level size is\n // 8x8, we have to add 3 more null textures (4x4, 2x2, 1x1)\n // In webgl 2, the attribute maxLevel will be use.\n var tempData = null;\n\n if (j <= model.maxLevel) {\n tempData = invertedData[6 * j + _i4];\n }\n\n model.context.texImage2D(model.context.TEXTURE_CUBE_MAP_POSITIVE_X + _i4, j, model.internalFormat, w, h, 0, model.format, model.openGLDataType, tempData);\n j++;\n w /= 2;\n h /= 2;\n }\n } // generateMipmap must not be called here because we manually upload all levels\n // if it is called, all levels will be overwritten\n\n\n publicAPI.deactivate();\n return true;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.createDepthFromRaw = function (width, height, dataType, data) {\n // Now determine the texture parameters using the arguments.\n publicAPI.getOpenGLDataType(dataType);\n model.format = model.context.DEPTH_COMPONENT;\n\n if (model.openGLRenderWindow.getWebgl2()) {\n if (dataType === VtkDataTypes.FLOAT) {\n model.internalFormat = model.context.DEPTH_COMPONENT32F;\n } else {\n model.internalFormat = model.context.DEPTH_COMPONENT16;\n }\n } else {\n model.internalFormat = model.context.DEPTH_COMPONENT;\n }\n\n if (!model.internalFormat || !model.format || !model.openGLDataType) {\n vtkErrorMacro('Failed to determine texture parameters.');\n return false;\n }\n\n model.target = model.context.TEXTURE_2D;\n model.components = 1;\n model.width = width;\n model.height = height;\n model.depth = 1;\n model.numberOfDimensions = 2;\n model.openGLRenderWindow.activateTexture(publicAPI);\n publicAPI.createTexture();\n publicAPI.bind(); // Source texture data from the PBO.\n // model.context.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n\n model.context.pixelStorei(model.context.UNPACK_ALIGNMENT, 1);\n model.context.texImage2D(model.target, 0, model.internalFormat, model.width, model.height, 0, model.format, model.openGLDataType, data);\n\n if (model.generateMipmap) {\n model.context.generateMipmap(model.target);\n }\n\n publicAPI.deactivate();\n return true;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.create2DFromImage = function (image) {\n // Now determine the texture parameters using the arguments.\n publicAPI.getOpenGLDataType(VtkDataTypes.UNSIGNED_CHAR);\n publicAPI.getInternalFormat(VtkDataTypes.UNSIGNED_CHAR, 4);\n publicAPI.getFormat(VtkDataTypes.UNSIGNED_CHAR, 4);\n\n if (!model.internalFormat || !model.format || !model.openGLDataType) {\n vtkErrorMacro('Failed to determine texture parameters.');\n return false;\n }\n\n model.target = model.context.TEXTURE_2D;\n model.components = 4;\n model.width = image.width;\n model.height = image.height;\n model.depth = 1;\n model.numberOfDimensions = 2;\n model.openGLRenderWindow.activateTexture(publicAPI);\n publicAPI.createTexture();\n publicAPI.bind(); // Source texture data from the PBO.\n // model.context.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n\n model.context.pixelStorei(model.context.UNPACK_ALIGNMENT, 1); // Scale up the texture to the next highest power of two dimensions (if needed) and flip y.\n\n var needNearestPowerOfTwo = !vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"isPowerOfTwo\"](image.width) || !vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"isPowerOfTwo\"](image.height);\n var canvas = document.createElement('canvas');\n canvas.width = needNearestPowerOfTwo ? vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"nearestPowerOfTwo\"](image.width) : image.width;\n canvas.height = needNearestPowerOfTwo ? vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"nearestPowerOfTwo\"](image.height) : image.height;\n var ctx = canvas.getContext('2d');\n ctx.translate(0, canvas.height);\n ctx.scale(1, -1);\n ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height); // In Chrome 69 on Windows and Ubuntu, there is a bug that prevents some\n // canvases from working properly with webGL textures. By getting any\n // image data from the canvas, this works around the bug. See\n // https://bugs.chromium.org/p/chromium/issues/detail?id=896307\n\n if (navigator.userAgent.indexOf('Chrome/69') >= 0) {\n ctx.getImageData(0, 0, 1, 1);\n }\n\n var safeImage = canvas;\n model.context.texImage2D(model.target, 0, model.internalFormat, model.format, model.openGLDataType, safeImage);\n\n if (model.generateMipmap) {\n model.context.generateMipmap(model.target);\n }\n\n publicAPI.deactivate();\n return true;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.create3DFromRaw = function (width, height, depth, numComps, dataType, data) {\n // Now determine the texture parameters using the arguments.\n publicAPI.getOpenGLDataType(dataType);\n publicAPI.getInternalFormat(dataType, numComps);\n publicAPI.getFormat(dataType, numComps);\n\n if (!model.internalFormat || !model.format || !model.openGLDataType) {\n vtkErrorMacro('Failed to determine texture parameters.');\n return false;\n }\n\n model.target = model.context.TEXTURE_3D;\n model.components = numComps;\n model.width = width;\n model.height = height;\n model.depth = depth;\n model.numberOfDimensions = 3;\n model.openGLRenderWindow.activateTexture(publicAPI);\n publicAPI.createTexture();\n publicAPI.bind(); // Source texture data from the PBO.\n // model.context.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n // model.context.pixelStorei(model.context.UNPACK_ALIGNMENT, 1);\n\n model.context.texImage3D(model.target, 0, model.internalFormat, model.width, model.height, model.depth, 0, model.format, model.openGLDataType, data);\n\n if (model.generateMipmap) {\n model.context.generateMipmap(model.target);\n }\n\n publicAPI.deactivate();\n return true;\n };\n\n function computeScaleOffsets(numComps, numPixelsIn, data) {\n // compute min and max values per component\n var min = [];\n var max = [];\n\n for (var c = 0; c < numComps; ++c) {\n min[c] = data[c];\n max[c] = data[c];\n }\n\n var count = 0;\n\n for (var i = 0; i < numPixelsIn; ++i) {\n for (var _c = 0; _c < numComps; ++_c) {\n if (data[count] < min[_c]) {\n min[_c] = data[count];\n }\n\n if (data[count] > max[_c]) {\n max[_c] = data[count];\n }\n\n count++;\n }\n }\n\n var offset = [];\n var scale = [];\n\n for (var _c2 = 0; _c2 < numComps; ++_c2) {\n if (min[_c2] === max[_c2]) {\n max[_c2] = min[_c2] + 1.0;\n }\n\n offset[_c2] = min[_c2];\n scale[_c2] = max[_c2] - min[_c2];\n }\n\n return {\n scale: scale,\n offset: offset\n };\n } //----------------------------------------------------------------------------\n // This method simulates a 3D texture using 2D\n\n\n publicAPI.create3DFilterableFromRaw = function (width, height, depth, numComps, dataType, data) {\n var numPixelsIn = width * height * depth; // initialize offset/scale\n\n var offset = [];\n var scale = [];\n\n for (var c = 0; c < numComps; ++c) {\n offset[c] = 0.0;\n scale[c] = 1.0;\n } // store the information, we will need it later\n // offset and scale are the offset and scale required to get\n // the texture value back to data values ala\n // data = texture * scale + offset\n // and texture = (data - offset)/scale\n\n\n model.volumeInfo = {\n scale: scale,\n offset: offset,\n width: width,\n height: height,\n depth: depth\n }; // WebGL2 path, we have 3d textures etc\n\n if (model.openGLRenderWindow.getWebgl2()) {\n if (dataType === VtkDataTypes.FLOAT) {\n return publicAPI.create3DFromRaw(width, height, depth, numComps, dataType, data);\n }\n\n if (dataType === VtkDataTypes.UNSIGNED_CHAR) {\n for (var _c3 = 0; _c3 < numComps; ++_c3) {\n model.volumeInfo.scale[_c3] = 255.0;\n }\n\n return publicAPI.create3DFromRaw(width, height, depth, numComps, dataType, data);\n } // otherwise convert to float\n\n\n var _newArray2 = new Float32Array(numPixelsIn * numComps); // compute min and max values\n\n\n var _computeScaleOffsets = computeScaleOffsets(numComps, numPixelsIn, data),\n computedOffset = _computeScaleOffsets.offset,\n computedScale = _computeScaleOffsets.scale;\n\n model.volumeInfo.offset = computedOffset;\n model.volumeInfo.scale = computedScale;\n var count = 0;\n var scaleInverse = computedScale.map(function (s) {\n return 1 / s;\n });\n\n for (var i = 0; i < numPixelsIn; i++) {\n for (var nc = 0; nc < numComps; nc++) {\n _newArray2[count] = (data[count] - computedOffset[nc]) * scaleInverse[nc];\n count++;\n }\n }\n\n return publicAPI.create3DFromRaw(width, height, depth, numComps, VtkDataTypes.FLOAT, _newArray2);\n } // not webgl2, deal with webgl1, no 3d textures\n // and maybe no float textures\n // compute min and max values\n\n\n var res = computeScaleOffsets(numComps, numPixelsIn, data);\n\n var volCopyData = function volCopyData(outArray, outIdx, inValue, smin, smax) {\n outArray[outIdx] = inValue;\n };\n\n var dataTypeToUse = VtkDataTypes.UNSIGNED_CHAR; // unsigned char gets used as is\n\n if (dataType === VtkDataTypes.UNSIGNED_CHAR) {\n for (var _c4 = 0; _c4 < numComps; ++_c4) {\n res.offset[_c4] = 0.0;\n res.scale[_c4] = 255.0;\n }\n } else if (model.context.getExtension('OES_texture_float') && model.context.getExtension('OES_texture_float_linear')) {\n // use float textures scaled to 0.0 to 1.0\n dataTypeToUse = VtkDataTypes.FLOAT;\n\n volCopyData = function volCopyData(outArray, outIdx, inValue, soffset, sscale) {\n outArray[outIdx] = (inValue - soffset) / sscale;\n };\n } else {\n // worst case, scale data to uchar\n dataTypeToUse = VtkDataTypes.UNSIGNED_CHAR;\n\n volCopyData = function volCopyData(outArray, outIdx, inValue, soffset, sscale) {\n outArray[outIdx] = 255.0 * (inValue - soffset) / sscale;\n };\n } // Now determine the texture parameters using the arguments.\n\n\n publicAPI.getOpenGLDataType(dataTypeToUse);\n publicAPI.getInternalFormat(dataTypeToUse, numComps);\n publicAPI.getFormat(dataTypeToUse, numComps);\n\n if (!model.internalFormat || !model.format || !model.openGLDataType) {\n vtkErrorMacro('Failed to determine texture parameters.');\n return false;\n } // have to pack this 3D texture into pot 2D texture\n\n\n model.target = model.context.TEXTURE_2D;\n model.components = numComps;\n model.depth = 1;\n model.numberOfDimensions = 2; // MAX_TEXTURE_SIZE gives the max dimensions that can be supported by the GPU,\n // but it doesn't mean it will fit in memory. If we have to use a float data type\n // or 4 components, there are good chances that the texture size will blow up\n // and could not fit in the GPU memory. Use a smaller texture size in that case,\n // which will force a downsampling of the dataset.\n // That problem does not occur when using webGL2 since we can pack the data in\n // denser textures based on our data type.\n // TODO: try to fit in the biggest supported texture, catch the gl error if it\n // does not fix (OUT_OF_MEMORY), then attempt with smaller texture\n\n var maxTexDim = model.context.getParameter(model.context.MAX_TEXTURE_SIZE);\n\n if (maxTexDim > 4096 && (dataTypeToUse === VtkDataTypes.FLOAT || numComps >= 3)) {\n maxTexDim = 4096;\n } // compute estimate for XY subsample\n\n\n var xstride = 1;\n var ystride = 1;\n\n if (numPixelsIn > maxTexDim * maxTexDim) {\n xstride = Math.ceil(Math.sqrt(numPixelsIn / (maxTexDim * maxTexDim)));\n ystride = xstride;\n }\n\n var targetWidth = Math.sqrt(numPixelsIn) / xstride;\n targetWidth = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"nearestPowerOfTwo\"](targetWidth); // determine X reps\n\n var xreps = Math.floor(targetWidth * xstride / width);\n var yreps = Math.ceil(depth / xreps);\n var targetHeight = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"nearestPowerOfTwo\"](height * yreps / ystride);\n model.width = targetWidth;\n model.height = targetHeight;\n model.openGLRenderWindow.activateTexture(publicAPI);\n publicAPI.createTexture();\n publicAPI.bind(); // store the information, we will need it later\n\n model.volumeInfo.xreps = xreps;\n model.volumeInfo.yreps = yreps;\n model.volumeInfo.xstride = xstride;\n model.volumeInfo.ystride = ystride;\n model.volumeInfo.offset = res.offset;\n model.volumeInfo.scale = res.scale; // OK stuff the data into the 2d TEXTURE\n // first allocate the new texture\n\n var newArray;\n var pixCount = targetWidth * targetHeight * numComps;\n\n if (dataTypeToUse === VtkDataTypes.FLOAT) {\n newArray = new Float32Array(pixCount);\n } else {\n newArray = new Uint8Array(pixCount);\n } // then stuff the data into it, nothing fancy right now\n // for stride\n\n\n var outIdx = 0;\n var tileWidth = Math.floor(width / xstride);\n var tileHeight = Math.floor(height / ystride);\n\n for (var yRep = 0; yRep < yreps; yRep++) {\n var xrepsThisRow = Math.min(xreps, depth - yRep * xreps);\n var outXContIncr = numComps * (model.width - xrepsThisRow * Math.floor(width / xstride));\n\n for (var tileY = 0; tileY < tileHeight; tileY++) {\n for (var xRep = 0; xRep < xrepsThisRow; xRep++) {\n var inOffset = numComps * ((yRep * xreps + xRep) * width * height + ystride * tileY * width);\n\n for (var tileX = 0; tileX < tileWidth; tileX++) {\n // copy value\n for (var _nc = 0; _nc < numComps; _nc++) {\n volCopyData(newArray, outIdx, data[inOffset + xstride * tileX * numComps + _nc], res.offset[_nc], res.scale[_nc]);\n outIdx++;\n }\n }\n }\n\n outIdx += outXContIncr;\n }\n } // Source texture data from the PBO.\n // model.context.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n\n\n model.context.pixelStorei(model.context.UNPACK_ALIGNMENT, 1);\n model.context.texImage2D(model.target, 0, model.internalFormat, model.width, model.height, 0, model.format, model.openGLDataType, newArray);\n publicAPI.deactivate();\n return true;\n };\n\n publicAPI.setOpenGLRenderWindow = function (rw) {\n if (model.openGLRenderWindow === rw) {\n return;\n }\n\n publicAPI.releaseGraphicsResources();\n model.openGLRenderWindow = rw;\n model.context = null;\n\n if (rw) {\n model.context = model.openGLRenderWindow.getContext();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getMaximumTextureSize = function (ctx) {\n if (ctx && ctx.isCurrent()) {\n return ctx.getIntegerv(ctx.MAX_TEXTURE_SIZE);\n }\n\n return -1;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n openGLRenderWindow: null,\n context: null,\n handle: 0,\n sendParametersTime: null,\n textureBuildTime: null,\n numberOfDimensions: 0,\n target: 0,\n format: 0,\n openGLDataType: 0,\n components: 0,\n width: 0,\n height: 0,\n depth: 0,\n autoParameters: true,\n wrapS: Wrap.CLAMP_TO_EDGE,\n wrapT: Wrap.CLAMP_TO_EDGE,\n wrapR: Wrap.CLAMP_TO_EDGE,\n minificationFilter: Filter.NEAREST,\n magnificationFilter: Filter.NEAREST,\n minLOD: -1000.0,\n maxLOD: 1000.0,\n baseLevel: 0,\n maxLevel: 1000,\n generateMipmap: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_4__[\"default\"].extend(publicAPI, model, initialValues);\n model.sendParametersTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.sendParametersTime, {\n mtime: 0\n });\n model.textureBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.textureBuildTime, {\n mtime: 0\n }); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"set\"](publicAPI, model, ['format', 'openGLDataType']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['keyMatrixTime', 'minificationFilter', 'magnificationFilter', 'wrapS', 'wrapT', 'wrapR', 'generateMipmap']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"get\"](publicAPI, model, ['width', 'height', 'volumeInfo', 'components', 'handle', 'target']); // Object methods\n\n vtkOpenGLTexture(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkOpenGLTexture'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"])); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_5__[\"registerOverride\"])('vtkTexture', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/TextureUnitManager/index.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/TextureUnitManager/index.js ***! - \**********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkOpenGLTextureUnitManager methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLTextureUnitManager(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLTextureUnitManager'); // ----------------------------------------------------------------------------\n // Description:\n // Delete the allocation table and check if it is not called before\n // all the texture units have been released.\n\n publicAPI.deleteTable = function () {\n for (var i = 0; i < model.numberOfTextureUnits; ++i) {\n if (model.textureUnits[i] === true) {\n vtkErrorMacro('some texture units were not properly released');\n }\n }\n\n model.textureUnits = [];\n model.numberOfTextureUnits = 0;\n }; // ----------------------------------------------------------------------------\n\n\n publicAPI.setContext = function (ctx) {\n if (model.context !== ctx) {\n if (model.context !== 0) {\n publicAPI.deleteTable();\n }\n\n model.context = ctx;\n\n if (model.context) {\n model.numberOfTextureUnits = ctx.getParameter(ctx.MAX_TEXTURE_IMAGE_UNITS);\n\n for (var i = 0; i < model.numberOfTextureUnits; ++i) {\n model.textureUnits[i] = false;\n }\n }\n\n publicAPI.modified();\n }\n }; // ----------------------------------------------------------------------------\n // Description:\n // Reserve a texture unit. It returns its number.\n // It returns -1 if the allocation failed (because there are no more\n // texture units left).\n // \\post valid_result: result==-1 || result>=0 && resultGetNumberOfTextureUnits())\n // \\post allocated: result==-1 || this->IsAllocated(result)\n\n\n publicAPI.allocate = function () {\n for (var i = 0; i < model.numberOfTextureUnits; i++) {\n if (!publicAPI.isAllocated(i)) {\n model.textureUnits[i] = true;\n return i;\n }\n }\n\n return -1;\n };\n\n publicAPI.allocateUnit = function (unit) {\n if (publicAPI.isAllocated(unit)) {\n return -1;\n }\n\n model.textureUnits[unit] = true;\n return unit;\n }; // ----------------------------------------------------------------------------\n // Description:\n // Tell if texture unit `textureUnitId' is already allocated.\n // \\pre valid_id_range : textureUnitId>=0 && textureUnitIdGetNumberOfTextureUnits()\n\n\n publicAPI.isAllocated = function (textureUnitId) {\n return model.textureUnits[textureUnitId];\n }; // ----------------------------------------------------------------------------\n // Description:\n // Release a texture unit.\n // \\pre valid_id: textureUnitId>=0 && textureUnitIdGetNumberOfTextureUnits()\n // \\pre allocated_id: this->IsAllocated(textureUnitId)\n\n\n publicAPI.free = function (val) {\n model.textureUnits[val] = false;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n numberOfTextureUnits: 0,\n textureUnits: 0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.textureUnits = []; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['numberOfTextureUnits']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['context']); // Object methods\n\n vtkOpenGLTextureUnitManager(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkOpenGLTextureUnitManager'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/TextureUnitManager/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/VertexArrayObject/index.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/VertexArrayObject/index.js ***! - \*********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants.js\");\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLVertexArrayObject methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLVertexArrayObject(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLVertexArrayObject'); // Public API methods\n\n publicAPI.exposedMethod = function () {// This is a publicly exposed method of this object\n };\n\n publicAPI.initialize = function () {\n model.instancingExtension = null;\n\n if (!model.openGLRenderWindow.getWebgl2()) {\n model.instancingExtension = model.context.getExtension('ANGLE_instanced_arrays');\n }\n\n if (!model.forceEmulation && model.openGLRenderWindow && model.openGLRenderWindow.getWebgl2()) {\n model.extension = null;\n model.supported = true;\n model.handleVAO = model.context.createVertexArray();\n } else {\n model.extension = model.context.getExtension('OES_vertex_array_object'); // Start setting up VAO\n\n if (!model.forceEmulation && model.extension) {\n model.supported = true;\n model.handleVAO = model.extension.createVertexArrayOES();\n } else {\n model.supported = false;\n }\n }\n };\n\n publicAPI.isReady = function () {\n return (// We either probed and allocated a VAO, or are falling back as the current\n // hardware does not support VAOs.\n model.handleVAO !== 0 || model.supported === false\n );\n };\n\n publicAPI.bind = function () {\n // Either simply bind the VAO, or emulate behavior by binding all attributes.\n if (!publicAPI.isReady()) {\n publicAPI.initialize();\n }\n\n if (publicAPI.isReady() && model.supported) {\n if (model.extension) {\n model.extension.bindVertexArrayOES(model.handleVAO);\n } else {\n model.context.bindVertexArray(model.handleVAO);\n }\n } else if (publicAPI.isReady()) {\n var gl = model.context;\n\n for (var ibuff = 0; ibuff < model.buffers.length; ++ibuff) {\n var buff = model.buffers[ibuff];\n model.context.bindBuffer(gl.ARRAY_BUFFER, buff.buffer);\n\n for (var iatt = 0; iatt < buff.attributes.length; ++iatt) {\n var attrIt = buff.attributes[iatt];\n var matrixCount = attrIt.isMatrix ? attrIt.size : 1;\n\n for (var i = 0; i < matrixCount; ++i) {\n gl.enableVertexAttribArray(attrIt.index + i);\n gl.vertexAttribPointer(attrIt.index + i, attrIt.size, attrIt.type, attrIt.normalize, attrIt.stride, attrIt.offset + attrIt.stride * i / attrIt.size);\n\n if (attrIt.divisor > 0) {\n if (model.instancingExtension) {\n model.instancingExtension.vertexAttribDivisorANGLE(attrIt.index + i, 1);\n } else {\n gl.vertexAttribDivisor(attrIt.index + i, 1);\n }\n }\n }\n }\n }\n }\n };\n\n publicAPI.release = function () {\n // Either simply release the VAO, or emulate behavior by releasing all attributes.\n if (publicAPI.isReady() && model.supported) {\n if (model.extension) {\n model.extension.bindVertexArrayOES(null);\n } else {\n model.context.bindVertexArray(null);\n }\n } else if (publicAPI.isReady()) {\n var gl = model.context;\n\n for (var ibuff = 0; ibuff < model.buffers.length; ++ibuff) {\n var buff = model.buffers[ibuff];\n model.context.bindBuffer(gl.ARRAY_BUFFER, buff.buffer);\n\n for (var iatt = 0; iatt < buff.attributes.length; ++iatt) {\n var attrIt = buff.attributes[iatt];\n var matrixCount = attrIt.isMatrix ? attrIt.size : 1;\n\n for (var i = 0; i < matrixCount; ++i) {\n gl.enableVertexAttribArray(attrIt.index + i);\n gl.vertexAttribPointer(attrIt.index + i, attrIt.size, attrIt.type, attrIt.normalize, attrIt.stride, attrIt.offset + attrIt.stride * i / attrIt.size);\n\n if (attrIt.divisor > 0) {\n if (model.instancingExtension) {\n model.instancingExtension.vertexAttribDivisorANGLE(attrIt.index + i, 0);\n } else {\n gl.vertexAttribDivisor(attrIt.index + i, 0);\n }\n }\n\n gl.disableVertexAttribArray(attrIt.index + i);\n }\n }\n }\n }\n };\n\n publicAPI.shaderProgramChanged = function () {\n publicAPI.release();\n\n if (model.handleVAO) {\n if (model.extension) {\n model.extension.deleteVertexArrayOES(model.handleVAO);\n } else {\n model.context.deleteVertexArray(model.handleVAO);\n }\n }\n\n model.handleVAO = 0;\n model.handleProgram = 0;\n };\n\n publicAPI.releaseGraphicsResources = function () {\n publicAPI.shaderProgramChanged();\n\n if (model.handleVAO) {\n if (model.extension) {\n model.extension.deleteVertexArrayOES(model.handleVAO);\n } else {\n model.context.deleteVertexArray(model.handleVAO);\n }\n }\n\n model.handleVAO = 0;\n model.supported = true;\n model.handleProgram = 0;\n };\n\n publicAPI.addAttributeArray = function (program, buffer, name, offset, stride, elementType, elementTupleSize, normalize) {\n return publicAPI.addAttributeArrayWithDivisor(program, buffer, name, offset, stride, elementType, elementTupleSize, normalize, 0, false);\n };\n\n publicAPI.addAttributeArrayWithDivisor = function (program, buffer, name, offset, stride, elementType, elementTupleSize, normalize, divisor, isMatrix) {\n if (!program) {\n return false;\n } // Check the program is bound, and the buffer is valid.\n\n\n if (!program.isBound() || buffer.getHandle() === 0 || buffer.getType() !== vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_1__[\"ObjectType\"].ARRAY_BUFFER) {\n return false;\n } // Perform initialization if necessary, ensure program matches VAOs.\n\n\n if (model.handleProgram === 0) {\n model.handleProgram = program.getHandle();\n }\n\n if (!publicAPI.isReady()) {\n publicAPI.initialize();\n }\n\n if (!publicAPI.isReady() || model.handleProgram !== program.getHandle()) {\n return false;\n }\n\n var gl = model.context;\n var attribs = {};\n attribs.name = name;\n attribs.index = gl.getAttribLocation(model.handleProgram, name);\n attribs.offset = offset;\n attribs.stride = stride;\n attribs.type = elementType;\n attribs.size = elementTupleSize;\n attribs.normalize = normalize;\n attribs.isMatrix = isMatrix;\n attribs.divisor = divisor;\n\n if (attribs.Index === -1) {\n return false;\n } // Always make the call as even the first use wants the attrib pointer setting\n // up when we are emulating.\n\n\n buffer.bind();\n gl.enableVertexAttribArray(attribs.index);\n gl.vertexAttribPointer(attribs.index, attribs.size, attribs.type, attribs.normalize, attribs.stride, attribs.offset);\n\n if (divisor > 0) {\n if (model.instancingExtension) {\n model.instancingExtension.vertexAttribDivisorANGLE(attribs.index, 1);\n } else {\n gl.vertexAttribDivisor(attribs.index, 1);\n }\n }\n\n attribs.buffer = buffer.getHandle(); // If vertex array objects are not supported then build up our list.\n\n if (!model.supported) {\n // find the buffer\n var buffFound = false;\n\n for (var ibuff = 0; ibuff < model.buffers.length; ++ibuff) {\n var buff = model.buffers[ibuff];\n\n if (buff.buffer === attribs.buffer) {\n buffFound = true;\n var found = false;\n\n for (var iatt = 0; iatt < buff.attributes.length; ++iatt) {\n var attrIt = buff.attributes[iatt];\n\n if (attrIt.name === name) {\n found = true;\n buff.attributes[iatt] = attribs;\n }\n }\n\n if (!found) {\n buff.attributes.push(attribs);\n }\n }\n }\n\n if (!buffFound) {\n model.buffers.push({\n buffer: attribs.buffer,\n attributes: [attribs]\n });\n }\n }\n\n return true;\n };\n\n publicAPI.addAttributeMatrixWithDivisor = function (program, buffer, name, offset, stride, elementType, elementTupleSize, normalize, divisor) {\n // bind the first row of values\n var result = publicAPI.addAttributeArrayWithDivisor(program, buffer, name, offset, stride, elementType, elementTupleSize, normalize, divisor, true);\n\n if (!result) {\n return result;\n }\n\n var gl = model.context;\n var index = gl.getAttribLocation(model.handleProgram, name);\n\n for (var i = 1; i < elementTupleSize; i++) {\n gl.enableVertexAttribArray(index + i);\n gl.vertexAttribPointer(index + i, elementTupleSize, elementType, normalize, stride, offset + stride * i / elementTupleSize);\n\n if (divisor > 0) {\n if (model.instancingExtension) {\n model.instancingExtension.vertexAttribDivisorANGLE(index + i, 1);\n } else {\n gl.vertexAttribDivisor(index + i, 1);\n }\n }\n }\n\n return true;\n };\n\n publicAPI.removeAttributeArray = function (name) {\n if (!publicAPI.isReady() || model.handleProgram === 0) {\n return false;\n } // If we don't have real VAOs find the entry and remove it too.\n\n\n if (!model.supported) {\n for (var ibuff = 0; ibuff < model.buffers.length; ++ibuff) {\n var buff = model.buffers[ibuff];\n\n for (var iatt = 0; iatt < buff.attributes.length; ++iatt) {\n var attrIt = buff.attributes[iatt];\n\n if (attrIt.name === name) {\n buff.attributes.splice(iatt, 1);\n\n if (!buff.attributes.length) {\n model.buffers.splice(ibuff, 1);\n }\n\n return true;\n }\n }\n }\n }\n\n return true;\n };\n\n publicAPI.setOpenGLRenderWindow = function (rw) {\n if (model.openGLRenderWindow === rw) {\n return;\n }\n\n publicAPI.releaseGraphicsResources();\n model.openGLRenderWindow = rw;\n model.context = null;\n\n if (rw) {\n model.context = model.openGLRenderWindow.getContext();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n forceEmulation: false,\n handleVAO: 0,\n handleProgram: 0,\n supported: true,\n buffers: null,\n context: null,\n openGLRenderWindow: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Internal objects initialization\n\n model.buffers = []; // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Create get-only macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['supported']); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['forceEmulation']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkOpenGLVertexArrayObject(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkOpenGLVertexArrayObject'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/VertexArrayObject/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js ***! - \*******************************************************************************/ -/*! exports provided: registerOverride, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerOverride\", function() { return registerOverride; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory/index.js\");\n\n\nvar CLASS_MAPPING = Object.create(null);\nfunction registerOverride(className, fn) {\n CLASS_MAPPING[className] = fn;\n} // ----------------------------------------------------------------------------\n// vtkOpenGLViewNodeFactory methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLViewNodeFactory(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLViewNodeFactory');\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Static class mapping shared across instances\n\n model.overrides = CLASS_MAPPING; // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object methods\n\n vtkOpenGLViewNodeFactory(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkOpenGLViewNodeFactory'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Volume/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Volume/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLVolume methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLVolume(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLVolume'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (prepass) {\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getMapper());\n publicAPI.removeUnusedNodes();\n }\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n renderPass.incrementVolumeCount();\n }\n };\n\n publicAPI.traverseVolumePass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.children[0].traverse(renderPass);\n publicAPI.apply(renderPass, false);\n }; // Renders myself\n\n\n publicAPI.volumePass = function (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (prepass) {\n model.context = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow').getContext();\n model.context.depthMask(false);\n } else {\n model.context.depthMask(true);\n }\n };\n\n publicAPI.getKeyMatrices = function () {\n // has the actor changed?\n if (model.renderable.getMTime() > model.keyMatrixTime.getMTime()) {\n model.renderable.computeMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.MCWCMatrix, model.renderable.getMatrix());\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.MCWCMatrix, model.MCWCMatrix);\n\n if (model.renderable.getIsIdentity()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(model.normalMatrix);\n } else {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromMat4(model.normalMatrix, model.MCWCMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].invert(model.normalMatrix, model.normalMatrix);\n }\n\n model.keyMatrixTime.modified();\n }\n\n return {\n mcwc: model.MCWCMatrix,\n normalMatrix: model.normalMatrix\n };\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {// context: null,\n // keyMatrixTime: null,\n // normalMatrix: null,\n // MCWCMatrix: null,\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatrixTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.keyMatrixTime, {\n mtime: 0\n }); // always set by getter\n\n model.normalMatrix = new Float64Array(9);\n model.MCWCMatrix = new Float64Array(16); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['context']); // Object methods\n\n vtkOpenGLVolume(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkOpenGLVolume'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkVolume', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Volume/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/VolumeMapper/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/VolumeMapper/index.js ***! - \****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Helper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Framebuffer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Framebuffer */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Framebuffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_VertexArrayObject__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/VertexArrayObject */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/VertexArrayObject/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/VolumeProperty/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_VolumeMapper_Constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/VolumeMapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeVS_glsl__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeVS_glsl__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeVS_glsl__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeFS_glsl__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeFS.glsl */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeFS.glsl\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeFS_glsl__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeFS_glsl__WEBPACK_IMPORTED_MODULE_16__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n // import vtkBoundingBox from 'vtk.js/Sources/Common/DataModel/BoundingBox';\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkWarningMacro\"],\n vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"]; // TODO: Do we want this in some shared utility? Shouldwe just use lodash.isEqual\n\nfunction arrayEquals(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n} // ----------------------------------------------------------------------------\n// vtkOpenGLVolumeMapper methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkOpenGLVolumeMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLVolumeMapper');\n\n publicAPI.buildPass = function () {\n model.zBufferTexture = null;\n }; // ohh someone is doing a zbuffer pass, use that for\n // intermixed volume rendering\n\n\n publicAPI.opaqueZBufferPass = function (prepass, renderPass) {\n if (prepass) {\n var zbt = renderPass.getZBufferTexture();\n\n if (zbt !== model.zBufferTexture) {\n model.zBufferTexture = zbt;\n }\n }\n }; // Renders myself\n\n\n publicAPI.volumePass = function (prepass, renderPass) {\n if (prepass) {\n model.openGLRenderWindow = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow');\n model.context = model.openGLRenderWindow.getContext();\n model.tris.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.jitterTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.framebuffer.setOpenGLRenderWindow(model.openGLRenderWindow); // Per Component?\n\n model.scalarTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.colorTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.opacityTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.openGLVolume = publicAPI.getFirstAncestorOfType('vtkOpenGLVolume');\n var actor = model.openGLVolume.getRenderable();\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n var ren = model.openGLRenderer.getRenderable();\n model.openGLCamera = model.openGLRenderer.getViewNodeFor(ren.getActiveCamera());\n publicAPI.renderPiece(ren, actor);\n }\n };\n\n publicAPI.buildShaders = function (shaders, ren, actor) {\n publicAPI.getShaderTemplate(shaders, ren, actor);\n publicAPI.replaceShaderValues(shaders, ren, actor);\n };\n\n publicAPI.getShaderTemplate = function (shaders, ren, actor) {\n shaders.Vertex = vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeVS_glsl__WEBPACK_IMPORTED_MODULE_15___default.a;\n shaders.Fragment = vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeFS_glsl__WEBPACK_IMPORTED_MODULE_16___default.a;\n shaders.Geometry = '';\n };\n\n publicAPI.replaceShaderValues = function (shaders, ren, actor) {\n var FSSource = shaders.Fragment; // define some values in the shader\n\n var iType = actor.getProperty().getInterpolationType();\n\n if (iType === vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_13__[\"InterpolationType\"].LINEAR) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::TrilinearOn', '#define vtkTrilinearOn').result;\n }\n\n var vtkImageLabelOutline = actor.getProperty().getUseLabelOutline();\n\n if (vtkImageLabelOutline === true) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ImageLabelOutlineOn', '#define vtkImageLabelOutlineOn').result;\n }\n\n var numComp = model.scalarTexture.getComponents();\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::NumComponents', \"#define vtkNumComponents \".concat(numComp)).result;\n var iComps = actor.getProperty().getIndependentComponents();\n\n if (iComps) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::IndependentComponentsOn', '#define vtkIndependentComponentsOn').result; // Define any proportional components\n\n var proportionalComponents = [];\n\n for (var nc = 0; nc < numComp; nc++) {\n if (actor.getProperty().getOpacityMode(nc) === vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_13__[\"OpacityMode\"].PROPORTIONAL) {\n proportionalComponents.push(\"#define vtkComponent\".concat(nc, \"Proportional\"));\n }\n }\n\n if (proportionalComponents.length > 0) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::vtkProportionalComponents', proportionalComponents.join('\\n')).result;\n }\n } // WebGL only supports loops over constants\n // and does not support while loops so we\n // have to hard code how many steps/samples to take\n // We do a break so most systems will gracefully\n // early terminate, but it is always possible\n // a system will execute every step regardless\n\n\n var ext = model.currentInput.getExtent();\n var spc = model.currentInput.getSpacing();\n var vsize = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(vsize, (ext[1] - ext[0]) * spc[0], (ext[3] - ext[2]) * spc[1], (ext[5] - ext[4]) * spc[2]);\n var maxSamples = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].length(vsize) / model.renderable.getSampleDistance();\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::MaximumSamplesValue', \"\".concat(Math.ceil(maxSamples))).result; // set light complexity\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::LightComplexity', \"#define vtkLightComplexity \".concat(model.lastLightComplexity)).result; // if using gradient opacity define that\n\n model.gopacity = actor.getProperty().getUseGradientOpacity(0);\n\n for (var _nc = 1; iComps && !model.gopacity && _nc < numComp; ++_nc) {\n if (actor.getProperty().getUseGradientOpacity(_nc)) {\n model.gopacity = true;\n }\n }\n\n if (model.gopacity) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::GradientOpacityOn', '#define vtkGradientOpacityOn').result;\n } // if we have a ztexture then declare it and use it\n\n\n if (model.zBufferTexture !== null) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ZBuffer::Dec', ['uniform sampler2D zBufferTexture;', 'uniform float vpWidth;', 'uniform float vpHeight;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ZBuffer::Impl', ['vec4 depthVec = texture2D(zBufferTexture, vec2(gl_FragCoord.x / vpWidth, gl_FragCoord.y/vpHeight));', 'float zdepth = (depthVec.r*256.0 + depthVec.g)/257.0;', 'zdepth = zdepth * 2.0 - 1.0;', 'zdepth = -2.0 * camFar * camNear / (zdepth*(camFar-camNear)-(camFar+camNear)) - camNear;', 'zdepth = -zdepth/rayDir.z;', 'dists.y = min(zdepth,dists.y);']).result;\n } // Set the BlendMode approach\n\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::BlendMode', \"\".concat(model.renderable.getBlendMode())).result;\n var averageIPScalarRange = model.renderable.getAverageIPScalarRange(); // TODO: Adding the .0 at the end feels hacky\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::AverageIPScalarRangeMin', \"\".concat(averageIPScalarRange[0], \".0\")).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::AverageIPScalarRangeMax', \"\".concat(averageIPScalarRange[1], \".0\")).result;\n shaders.Fragment = FSSource;\n publicAPI.replaceShaderLight(shaders, ren, actor);\n publicAPI.replaceShaderClippingPlane(shaders, ren, actor);\n };\n\n publicAPI.replaceShaderLight = function (shaders, ren, actor) {\n var FSSource = shaders.Fragment; // check for shadow maps\n\n var shadowFactor = '';\n\n switch (model.lastLightComplexity) {\n default:\n case 0:\n // no lighting, tcolor is fine as is\n break;\n\n case 1: // headlight\n\n case 2: // light kit\n\n case 3:\n {\n // positional not implemented fallback to directional\n var lightNum = 0;\n ren.getLights().forEach(function (light) {\n var status = light.getSwitch();\n\n if (status > 0) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::Light::Dec', [// intensity weighted color\n \"uniform vec3 lightColor\".concat(lightNum, \";\"), \"uniform vec3 lightDirectionVC\".concat(lightNum, \"; // normalized\"), \"uniform vec3 lightHalfAngleVC\".concat(lightNum, \"; // normalized\"), '//VTK::Light::Dec'], false).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::Light::Impl', [// ` float df = max(0.0, dot(normal.rgb, -lightDirectionVC${lightNum}));`,\n \" float df = abs(dot(normal.rgb, -lightDirectionVC\".concat(lightNum, \"));\"), \" diffuse += ((df\".concat(shadowFactor, \") * lightColor\").concat(lightNum, \");\"), // ' if (df > 0.0)',\n // ' {',\n // ` float sf = pow( max(0.0, dot(lightHalfAngleWC${lightNum},normal.rgb)), specularPower);`,\n \" float sf = pow( abs(dot(lightHalfAngleVC\".concat(lightNum, \",normal.rgb)), vSpecularPower);\"), \" specular += ((sf\".concat(shadowFactor, \") * lightColor\").concat(lightNum, \");\"), // ' }',\n ' //VTK::Light::Impl'], false).result;\n lightNum++;\n }\n });\n }\n }\n\n shaders.Fragment = FSSource;\n };\n\n publicAPI.replaceShaderClippingPlane = function (shaders, ren, actor) {\n var FSSource = shaders.Fragment;\n\n if (model.renderable.getClippingPlanes().length > 0) {\n var clipPlaneSize = model.renderable.getClippingPlanes().length;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ClipPlane::Dec', [\"uniform vec3 vClipPlaneNormals[6];\", \"uniform float vClipPlaneDistances[6];\", '//VTK::ClipPlane::Dec'], false).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ClipPlane::Impl', [\"for(int i = 0; i < \".concat(clipPlaneSize, \"; i++) {\"), ' float rayDirRatio = dot(rayDir, vClipPlaneNormals[i]);', ' float equationResult = dot(vertexVCVSOutput, vClipPlaneNormals[i]) + vClipPlaneDistances[i];', ' if (rayDirRatio == 0.0)', ' {', ' if (equationResult < 0.0) dists.x = dists.y;', ' continue;', ' }', ' float result = -1.0 * equationResult / rayDirRatio;', ' if (rayDirRatio < 0.0) dists.y = min(dists.y, result);', ' else dists.x = max(dists.x, result);', '}', '//VTK::ClipPlane::Impl'], false).result;\n }\n\n shaders.Fragment = FSSource;\n };\n\n publicAPI.getNeedToRebuildShaders = function (cellBO, ren, actor) {\n // do we need lighting?\n var lightComplexity = 0;\n\n if (actor.getProperty().getShade() && model.renderable.getBlendMode() === vtk_js_Sources_Rendering_Core_VolumeMapper_Constants__WEBPACK_IMPORTED_MODULE_14__[\"BlendMode\"].COMPOSITE_BLEND) {\n // consider the lighting complexity to determine which case applies\n // simple headlight, Light Kit, the whole feature set of VTK\n lightComplexity = 0;\n model.numberOfLights = 0;\n ren.getLights().forEach(function (light) {\n var status = light.getSwitch();\n\n if (status > 0) {\n model.numberOfLights++;\n\n if (lightComplexity === 0) {\n lightComplexity = 1;\n }\n }\n\n if (lightComplexity === 1 && (model.numberOfLights > 1 || light.getIntensity() !== 1.0 || !light.lightTypeIsHeadLight())) {\n lightComplexity = 2;\n }\n\n if (lightComplexity < 3 && light.getPositional()) {\n lightComplexity = 3;\n }\n });\n }\n\n var needRebuild = false;\n\n if (model.lastLightComplexity !== lightComplexity) {\n model.lastLightComplexity = lightComplexity;\n needRebuild = true;\n }\n\n var numComp = model.scalarTexture.getComponents();\n var iComps = actor.getProperty().getIndependentComponents();\n var usesProportionalComponents = false;\n var proportionalComponents = [];\n\n if (iComps) {\n // Define any proportional components\n for (var nc = 0; nc < numComp; nc++) {\n proportionalComponents.push(actor.getProperty().getOpacityMode(nc));\n }\n\n if (proportionalComponents.length > 0) {\n usesProportionalComponents = true;\n }\n }\n\n var ext = model.currentInput.getExtent();\n var spc = model.currentInput.getSpacing();\n var vsize = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(vsize, (ext[1] - ext[0]) * spc[0], (ext[3] - ext[2]) * spc[1], (ext[5] - ext[4]) * spc[2]);\n var maxSamples = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].length(vsize) / model.renderable.getSampleDistance();\n var state = {\n interpolationType: actor.getProperty().getInterpolationType(),\n useLabelOutline: actor.getProperty().getUseLabelOutline(),\n numComp: numComp,\n usesProportionalComponents: usesProportionalComponents,\n iComps: iComps,\n maxSamples: maxSamples,\n useGradientOpacity: actor.getProperty().getUseGradientOpacity(0),\n blendMode: model.renderable.getBlendMode(),\n averageIPScalarMode: model.renderable.getAverageIPScalarRange(),\n proportionalComponents: proportionalComponents\n }; // We only need to rebuild the shader if one of these variables has changed,\n // since they are used in the shader template replacement step.\n\n if (!model.previousState || model.previousState.interpolationType !== state.interpolationType || model.previousState.useLabelOutline !== state.useLabelOutline || model.previousState.numComp !== state.numComp || model.previousState.usesProportionalComponents !== state.usesProportionalComponents || model.previousState.iComps !== state.iComps || model.previousState.maxSamples !== state.maxSamples || model.previousState.useGradientOpacity !== state.useGradientOpacity || model.previousState.blendMode !== state.blendMode || !arrayEquals(model.previousState.averageIPScalarMode, state.averageIPScalarMode) || !arrayEquals(model.previousState.proportionalComponents, state.proportionalComponents)) {\n model.previousState = _objectSpread({}, state);\n return true;\n } // has something changed that would require us to recreate the shader?\n\n\n if (cellBO.getProgram() === 0 || needRebuild || model.lastHaveSeenDepthRequest !== model.haveSeenDepthRequest || !!model.lastZBufferTexture !== !!model.zBufferTexture || cellBO.getShaderSourceTime().getMTime() < publicAPI.getMTime() || cellBO.getShaderSourceTime().getMTime() < model.renderable.getMTime()) {\n model.lastZBufferTexture = model.zBufferTexture;\n return true;\n }\n\n return false;\n };\n\n publicAPI.updateShaders = function (cellBO, ren, actor) {\n model.lastBoundBO = cellBO; // has something changed that would require us to recreate the shader?\n\n if (publicAPI.getNeedToRebuildShaders(cellBO, ren, actor)) {\n var shaders = {\n Vertex: null,\n Fragment: null,\n Geometry: null\n };\n publicAPI.buildShaders(shaders, ren, actor); // compile and bind the program if needed\n\n var newShader = model.openGLRenderWindow.getShaderCache().readyShaderProgramArray(shaders.Vertex, shaders.Fragment, shaders.Geometry); // if the shader changed reinitialize the VAO\n\n if (newShader !== cellBO.getProgram()) {\n cellBO.setProgram(newShader); // reset the VAO as the shader has changed\n\n cellBO.getVAO().releaseGraphicsResources();\n }\n\n cellBO.getShaderSourceTime().modified();\n } else {\n model.openGLRenderWindow.getShaderCache().readyShaderProgram(cellBO.getProgram());\n }\n\n cellBO.getVAO().bind();\n publicAPI.setMapperShaderParameters(cellBO, ren, actor);\n publicAPI.setCameraShaderParameters(cellBO, ren, actor);\n publicAPI.setPropertyShaderParameters(cellBO, ren, actor);\n publicAPI.getClippingPlaneShaderParameters(cellBO, ren, actor);\n };\n\n publicAPI.setMapperShaderParameters = function (cellBO, ren, actor) {\n // Now to update the VAO too, if necessary.\n var program = cellBO.getProgram();\n\n if (cellBO.getCABO().getElementCount() && (model.VBOBuildTime.getMTime() > cellBO.getAttributeUpdateTime().getMTime() || cellBO.getShaderSourceTime().getMTime() > cellBO.getAttributeUpdateTime().getMTime())) {\n if (program.isAttributeUsed('vertexDC')) {\n if (!cellBO.getVAO().addAttributeArray(program, cellBO.getCABO(), 'vertexDC', cellBO.getCABO().getVertexOffset(), cellBO.getCABO().getStride(), model.context.FLOAT, 3, model.context.FALSE)) {\n vtkErrorMacro('Error setting vertexDC in shader VAO.');\n }\n }\n\n cellBO.getAttributeUpdateTime().modified();\n }\n\n program.setUniformi('texture1', model.scalarTexture.getTextureUnit());\n program.setUniformf('sampleDistance', model.renderable.getSampleDistance()); // if we have a zbuffer texture then set it\n\n if (model.zBufferTexture !== null) {\n program.setUniformi('zBufferTexture', model.zBufferTexture.getTextureUnit());\n var size = publicAPI.getRenderTargetSize();\n program.setUniformf('vpWidth', size[0]);\n program.setUniformf('vpHeight', size[1]);\n }\n };\n\n publicAPI.setCameraShaderParameters = function (cellBO, ren, actor) {\n // // [WMVP]C == {world, model, view, projection} coordinates\n // // E.g., WCPC == world to projection coordinate transformation\n var keyMats = model.openGLCamera.getKeyMatrices(ren);\n var actMats = model.openGLVolume.getKeyMatrices();\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].multiply(model.modelToView, keyMats.wcvc, actMats.mcwc);\n var program = cellBO.getProgram();\n var cam = model.openGLCamera.getRenderable();\n var crange = cam.getClippingRange();\n program.setUniformf('camThick', crange[1] - crange[0]);\n program.setUniformf('camNear', crange[0]);\n program.setUniformf('camFar', crange[1]);\n var bounds = model.currentInput.getBounds();\n var dims = model.currentInput.getDimensions(); // compute the viewport bounds of the volume\n // we will only render those fragments.\n\n var pos = new Float64Array(3);\n var dir = new Float64Array(3);\n var dcxmin = 1.0;\n var dcxmax = -1.0;\n var dcymin = 1.0;\n var dcymax = -1.0;\n\n for (var i = 0; i < 8; ++i) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos, bounds[i % 2], bounds[2 + Math.floor(i / 2) % 2], bounds[4 + Math.floor(i / 4)]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat4(pos, pos, model.modelToView);\n\n if (!cam.getParallelProjection()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].normalize(dir, pos); // now find the projection of this point onto a\n // nearZ distance plane. Since the camera is at 0,0,0\n // in VC the ray is just t*pos and\n // t is -nearZ/dir.z\n // intersection becomes pos.x/pos.z\n\n var t = -crange[0] / pos[2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].scale(pos, dir, t);\n } // now convert to DC\n\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat4(pos, pos, keyMats.vcpc);\n dcxmin = Math.min(pos[0], dcxmin);\n dcxmax = Math.max(pos[0], dcxmax);\n dcymin = Math.min(pos[1], dcymin);\n dcymax = Math.max(pos[1], dcymax);\n }\n\n program.setUniformf('dcxmin', dcxmin);\n program.setUniformf('dcxmax', dcxmax);\n program.setUniformf('dcymin', dcymin);\n program.setUniformf('dcymax', dcymax);\n\n if (program.isUniformUsed('cameraParallel')) {\n program.setUniformi('cameraParallel', cam.getParallelProjection());\n }\n\n var ext = model.currentInput.getExtent();\n var spc = model.currentInput.getSpacing();\n var vsize = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(vsize, (ext[1] - ext[0] + 1) * spc[0], (ext[3] - ext[2] + 1) * spc[1], (ext[5] - ext[4] + 1) * spc[2]);\n program.setUniform3f('vSpacing', spc[0], spc[1], spc[2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos, ext[0], ext[2], ext[4]);\n model.currentInput.indexToWorldVec3(pos, pos);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat4(pos, pos, model.modelToView);\n program.setUniform3f('vOriginVC', pos[0], pos[1], pos[2]); // apply the image directions\n\n var i2wmat4 = model.currentInput.getIndexToWorld();\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].multiply(model.idxToView, model.modelToView, i2wmat4);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat3\"].multiply(model.idxNormalMatrix, keyMats.normalMatrix, actMats.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat3\"].multiply(model.idxNormalMatrix, model.idxNormalMatrix, model.currentInput.getDirection());\n var maxSamples = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].length(vsize) / model.renderable.getSampleDistance();\n\n if (maxSamples > model.renderable.getMaximumSamplesPerRay()) {\n vtkWarningMacro(\"The number of steps required \".concat(Math.ceil(maxSamples), \" is larger than the\\n specified maximum number of steps \").concat(model.renderable.getMaximumSamplesPerRay(), \".\\n Please either change the\\n volumeMapper sampleDistance or its maximum number of samples.\"));\n }\n\n var vctoijk = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(vctoijk, 1.0, 1.0, 1.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].divide(vctoijk, vctoijk, vsize);\n program.setUniform3f('vVCToIJK', vctoijk[0], vctoijk[1], vctoijk[2]);\n program.setUniform3i('volumeDimensions', dims[0], dims[1], dims[2]);\n\n if (!model.openGLRenderWindow.getWebgl2()) {\n var volInfo = model.scalarTexture.getVolumeInfo();\n program.setUniformf('texWidth', model.scalarTexture.getWidth());\n program.setUniformf('texHeight', model.scalarTexture.getHeight());\n program.setUniformi('xreps', volInfo.xreps);\n program.setUniformi('xstride', volInfo.xstride);\n program.setUniformi('ystride', volInfo.ystride);\n } // map normals through normal matrix\n // then use a point on the plane to compute the distance\n\n\n var normal = new Float64Array(3);\n var pos2 = new Float64Array(3);\n\n for (var _i = 0; _i < 6; ++_i) {\n switch (_i) {\n default:\n case 0:\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, 1.0, 0.0, 0.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos2, ext[1], ext[3], ext[5]);\n break;\n\n case 1:\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, -1.0, 0.0, 0.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos2, ext[0], ext[2], ext[4]);\n break;\n\n case 2:\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, 0.0, 1.0, 0.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos2, ext[1], ext[3], ext[5]);\n break;\n\n case 3:\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, 0.0, -1.0, 0.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos2, ext[0], ext[2], ext[4]);\n break;\n\n case 4:\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, 0.0, 0.0, 1.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos2, ext[1], ext[3], ext[5]);\n break;\n\n case 5:\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, 0.0, 0.0, -1.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos2, ext[0], ext[2], ext[4]);\n break;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat3(normal, normal, model.idxNormalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat4(pos2, pos2, model.idxToView);\n var dist = -1.0 * gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].dot(pos2, normal); // we have the plane in view coordinates\n // specify the planes in view coordinates\n\n program.setUniform3f(\"vPlaneNormal\".concat(_i), normal[0], normal[1], normal[2]);\n program.setUniformf(\"vPlaneDistance\".concat(_i), dist);\n\n if (actor.getProperty().getUseLabelOutline()) {\n var image = model.currentInput;\n var worldToIndex = image.getWorldToIndex();\n program.setUniformMatrix('vWCtoIDX', worldToIndex); // Get the projection coordinate to world coordinate transformation matrix.\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].invert(model.projectionToWorld, keyMats.wcpc);\n program.setUniformMatrix('PCWCMatrix', model.projectionToWorld);\n var size = publicAPI.getRenderTargetSize();\n program.setUniformf('vpWidth', size[0]);\n program.setUniformf('vpHeight', size[1]);\n }\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].invert(model.projectionToView, keyMats.vcpc);\n program.setUniformMatrix('PCVCMatrix', model.projectionToView); // handle lighting values\n\n switch (model.lastLightComplexity) {\n default:\n case 0:\n // no lighting, tcolor is fine as is\n break;\n\n case 1: // headlight\n\n case 2: // light kit\n\n case 3:\n {\n // positional not implemented fallback to directional\n // mat3.transpose(keyMats.normalMatrix, keyMats.normalMatrix);\n var lightNum = 0;\n var lightColor = [];\n ren.getLights().forEach(function (light) {\n var status = light.getSwitch();\n\n if (status > 0) {\n var dColor = light.getColor();\n var intensity = light.getIntensity();\n lightColor[0] = dColor[0] * intensity;\n lightColor[1] = dColor[1] * intensity;\n lightColor[2] = dColor[2] * intensity;\n program.setUniform3fArray(\"lightColor\".concat(lightNum), lightColor);\n var ldir = light.getDirection();\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, ldir[0], ldir[1], ldir[2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat3(normal, normal, keyMats.normalMatrix);\n program.setUniform3f(\"lightDirectionVC\".concat(lightNum), normal[0], normal[1], normal[2]); // camera DOP is 0,0,-1.0 in VC\n\n var halfAngle = [-0.5 * normal[0], -0.5 * normal[1], -0.5 * (normal[2] - 1.0)];\n program.setUniform3fArray(\"lightHalfAngleVC\".concat(lightNum), halfAngle);\n lightNum++;\n }\n }); // mat3.transpose(keyMats.normalMatrix, keyMats.normalMatrix);\n }\n }\n };\n\n publicAPI.setPropertyShaderParameters = function (cellBO, ren, actor) {\n var program = cellBO.getProgram();\n program.setUniformi('ctexture', model.colorTexture.getTextureUnit());\n program.setUniformi('otexture', model.opacityTexture.getTextureUnit());\n program.setUniformi('jtexture', model.jitterTexture.getTextureUnit());\n var volInfo = model.scalarTexture.getVolumeInfo();\n var vprop = actor.getProperty(); // set the component mix when independent\n\n var numComp = model.scalarTexture.getComponents();\n var iComps = actor.getProperty().getIndependentComponents();\n\n if (iComps && numComp >= 2) {\n for (var i = 0; i < numComp; i++) {\n program.setUniformf(\"mix\".concat(i), actor.getProperty().getComponentWeight(i));\n }\n } // three levels of shift scale combined into one\n // for performance in the fragment shader\n\n\n for (var _i2 = 0; _i2 < numComp; _i2++) {\n var target = iComps ? _i2 : 0;\n var sscale = volInfo.scale[_i2];\n var ofun = vprop.getScalarOpacity(target);\n var oRange = ofun.getRange();\n var oscale = sscale / (oRange[1] - oRange[0]);\n var oshift = (volInfo.offset[_i2] - oRange[0]) / (oRange[1] - oRange[0]);\n program.setUniformf(\"oshift\".concat(_i2), oshift);\n program.setUniformf(\"oscale\".concat(_i2), oscale);\n var cfun = vprop.getRGBTransferFunction(target);\n var cRange = cfun.getRange();\n program.setUniformf(\"cshift\".concat(_i2), (volInfo.offset[_i2] - cRange[0]) / (cRange[1] - cRange[0]));\n program.setUniformf(\"cscale\".concat(_i2), sscale / (cRange[1] - cRange[0]));\n }\n\n if (model.gopacity) {\n if (iComps) {\n for (var nc = 0; nc < numComp; ++nc) {\n var _sscale = volInfo.scale[nc];\n var useGO = vprop.getUseGradientOpacity(nc);\n\n if (useGO) {\n var gomin = vprop.getGradientOpacityMinimumOpacity(nc);\n var gomax = vprop.getGradientOpacityMaximumOpacity(nc);\n program.setUniformf(\"gomin\".concat(nc), gomin);\n program.setUniformf(\"gomax\".concat(nc), gomax);\n var goRange = [vprop.getGradientOpacityMinimumValue(nc), vprop.getGradientOpacityMaximumValue(nc)];\n program.setUniformf(\"goscale\".concat(nc), _sscale * (gomax - gomin) / (goRange[1] - goRange[0]));\n program.setUniformf(\"goshift\".concat(nc), -goRange[0] * (gomax - gomin) / (goRange[1] - goRange[0]) + gomin);\n } else {\n program.setUniformf(\"gomin\".concat(nc), 1.0);\n program.setUniformf(\"gomax\".concat(nc), 1.0);\n program.setUniformf(\"goscale\".concat(nc), 0.0);\n program.setUniformf(\"goshift\".concat(nc), 1.0);\n }\n }\n } else {\n var _sscale2 = volInfo.scale[numComp - 1];\n\n var _gomin = vprop.getGradientOpacityMinimumOpacity(0);\n\n var _gomax = vprop.getGradientOpacityMaximumOpacity(0);\n\n program.setUniformf('gomin0', _gomin);\n program.setUniformf('gomax0', _gomax);\n var _goRange = [vprop.getGradientOpacityMinimumValue(0), vprop.getGradientOpacityMaximumValue(0)];\n program.setUniformf('goscale0', _sscale2 * (_gomax - _gomin) / (_goRange[1] - _goRange[0]));\n program.setUniformf('goshift0', -_goRange[0] * (_gomax - _gomin) / (_goRange[1] - _goRange[0]) + _gomin);\n }\n }\n\n var vtkImageLabelOutline = actor.getProperty().getUseLabelOutline();\n\n if (vtkImageLabelOutline === true) {\n var labelOutlineThickness = actor.getProperty().getLabelOutlineThickness();\n program.setUniformi('outlineThickness', labelOutlineThickness);\n }\n\n if (model.lastLightComplexity > 0) {\n program.setUniformf('vAmbient', vprop.getAmbient());\n program.setUniformf('vDiffuse', vprop.getDiffuse());\n program.setUniformf('vSpecular', vprop.getSpecular());\n program.setUniformf('vSpecularPower', vprop.getSpecularPower());\n }\n };\n\n publicAPI.getClippingPlaneShaderParameters = function (cellBO, ren, actor) {\n if (model.renderable.getClippingPlanes().length > 0) {\n var keyMats = model.openGLCamera.getKeyMatrices(ren);\n var clipPlaneNormals = [];\n var clipPlaneDistances = [];\n var clipPlanes = model.renderable.getClippingPlanes();\n var clipPlaneSize = clipPlanes.length;\n\n for (var i = 0; i < clipPlaneSize; ++i) {\n var clipPlaneNormal = clipPlanes[i].getNormal();\n var clipPlanePos = clipPlanes[i].getOrigin();\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat3(clipPlaneNormal, clipPlaneNormal, keyMats.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat4(clipPlanePos, clipPlanePos, keyMats.wcvc);\n var clipPlaneDist = -1.0 * gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].dot(clipPlanePos, clipPlaneNormal);\n clipPlaneNormals.push(clipPlaneNormal[0]);\n clipPlaneNormals.push(clipPlaneNormal[1]);\n clipPlaneNormals.push(clipPlaneNormal[2]);\n clipPlaneDistances.push(clipPlaneDist);\n }\n\n var program = cellBO.getProgram();\n program.setUniform3fv(\"vClipPlaneNormals\", clipPlaneNormals);\n program.setUniformfv(\"vClipPlaneDistances\", clipPlaneDistances);\n }\n };\n\n publicAPI.getRenderTargetSize = function () {\n if (model.lastXYF > 1.43) {\n var sz = model.framebuffer.getSize();\n return [model.fvp[0] * sz[0], model.fvp[1] * sz[1]];\n }\n\n return model.openGLRenderWindow.getFramebufferSize();\n };\n\n publicAPI.renderPieceStart = function (ren, actor) {\n if (model.renderable.getAutoAdjustSampleDistances()) {\n var rwi = ren.getVTKWindow().getInteractor();\n var rft = rwi.getLastFrameTime(); // console.log(`last frame time ${Math.floor(1.0 / rft)}`);\n // frame time is typically for a couple frames prior\n // which makes it messy, so keep long running averages\n // of frame times and pixels rendered\n\n model.avgFrameTime = 0.97 * model.avgFrameTime + 0.03 * rft;\n model.avgWindowArea = 0.97 * model.avgWindowArea + 0.03 / (model.lastXYF * model.lastXYF);\n\n if (ren.getVTKWindow().getInteractor().isAnimating()) {\n // compute target xy factor\n var txyf = Math.sqrt(model.avgFrameTime * rwi.getDesiredUpdateRate() / model.avgWindowArea); // limit subsampling to a factor of 10\n\n if (txyf > 10.0) {\n txyf = 10.0;\n }\n\n model.targetXYF = txyf;\n } else {\n model.targetXYF = Math.sqrt(model.avgFrameTime * rwi.getStillUpdateRate() / model.avgWindowArea);\n } // have some inertia to change states around 1.43\n\n\n if (model.targetXYF < 1.53 && model.targetXYF > 1.33) {\n model.targetXYF = model.lastXYF;\n } // and add some inertia to change at all\n\n\n if (Math.abs(1.0 - model.targetXYF / model.lastXYF) < 0.1) {\n model.targetXYF = model.lastXYF;\n }\n\n model.lastXYF = model.targetXYF;\n } else {\n model.lastXYF = model.renderable.getImageSampleDistance();\n } // only use FBO beyond this value\n\n\n if (model.lastXYF <= 1.43) {\n model.lastXYF = 1.0;\n } // console.log(`last target ${model.lastXYF} ${model.targetXYF}`);\n // console.log(`awin aft ${model.avgWindowArea} ${model.avgFrameTime}`);\n\n\n var xyf = model.lastXYF;\n var size = model.openGLRenderWindow.getFramebufferSize(); // const newSize = [\n // Math.floor((size[0] / xyf) + 0.5),\n // Math.floor((size[1] / xyf) + 0.5)];\n // const diag = vtkBoundingBox.getDiagonalLength(model.currentInput.getBounds());\n // // so what is the resulting sample size roughly\n // console.log(`sam size ${diag / newSize[0]} ${diag / newSize[1]} ${model.renderable.getImageSampleDistance()}`);\n // // if the sample distance is getting far from the image sample dist\n // if (2.0 * diag / (newSize[0] + newSize[1]) > 4 * model.renderable.getSampleDistance()) {\n // model.renderable.setSampleDistance(4.0 * model.renderable.getSampleDistance());\n // }\n // if (2.0 * diag / (newSize[0] + newSize[1]) < 0.25 * model.renderable.getSampleDistance()) {\n // model.renderable.setSampleDistance(0.25 * model.renderable.getSampleDistance());\n // }\n // create/resize framebuffer if needed\n\n if (xyf > 1.43) {\n model.framebuffer.saveCurrentBindingsAndBuffers();\n\n if (model.framebuffer.getGLFramebuffer() === null) {\n model.framebuffer.create(Math.floor(size[0] * 0.7), Math.floor(size[1] * 0.7));\n model.framebuffer.populateFramebuffer();\n } else {\n var fbSize = model.framebuffer.getSize();\n\n if (fbSize[0] !== Math.floor(size[0] * 0.7) || fbSize[1] !== Math.floor(size[1] * 0.7)) {\n model.framebuffer.create(Math.floor(size[0] * 0.7), Math.floor(size[1] * 0.7));\n model.framebuffer.populateFramebuffer();\n }\n }\n\n model.framebuffer.bind();\n var gl = model.context;\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\n gl.colorMask(true, true, true, true);\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.viewport(0, 0, size[0] / xyf, size[1] / xyf);\n model.fvp = [Math.floor(size[0] / xyf) / Math.floor(size[0] * 0.7), Math.floor(size[1] / xyf) / Math.floor(size[1] * 0.7)];\n }\n\n model.context.disable(model.context.DEPTH_TEST); // make sure the BOs are up to date\n\n publicAPI.updateBufferObjects(ren, actor); // set interpolation on the texture based on property setting\n\n var iType = actor.getProperty().getInterpolationType();\n\n if (iType === vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_13__[\"InterpolationType\"].NEAREST) {\n model.scalarTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].NEAREST);\n model.scalarTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].NEAREST);\n } else {\n model.scalarTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n model.scalarTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n } // Bind the OpenGL, this is shared between the different primitive/cell types.\n\n\n model.lastBoundBO = null; // if we have a zbuffer texture then activate it\n\n if (model.zBufferTexture !== null) {\n model.zBufferTexture.activate();\n }\n };\n\n publicAPI.renderPieceDraw = function (ren, actor) {\n var gl = model.context; // render the texture\n\n model.scalarTexture.activate();\n model.opacityTexture.activate();\n model.colorTexture.activate();\n model.jitterTexture.activate();\n publicAPI.updateShaders(model.tris, ren, actor); // First we do the triangles, update the shader, set uniforms, etc.\n // for (let i = 0; i < 11; ++i) {\n // gl.drawArrays(gl.TRIANGLES, 66 * i, 66);\n // }\n\n gl.drawArrays(gl.TRIANGLES, 0, model.tris.getCABO().getElementCount());\n model.tris.getVAO().release();\n model.scalarTexture.deactivate();\n model.colorTexture.deactivate();\n model.opacityTexture.deactivate();\n model.jitterTexture.deactivate();\n };\n\n publicAPI.renderPieceFinish = function (ren, actor) {\n // if we have a zbuffer texture then deactivate it\n if (model.zBufferTexture !== null) {\n model.zBufferTexture.deactivate();\n }\n\n if (model.lastXYF > 1.43) {\n // now copy the framebuffer with the volume into the\n // regular buffer\n model.framebuffer.restorePreviousBindingsAndBuffers();\n\n if (model.copyShader === null) {\n model.copyShader = model.openGLRenderWindow.getShaderCache().readyShaderProgramArray(['//VTK::System::Dec', 'attribute vec4 vertexDC;', 'uniform vec2 tfactor;', 'varying vec2 tcoord;', 'void main() { tcoord = vec2(vertexDC.x*0.5 + 0.5, vertexDC.y*0.5 + 0.5) * tfactor; gl_Position = vertexDC; }'].join('\\n'), ['//VTK::System::Dec', '//VTK::Output::Dec', 'uniform sampler2D texture1;', 'varying vec2 tcoord;', 'void main() { gl_FragData[0] = texture2D(texture1,tcoord); }'].join('\\n'), '');\n var program = model.copyShader;\n model.copyVAO = vtk_js_Sources_Rendering_OpenGL_VertexArrayObject__WEBPACK_IMPORTED_MODULE_9__[\"default\"].newInstance();\n model.copyVAO.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.tris.getCABO().bind();\n\n if (!model.copyVAO.addAttributeArray(program, model.tris.getCABO(), 'vertexDC', model.tris.getCABO().getVertexOffset(), model.tris.getCABO().getStride(), model.context.FLOAT, 3, model.context.FALSE)) {\n vtkErrorMacro('Error setting vertexDC in copy shader VAO.');\n }\n } else {\n model.openGLRenderWindow.getShaderCache().readyShaderProgram(model.copyShader);\n }\n\n var size = model.openGLRenderWindow.getFramebufferSize();\n model.context.viewport(0, 0, size[0], size[1]); // activate texture\n\n var tex = model.framebuffer.getColorTexture();\n tex.activate();\n model.copyShader.setUniformi('texture', tex.getTextureUnit());\n model.copyShader.setUniform2f('tfactor', model.fvp[0], model.fvp[1]);\n var gl = model.context;\n gl.blendFuncSeparate(gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); // render quad\n\n model.context.drawArrays(model.context.TRIANGLES, 0, model.tris.getCABO().getElementCount());\n tex.deactivate();\n gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n }\n };\n\n publicAPI.renderPiece = function (ren, actor) {\n publicAPI.invokeEvent({\n type: 'StartEvent'\n });\n model.renderable.update();\n model.currentInput = model.renderable.getInputData();\n publicAPI.invokeEvent({\n type: 'EndEvent'\n });\n\n if (!model.currentInput) {\n vtkErrorMacro('No input!');\n return;\n }\n\n publicAPI.renderPieceStart(ren, actor);\n publicAPI.renderPieceDraw(ren, actor);\n publicAPI.renderPieceFinish(ren, actor);\n };\n\n publicAPI.computeBounds = function (ren, actor) {\n if (!publicAPI.getInput()) {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_5__[\"uninitializeBounds\"](model.Bounds);\n return;\n }\n\n model.bounds = publicAPI.getInput().getBounds();\n };\n\n publicAPI.updateBufferObjects = function (ren, actor) {\n // Rebuild buffers if needed\n if (publicAPI.getNeedToRebuildBufferObjects(ren, actor)) {\n publicAPI.buildBufferObjects(ren, actor);\n }\n };\n\n publicAPI.getNeedToRebuildBufferObjects = function (ren, actor) {\n // first do a coarse check\n if (model.VBOBuildTime.getMTime() < publicAPI.getMTime() || model.VBOBuildTime.getMTime() < actor.getMTime() || model.VBOBuildTime.getMTime() < model.renderable.getMTime() || model.VBOBuildTime.getMTime() < actor.getProperty().getMTime() || model.VBOBuildTime.getMTime() < model.currentInput.getMTime()) {\n return true;\n }\n\n return false;\n };\n\n publicAPI.buildBufferObjects = function (ren, actor) {\n var image = model.currentInput;\n\n if (!image) {\n return;\n }\n\n var scalars = image.getPointData() && image.getPointData().getScalars();\n\n if (!scalars) {\n return;\n }\n\n var vprop = actor.getProperty();\n\n if (!model.jitterTexture.getHandle()) {\n var oTable = new Uint8Array(32 * 32);\n\n for (var i = 0; i < 32 * 32; ++i) {\n oTable[i] = 255.0 * Math.random();\n }\n\n model.jitterTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n model.jitterTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n model.jitterTexture.create2DFromRaw(32, 32, 1, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_3__[\"VtkDataTypes\"].UNSIGNED_CHAR, oTable);\n }\n\n var numComp = scalars.getNumberOfComponents();\n var iComps = vprop.getIndependentComponents();\n var numIComps = iComps ? numComp : 1; // rebuild opacity tfun?\n\n var toString = \"\".concat(vprop.getMTime());\n\n if (model.opacityTextureString !== toString) {\n var oWidth = 1024;\n var oSize = oWidth * 2 * numIComps;\n var ofTable = new Float32Array(oSize);\n var tmpTable = new Float32Array(oWidth);\n\n for (var c = 0; c < numIComps; ++c) {\n var ofun = vprop.getScalarOpacity(c);\n var opacityFactor = model.renderable.getSampleDistance() / vprop.getScalarOpacityUnitDistance(c);\n var oRange = ofun.getRange();\n ofun.getTable(oRange[0], oRange[1], oWidth, tmpTable, 1); // adjust for sample distance etc\n\n for (var _i3 = 0; _i3 < oWidth; ++_i3) {\n ofTable[c * oWidth * 2 + _i3] = 1.0 - Math.pow(1.0 - tmpTable[_i3], opacityFactor);\n ofTable[c * oWidth * 2 + _i3 + oWidth] = ofTable[c * oWidth * 2 + _i3];\n }\n }\n\n model.opacityTexture.releaseGraphicsResources(model.openGLRenderWindow);\n model.opacityTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n model.opacityTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR); // use float texture where possible because we really need the resolution\n // for this table. Errors in low values of opacity accumulate to\n // visible artifacts. High values of opacity quickly terminate without\n // artifacts.\n\n if (model.openGLRenderWindow.getWebgl2() || model.context.getExtension('OES_texture_float') && model.context.getExtension('OES_texture_float_linear')) {\n model.opacityTexture.create2DFromRaw(oWidth, 2 * numIComps, 1, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_3__[\"VtkDataTypes\"].FLOAT, ofTable);\n } else {\n var _oTable = new Uint8Array(oSize);\n\n for (var _i4 = 0; _i4 < oSize; ++_i4) {\n _oTable[_i4] = 255.0 * ofTable[_i4];\n }\n\n model.opacityTexture.create2DFromRaw(oWidth, 2 * numIComps, 1, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_3__[\"VtkDataTypes\"].UNSIGNED_CHAR, _oTable);\n }\n\n model.opacityTextureString = toString;\n } // rebuild color tfun?\n\n\n toString = \"\".concat(vprop.getMTime());\n\n if (model.colorTextureString !== toString) {\n var cWidth = 1024;\n var cSize = cWidth * 2 * numIComps * 3;\n var cTable = new Uint8Array(cSize);\n\n var _tmpTable = new Float32Array(cWidth * 3);\n\n for (var _c = 0; _c < numIComps; ++_c) {\n var cfun = vprop.getRGBTransferFunction(_c);\n var cRange = cfun.getRange();\n cfun.getTable(cRange[0], cRange[1], cWidth, _tmpTable, 1);\n\n for (var _i5 = 0; _i5 < cWidth * 3; ++_i5) {\n cTable[_c * cWidth * 6 + _i5] = 255.0 * _tmpTable[_i5];\n cTable[_c * cWidth * 6 + _i5 + cWidth * 3] = 255.0 * _tmpTable[_i5];\n }\n }\n\n model.colorTexture.releaseGraphicsResources(model.openGLRenderWindow);\n model.colorTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n model.colorTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n model.colorTexture.create2DFromRaw(cWidth, 2 * numIComps, 3, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_3__[\"VtkDataTypes\"].UNSIGNED_CHAR, cTable);\n model.colorTextureString = toString;\n } // rebuild the scalarTexture if the data has changed\n\n\n toString = \"\".concat(image.getMTime());\n\n if (model.scalarTextureString !== toString) {\n // Build the textures\n var dims = image.getDimensions();\n model.scalarTexture.releaseGraphicsResources(model.openGLRenderWindow);\n model.scalarTexture.resetFormatAndType();\n model.scalarTexture.create3DFilterableFromRaw(dims[0], dims[1], dims[2], numComp, scalars.getDataType(), scalars.getData()); // console.log(model.scalarTexture.get());\n\n model.scalarTextureString = toString;\n }\n\n if (!model.tris.getCABO().getElementCount()) {\n // build the CABO\n var ptsArray = new Float32Array(12);\n\n for (var _i6 = 0; _i6 < 4; _i6++) {\n ptsArray[_i6 * 3] = _i6 % 2 * 2 - 1.0;\n ptsArray[_i6 * 3 + 1] = _i6 > 1 ? 1.0 : -1.0;\n ptsArray[_i6 * 3 + 2] = -1.0;\n }\n\n var cellArray = new Uint16Array(8);\n cellArray[0] = 3;\n cellArray[1] = 0;\n cellArray[2] = 1;\n cellArray[3] = 3;\n cellArray[4] = 3;\n cellArray[5] = 0;\n cellArray[6] = 3;\n cellArray[7] = 2; // const dim = 12.0;\n // const ptsArray = new Float32Array(3 * dim * dim);\n // for (let i = 0; i < dim; i++) {\n // for (let j = 0; j < dim; j++) {\n // const offset = ((i * dim) + j) * 3;\n // ptsArray[offset] = (2.0 * (i / (dim - 1.0))) - 1.0;\n // ptsArray[offset + 1] = (2.0 * (j / (dim - 1.0))) - 1.0;\n // ptsArray[offset + 2] = -1.0;\n // }\n // }\n // const cellArray = new Uint16Array(8 * (dim - 1) * (dim - 1));\n // for (let i = 0; i < dim - 1; i++) {\n // for (let j = 0; j < dim - 1; j++) {\n // const offset = 8 * ((i * (dim - 1)) + j);\n // cellArray[offset] = 3;\n // cellArray[offset + 1] = (i * dim) + j;\n // cellArray[offset + 2] = (i * dim) + 1 + j;\n // cellArray[offset + 3] = ((i + 1) * dim) + 1 + j;\n // cellArray[offset + 4] = 3;\n // cellArray[offset + 5] = (i * dim) + j;\n // cellArray[offset + 6] = ((i + 1) * dim) + 1 + j;\n // cellArray[offset + 7] = ((i + 1) * dim) + j;\n // }\n // }\n\n var points = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 3,\n values: ptsArray\n });\n points.setName('points');\n var cells = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 1,\n values: cellArray\n });\n model.tris.getCABO().createVBO(cells, 'polys', vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Representation\"].SURFACE, {\n points: points,\n cellOffset: 0\n });\n }\n\n model.VBOBuildTime.modified();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n VBOBuildTime: null,\n scalarTexture: null,\n scalarTextureString: null,\n opacityTexture: null,\n opacityTextureString: null,\n colorTexture: null,\n colorTextureString: null,\n jitterTexture: null,\n tris: null,\n framebuffer: null,\n copyShader: null,\n copyVAO: null,\n lastXYF: 1.0,\n targetXYF: 1.0,\n zBufferTexture: null,\n lastZBufferTexture: null,\n lastLightComplexity: 0,\n fullViewportTime: 1.0,\n idxToView: null,\n idxNormalMatrix: null,\n modelToView: null,\n projectionToView: null,\n avgWindowArea: 0.0,\n avgFrameTime: 0.0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_10__[\"default\"].extend(publicAPI, model, initialValues);\n model.VBOBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"obj\"](model.VBOBuildTime, {\n mtime: 0\n });\n model.tris = vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n model.scalarTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.opacityTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.colorTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.jitterTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.jitterTexture.setWrapS(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Wrap\"].REPEAT);\n model.jitterTexture.setWrapT(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Wrap\"].REPEAT);\n model.framebuffer = vtk_js_Sources_Rendering_OpenGL_Framebuffer__WEBPACK_IMPORTED_MODULE_6__[\"default\"].newInstance();\n model.idxToView = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].identity(new Float64Array(16));\n model.idxNormalMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat3\"].identity(new Float64Array(9));\n model.modelToView = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].identity(new Float64Array(16));\n model.projectionToView = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].identity(new Float64Array(16));\n model.projectionToWorld = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].identity(new Float64Array(16)); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['context']); // Object methods\n\n vtkOpenGLVolumeMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkOpenGLVolumeMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_17__[\"registerOverride\"])('vtkVolumeMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/VolumeMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl ***! - \******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = \"//VTK::System::Dec\\n\\n/*=========================================================================\\n\\n Program: Visualization Toolkit\\n Module: vtkPolyDataFS.glsl\\n\\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\\n All rights reserved.\\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\\n\\n This software is distributed WITHOUT ANY WARRANTY; without even\\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\\n PURPOSE. See the above copyright notice for more information.\\n\\n=========================================================================*/\\n// Template for the polydata mappers fragment shader\\n\\nuniform int PrimitiveIDOffset;\\n\\n// VC position of this fragment\\n//VTK::PositionVC::Dec\\n\\n// optional color passed in from the vertex shader, vertexColor\\n//VTK::Color::Dec\\n\\n// optional surface normal declaration\\n//VTK::Normal::Dec\\n\\n// extra lighting parameters\\n//VTK::Light::Dec\\n\\n// Texture coordinates\\n//VTK::TCoord::Dec\\n\\n// picking support\\n//VTK::Picking::Dec\\n\\n// Depth Peeling Support\\n//VTK::DepthPeeling::Dec\\n\\n// clipping plane vars\\n//VTK::Clip::Dec\\n\\n// the output of this shader\\n//VTK::Output::Dec\\n\\n// Apple Bug\\n//VTK::PrimID::Dec\\n\\n// handle coincident offsets\\n//VTK::Coincident::Dec\\n\\n//VTK::ZBuffer::Dec\\n\\nvoid main()\\n{\\n // VC position of this fragment. This should not branch/return/discard.\\n //VTK::PositionVC::Impl\\n\\n // Place any calls that require uniform flow (e.g. dFdx) here.\\n //VTK::UniformFlow::Impl\\n\\n // Set gl_FragDepth here (gl_FragCoord.z by default)\\n //VTK::Depth::Impl\\n\\n // Early depth peeling abort:\\n //VTK::DepthPeeling::PreColor\\n\\n // Apple Bug\\n //VTK::PrimID::Impl\\n\\n //VTK::Clip::Impl\\n\\n //VTK::Color::Impl\\n\\n // Generate the normal if we are not passed in one\\n //VTK::Normal::Impl\\n\\n //VTK::Light::Impl\\n\\n //VTK::TCoord::Impl\\n\\n if (gl_FragData[0].a <= 0.0)\\n {\\n discard;\\n }\\n\\n //VTK::DepthPeeling::Impl\\n\\n //VTK::Picking::Impl\\n\\n // handle coincident offsets\\n //VTK::Coincident::Impl\\n\\n //VTK::ZBuffer::Impl\\n}\\n\"\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl ***! - \******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = \"//VTK::System::Dec\\n\\n/*=========================================================================\\n\\n Program: Visualization Toolkit\\n Module: vtkPolyDataVS.glsl\\n\\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\\n All rights reserved.\\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\\n\\n This software is distributed WITHOUT ANY WARRANTY; without even\\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\\n PURPOSE. See the above copyright notice for more information.\\n\\n=========================================================================*/\\n\\nattribute vec4 vertexMC;\\n\\n// frag position in VC\\n//VTK::PositionVC::Dec\\n\\n// optional normal declaration\\n//VTK::Normal::Dec\\n\\n// extra lighting parameters\\n//VTK::Light::Dec\\n\\n// Texture coordinates\\n//VTK::TCoord::Dec\\n\\n// material property values\\n//VTK::Color::Dec\\n\\n// clipping plane vars\\n//VTK::Clip::Dec\\n\\n// camera and actor matrix values\\n//VTK::Camera::Dec\\n\\n// Apple Bug\\n//VTK::PrimID::Dec\\n\\n// picking support\\n//VTK::Picking::Dec\\n\\nvoid main()\\n{\\n //VTK::Color::Impl\\n\\n //VTK::Normal::Impl\\n\\n //VTK::TCoord::Impl\\n\\n //VTK::Clip::Impl\\n\\n //VTK::PrimID::Impl\\n\\n //VTK::PositionVC::Impl\\n\\n //VTK::Light::Impl\\n\\n //VTK::Picking::Impl\\n}\\n\"\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeFS.glsl": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeFS.glsl ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = \"//VTK::System::Dec\\n\\n/*=========================================================================\\n\\n Program: Visualization Toolkit\\n Module: vtkVolumeFS.glsl\\n\\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\\n All rights reserved.\\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\\n\\n This software is distributed WITHOUT ANY WARRANTY; without even\\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\\n PURPOSE. See the above copyright notice for more information.\\n\\n=========================================================================*/\\n// Template for the volume mappers fragment shader\\n\\n// the output of this shader\\n//VTK::Output::Dec\\n\\nvarying vec3 vertexVCVSOutput;\\n\\n// first declare the settings from the mapper\\n// that impact the code paths in here\\n\\n// always set vtkNumComponents 1,2,3,4\\n//VTK::NumComponents\\n\\n// possibly define vtkUseTriliear\\n//VTK::TrilinearOn\\n\\n// possibly define vtkIndependentComponents\\n//VTK::IndependentComponentsOn\\n\\n// possibly define any \\\"proportional\\\" components\\n//VTK::vtkProportionalComponents\\n\\n// Define the blend mode to use\\n#define vtkBlendMode //VTK::BlendMode\\n\\n// Possibly define vtkImageLabelOutlineOn\\n//VTK::ImageLabelOutlineOn\\n\\n#ifdef vtkImageLabelOutlineOn\\nuniform int outlineThickness;\\nuniform float vpWidth;\\nuniform float vpHeight;\\nuniform mat4 PCWCMatrix;\\nuniform mat4 vWCtoIDX;\\n#endif\\n\\n// define vtkLightComplexity\\n//VTK::LightComplexity\\n#if vtkLightComplexity > 0\\nuniform float vSpecularPower;\\nuniform float vAmbient;\\nuniform float vDiffuse;\\nuniform float vSpecular;\\n//VTK::Light::Dec\\n#endif\\n\\n// possibly define vtkGradientOpacityOn\\n//VTK::GradientOpacityOn\\n#ifdef vtkGradientOpacityOn\\nuniform float goscale0;\\nuniform float goshift0;\\nuniform float gomin0;\\nuniform float gomax0;\\n#if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\\nuniform float goscale1;\\nuniform float goshift1;\\nuniform float gomin1;\\nuniform float gomax1;\\n#if vtkNumComponents >= 3\\nuniform float goscale2;\\nuniform float goshift2;\\nuniform float gomin2;\\nuniform float gomax2;\\n#endif\\n#if vtkNumComponents >= 4\\nuniform float goscale3;\\nuniform float goshift3;\\nuniform float gomin3;\\nuniform float gomax3;\\n#endif\\n#endif\\n#endif\\n\\n// if you want to see the raw tiled\\n// data in webgl1 uncomment the following line\\n// #define debugtile\\n\\n// camera values\\nuniform float camThick;\\nuniform float camNear;\\nuniform float camFar;\\nuniform int cameraParallel;\\n\\n// values describing the volume geometry\\nuniform vec3 vOriginVC;\\nuniform vec3 vSpacing;\\nuniform ivec3 volumeDimensions; // 3d texture dimensions\\nuniform vec3 vPlaneNormal0;\\nuniform float vPlaneDistance0;\\nuniform vec3 vPlaneNormal1;\\nuniform float vPlaneDistance1;\\nuniform vec3 vPlaneNormal2;\\nuniform float vPlaneDistance2;\\nuniform vec3 vPlaneNormal3;\\nuniform float vPlaneDistance3;\\nuniform vec3 vPlaneNormal4;\\nuniform float vPlaneDistance4;\\nuniform vec3 vPlaneNormal5;\\nuniform float vPlaneDistance5;\\n\\n//VTK::ClipPlane::Dec\\n\\n// opacity and color textures\\nuniform sampler2D otexture;\\nuniform float oshift0;\\nuniform float oscale0;\\nuniform sampler2D ctexture;\\nuniform float cshift0;\\nuniform float cscale0;\\n\\n// jitter texture\\nuniform sampler2D jtexture;\\n\\n// some 3D texture values\\nuniform float sampleDistance;\\nuniform vec3 vVCToIJK;\\n\\n// the heights defined below are the locations\\n// for the up to four components of the tfuns\\n// the tfuns have a height of 2XnumComps pixels so the\\n// values are computed to hit the middle of the two rows\\n// for that component\\n#ifdef vtkIndependentComponentsOn\\n#if vtkNumComponents == 2\\nuniform float mix0;\\nuniform float mix1;\\n#define height0 0.25\\n#define height1 0.75\\n#endif\\n#if vtkNumComponents == 3\\nuniform float mix0;\\nuniform float mix1;\\nuniform float mix2;\\n#define height0 0.17\\n#define height1 0.5\\n#define height2 0.83\\n#endif\\n#if vtkNumComponents == 4\\nuniform float mix0;\\nuniform float mix1;\\nuniform float mix2;\\nuniform float mix3;\\n#define height0 0.125\\n#define height1 0.375\\n#define height2 0.625\\n#define height3 0.875\\n#endif\\n#endif\\n\\n#if vtkNumComponents >= 2\\nuniform float oshift1;\\nuniform float oscale1;\\nuniform float cshift1;\\nuniform float cscale1;\\n#endif\\n#if vtkNumComponents >= 3\\nuniform float oshift2;\\nuniform float oscale2;\\nuniform float cshift2;\\nuniform float cscale2;\\n#endif\\n#if vtkNumComponents >= 4\\nuniform float oshift3;\\nuniform float oscale3;\\nuniform float cshift3;\\nuniform float cscale3;\\n#endif\\n\\n// declaration for intermixed geometry\\n//VTK::ZBuffer::Dec\\n\\n// Lighting values\\n//VTK::Light::Dec\\n\\n//=======================================================================\\n// Webgl2 specific version of functions\\n#if __VERSION__ == 300\\n\\nuniform highp sampler3D texture1;\\n\\nvec4 getTextureValue(vec3 pos)\\n{\\n vec4 tmp = texture(texture1, pos);\\n#if vtkNumComponents == 1\\n tmp.a = tmp.r;\\n#endif\\n#if vtkNumComponents == 2\\n tmp.a = tmp.g;\\n#endif\\n#if vtkNumComponents == 3\\n tmp.a = length(tmp.rgb);\\n#endif\\n return tmp;\\n}\\n\\n//=======================================================================\\n// WebGL1 specific version of functions\\n#else\\n\\nuniform sampler2D texture1;\\n\\nuniform float texWidth;\\nuniform float texHeight;\\nuniform int xreps;\\nuniform int xstride;\\nuniform int ystride;\\n\\n// if computing triliear values from multiple z slices\\n#ifdef vtkTriliearOn\\nvec4 getTextureValue(vec3 ijk)\\n{\\n float zoff = 1.0/float(volumeDimensions.z);\\n vec4 val1 = getOneTextureValue(ijk);\\n vec4 val2 = getOneTextureValue(vec3(ijk.xy, ijk.z + zoff));\\n\\n float indexZ = float(volumeDimensions)*ijk.z;\\n float zmix = indexZ - floor(indexZ);\\n\\n return mix(val1, val2, zmix);\\n}\\n\\nvec4 getOneTextureValue(vec3 ijk)\\n#else // nearest or fast linear\\nvec4 getTextureValue(vec3 ijk)\\n#endif\\n{\\n vec3 tdims = vec3(volumeDimensions);\\n\\n#ifdef debugtile\\n vec2 tpos = vec2(ijk.x, ijk.y);\\n vec4 tmp = texture2D(texture1, tpos);\\n tmp.a = 1.0;\\n\\n#else\\n int z = int(ijk.z * tdims.z);\\n int yz = z / xreps;\\n int xz = z - yz*xreps;\\n\\n int tileWidth = volumeDimensions.x/xstride;\\n int tileHeight = volumeDimensions.y/ystride;\\n\\n xz *= tileWidth;\\n yz *= tileHeight;\\n\\n float ni = float(xz) + (ijk.x*float(tileWidth));\\n float nj = float(yz) + (ijk.y*float(tileHeight));\\n\\n vec2 tpos = vec2(ni/texWidth, nj/texHeight);\\n\\n vec4 tmp = texture2D(texture1, tpos);\\n\\n#if vtkNumComponents == 1\\n tmp.a = tmp.r;\\n#endif\\n#if vtkNumComponents == 2\\n tmp.g = tmp.a;\\n#endif\\n#if vtkNumComponents == 3\\n tmp.a = length(tmp.rgb);\\n#endif\\n#endif\\n\\n return tmp;\\n}\\n\\n// End of Webgl1 specific code\\n//=======================================================================\\n#endif\\n\\n//=======================================================================\\n// compute the normal and gradient magnitude for a position\\nvec4 computeNormal(vec3 pos, float scalar, vec3 tstep)\\n{\\n vec4 result;\\n\\n result.x = getTextureValue(pos + vec3(tstep.x, 0.0, 0.0)).a - scalar;\\n result.y = getTextureValue(pos + vec3(0.0, tstep.y, 0.0)).a - scalar;\\n result.z = getTextureValue(pos + vec3(0.0, 0.0, tstep.z)).a - scalar;\\n\\n // divide by spacing\\n result.xyz /= vSpacing;\\n\\n result.w = length(result.xyz);\\n\\n // rotate to View Coords\\n result.xyz =\\n result.x * vPlaneNormal0 +\\n result.y * vPlaneNormal2 +\\n result.z * vPlaneNormal4;\\n\\n if (result.w > 0.0)\\n {\\n result.xyz /= result.w;\\n }\\n return result;\\n}\\n\\n#ifdef vtkImageLabelOutlineOn\\nvec3 fragCoordToIndexSpace(vec4 fragCoord) {\\n vec4 pcPos = vec4(\\n (fragCoord.x / vpWidth - 0.5) * 2.0,\\n (fragCoord.y / vpHeight - 0.5) * 2.0,\\n (fragCoord.z - 0.5) * 2.0,\\n 1.0);\\n\\n vec4 worldCoord = PCWCMatrix * pcPos;\\n vec4 vertex = (worldCoord/worldCoord.w);\\n\\n return (vWCtoIDX * vertex).xyz / vec3(volumeDimensions);\\n}\\n#endif\\n\\n//=======================================================================\\n// compute the normals and gradient magnitudes for a position\\n// for independent components\\nmat4 computeMat4Normal(vec3 pos, vec4 tValue, vec3 tstep)\\n{\\n mat4 result;\\n vec4 distX = getTextureValue(pos + vec3(tstep.x, 0.0, 0.0)) - tValue;\\n vec4 distY = getTextureValue(pos + vec3(0.0, tstep.y, 0.0)) - tValue;\\n vec4 distZ = getTextureValue(pos + vec3(0.0, 0.0, tstep.z)) - tValue;\\n\\n // divide by spacing\\n distX /= vSpacing.x;\\n distY /= vSpacing.y;\\n distZ /= vSpacing.z;\\n\\n mat3 rot;\\n rot[0] = vPlaneNormal0;\\n rot[1] = vPlaneNormal2;\\n rot[2] = vPlaneNormal4;\\n\\n#if !defined(vtkComponent0Proportional)\\n result[0].xyz = vec3(distX.r, distY.r, distZ.r);\\n result[0].a = length(result[0].xyz);\\n result[0].xyz *= rot;\\n if (result[0].w > 0.0)\\n {\\n result[0].xyz /= result[0].w;\\n }\\n#endif\\n\\n// optionally compute the 2nd component\\n#if vtkNumComponents >= 2 && !defined(vtkComponent1Proportional)\\n result[1].xyz = vec3(distX.g, distY.g, distZ.g);\\n result[1].a = length(result[1].xyz);\\n result[1].xyz *= rot;\\n if (result[1].w > 0.0)\\n {\\n result[1].xyz /= result[1].w;\\n }\\n#endif\\n\\n// optionally compute the 3rd component\\n#if vtkNumComponents >= 3 && !defined(vtkComponent2Proportional)\\n result[2].xyz = vec3(distX.b, distY.b, distZ.b);\\n result[2].a = length(result[2].xyz);\\n result[2].xyz *= rot;\\n if (result[2].w > 0.0)\\n {\\n result[2].xyz /= result[2].w;\\n }\\n#endif\\n\\n// optionally compute the 4th component\\n#if vtkNumComponents >= 4 && !defined(vtkComponent3Proportional)\\n result[3].xyz = vec3(distX.a, distY.a, distZ.a);\\n result[3].a = length(result[3].xyz);\\n result[3].xyz *= rot;\\n if (result[3].w > 0.0)\\n {\\n result[3].xyz /= result[3].w;\\n }\\n#endif\\n\\n return result;\\n}\\n\\n//=======================================================================\\n// Given a normal compute the gradient opacity factors\\n//\\nfloat computeGradientOpacityFactor(\\n vec4 normal, float goscale, float goshift, float gomin, float gomax)\\n{\\n#if defined(vtkGradientOpacityOn)\\n return clamp(normal.a*goscale + goshift, gomin, gomax);\\n#else\\n return 1.0;\\n#endif\\n}\\n\\n#if vtkLightComplexity > 0\\nvoid applyLighting(inout vec3 tColor, vec4 normal)\\n{\\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\\n vec3 specular = vec3(0.0, 0.0, 0.0);\\n //VTK::Light::Impl\\n tColor.rgb = tColor.rgb*(diffuse*vDiffuse + vAmbient) + specular*vSpecular;\\n}\\n#endif\\n\\n//=======================================================================\\n// Given a texture value compute the color and opacity\\n//\\nvec4 getColorForValue(vec4 tValue, vec3 posIS, vec3 tstep)\\n{\\n#ifdef vtkImageLabelOutlineOn\\n vec3 centerPosIS = fragCoordToIndexSpace(gl_FragCoord); // pos in texture space\\n vec4 centerValue = getTextureValue(centerPosIS);\\n bool pixelOnBorder = false;\\n vec4 tColor = texture2D(ctexture, vec2(centerValue.r * cscale0 + cshift0, 0.5));\\n\\n // Get alpha of segment from opacity function.\\n tColor.a = texture2D(otexture, vec2(centerValue.r * oscale0 + oshift0, 0.5)).r;\\n\\n // Only perform outline check on fragments rendering voxels that aren't invisible.\\n // Saves a bunch of needless checks on the background.\\n // TODO define epsilon when building shader?\\n if (float(tColor.a) > 0.01) {\\n for (int i = -outlineThickness; i <= outlineThickness; i++) {\\n for (int j = -outlineThickness; j <= outlineThickness; j++) {\\n if (i == 0 || j == 0) {\\n continue;\\n }\\n\\n vec4 neighborPixelCoord = vec4(gl_FragCoord.x + float(i),\\n gl_FragCoord.y + float(j),\\n gl_FragCoord.z, gl_FragCoord.w);\\n\\n vec3 neighborPosIS = fragCoordToIndexSpace(neighborPixelCoord);\\n vec4 value = getTextureValue(neighborPosIS);\\n\\n // If any of my neighbours are not the same value as I\\n // am, this means I am on the border of the segment.\\n // We can break the loops\\n if (any(notEqual(value, centerValue))) {\\n pixelOnBorder = true;\\n break;\\n }\\n }\\n\\n if (pixelOnBorder == true) {\\n break;\\n }\\n }\\n\\n // If I am on the border, I am displayed at full opacity\\n if (pixelOnBorder == true) {\\n tColor.a = 1.0;\\n }\\n }\\n\\n#else\\n // compute the normal and gradient magnitude if needed\\n // We compute it as a vec4 if possible otherwise a mat4\\n //\\n vec4 goFactor = vec4(1.0,1.0,1.0,1.0);\\n\\n // compute the normal vectors as needed\\n #if (vtkLightComplexity > 0) || defined(vtkGradientOpacityOn)\\n #if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\\n mat4 normalMat = computeMat4Normal(posIS, tValue, tstep);\\n #if !defined(vtkComponent0Proportional)\\n vec4 normal0 = normalMat[0];\\n #endif\\n #if !defined(vtkComponent1Proportional)\\n vec4 normal1 = normalMat[1];\\n #endif\\n #if vtkNumComponents > 2\\n #if !defined(vtkComponent2Proportional)\\n vec4 normal2 = normalMat[2];\\n #endif\\n #if vtkNumComponents > 3\\n #if !defined(vtkComponent3Proportional)\\n vec4 normal3 = normalMat[3];\\n #endif\\n #endif\\n #endif\\n #else\\n vec4 normal0 = computeNormal(posIS, tValue.a, tstep);\\n #endif\\n #endif\\n\\n // compute gradient opacity factors as needed\\n #if defined(vtkGradientOpacityOn)\\n #if !defined(vtkComponent0Proportional)\\n goFactor.x =\\n computeGradientOpacityFactor(normal0, goscale0, goshift0, gomin0, gomax0);\\n #endif\\n #if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\\n #if !defined(vtkComponent1Proportional)\\n goFactor.y =\\n computeGradientOpacityFactor(normal1, goscale1, goshift1, gomin1, gomax1);\\n #endif\\n #if vtkNumComponents > 2\\n #if !defined(vtkComponent2Proportional)\\n goFactor.z =\\n computeGradientOpacityFactor(normal2, goscale2, goshift2, gomin2, gomax2);\\n #endif\\n #if vtkNumComponents > 3\\n #if !defined(vtkComponent3Proportional)\\n goFactor.w =\\n computeGradientOpacityFactor(normal3, goscale3, goshift3, gomin3, gomax3);\\n #endif\\n #endif\\n #endif\\n #endif\\n #endif\\n\\n // single component is always independent\\n #if vtkNumComponents == 1\\n vec4 tColor = texture2D(ctexture, vec2(tValue.r * cscale0 + cshift0, 0.5));\\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, 0.5)).r;\\n #endif\\n\\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\\n vec4 tColor = mix0*texture2D(ctexture, vec2(tValue.r * cscale0 + cshift0, height0));\\n #if !defined(vtkComponent0Proportional)\\n tColor.a = goFactor.x*mix0*texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, height0)).r;\\n #else\\n float pwfValue = texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, height0)).r;\\n tColor *= pwfValue;\\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix0));\\n #endif\\n\\n vec3 tColor1 = mix1*texture2D(ctexture, vec2(tValue.g * cscale1 + cshift1, height1)).rgb;\\n #if !defined(vtkComponent1Proportional)\\n tColor.a += goFactor.y*mix1*texture2D(otexture, vec2(tValue.g * oscale1 + oshift1, height1)).r;\\n #else\\n float pwfValue = texture2D(otexture, vec2(tValue.g * oscale1 + oshift1, height1)).r;\\n tColor1 *= pwfValue;\\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix1));\\n #endif\\n\\n #if vtkNumComponents >= 3\\n vec3 tColor2 = mix2*texture2D(ctexture, vec2(tValue.b * cscale2 + cshift2, height2)).rgb;\\n #if !defined(vtkComponent2Proportional)\\n tColor.a += goFactor.z*mix2*texture2D(otexture, vec2(tValue.b * oscale2 + oshift2, height2)).r;\\n #else\\n float pwfValue = texture2D(otexture, vec2(tValue.b * oscale2 + oshift2, height2)).r;\\n tColor2 *= pwfValue;\\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix2));\\n #endif\\n\\n #if vtkNumComponents >= 4\\n vec3 tColor3 = mix3*texture2D(ctexture, vec2(tValue.a * cscale3 + cshift3, height3)).rgb;\\n #if !defined(vtkComponent3Proportional)\\n tColor.a += goFactor.w*mix3*texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, height3)).r;\\n #else\\n float pwfValue = texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, height3)).r;\\n tColor3 *= pwfValue;\\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix3));\\n #endif\\n #endif\\n #endif\\n #else // then not independent\\n\\n #if vtkNumComponents == 2\\n float lum = tValue.r * cscale0 + cshift0;\\n float alpha = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale1 + oshift1, 0.5)).r;\\n vec4 tColor = vec4(lum, lum, lum, alpha);\\n #endif\\n #if vtkNumComponents == 3\\n vec4 tColor;\\n tColor.r = tValue.r * cscale0 + cshift0;\\n tColor.g = tValue.g * cscale1 + cshift1;\\n tColor.b = tValue.b * cscale2 + cshift2;\\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale0 + oshift0, 0.5)).r;\\n #endif\\n #if vtkNumComponents == 4\\n vec4 tColor;\\n tColor.r = tValue.r * cscale0 + cshift0;\\n tColor.g = tValue.g * cscale1 + cshift1;\\n tColor.b = tValue.b * cscale2 + cshift2;\\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, 0.5)).r;\\n #endif\\n #endif // dependent\\n\\n // apply lighting if requested as appropriate\\n #if vtkLightComplexity > 0\\n #if !defined(vtkComponent0Proportional)\\n applyLighting(tColor.rgb, normal0);\\n #endif\\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\\n #if !defined(vtkComponent1Proportional)\\n applyLighting(tColor1, normal1);\\n #endif\\n #if vtkNumComponents >= 3\\n #if !defined(vtkComponent2Proportional)\\n applyLighting(tColor2, normal2);\\n #endif\\n #if vtkNumComponents >= 4\\n #if !defined(vtkComponent3Proportional)\\n applyLighting(tColor3, normal3);\\n #endif\\n #endif\\n #endif\\n #endif\\n#endif\\n\\n// perform final independent blend as needed\\n#if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\\n tColor.rgb += tColor1;\\n#if vtkNumComponents >= 3\\n tColor.rgb += tColor2;\\n#if vtkNumComponents >= 4\\n tColor.rgb += tColor3;\\n#endif\\n#endif\\n#endif\\n\\n#endif\\n\\n\\n\\n\\n\\n\\n\\nreturn tColor;\\n}\\n\\n\\n\\n//=======================================================================\\n// Apply the specified blend mode operation along the ray's path.\\n//\\nvoid applyBlend(vec3 posIS, vec3 endIS, float sampleDistanceIS, vec3 tdims)\\n{\\n vec3 tstep = 1.0/tdims;\\n\\n // start slightly inside and apply some jitter\\n vec3 delta = endIS - posIS;\\n vec3 stepIS = normalize(delta)*sampleDistanceIS;\\n float raySteps = length(delta)/sampleDistanceIS;\\n\\n // avoid 0.0 jitter\\n float jitter = 0.01 + 0.99*texture2D(jtexture, gl_FragCoord.xy/32.0).r;\\n float stepsTraveled = jitter;\\n\\n // local vars for the loop\\n vec4 color = vec4(0.0, 0.0, 0.0, 0.0);\\n vec4 tValue;\\n vec4 tColor;\\n\\n // if we have less than one step then pick the middle point\\n // as our value\\n // if (raySteps <= 1.0)\\n // {\\n // posIS = (posIS + endIS)*0.5;\\n // }\\n\\n // Perform initial step at the volume boundary\\n // compute the scalar\\n tValue = getTextureValue(posIS);\\n\\n #if vtkBlendMode == 0 // COMPOSITE_BLEND\\n // now map through opacity and color\\n tColor = getColorForValue(tValue, posIS, tstep);\\n\\n // handle very thin volumes\\n if (raySteps <= 1.0)\\n {\\n tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps);\\n gl_FragData[0] = tColor;\\n return;\\n }\\n\\n tColor.a = 1.0 - pow(1.0 - tColor.a, jitter);\\n color = vec4(tColor.rgb*tColor.a, tColor.a);\\n posIS += (jitter*stepIS);\\n\\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\\n {\\n if (stepsTraveled + 1.0 >= raySteps) { break; }\\n\\n // compute the scalar\\n tValue = getTextureValue(posIS);\\n\\n // now map through opacity and color\\n tColor = getColorForValue(tValue, posIS, tstep);\\n\\n float mix = (1.0 - color.a);\\n\\n // this line should not be needed but nvidia seems to not handle\\n // the break correctly on windows/chrome 58 angle\\n //mix = mix * sign(max(raySteps - stepsTraveled - 1.0, 0.0));\\n\\n color = color + vec4(tColor.rgb*tColor.a, tColor.a)*mix;\\n stepsTraveled++;\\n posIS += stepIS;\\n if (color.a > 0.99) { color.a = 1.0; break; }\\n }\\n\\n if (color.a < 0.99 && (raySteps - stepsTraveled) > 0.0)\\n {\\n posIS = endIS;\\n\\n // compute the scalar\\n tValue = getTextureValue(posIS);\\n\\n // now map through opacity and color\\n tColor = getColorForValue(tValue, posIS, tstep);\\n tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps - stepsTraveled);\\n\\n float mix = (1.0 - color.a);\\n color = color + vec4(tColor.rgb*tColor.a, tColor.a)*mix;\\n }\\n\\n gl_FragData[0] = vec4(color.rgb/color.a, color.a);\\n #endif\\n #if vtkBlendMode == 1 || vtkBlendMode == 2\\n // MAXIMUM_INTENSITY_BLEND || MINIMUM_INTENSITY_BLEND\\n // Find maximum/minimum intensity along the ray.\\n\\n // Define the operation we will use (min or max)\\n #if vtkBlendMode == 1\\n #define OP max\\n #else\\n #define OP min\\n #endif\\n\\n // If the clipping range is shorter than the sample distance\\n // we can skip the sampling loop along the ray.\\n if (raySteps <= 1.0)\\n {\\n gl_FragData[0] = getColorForValue(tValue, posIS, tstep);\\n return;\\n }\\n\\n vec4 value = tValue;\\n posIS += (jitter*stepIS);\\n\\n // Sample along the ray until MaximumSamplesValue,\\n // ending slightly inside the total distance\\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\\n {\\n // If we have reached the last step, break\\n if (stepsTraveled + 1.0 >= raySteps) { break; }\\n\\n // compute the scalar\\n tValue = getTextureValue(posIS);\\n\\n // Update the maximum value if necessary\\n value = OP(tValue, value);\\n\\n // Otherwise, continue along the ray\\n stepsTraveled++;\\n posIS += stepIS;\\n }\\n\\n // Perform the last step along the ray using the\\n // residual distance\\n posIS = endIS;\\n tValue = getTextureValue(posIS);\\n value = OP(tValue, value);\\n\\n // Now map through opacity and color\\n gl_FragData[0] = getColorForValue(value, posIS, tstep);\\n #endif\\n #if vtkBlendMode == 3 //AVERAGE_INTENSITY_BLEND\\n vec4 averageIPScalarRangeMin = vec4 (\\n //VTK::AverageIPScalarRangeMin,\\n //VTK::AverageIPScalarRangeMin,\\n //VTK::AverageIPScalarRangeMin,\\n 1.0);\\n vec4 averageIPScalarRangeMax = vec4(\\n //VTK::AverageIPScalarRangeMax,\\n //VTK::AverageIPScalarRangeMax,\\n //VTK::AverageIPScalarRangeMax,\\n 1.0);\\n\\n vec4 sum = vec4(0.);\\n\\n averageIPScalarRangeMin.a = tValue.a;\\n averageIPScalarRangeMax.a = tValue.a;\\n\\n if (all(greaterThanEqual(tValue, averageIPScalarRangeMin)) &&\\n all(lessThanEqual(tValue, averageIPScalarRangeMax))) {\\n sum += tValue;\\n }\\n\\n if (raySteps <= 1.0) {\\n gl_FragData[0] = getColorForValue(sum, posIS, tstep);\\n return;\\n }\\n\\n posIS += (jitter*stepIS);\\n\\n // Sample along the ray until MaximumSamplesValue,\\n // ending slightly inside the total distance\\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\\n {\\n // If we have reached the last step, break\\n if (stepsTraveled + 1.0 >= raySteps) { break; }\\n\\n // compute the scalar\\n tValue = getTextureValue(posIS);\\n\\n // One can control the scalar range by setting the AverageIPScalarRange to disregard scalar values, not in the range of interest, from the average computation.\\n // Notes:\\n // - We are comparing all values in the texture to see if any of them\\n // are outside of the scalar range. In the future we might want to allow\\n // scalar ranges for each component.\\n // - We are setting the alpha channel for averageIPScalarRangeMin and\\n // averageIPScalarRangeMax so that we do not trigger this 'continue'\\n // based on the alpha channel comparison.\\n // - There might be a better way to do this. I'm not sure if there is an\\n // equivalent of 'any' which only operates on RGB, though I suppose\\n // we could write an 'anyRGB' function and see if that is faster.\\n averageIPScalarRangeMin.a = tValue.a;\\n averageIPScalarRangeMax.a = tValue.a;\\n if (any(lessThan(tValue, averageIPScalarRangeMin)) ||\\n any(greaterThan(tValue, averageIPScalarRangeMax))) {\\n continue;\\n }\\n\\n // Sum the values across each step in the path\\n sum += tValue;\\n\\n // Otherwise, continue along the ray\\n stepsTraveled++;\\n posIS += stepIS;\\n }\\n\\n // Perform the last step along the ray using the\\n // residual distance\\n posIS = endIS;\\n\\n // compute the scalar\\n tValue = getTextureValue(posIS);\\n\\n // One can control the scalar range by setting the AverageIPScalarRange to disregard scalar values, not in the range of interest, from the average computation\\n if (all(greaterThanEqual(tValue, averageIPScalarRangeMin)) &&\\n all(lessThanEqual(tValue, averageIPScalarRangeMax))) {\\n sum += tValue;\\n\\n stepsTraveled++;\\n }\\n\\n sum /= vec4(stepsTraveled, stepsTraveled, stepsTraveled, 1.0);\\n\\n gl_FragData[0] = getColorForValue(sum, posIS, tstep);\\n #endif\\n}\\n\\n//=======================================================================\\n// Compute a new start and end point for a given ray based\\n// on the provided bounded clipping plane (aka a rectangle)\\nvoid getRayPointIntersectionBounds(\\n vec3 rayPos, vec3 rayDir,\\n vec3 planeDir, float planeDist,\\n inout vec2 tbounds, vec3 vPlaneX, vec3 vPlaneY,\\n float vSize1, float vSize2)\\n{\\n float result = dot(rayDir, planeDir);\\n if (result == 0.0)\\n {\\n return;\\n }\\n result = -1.0 * (dot(rayPos, planeDir) + planeDist) / result;\\n vec3 xposVC = rayPos + rayDir*result;\\n vec3 vxpos = xposVC - vOriginVC;\\n vec2 vpos = vec2(\\n dot(vxpos, vPlaneX),\\n dot(vxpos, vPlaneY));\\n\\n // on some apple nvidia systems this does not work\\n // if (vpos.x < 0.0 || vpos.x > vSize1 ||\\n // vpos.y < 0.0 || vpos.y > vSize2)\\n // even just\\n // if (vpos.x < 0.0 || vpos.y < 0.0)\\n // fails\\n // so instead we compute a value that represents in and out\\n //and then compute the return using this value\\n float xcheck = max(0.0, vpos.x * (vpos.x - vSize1)); // 0 means in bounds\\n float check = sign(max(xcheck, vpos.y * (vpos.y - vSize2))); // 0 means in bounds, 1 = out\\n\\n tbounds = mix(\\n vec2(min(tbounds.x, result), max(tbounds.y, result)), // in value\\n tbounds, // out value\\n check); // 0 in 1 out\\n}\\n\\n//=======================================================================\\n// given a\\n// - ray direction (rayDir)\\n// - starting point (vertexVCVSOutput)\\n// - bounding planes of the volume\\n// - optionally depth buffer values\\n// - far clipping plane\\n// compute the start/end distances of the ray we need to cast\\nvec2 computeRayDistances(vec3 rayDir, vec3 tdims)\\n{\\n vec2 dists = vec2(100.0*camFar, -1.0);\\n\\n vec3 vSize = vSpacing*(tdims - 1.0);\\n\\n // all this is in View Coordinates\\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\\n vPlaneNormal0, vPlaneDistance0, dists, vPlaneNormal2, vPlaneNormal4,\\n vSize.y, vSize.z);\\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\\n vPlaneNormal1, vPlaneDistance1, dists, vPlaneNormal2, vPlaneNormal4,\\n vSize.y, vSize.z);\\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\\n vPlaneNormal2, vPlaneDistance2, dists, vPlaneNormal0, vPlaneNormal4,\\n vSize.x, vSize.z);\\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\\n vPlaneNormal3, vPlaneDistance3, dists, vPlaneNormal0, vPlaneNormal4,\\n vSize.x, vSize.z);\\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\\n vPlaneNormal4, vPlaneDistance4, dists, vPlaneNormal0, vPlaneNormal2,\\n vSize.x, vSize.y);\\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\\n vPlaneNormal5, vPlaneDistance5, dists, vPlaneNormal0, vPlaneNormal2,\\n vSize.x, vSize.y);\\n\\n //VTK::ClipPlane::Impl\\n\\n // do not go behind front clipping plane\\n dists.x = max(0.0,dists.x);\\n\\n // do not go PAST far clipping plane\\n float farDist = -camThick/rayDir.z;\\n dists.y = min(farDist,dists.y);\\n\\n // Do not go past the zbuffer value if set\\n // This is used for intermixing opaque geometry\\n //VTK::ZBuffer::Impl\\n\\n return dists;\\n}\\n\\n//=======================================================================\\n// Compute the index space starting position (pos) and end\\n// position\\n//\\nvoid computeIndexSpaceValues(out vec3 pos, out vec3 endPos, out float sampleDistanceIS, vec3 rayDir, vec2 dists)\\n{\\n // compute starting and ending values in volume space\\n pos = vertexVCVSOutput + dists.x*rayDir;\\n pos = pos - vOriginVC;\\n // convert to volume basis and origin\\n pos = vec3(\\n dot(pos, vPlaneNormal0),\\n dot(pos, vPlaneNormal2),\\n dot(pos, vPlaneNormal4));\\n\\n endPos = vertexVCVSOutput + dists.y*rayDir;\\n endPos = endPos - vOriginVC;\\n endPos = vec3(\\n dot(endPos, vPlaneNormal0),\\n dot(endPos, vPlaneNormal2),\\n dot(endPos, vPlaneNormal4));\\n\\n float delta = length(endPos - pos);\\n\\n pos *= vVCToIJK;\\n endPos *= vVCToIJK;\\n\\n float delta2 = length(endPos - pos);\\n sampleDistanceIS = sampleDistance*delta2/delta;\\n}\\n\\nvoid main()\\n{\\n\\n vec3 rayDirVC;\\n\\n if (cameraParallel == 1)\\n {\\n // Camera is parallel, so the rayDir is just the direction of the camera.\\n rayDirVC = vec3(0.0, 0.0, -1.0);\\n } else {\\n // camera is at 0,0,0 so rayDir for perspective is just the vc coord\\n rayDirVC = normalize(vertexVCVSOutput);\\n }\\n\\n vec3 tdims = vec3(volumeDimensions);\\n\\n // compute the start and end points for the ray\\n vec2 rayStartEndDistancesVC = computeRayDistances(rayDirVC, tdims);\\n\\n // do we need to composite? aka does the ray have any length\\n // If not, bail out early\\n if (rayStartEndDistancesVC.y <= rayStartEndDistancesVC.x)\\n {\\n discard;\\n }\\n\\n // IS = Index Space\\n vec3 posIS;\\n vec3 endIS;\\n float sampleDistanceIS;\\n computeIndexSpaceValues(posIS, endIS, sampleDistanceIS, rayDirVC, rayStartEndDistancesVC);\\n\\n // Perform the blending operation along the ray\\n applyBlend(posIS, endIS, sampleDistanceIS, tdims);\\n}\\n\"\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeFS.glsl?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = \"//VTK::System::Dec\\n\\n/*=========================================================================\\n\\n Program: Visualization Toolkit\\n Module: vtkPolyDataVS.glsl\\n\\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\\n All rights reserved.\\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\\n\\n This software is distributed WITHOUT ANY WARRANTY; without even\\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\\n PURPOSE. See the above copyright notice for more information.\\n\\n=========================================================================*/\\n\\nattribute vec4 vertexDC;\\n\\nvarying vec3 vertexVCVSOutput;\\nuniform mat4 PCVCMatrix;\\n\\nuniform float dcxmin;\\nuniform float dcxmax;\\nuniform float dcymin;\\nuniform float dcymax;\\n\\nvoid main()\\n{\\n // dcsmall is the device coords reduced to the\\n // x y area covered by the volume\\n vec4 dcsmall = vec4(\\n dcxmin + 0.5 * (vertexDC.x + 1.0) * (dcxmax - dcxmin),\\n dcymin + 0.5 * (vertexDC.y + 1.0) * (dcymax - dcymin),\\n vertexDC.z,\\n vertexDC.w);\\n vec4 vcpos = PCVCMatrix * dcsmall;\\n vertexVCVSOutput = vcpos.xyz/vcpos.w;\\n gl_Position = dcsmall;\\n}\\n\"\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Profiles/Geometry.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Profiles/Geometry.js ***! - \********************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Profiles_Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Profiles/Geometry */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Geometry.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Profiles_Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Profiles/Geometry */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Geometry.js\");\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Profiles/Geometry.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Profiles/Glyph.js": -/*!*****************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Profiles/Glyph.js ***! - \*****************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Profiles_Glyph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Profiles/Glyph */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Glyph.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Profiles_Glyph__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Profiles/Glyph */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Glyph.js\");\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Profiles/Glyph.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Profiles/Volume.js": -/*!******************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Profiles/Volume.js ***! - \******************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Profiles_Volume__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Profiles/Volume */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Volume.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Profiles_Volume__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Profiles/Volume */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Volume.js\");\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Profiles/Volume.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderPass/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderPass/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n\nfunction vtkRenderPass(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkRenderPass');\n\n publicAPI.getOperation = function () {\n return model.currentOperation;\n };\n\n publicAPI.setCurrentOperation = function (val) {\n model.currentOperation = val;\n model.currentTraverseOperation = \"traverse\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(model.currentOperation));\n };\n\n publicAPI.getTraverseOperation = function () {\n return model.currentTraverseOperation;\n }; // by default this class will traverse all of its\n // preDelegateOperations, then call its delegate render passes\n // the traverse all of its postDelegateOperations\n // any of those three arrays can be empty\n\n\n publicAPI.traverse = function (viewNode) {\n var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (model.deleted) {\n return;\n } // we just render our delegates in order\n\n\n model.currentParent = parent;\n model.preDelegateOperations.forEach(function (val) {\n publicAPI.setCurrentOperation(val);\n viewNode.traverse(publicAPI);\n });\n model.delegates.forEach(function (val) {\n val.traverse(viewNode, publicAPI);\n });\n model.postDelegateOperations.forEach(function (val) {\n publicAPI.setCurrentOperation(val);\n viewNode.traverse(publicAPI);\n });\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n delegates: [],\n currentOperation: null,\n preDelegateOperations: [],\n postDelegateOperations: [],\n currentParent: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['currentOperation']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['delegates', 'currentParent', 'preDelegateOperations', 'postDelegateOperations']); // Object methods\n\n vtkRenderPass(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkRenderPass'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderPass/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderWindowViewNode/index.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderWindowViewNode/index.js ***! - \****************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n\n // ----------------------------------------------------------------------------\n// vtkRenderWindowViewNode is intended to be a superclass for all api specific\n// RenderWindows. It is intended to define a common API that can be invoked\n// upon an api specific render window and provide some common method\n// implementations. If your application requires communicating with an api specific\n// view try to limit such interactions to methods defined in this class.\n// ----------------------------------------------------------------------------\n// ----------------------------------------------------------------------------\n// vtkRenderWindowViewNode methods\n// ----------------------------------------------------------------------------\n\nfunction vtkRenderWindowViewNode(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkRenderWindowViewNode');\n\n publicAPI.getViewNodeFactory = function () {\n return null;\n };\n\n publicAPI.getAspectRatio = function () {\n return model.size[0] / model.size[1];\n };\n\n publicAPI.getAspectRatioForRenderer = function (renderer) {\n var viewport = renderer.getViewportByReference();\n return model.size[0] * (viewport[2] - viewport[0]) / ((viewport[3] - viewport[1]) * model.size[1]);\n };\n\n publicAPI.isInViewport = function (x, y, viewport) {\n var vCoords = viewport.getViewportByReference();\n var size = publicAPI.getFramebufferSize();\n\n if (vCoords[0] * size[0] <= x && vCoords[2] * size[0] >= x && vCoords[1] * size[1] <= y && vCoords[3] * size[1] >= y) {\n return true;\n }\n\n return false;\n };\n\n publicAPI.getViewportSize = function (viewport) {\n var vCoords = viewport.getViewportByReference();\n var size = publicAPI.getFramebufferSize();\n return [(vCoords[2] - vCoords[0]) * size[0], (vCoords[3] - vCoords[1]) * size[1]];\n };\n\n publicAPI.getViewportCenter = function (viewport) {\n var size = publicAPI.getViewportSize(viewport);\n return [size[0] * 0.5, size[1] * 0.5];\n };\n\n publicAPI.displayToNormalizedDisplay = function (x, y, z) {\n var size = publicAPI.getFramebufferSize();\n return [x / size[0], y / size[1], z];\n };\n\n publicAPI.normalizedDisplayToDisplay = function (x, y, z) {\n var size = publicAPI.getFramebufferSize();\n return [x * size[0], y * size[1], z];\n };\n\n publicAPI.worldToView = function (x, y, z, renderer) {\n return renderer.worldToView(x, y, z);\n };\n\n publicAPI.viewToWorld = function (x, y, z, renderer) {\n return renderer.viewToWorld(x, y, z);\n };\n\n publicAPI.worldToDisplay = function (x, y, z, renderer) {\n var val = renderer.worldToView(x, y, z);\n var dims = publicAPI.getViewportSize(renderer);\n var val2 = renderer.viewToProjection(val[0], val[1], val[2], dims[0] / dims[1]);\n var val3 = renderer.projectionToNormalizedDisplay(val2[0], val2[1], val2[2]);\n return publicAPI.normalizedDisplayToDisplay(val3[0], val3[1], val3[2]);\n };\n\n publicAPI.displayToWorld = function (x, y, z, renderer) {\n var val = publicAPI.displayToNormalizedDisplay(x, y, z);\n var val2 = renderer.normalizedDisplayToProjection(val[0], val[1], val[2]);\n var dims = publicAPI.getViewportSize(renderer);\n var val3 = renderer.projectionToView(val2[0], val2[1], val2[2], dims[0] / dims[1]);\n return renderer.viewToWorld(val3[0], val3[1], val3[2]);\n };\n\n publicAPI.normalizedDisplayToViewport = function (x, y, z, renderer) {\n var vCoords = renderer.getViewportByReference();\n vCoords = publicAPI.normalizedDisplayToDisplay(vCoords[0], vCoords[1], 0.0);\n var coords = publicAPI.normalizedDisplayToDisplay(x, y, z);\n return [coords[0] - vCoords[0] - 0.5, coords[1] - vCoords[1] - 0.5, z];\n };\n\n publicAPI.viewportToNormalizedViewport = function (x, y, z, renderer) {\n var size = publicAPI.getViewportSize(renderer);\n\n if (size && size[0] !== 0 && size[1] !== 0) {\n return [x / (size[0] - 1.0), y / (size[1] - 1.0), z];\n }\n\n return [x, y, z];\n };\n\n publicAPI.normalizedViewportToViewport = function (x, y, z) {\n var size = publicAPI.getFramebufferSize();\n return [x * (size[0] - 1.0), y * (size[1] - 1.0), z];\n };\n\n publicAPI.displayToLocalDisplay = function (x, y, z) {\n var size = publicAPI.getFramebufferSize();\n return [x, size[1] - y - 1, z];\n };\n\n publicAPI.viewportToNormalizedDisplay = function (x, y, z, renderer) {\n var vCoords = renderer.getViewportByReference();\n vCoords = publicAPI.normalizedDisplayToDisplay(vCoords[0], vCoords[1], 0.0);\n var x2 = x + vCoords[0] + 0.5;\n var y2 = y + vCoords[1] + 0.5;\n return publicAPI.displayToNormalizedDisplay(x2, y2, z);\n };\n\n publicAPI.getPixelData = function (x1, y1, x2, y2) {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro('not implemented');\n return undefined;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n size: undefined,\n selector: undefined\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n\n if (!model.size) {\n model.size = [300, 300];\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['size'], 2);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['selector']); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object methods\n\n vtkRenderWindowViewNode(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkRenderWindowViewNode'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderWindowViewNode/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js ***! - \****************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\nvar PASS_TYPES = ['Build', 'Render']; // ----------------------------------------------------------------------------\n// vtkViewNode methods\n// ----------------------------------------------------------------------------\n\nfunction vtkViewNode(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkViewNode'); // Builds myself.\n\n publicAPI.build = function (prepass) {}; // Renders myself\n\n\n publicAPI.render = function (prepass) {};\n\n publicAPI.traverse = function (renderPass) {\n // we can choose to do special\n // traversal here based on pass\n var passTraversal = renderPass.getTraverseOperation();\n var fn = publicAPI[passTraversal];\n\n if (fn) {\n fn(renderPass);\n return;\n } // default traversal\n\n\n publicAPI.apply(renderPass, true);\n\n for (var index = 0; index < model.children.length; index++) {\n model.children[index].traverse(renderPass);\n }\n\n publicAPI.apply(renderPass, false);\n };\n\n publicAPI.apply = function (renderPass, prepass) {\n var customRenderPass = publicAPI[renderPass.getOperation()];\n\n if (customRenderPass) {\n customRenderPass(prepass, renderPass);\n }\n };\n\n publicAPI.getViewNodeFor = function (dataObject) {\n if (model.renderable === dataObject) {\n return publicAPI;\n }\n\n for (var index = 0; index < model.children.length; ++index) {\n var child = model.children[index];\n var vn = child.getViewNodeFor(dataObject);\n\n if (vn) {\n return vn;\n }\n }\n\n return undefined;\n };\n\n publicAPI.getFirstAncestorOfType = function (type) {\n if (!model.parent) {\n return null;\n }\n\n if (model.parent.isA(type)) {\n return model.parent;\n }\n\n return model.parent.getFirstAncestorOfType(type);\n };\n\n publicAPI.addMissingNode = function (dobj) {\n if (!dobj) {\n return;\n }\n\n var result = model._renderableChildMap.get(dobj); // if found just mark as visited\n\n\n if (result !== undefined) {\n result.setVisited(true);\n } else {\n // otherwise create a node\n var newNode = publicAPI.createViewNode(dobj);\n\n if (newNode) {\n newNode.setParent(publicAPI);\n newNode.setVisited(true);\n\n model._renderableChildMap.set(dobj, newNode);\n\n model.children.push(newNode);\n }\n }\n };\n\n publicAPI.addMissingNodes = function (dataObjs) {\n if (!dataObjs || !dataObjs.length) {\n return;\n }\n\n for (var index = 0; index < dataObjs.length; ++index) {\n var dobj = dataObjs[index];\n\n var result = model._renderableChildMap.get(dobj); // if found just mark as visited\n\n\n if (result !== undefined) {\n result.setVisited(true);\n } else {\n // otherwise create a node\n var newNode = publicAPI.createViewNode(dobj);\n\n if (newNode) {\n newNode.setParent(publicAPI);\n newNode.setVisited(true);\n\n model._renderableChildMap.set(dobj, newNode);\n\n model.children.push(newNode);\n }\n }\n }\n };\n\n publicAPI.prepareNodes = function () {\n for (var index = 0; index < model.children.length; ++index) {\n model.children[index].setVisited(false);\n }\n };\n\n publicAPI.setVisited = function (val) {\n model.visited = val;\n };\n\n publicAPI.removeUnusedNodes = function () {\n var deleted = null;\n\n for (var index = 0; index < model.children.length; ++index) {\n var child = model.children[index];\n var visited = child.getVisited();\n\n if (!visited) {\n var renderable = child.getRenderable();\n\n if (renderable) {\n model._renderableChildMap.delete(renderable);\n }\n\n if (!deleted) {\n deleted = [];\n }\n\n deleted.push(child);\n } else {\n child.setVisited(false);\n }\n }\n\n if (deleted) {\n // slow does alloc but not as common\n model.children = model.children.filter(function (el) {\n return !deleted.includes(el);\n });\n }\n };\n\n publicAPI.createViewNode = function (dataObj) {\n if (!model.myFactory) {\n vtkErrorMacro('Cannot create view nodes without my own factory');\n return null;\n }\n\n var ret = model.myFactory.createNode(dataObj);\n\n if (ret) {\n ret.setRenderable(dataObj);\n }\n\n return ret;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n parent: null,\n renderable: null,\n myFactory: null,\n children: [],\n visited: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'event');\n model._renderableChildMap = new Map();\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['visited']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['parent', 'renderable', 'myFactory']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['children']); // Object methods\n\n vtkViewNode(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkViewNode'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n PASS_TYPES: PASS_TYPES\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory/index.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory/index.js ***! - \***********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkViewNodeFactory methods\n// ----------------------------------------------------------------------------\n\nfunction vtkViewNodeFactory(publicAPI, model) {\n // Make sure our overrides is just for our instance not shared with everyone...\n if (!model.overrides) {\n model.overrides = {};\n } // Set our className\n\n\n model.classHierarchy.push('vtkViewNodeFactory');\n\n publicAPI.createNode = function (dataObject) {\n if (dataObject.isDeleted()) {\n return null;\n }\n\n var cpt = 0;\n var className = dataObject.getClassName(cpt++);\n var isObject = false;\n var keys = Object.keys(model.overrides);\n\n while (className && !isObject) {\n if (keys.indexOf(className) !== -1) {\n isObject = true;\n } else {\n className = dataObject.getClassName(cpt++);\n }\n }\n\n if (!isObject) {\n return null;\n }\n\n var vn = model.overrides[className]();\n vn.setMyFactory(publicAPI);\n return vn;\n };\n\n publicAPI.registerOverride = function (className, func) {\n model.overrides[className] = func;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {// overrides: {},\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Object methods\n\n vtkViewNodeFactory(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkViewNodeFactory'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Actor/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Actor/index.js ***! - \*********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUActor methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUActor(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUActor'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.WebGPURenderer = publicAPI.getFirstAncestorOfType('vtkWebGPURenderer');\n model.WebGPURenderWindow = model.WebGPURenderer.getFirstAncestorOfType('vtkWebGPURenderWindow');\n\n if (model.propID === undefined) {\n model.propID = model.WebGPURenderWindow.getUniquePropID();\n }\n\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getMapper());\n publicAPI.removeUnusedNodes();\n }\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseOpaquePass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || !model.renderable.getIsOpaque() || model.WebGPURenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n\n if (model.children[0]) {\n model.children[0].traverse(renderPass);\n }\n\n publicAPI.apply(renderPass, false);\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseTranslucentPass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || model.renderable.getIsOpaque() || model.WebGPURenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n\n if (model.children[0]) {\n model.children[0].traverse(renderPass);\n }\n\n publicAPI.apply(renderPass, false);\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (model.renderable.getIsOpaque()) {\n renderPass.incrementOpaqueActorCount();\n } else {\n renderPass.incrementTranslucentActorCount();\n }\n }\n };\n\n publicAPI.getBufferShift = function (wgpuRen) {\n publicAPI.getKeyMatrices(wgpuRen);\n return model.bufferShift;\n };\n\n publicAPI.getKeyMatrices = function (wgpuRen) {\n // has the actor or stabilization center changed?\n if (Math.max(model.renderable.getMTime(), wgpuRen.getStabilizedTime().getMTime()) > model.keyMatricesTime.getMTime()) {\n model.renderable.computeMatrix();\n var mcwc = model.renderable.getMatrix(); // compute the net shift\n\n var center = wgpuRen.getStabilizedCenterByReference();\n model.bufferShift[0] = mcwc[3] - center[0];\n model.bufferShift[1] = mcwc[7] - center[1];\n model.bufferShift[2] = mcwc[11] - center[2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.bcwc, mcwc);\n\n if (model.renderable.getIsIdentity()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(model.keyMatrices.normalMatrix);\n } else {\n // we use bcwc BEFORE the translate below (just to get transposed mcvc)\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.keyMatrices.normalMatrix, model.keyMatrices.bcwc); // zero out translation\n\n model.keyMatrices.normalMatrix[3] = 0.0;\n model.keyMatrices.normalMatrix[7] = 0.0;\n model.keyMatrices.normalMatrix[11] = 0.0;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(model.keyMatrices.normalMatrix, model.keyMatrices.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.normalMatrix, model.keyMatrices.normalMatrix);\n } // only meed the buffer shift to get to world\n\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.keyMatrices.bcwc, model.keyMatrices.bcwc, [-model.bufferShift[0], -model.bufferShift[1], -model.bufferShift[2]]); // to get to stabilized we also need the center\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.keyMatrices.bcsc, model.keyMatrices.bcwc, [-center[0], -center[1], -center[2]]);\n model.keyMatricesTime.modified();\n }\n\n return model.keyMatrices;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n keyMatricesTime: null,\n keyMatrices: null,\n propID: undefined,\n bufferShift: undefined\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatricesTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(model.keyMatricesTime, {\n mtime: 0\n });\n model.keyMatrices = {\n normalMatrix: new Float64Array(16),\n bcwc: new Float64Array(16),\n bcsc: new Float64Array(16)\n };\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get(publicAPI, model, ['propID', 'keyMatricesTime']);\n model.bufferShift = [0, 0, 0, 0]; // Object methods\n\n vtkWebGPUActor(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkActor', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Actor/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/BindGroup/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/BindGroup/index.js ***! - \*************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkWebGPUBindGroup methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUBindGroup(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUBindGroup');\n\n publicAPI.addBindable = function (bindable) {\n // only add new bindables\n for (var i = 0; i < model.bindables.length; i++) {\n if (model.bindables[i] === bindable) {\n return;\n }\n }\n\n model.bindables.push(bindable);\n publicAPI.modified();\n };\n\n publicAPI.getBindGroupLayout = function (device) {\n var entries = [];\n\n for (var i = 0; i < model.bindables.length; i++) {\n var entry = model.bindables[i].getBindGroupLayoutEntry();\n entry.binding = i;\n entries.push(entry);\n }\n\n return device.getBindGroupLayout({\n entries: entries\n });\n };\n\n publicAPI.getBindGroup = function (device) {\n // check mtime\n var mtime = publicAPI.getMTime();\n\n for (var i = 0; i < model.bindables.length; i++) {\n var tm = model.bindables[i].getBindGroupTime();\n mtime = tm > mtime ? tm : mtime;\n }\n\n if (mtime < model.bindGroupTime.getMTime()) {\n return model.bindGroup;\n }\n\n var entries = [];\n\n for (var _i = 0; _i < model.bindables.length; _i++) {\n var entry = model.bindables[_i].getBindGroupEntry();\n\n entry.binding = _i;\n entries.push(entry);\n }\n\n model.bindGroup = device.getHandle().createBindGroup({\n layout: publicAPI.getBindGroupLayout(device),\n entries: entries\n });\n model.bindGroupTime.modified();\n return model.bindGroup;\n };\n\n publicAPI.getShaderCode = function (pipeline) {\n var lines = [];\n var bgroup = pipeline.getBindGroupLayoutCount(model.name);\n\n for (var i = 0; i < model.bindables.length; i++) {\n lines.push(model.bindables[i].getShaderCode(i, bgroup));\n }\n\n return lines.join('\\n');\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n device: null,\n handle: null,\n name: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.bindables = [];\n model.bindGroupTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.bindGroupTime, {\n mtime: 0\n });\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['bindGroupTime', 'handle', 'sizeInBytes', 'usage']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['name', 'device', 'arrayInformation', 'sourceTime']);\n vtkWebGPUBindGroup(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/BindGroup/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Buffer/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Buffer/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BufferManager_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BufferManager/Constants */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n // methods we forward to the handle\n\nvar forwarded = ['getMappedRange', 'mapAsync', 'unmap'];\n\nfunction bufferSubData(device, destBuffer, destOffset, srcArrayBuffer) {\n var byteCount = srcArrayBuffer.byteLength;\n var srcBuffer = device.createBuffer({\n size: byteCount,\n\n /* eslint-disable no-undef */\n usage: GPUBufferUsage.COPY_SRC,\n\n /* eslint-enable no-undef */\n mappedAtCreation: true\n });\n var arrayBuffer = srcBuffer.getMappedRange(0, byteCount);\n new Uint8Array(arrayBuffer).set(new Uint8Array(srcArrayBuffer)); // memcpy\n\n srcBuffer.unmap();\n var encoder = device.createCommandEncoder();\n encoder.copyBufferToBuffer(srcBuffer, 0, destBuffer, destOffset, byteCount);\n var commandBuffer = encoder.finish();\n var queue = device.queue;\n queue.submit([commandBuffer]);\n srcBuffer.destroy();\n} // ----------------------------------------------------------------------------\n// vtkWebGPUBufferManager methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkWebGPUBuffer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUBuffer');\n\n publicAPI.create = function (sizeInBytes, usage) {\n model.handle = model.device.getHandle().createBuffer({\n size: sizeInBytes,\n usage: usage\n });\n model.sizeInBytes = sizeInBytes;\n model.usage = usage;\n };\n\n publicAPI.write = function (data) {\n bufferSubData(model.device.getHandle(), model.handle, 0, data.buffer);\n };\n\n publicAPI.createAndWrite = function (data, usage) {\n model.handle = model.device.getHandle().createBuffer({\n size: data.byteLength,\n usage: usage,\n mappedAtCreation: true\n });\n model.sizeInBytes = data.byteLength;\n model.usage = usage;\n new Uint8Array(model.handle.getMappedRange()).set(new Uint8Array(data.buffer)); // memcpy\n\n model.handle.unmap();\n }; // simple forwarders\n\n\n var _loop = function _loop(i) {\n publicAPI[forwarded[i]] = function () {\n var _model$handle;\n\n return (_model$handle = model.handle)[forwarded[i]].apply(_model$handle, arguments);\n };\n };\n\n for (var i = 0; i < forwarded.length; i++) {\n _loop(i);\n }\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n device: null,\n handle: null,\n sizeInBytes: 0,\n strideInBytes: 0,\n arrayInformation: null,\n usage: null,\n sourceTime: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['handle', 'sizeInBytes', 'usage']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['strideInBytes', 'device', 'arrayInformation', 'sourceTime']);\n vtkWebGPUBuffer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_WebGPU_BufferManager_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Buffer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/Constants.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/Constants.js ***! - \*********************************************************************************/ -/*! exports provided: BufferUsage, PrimitiveTypes, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BufferUsage\", function() { return BufferUsage; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PrimitiveTypes\", function() { return PrimitiveTypes; });\nvar BufferUsage = {\n Verts: 0,\n Lines: 1,\n Triangles: 2,\n Strips: 3,\n LinesFromStrips: 4,\n LinesFromTriangles: 5,\n Points: 6,\n UniformArray: 7,\n PointArray: 8,\n NormalsFromPoints: 9,\n Texture: 10,\n RawVertex: 11,\n Storage: 12\n};\nvar PrimitiveTypes = {\n Start: 0,\n Points: 0,\n Lines: 1,\n Triangles: 2,\n TriangleStrips: 3,\n TriangleEdges: 4,\n TriangleStripEdges: 5,\n End: 6\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n BufferUsage: BufferUsage,\n PrimitiveTypes: PrimitiveTypes\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js ***! - \*****************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Buffer */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Buffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Types */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js\");\n/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Constants */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n\nvar BufferUsage = _Constants__WEBPACK_IMPORTED_MODULE_5__[\"default\"].BufferUsage,\n PrimitiveTypes = _Constants__WEBPACK_IMPORTED_MODULE_5__[\"default\"].PrimitiveTypes;\nvar Representation = vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Representation;\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkDebugMacro\"]; // the webgpu constants all show up as undefined\n\n/* eslint-disable no-undef */\n// ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\nvar STATIC = {};\n\nfunction requestMatches(req1, req2) {\n if (req1.time !== req2.time) return false;\n if (req1.format !== req2.format) return false;\n if (req1.usage !== req2.usage) return false;\n if (req1.hash !== req2.hash) return false;\n return true;\n}\n\nvar cellCounters = {\n // easy, every input point becomes an output point\n anythingToPoints: function anythingToPoints(numPoints, cellPts) {\n return numPoints;\n },\n linesToWireframe: function linesToWireframe(numPoints, cellPts) {\n if (numPoints > 1) {\n return (numPoints - 1) * 2;\n }\n\n return 0;\n },\n polysToWireframe: function polysToWireframe(numPoints, cellPts) {\n if (numPoints > 2) {\n return numPoints * 2;\n }\n\n return 0;\n },\n stripsToWireframe: function stripsToWireframe(numPoints, cellPts) {\n if (numPoints > 2) {\n return numPoints * 4 - 6;\n }\n\n return 0;\n },\n polysToSurface: function polysToSurface(npts, cellPts) {\n if (npts > 2) {\n return (npts - 2) * 3;\n }\n\n return 0;\n },\n stripsToSurface: function stripsToSurface(npts, cellPts, offset) {\n if (numPoints > 2) {\n return (npts - 2) * 3;\n }\n\n return 0;\n }\n};\n\nfunction getPrimitiveName(primType) {\n switch (primType) {\n case PrimitiveTypes.Points:\n return 'points';\n\n case PrimitiveTypes.Lines:\n return 'lines';\n\n case PrimitiveTypes.Triangles:\n return 'polys';\n\n case PrimitiveTypes.TriangleStrips:\n return 'strips';\n\n default:\n return '';\n }\n}\n\nfunction getOutputSize(cellArray, representation, inRepName) {\n var countFunc = null;\n\n if (representation === Representation.POINTS || inRepName === 'points') {\n countFunc = cellCounters.anythingToPoints;\n } else if (representation === Representation.WIREFRAME || inRepName === 'lines') {\n countFunc = cellCounters[\"\".concat(inRepName, \"ToWireframe\")];\n } else {\n countFunc = cellCounters[\"\".concat(inRepName, \"ToSurface\")];\n }\n\n var array = cellArray.getData();\n var size = array.length;\n var caboCount = 0;\n\n for (var index = 0; index < size;) {\n caboCount += countFunc(array[index], array);\n index += array[index] + 1;\n }\n\n return caboCount;\n}\n\nfunction packArray(cellArray, primType, representation, inArray, outputType, options) {\n var result = {\n elementCount: 0,\n blockSize: 0,\n stride: 0\n };\n\n if (!cellArray.getData() || !cellArray.getData().length) {\n return result;\n } // setup shift and scale\n\n\n var shift = [0.0, 0.0, 0.0, 0.0];\n\n if (options.shift) {\n if (options.shift.length) {\n shift = options.shift;\n } else {\n shift.fill(options.shift);\n }\n }\n\n var scale = [1.0, 1.0, 1.0, 1.0];\n\n if (options.scale) {\n if (options.scale.length) {\n scale = options.scale;\n } else {\n scale.fill(options.scale);\n }\n }\n\n var packExtra = Object.prototype.hasOwnProperty.call(options, 'packExtra') ? options.packExtra : false;\n var pointData = inArray.getData();\n var addAPoint;\n var cellBuilders = {\n // easy, every input point becomes an output point\n anythingToPoints: function anythingToPoints(numPoints, cellPts, offset, cellId) {\n for (var i = 0; i < numPoints; ++i) {\n addAPoint(cellPts[offset + i], cellId);\n }\n },\n linesToWireframe: function linesToWireframe(numPoints, cellPts, offset, cellId) {\n // for lines we add a bunch of segments\n for (var i = 0; i < numPoints - 1; ++i) {\n addAPoint(cellPts[offset + i], cellId);\n addAPoint(cellPts[offset + i + 1], cellId);\n }\n },\n polysToWireframe: function polysToWireframe(numPoints, cellPts, offset, cellId) {\n // for polys we add a bunch of segments and close it\n if (numPoints > 2) {\n for (var i = 0; i < numPoints; ++i) {\n addAPoint(cellPts[offset + i], cellId);\n addAPoint(cellPts[offset + (i + 1) % numPoints], cellId);\n }\n }\n },\n stripsToWireframe: function stripsToWireframe(numPoints, cellPts, offset, cellId) {\n if (numPoints > 2) {\n // for strips we add a bunch of segments and close it\n for (var i = 0; i < numPoints - 1; ++i) {\n addAPoint(cellPts[offset + i], cellId);\n addAPoint(cellPts[offset + i + 1], cellId);\n }\n\n for (var _i = 0; _i < numPoints - 2; _i++) {\n addAPoint(cellPts[offset + _i], cellId);\n addAPoint(cellPts[offset + _i + 2], cellId);\n }\n }\n },\n polysToSurface: function polysToSurface(npts, cellPts, offset, cellId) {\n for (var i = 0; i < npts - 2; i++) {\n addAPoint(cellPts[offset + 0], cellId);\n addAPoint(cellPts[offset + i + 1], cellId);\n addAPoint(cellPts[offset + i + 2], cellId);\n }\n },\n stripsToSurface: function stripsToSurface(npts, cellPts, offset, cellId) {\n for (var i = 0; i < npts - 2; i++) {\n addAPoint(cellPts[offset + i], cellId);\n addAPoint(cellPts[offset + i + 1 + i % 2], cellId);\n addAPoint(cellPts[offset + i + 1 + (i + 1) % 2], cellId);\n }\n }\n };\n var inRepName = getPrimitiveName(primType);\n var func = null;\n\n if (representation === Representation.POINTS || primType === PrimitiveTypes.Points) {\n func = cellBuilders.anythingToPoints;\n } else if (representation === Representation.WIREFRAME || primType === PrimitiveTypes.Lines) {\n func = cellBuilders[\"\".concat(inRepName, \"ToWireframe\")];\n } else {\n func = cellBuilders[\"\".concat(inRepName, \"ToSurface\")];\n }\n\n var array = cellArray.getData();\n var size = array.length;\n var caboCount = getOutputSize(cellArray, representation, inRepName);\n var vboidx = 0;\n var numComp = inArray.getNumberOfComponents();\n var packedVBO = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newTypedArray\"](outputType, caboCount * (numComp + (packExtra ? 1 : 0))); // pick the right function based on point versus cell data\n\n var getData = function getData(ptId, cellId) {\n return pointData[ptId];\n };\n\n if (options.cellData) {\n getData = function getData(ptId, cellId) {\n return pointData[cellId];\n };\n } // add data based on number of components\n\n\n if (numComp === 1) {\n addAPoint = function addAPointFunc(i, cellid) {\n packedVBO[vboidx++] = scale[0] * getData(i, cellid) + shift[0];\n };\n } else if (numComp === 2) {\n addAPoint = function addAPointFunc(i, cellid) {\n packedVBO[vboidx++] = scale[0] * getData(i * 2, cellid * 2) + shift[0];\n packedVBO[vboidx++] = scale[1] * getData(i * 2 + 1, cellid * 2 + 1) + shift[1];\n };\n } else if (numComp === 3 && !packExtra) {\n addAPoint = function addAPointFunc(i, cellid) {\n packedVBO[vboidx++] = scale[0] * getData(i * 3, cellid * 3) + shift[0];\n packedVBO[vboidx++] = scale[1] * getData(i * 3 + 1, cellid * 3 + 1) + shift[1];\n packedVBO[vboidx++] = scale[2] * getData(i * 3 + 2, cellid * 3 + 2) + shift[2];\n };\n } else if (numComp === 3 && packExtra) {\n addAPoint = function addAPointFunc(i, cellid) {\n packedVBO[vboidx++] = scale[0] * getData(i * 3, cellid * 3) + shift[0];\n packedVBO[vboidx++] = scale[1] * getData(i * 3 + 1, cellid * 3 + 1) + shift[1];\n packedVBO[vboidx++] = scale[2] * getData(i * 3 + 2, cellid * 3 + 2) + shift[2];\n packedVBO[vboidx++] = scale[3] * 1.0 + shift[3];\n };\n } else if (numComp === 4) {\n addAPoint = function addAPointFunc(i, cellid) {\n packedVBO[vboidx++] = scale[0] * getData(i * 4, cellid * 4) + shift[0];\n packedVBO[vboidx++] = scale[1] * getData(i * 4 + 1, cellid * 4 + 1) + shift[1];\n packedVBO[vboidx++] = scale[2] * getData(i * 4 + 2, cellid * 4 + 2) + shift[2];\n packedVBO[vboidx++] = scale[3] * getData(i * 4 + 3, cellid * 4 + 3) + shift[3];\n };\n }\n\n var cellId = options.cellOffset;\n\n for (var index = 0; index < size;) {\n func(array[index], array, index + 1, cellId);\n index += array[index] + 1;\n cellId++;\n }\n\n result.nativeArray = packedVBO;\n result.elementCount = caboCount;\n return result;\n}\n\nfunction getNormal(pointData, i0, i1, i2) {\n var v1 = [pointData[i2 * 3] - pointData[i1 * 3], pointData[i2 * 3 + 1] - pointData[i1 * 3 + 1], pointData[i2 * 3 + 2] - pointData[i1 * 3 + 2]];\n var v2 = [pointData[i0 * 3] - pointData[i1 * 3], pointData[i0 * 3 + 1] - pointData[i1 * 3 + 1], pointData[i0 * 3 + 2] - pointData[i1 * 3 + 2]];\n var result = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"cross\"](v1, v2, result);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"normalize\"](result);\n return result;\n}\n\nfunction generateNormals(cellArray, primType, representation, inArray) {\n if (!cellArray.getData() || !cellArray.getData().length) {\n return null;\n }\n\n var pointData = inArray.getData();\n var addAPoint;\n var cellBuilders = {\n polysToPoints: function polysToPoints(numPoints, cellPts, offset) {\n var normal = getNormal(pointData, cellPts[offset], cellPts[offset + 1], cellPts[offset + 2]);\n\n for (var i = 0; i < numPoints; ++i) {\n addAPoint(normal);\n }\n },\n polysToWireframe: function polysToWireframe(numPoints, cellPts, offset) {\n // for polys we add a bunch of segments and close it\n // compute the normal\n var normal = getNormal(pointData, cellPts[offset], cellPts[offset + 1], cellPts[offset + 2]);\n\n for (var i = 0; i < numPoints; ++i) {\n addAPoint(normal);\n addAPoint(normal);\n }\n },\n polysToSurface: function polysToSurface(npts, cellPts, offset) {\n if (npts < 3) {\n // ignore degenerate triangles\n vtkDebugMacro('skipping degenerate triangle');\n } else {\n // compute the normal\n var normal = getNormal(pointData, cellPts[offset], cellPts[offset + 1], cellPts[offset + 2]);\n\n for (var i = 0; i < npts - 2; i++) {\n addAPoint(normal);\n addAPoint(normal);\n addAPoint(normal);\n }\n }\n }\n };\n var primName = getPrimitiveName(primType);\n var func = null;\n\n if (representation === Representation.POINTS) {\n func = cellBuilders[\"\".concat(primName, \"ToPoints\")];\n } else if (representation === Representation.WIREFRAME) {\n func = cellBuilders[\"\".concat(primName, \"ToWireframe\")];\n } else {\n func = cellBuilders[\"\".concat(primName, \"ToSurface\")];\n }\n\n var caboCount = getOutputSize(cellArray, representation, primName);\n var vboidx = 0;\n var packedVBO = new Int8Array(caboCount * 4);\n\n addAPoint = function addAPointFunc(normal) {\n packedVBO[vboidx++] = 127 * normal[0];\n packedVBO[vboidx++] = 127 * normal[1];\n packedVBO[vboidx++] = 127 * normal[2];\n packedVBO[vboidx++] = 127;\n };\n\n var array = cellArray.getData();\n var size = array.length;\n\n for (var index = 0; index < size;) {\n func(array[index], array, index + 1);\n index += array[index] + 1;\n }\n\n return packedVBO;\n} // ----------------------------------------------------------------------------\n// vtkWebGPUBufferManager methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkWebGPUBufferManager(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUBufferManager'); // is the buffer already present?\n\n publicAPI.hasBuffer = function (req) {\n if (req.source) {\n // if a matching buffer already exists then return true\n if (model.buffers.has(req.source)) {\n var dabuffers = model.buffers.get(req.source);\n\n for (var i = 0; i < dabuffers.length; i++) {\n if (requestMatches(dabuffers[i].request, req)) {\n return true;\n }\n }\n }\n }\n\n return false;\n }; // we cache based on the passed in source, when the source is\n // garbage collected then the cache entry is removed. If a source\n // is not provided then the buffer is NOT cached and you are on your own\n // if you want to share it etc\n\n\n publicAPI.getBuffer = function (req) {\n if (req.source) {\n // if a matching buffer already exists then return it\n if (model.buffers.has(req.source)) {\n var dabuffers = model.buffers.get(req.source);\n\n for (var i = 0; i < dabuffers.length; i++) {\n if (requestMatches(dabuffers[i].request, req)) {\n return dabuffers[i].buffer;\n }\n }\n }\n } // if a dataArray is provided set the nativeArray\n\n\n if (req.dataArray && !req.nativeArray) {\n req.nativeArray = req.dataArray.getData();\n } // create one\n\n\n var buffer = vtk_js_Sources_Rendering_WebGPU_Buffer__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n buffer.setDevice(model.device);\n var stride = vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getByteStrideFromBufferFormat(req.format);\n var arrayType = vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getNativeTypeFromBufferFormat(req.format);\n var gpuUsage = null; // handle uniform buffers\n\n if (req.usage === BufferUsage.UniformArray) {\n /* eslint-disable no-bitwise */\n gpuUsage = GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST;\n /* eslint-enable no-bitwise */\n\n buffer.createAndWrite(req.nativeArray, gpuUsage);\n } // handle storage buffers\n\n\n if (req.usage === BufferUsage.Storage) {\n /* eslint-disable no-bitwise */\n gpuUsage = GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST;\n /* eslint-enable no-bitwise */\n\n buffer.createAndWrite(req.nativeArray, gpuUsage);\n } // handle textures\n\n\n if (req.usage === BufferUsage.Texture) {\n /* eslint-disable no-bitwise */\n gpuUsage = GPUBufferUsage.COPY_SRC;\n /* eslint-enable no-bitwise */\n\n buffer.createAndWrite(req.nativeArray, gpuUsage);\n buffer.setArrayInformation([{\n offset: 0,\n format: req.format\n }]);\n } // handle point data\n\n\n if (req.usage === BufferUsage.PointArray) {\n gpuUsage = GPUBufferUsage.VERTEX;\n var result = packArray(req.cells, req.primitiveType, req.representation, req.dataArray, arrayType, {\n packExtra: req.packExtra,\n shift: req.shift,\n scale: req.scale,\n cellData: req.cellData,\n cellOffset: req.cellOffset\n }); // console.log(result);\n\n buffer.createAndWrite(result.nativeArray, gpuUsage);\n buffer.setStrideInBytes(stride);\n buffer.setArrayInformation([{\n offset: 0,\n format: req.format\n }]);\n } // handle normals from points, snorm8x4\n\n\n if (req.usage === BufferUsage.NormalsFromPoints) {\n gpuUsage = GPUBufferUsage.VERTEX;\n var normals = generateNormals(req.cells, req.primitiveType, req.representation, req.dataArray);\n buffer.createAndWrite(normals, gpuUsage);\n buffer.setStrideInBytes(stride);\n buffer.setArrayInformation([{\n offset: 0,\n format: req.format\n }]);\n }\n\n if (req.usage === BufferUsage.RawVertex) {\n gpuUsage = GPUBufferUsage.VERTEX;\n buffer.createAndWrite(req.nativeArray, gpuUsage);\n buffer.setStrideInBytes(stride);\n buffer.setArrayInformation([{\n offset: 0,\n format: req.format\n }]);\n }\n\n buffer.setSourceTime(req.time); // cache the buffer if we have a dataArray.\n // We create a new req that only has the 4 fields required for\n // a comparison to avoid GC cycles\n\n if (req.source) {\n if (!model.buffers.has(req.source)) {\n model.buffers.set(req.source, []);\n }\n\n var _dabuffers = model.buffers.get(req.source);\n\n _dabuffers.push({\n request: {\n time: req.time,\n format: req.format,\n usage: req.usage,\n hash: req.hash\n },\n buffer: buffer\n });\n }\n\n return buffer;\n };\n\n publicAPI.getFullScreenQuadBuffer = function () {\n if (model.fullScreenQuadBuffer) {\n return model.fullScreenQuadBuffer;\n }\n\n model.fullScreenQuadBuffer = vtk_js_Sources_Rendering_WebGPU_Buffer__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.fullScreenQuadBuffer.setDevice(model.device); // prettier-ignore\n\n var array = new Float32Array([-1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0]);\n model.fullScreenQuadBuffer.createAndWrite(array, GPUBufferUsage.VERTEX);\n model.fullScreenQuadBuffer.setStrideInBytes(12);\n model.fullScreenQuadBuffer.setArrayInformation([{\n offset: 0,\n format: 'float32x3'\n }]);\n return model.fullScreenQuadBuffer;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n device: null,\n fullScreenQuadBuffer: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"obj\"](publicAPI, model); // this is a cache, and a cache with GC pretty much means WeakMap\n\n model.buffers = new WeakMap();\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['device']);\n vtkWebGPUBufferManager(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread(_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC), _Constants__WEBPACK_IMPORTED_MODULE_5__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Camera/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Camera/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUCamera methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUCamera(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUCamera');\n\n publicAPI.getKeyMatrices = function (webGPURenderer) {\n // has the camera changed?\n var ren = webGPURenderer.getRenderable();\n var webGPURenderWindow = webGPURenderer.getParent();\n\n if (Math.max(webGPURenderWindow.getMTime(), publicAPI.getMTime(), ren.getMTime(), model.renderable.getMTime(), webGPURenderer.getStabilizedTime().getMTime()) > model.keyMatrixTime.getMTime()) {\n var wcvc = model.renderable.getViewMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.keyMatrices.normalMatrix, wcvc); // zero out translation\n\n model.keyMatrices.normalMatrix[3] = 0.0;\n model.keyMatrices.normalMatrix[7] = 0.0;\n model.keyMatrices.normalMatrix[11] = 0.0;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(model.keyMatrices.normalMatrix, model.keyMatrices.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.wcvc, wcvc);\n var center = webGPURenderer.getStabilizedCenterByReference();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.keyMatrices.scvc, model.keyMatrices.wcvc, center);\n var aspectRatio = webGPURenderer.getAspectRatio();\n var vcpc = model.renderable.getProjectionMatrix(aspectRatio, -1, 1);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.vcpc, vcpc); // adjust due to WebGPU using a different coordinate system in Z\n\n model.keyMatrices.vcpc[2] = 0.5 * vcpc[8] + 0.5 * vcpc[12];\n model.keyMatrices.vcpc[6] = 0.5 * vcpc[9] + 0.5 * vcpc[13];\n model.keyMatrices.vcpc[10] = 0.5 * vcpc[10] + 0.5 * vcpc[14];\n model.keyMatrices.vcpc[14] = 0.5 * vcpc[11] + 0.5 * vcpc[15];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.keyMatrices.scpc, model.keyMatrices.vcpc, model.keyMatrices.scvc);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(model.keyMatrices.pcsc, model.keyMatrices.scpc);\n model.keyMatrixTime.modified();\n }\n\n return model.keyMatrices;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n keyMatrixTime: null,\n keyMatrices: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatrixTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(model.keyMatrixTime); // values always get set by the get method\n\n model.keyMatrices = {\n normalMatrix: new Float64Array(16),\n vcpc: new Float64Array(16),\n pcsc: new Float64Array(16),\n wcvc: new Float64Array(16),\n scpc: new Float64Array(16),\n scvc: new Float64Array(16)\n }; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['keyMatrixTime']); // Object methods\n\n vtkWebGPUCamera(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkCamera', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Camera/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/FullScreenQuad/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/FullScreenQuad/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderCache */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_MapperHelper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/MapperHelper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/MapperHelper/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUFullScreenQuad methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUFullScreenQuad(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUFullScreenQuad');\n\n publicAPI.replaceShaderPosition = function (hash, pipeline, vertexInput) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addBuiltinOutput('vec4', '[[builtin(position)]] Position');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_1__[\"default\"].substitute(code, '//VTK::Position::Impl', ['output.tcoordVS = vec2(vertexBC.x * 0.5 + 0.5, 1.0 - vertexBC.y * 0.5 - 0.5);', 'output.Position = vec4(vertexBC, 1.0);']).result;\n vDesc.setCode(code);\n };\n\n model.shaderReplacements.set('replaceShaderPosition', publicAPI.replaceShaderPosition);\n var superclassBuild = publicAPI.build;\n\n publicAPI.build = function (renderEncoder, device) {\n var buff = device.getBufferManager().getFullScreenQuadBuffer();\n model.vertexInput.addBuffer(buff, ['vertexBC']);\n model.numberOfVertices = 6;\n superclassBuild(renderEncoder, device);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_WebGPU_MapperHelper__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues); // Object methods\n\n vtkWebGPUFullScreenQuad(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUFullScreenQuad'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/FullScreenQuad/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Glyph3DMapper/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Glyph3DMapper/index.js ***! - \*****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_PolyDataMapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/PolyDataMapper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/PolyDataMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_StorageBuffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/StorageBuffer */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/StorageBuffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderCache */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BufferManager */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n\nvar PrimitiveTypes = vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_4__[\"default\"].PrimitiveTypes; // ----------------------------------------------------------------------------\n// vtkWebGPUSphereMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUGlyph3DMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUGlyph3DMapper'); // Capture 'parentClass' api for internal use\n\n var superClass = _objectSpread({}, publicAPI);\n\n publicAPI.replaceShaderPosition = function (hash, pipeline, vertexInput) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addBuiltinInput('u32', '[[builtin(instance_index)]] instanceIndex');\n vDesc.addBuiltinOutput('vec4', '[[builtin(position)]] Position');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Position::Impl', [' output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix', ' *glyphSSBO.values[input.instanceIndex].matrix', ' *vertexBC;']).result;\n vDesc.setCode(code);\n };\n\n publicAPI.replaceShaderNormal = function (hash, pipeline, vertexInput) {\n if (vertexInput.hasAttribute('normalMC')) {\n var vDesc = pipeline.getShaderDescription('vertex');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Normal::Impl', [' output.normalVC = normalize((rendererUBO.WCVCNormals', ' * mapperUBO.MCWCNormals', ' * glyphSSBO.values[input.instanceIndex].normal*normalMC).xyz);']).result;\n vDesc.setCode(code);\n }\n\n superClass.replaceShaderNormal(hash, pipeline, vertexInput);\n };\n\n publicAPI.replaceShaderColor = function (hash, pipeline, vertexInput) {\n if (!model.carray) {\n superClass.replaceShaderColor(hash, pipeline, vertexInput);\n return;\n }\n\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addOutput('vec4', 'color');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Color::Impl', [' output.color = glyphSSBO.values[input.instanceIndex].color;']).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n code = fDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Color::Impl', ['ambientColor = input.color;', 'diffuseColor = input.color;', 'opacity = mapperUBO.Opacity * input.color.a;']).result;\n fDesc.setCode(code);\n };\n\n publicAPI.replaceShaderSelect = function (hash, pipeline, vertexInput) {\n if (hash.includes('sel')) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addOutput('u32', 'compositeID');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Select::Impl', [' output.compositeID = input.instanceIndex;']).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n code = fDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Select::Impl', ['var compositeID: u32 = input.compositeID;']).result;\n fDesc.setCode(code);\n }\n };\n\n publicAPI.buildPrimitives = function () {\n model.currentInput = model.renderable.getInputData(1);\n model.renderable.buildArrays(); // update the buffer objects if needed\n\n var garray = model.renderable.getMatrixArray();\n var narray = model.renderable.getNormalArray();\n model.carray = model.renderable.getColorArray();\n var numInstances = garray.length / 16;\n\n if (model.renderable.getBuildTime().getMTime() > model.glyphBOBuildTime.getMTime()) {\n // In Core class all arrays are rebuilt when this happens\n // but these arrays can be shared between all primType\n var device = model.WebGPURenderWindow.getDevice();\n model.SSBO.clearData();\n model.SSBO.setNumberOfInstances(numInstances);\n model.SSBO.addEntry('matrix', 'mat4x4');\n model.SSBO.addEntry('normal', 'mat4x4');\n\n if (model.carray) {\n model.SSBO.addEntry('color', 'vec4');\n }\n\n model.SSBO.setAllInstancesFromArray('matrix', garray);\n model.SSBO.setAllInstancesFromArray3x3To4x4('normal', narray);\n\n if (model.carray) {\n model.SSBO.setAllInstancesFromArrayColorToFloat('color', model.carray.getData());\n }\n\n model.SSBO.send(device);\n model.glyphBOBuildTime.modified();\n }\n\n superClass.buildPrimitives();\n\n for (var i = 0; i < model.primitives.length; i++) {\n var primHelper = model.primitives[i];\n primHelper.setNumberOfInstances(numInstances);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_WebGPU_PolyDataMapper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n model.glyphBOBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"obj\"](model.glyphBOBuildTime, {\n mtime: 0\n });\n model.SSBO = vtk_js_Sources_Rendering_WebGPU_StorageBuffer__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.SSBO.setName('glyphSSBO'); // Object methods\n\n vtkWebGPUGlyph3DMapper(publicAPI, model);\n\n for (var i = PrimitiveTypes.Start; i < PrimitiveTypes.End; i++) {\n model.primitives[i].setSSBO(model.SSBO);\n var sr = model.primitives[i].getShaderReplacements();\n sr.set('replaceShaderPosition', publicAPI.replaceShaderPosition);\n sr.set('replaceShaderNormal', publicAPI.replaceShaderNormal);\n sr.set('replaceShaderSelect', publicAPI.replaceShaderSelect);\n sr.set('replaceShaderColor', publicAPI.replaceShaderColor);\n }\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkWebGPUGlyph3DMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_5__[\"registerOverride\"])('vtkGlyph3DMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Glyph3DMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/MapperHelper/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/MapperHelper/index.js ***! - \****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BindGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BindGroup */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BindGroup/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Pipeline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Pipeline */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Pipeline/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderCache */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderDescription__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderDescription */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderDescription/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_VertexInput__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/VertexInput */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/VertexInput/index.js\");\n\n\n\n\n\n\nvar vtkWebGPUMapperHelperVS = \"\\n//VTK::Renderer::Dec\\n\\n//VTK::Color::Dec\\n\\n//VTK::Normal::Dec\\n\\n//VTK::TCoord::Dec\\n\\n//VTK::Select::Dec\\n\\n//VTK::Mapper::Dec\\n\\n//VTK::IOStructs::Dec\\n\\n[[stage(vertex)]]\\nfn main(\\n//VTK::IOStructs::Input\\n)\\n//VTK::IOStructs::Output\\n{\\n var output : vertexOutput;\\n\\n // var vertex: vec4 = vertexBC;\\n\\n //VTK::Color::Impl\\n\\n //VTK::Normal::Impl\\n\\n //VTK::TCoord::Impl\\n\\n //VTK::Select::Impl\\n\\n //VTK::Position::Impl\\n\\n return output;\\n}\\n\";\nvar vtkWebGPUMapperHelperFS = \"\\n//VTK::Renderer::Dec\\n\\n//VTK::Color::Dec\\n\\n//VTK::Normal::Dec\\n\\n//VTK::TCoord::Dec\\n\\n//VTK::Select::Dec\\n\\n//VTK::RenderEncoder::Dec\\n\\n//VTK::Mapper::Dec\\n\\n//VTK::IOStructs::Dec\\n\\n[[stage(fragment)]]\\nfn main(\\n//VTK::IOStructs::Input\\n)\\n//VTK::IOStructs::Output\\n{\\n var output : fragmentOutput;\\n\\n //VTK::Color::Impl\\n\\n //VTK::Normal::Impl\\n\\n //VTK::Light::Impl\\n\\n //VTK::TCoord::Impl\\n\\n //VTK::Select::Impl\\n\\n // var computedColor:vec4 = vec4(1.0,0.5,0.5,1.0);\\n\\n //VTK::RenderEncoder::Impl\\n return output;\\n}\\n\"; // ----------------------------------------------------------------------------\n// vtkWebGPUMapperHelper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUMapperHelper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUMapperHelper');\n\n publicAPI.generateShaderDescriptions = function (hash, pipeline, vertexInput) {\n // create the shader descriptions\n var vDesc = vtk_js_Sources_Rendering_WebGPU_ShaderDescription__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance({\n type: 'vertex',\n hash: hash,\n code: model.vertexShaderTemplate\n });\n var fDesc = vtk_js_Sources_Rendering_WebGPU_ShaderDescription__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance({\n type: 'fragment',\n hash: hash,\n code: model.fragmentShaderTemplate\n }); // add them to the pipeline\n\n var sdrs = pipeline.getShaderDescriptions();\n sdrs.push(vDesc);\n sdrs.push(fDesc); // look for replacements to invoke\n\n var scode = model.vertexShaderTemplate + model.fragmentShaderTemplate;\n var re = new RegExp('//VTK::[^:]*::', 'g');\n var unique = scode.match(re).filter(function (v, i, a) {\n return a.indexOf(v) === i;\n });\n var fnames = unique.map(function (v) {\n return \"replaceShader\".concat(v.substring(7, v.length - 2));\n }); // now invoke shader replacement functions\n\n for (var i = 0; i < fnames.length; i++) {\n var fname = fnames[i];\n\n if (fname !== 'replaceShaderIOStructs' && model.shaderReplacements.has(fname)) {\n model.shaderReplacements.get(fname)(hash, pipeline, vertexInput);\n }\n } // always replace the IOStructs last as other replacement funcs may\n // add inputs or outputs\n\n\n publicAPI.replaceShaderIOStructs(hash, pipeline, vertexInput); // console.log(vDesc.getCode());\n // console.log(fDesc.getCode());\n };\n\n publicAPI.replaceShaderIOStructs = function (hash, pipeline, vertexInput) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.replaceShaderCode(null, vertexInput);\n var fDesc = pipeline.getShaderDescription('fragment');\n fDesc.replaceShaderCode(vDesc);\n };\n\n publicAPI.replaceShaderRenderEncoder = function (hash, pipeline, vertexInput) {\n model.renderEncoder.replaceShaderCode(pipeline);\n };\n\n model.shaderReplacements.set('replaceShaderRenderEncoder', publicAPI.replaceShaderRenderEncoder);\n\n publicAPI.replaceShaderRenderer = function (hash, pipeline, vertexInput) {\n if (!model.WebGPURenderer) {\n return;\n }\n\n var ubocode = model.WebGPURenderer.getBindGroup().getShaderCode(pipeline);\n var vDesc = pipeline.getShaderDescription('vertex');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Renderer::Dec', [ubocode]).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n code = fDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Renderer::Dec', [ubocode]).result;\n fDesc.setCode(code);\n };\n\n model.shaderReplacements.set('replaceShaderRenderer', publicAPI.replaceShaderRenderer);\n\n publicAPI.replaceShaderMapper = function (hash, pipeline, vertexInput) {\n var ubocode = model.bindGroup.getShaderCode(pipeline);\n var vDesc = pipeline.getShaderDescription('vertex');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Mapper::Dec', [ubocode]).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n fDesc.addBuiltinInput('bool', '[[builtin(front_facing)]] frontFacing');\n code = fDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Mapper::Dec', [ubocode]).result;\n fDesc.setCode(code);\n };\n\n model.shaderReplacements.set('replaceShaderMapper', publicAPI.replaceShaderMapper);\n\n publicAPI.replaceShaderPosition = function (hash, pipeline, vertexInput) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addBuiltinOutput('vec4', '[[builtin(position)]] Position');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Position::Impl', [' output.Position = rendererUBO.SCPCMatrix*vertexBC;']).result;\n vDesc.setCode(code);\n };\n\n model.shaderReplacements.set('replaceShaderPosition', publicAPI.replaceShaderPosition);\n\n publicAPI.replaceShaderTCoord = function (hash, pipeline, vertexInput) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addOutput('vec2', 'tcoordVS');\n };\n\n model.shaderReplacements.set('replaceShaderTCoord', publicAPI.replaceShaderTCoord);\n\n publicAPI.addTextureView = function (view) {\n // is it already there?\n if (model.textureViews.includes(view)) {\n return;\n }\n\n model.textureViews.push(view);\n };\n\n publicAPI.renderForPipeline = function (renderEncoder) {\n var pipeline = renderEncoder.getBoundPipeline(); // bind the mapper bind group\n\n renderEncoder.activateBindGroup(model.bindGroup); // bind the vertex input\n\n pipeline.bindVertexInput(renderEncoder, model.vertexInput);\n renderEncoder.draw(model.numberOfVertices, model.numberOfInstances, 0, 0);\n };\n\n publicAPI.registerToDraw = function () {\n if (model.pipeline) {\n model.WebGPURenderer.registerPipelineCallback(model.pipeline, publicAPI.renderForPipeline);\n }\n };\n\n publicAPI.render = function (renderEncoder, device) {\n publicAPI.build(renderEncoder, device);\n renderEncoder.setPipeline(model.pipeline);\n\n if (model.WebGPURenderer) {\n model.WebGPURenderer.bindUBO(renderEncoder);\n }\n\n publicAPI.renderForPipeline(renderEncoder);\n };\n\n publicAPI.build = function (renderEncoder, device) {\n // handle per primitive type\n model.renderEncoder = renderEncoder;\n model.pipeline = device.getPipeline(model.pipelineHash); // todo handle removing a bindable\n\n if (model.UBO) {\n model.bindGroup.addBindable(model.UBO);\n }\n\n if (model.SSBO) {\n model.bindGroup.addBindable(model.SSBO);\n } // add texture BindGroupLayouts\n\n\n for (var t = 0; t < model.textureViews.length; t++) {\n model.bindGroup.addBindable(model.textureViews[t]);\n var samp = model.textureViews[t].getSampler();\n\n if (samp) {\n model.bindGroup.addBindable(samp);\n }\n } // build VBO for this primitive\n // build the pipeline if needed\n\n\n if (!model.pipeline) {\n model.pipeline = vtk_js_Sources_Rendering_WebGPU_Pipeline__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.pipeline.setDevice(device);\n\n if (model.WebGPURenderer) {\n model.pipeline.addBindGroupLayout(model.WebGPURenderer.getBindGroup());\n }\n\n model.pipeline.addBindGroupLayout(model.bindGroup);\n publicAPI.generateShaderDescriptions(model.pipelineHash, model.pipeline, model.vertexInput);\n model.pipeline.setTopology(model.topology);\n model.pipeline.setRenderEncoder(renderEncoder);\n model.pipeline.setVertexState(model.vertexInput.getVertexInputInformation());\n device.createPipeline(model.pipelineHash, model.pipeline);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bindGroup: null,\n device: null,\n fragmentShaderTemplate: null,\n numberOfInstances: 1,\n numberOfVertices: 0,\n pipelineHash: null,\n shaderReplacements: null,\n SSBO: null,\n textureViews: null,\n topology: 'triangle-list',\n UBO: null,\n vertexShaderTemplate: null,\n WebGPURenderer: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.textureViews = [];\n model.vertexInput = vtk_js_Sources_Rendering_WebGPU_VertexInput__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n model.bindGroup = vtk_js_Sources_Rendering_WebGPU_BindGroup__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.bindGroup.setName('mapperBG');\n model.fragmentShaderTemplate = model.fragmentShaderTemplate || vtkWebGPUMapperHelperFS;\n model.vertexShaderTemplate = model.vertexShaderTemplate || vtkWebGPUMapperHelperVS;\n model.shaderReplacements = new Map(); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['vertexInput']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['device', 'fragmentShaderTemplate', 'interpolate', 'numberOfInstances', 'numberOfVertices', 'pipelineHash', 'shaderReplacements', 'SSBO', 'textureViews', 'topology', 'UBO', 'vertexShaderTemplate', 'WebGPURenderer']); // Object methods\n\n vtkWebGPUMapperHelper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUMapperHelper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/MapperHelper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Pipeline/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Pipeline/index.js ***! - \************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkWebGPUPipeline methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUPipeline(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUPipeline');\n\n publicAPI.getShaderDescriptions = function () {\n return model.shaderDescriptions;\n };\n\n publicAPI.initialize = function (device) {\n // start with the renderencoder settings\n var pipelineDesc = model.renderEncoder.getPipelineSettings();\n pipelineDesc.primitive.topology = model.topology;\n pipelineDesc.vertex = model.vertexState; // add in bind group layouts\n\n var bindGroupLayouts = [];\n\n for (var i = 0; i < model.layouts.length; i++) {\n bindGroupLayouts.push(model.layouts[i].layout);\n }\n\n model.pipelineLayout = device.getHandle().createPipelineLayout({\n bindGroupLayouts: bindGroupLayouts\n });\n pipelineDesc.layout = model.pipelineLayout;\n\n for (var _i = 0; _i < model.shaderDescriptions.length; _i++) {\n var sd = model.shaderDescriptions[_i];\n var sm = device.getShaderModule(sd);\n\n if (sd.getType() === 'vertex') {\n pipelineDesc.vertex.module = sm.getHandle();\n pipelineDesc.vertex.entryPoint = 'main';\n }\n\n if (sd.getType() === 'fragment') {\n pipelineDesc.fragment.module = sm.getHandle();\n pipelineDesc.fragment.entryPoint = 'main';\n }\n }\n\n model.handle = device.getHandle().createRenderPipeline(pipelineDesc);\n };\n\n publicAPI.getShaderDescription = function (stype) {\n for (var i = 0; i < model.shaderDescriptions.length; i++) {\n if (model.shaderDescriptions[i].getType() === stype) return model.shaderDescriptions[i];\n }\n\n return null;\n };\n\n publicAPI.addBindGroupLayout = function (bindGroup) {\n if (!bindGroup) {\n return;\n }\n\n model.layouts.push({\n layout: bindGroup.getBindGroupLayout(model.device),\n name: bindGroup.getName()\n });\n };\n\n publicAPI.getBindGroupLayoutCount = function (lname) {\n for (var i = 0; i < model.layouts.length; i++) {\n if (model.layouts[i].name === lname) {\n return i;\n }\n }\n\n return 0;\n };\n\n publicAPI.bindVertexInput = function (renderEncoder, vInput) {\n vInput.bindBuffers(renderEncoder);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n handle: null,\n layouts: null,\n renderEncoder: null,\n shaderDescriptions: null,\n vertexState: null,\n topology: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"obj\"](publicAPI, model);\n model.layouts = [];\n model.shaderDescriptions = [];\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"get\"](publicAPI, model, ['handle']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['device', 'renderEncoder', 'topology', 'vertexState']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkWebGPUPipeline(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkWebGPUPipeline'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Pipeline/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper/index.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper/index.js ***! - \****************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUPixelSpaceCallbackMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUPixelSpaceCallbackMapper(publicAPI, model) {\n model.classHierarchy.push('vtkWebGPUPixelSpaceCallbackMapper');\n\n publicAPI.opaquePass = function (prepass, renderPass) {\n model.WebGPURenderer = publicAPI.getFirstAncestorOfType('vtkWebGPURenderer');\n model.WebGPURenderWindow = model.WebGPURenderer.getParent();\n var aspectRatio = model.WebGPURenderer.getAspectRatio();\n var camera = model.WebGPURenderer ? model.WebGPURenderer.getRenderable().getActiveCamera() : null;\n var tsize = model.WebGPURenderer.getTiledSizeAndOrigin();\n var texels = null;\n\n if (model.renderable.getUseZValues()) {// Todo\n }\n\n model.renderable.invokeCallback(model.renderable.getInputData(), camera, aspectRatio, tsize, texels);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object methods\n\n vtkWebGPUPixelSpaceCallbackMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUPixelSpaceCallbackMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__[\"registerOverride\"])('vtkPixelSpaceCallbackMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/PolyDataMapper/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/PolyDataMapper/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Texture__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Texture */ \"./node_modules/vtk.js/Sources/Rendering/Core/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BufferManager */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderCache */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_UniformBuffer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/UniformBuffer */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/UniformBuffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_MapperHelper__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/MapperHelper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/MapperHelper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\n\n\n\n\n\n\n\n\n\n\n\nvar BufferUsage = vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].BufferUsage,\n PrimitiveTypes = vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].PrimitiveTypes;\nvar Representation = vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_3__[\"default\"].Representation;\nvar ScalarMode = vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ScalarMode;\nvar StartEvent = {\n type: 'StartEvent'\n};\nvar EndEvent = {\n type: 'EndEvent'\n};\nvar vtkWebGPUPolyDataVS = \"\\n//VTK::Renderer::Dec\\n\\n//VTK::Color::Dec\\n\\n//VTK::Normal::Dec\\n\\n//VTK::TCoord::Dec\\n\\n//VTK::Select::Dec\\n\\n//VTK::Mapper::Dec\\n\\n//VTK::IOStructs::Dec\\n\\n[[stage(vertex)]]\\nfn main(\\n//VTK::IOStructs::Input\\n)\\n//VTK::IOStructs::Output\\n{\\n var output : vertexOutput;\\n\\n var vertex: vec4 = vertexBC;\\n\\n //VTK::Color::Impl\\n\\n //VTK::Normal::Impl\\n\\n //VTK::TCoord::Impl\\n\\n //VTK::Select::Impl\\n\\n //VTK::Position::Impl\\n\\n return output;\\n}\\n\";\nvar vtkWebGPUPolyDataFS = \"\\n//VTK::Renderer::Dec\\n\\n//VTK::Color::Dec\\n\\n// optional surface normal declaration\\n//VTK::Normal::Dec\\n\\n//VTK::TCoord::Dec\\n\\n//VTK::Select::Dec\\n\\n//VTK::RenderEncoder::Dec\\n\\n//VTK::Mapper::Dec\\n\\n//VTK::IOStructs::Dec\\n\\n[[stage(fragment)]]\\nfn main(\\n//VTK::IOStructs::Input\\n)\\n//VTK::IOStructs::Output\\n{\\n var output : fragmentOutput;\\n\\n var ambientColor: vec4 = mapperUBO.AmbientColor;\\n var diffuseColor: vec4 = mapperUBO.DiffuseColor;\\n var opacity: f32 = mapperUBO.Opacity;\\n\\n //VTK::Color::Impl\\n\\n //VTK::Normal::Impl\\n\\n //VTK::Light::Impl\\n\\n var computedColor: vec4 = vec4(ambientColor.rgb * mapperUBO.AmbientIntensity\\n + diffuse * mapperUBO.DiffuseIntensity\\n + specular * mapperUBO.SpecularIntensity,\\n opacity);\\n\\n //VTK::TCoord::Impl\\n\\n //VTK::Select::Impl\\n\\n if (computedColor.a == 0.0) { discard; };\\n\\n //VTK::RenderEncoder::Impl\\n return output;\\n}\\n\"; // ----------------------------------------------------------------------------\n// vtkWebGPUPolyDataMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUPolyDataMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUPolyDataMapper');\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.WebGPUActor = publicAPI.getFirstAncestorOfType('vtkWebGPUActor');\n model.WebGPURenderer = model.WebGPUActor.getFirstAncestorOfType('vtkWebGPURenderer');\n model.WebGPURenderWindow = model.WebGPURenderer.getParent();\n model.device = model.WebGPURenderWindow.getDevice();\n }\n }; // Renders myself\n\n\n publicAPI.translucentPass = function (prepass) {\n if (prepass) {\n publicAPI.render();\n }\n };\n\n publicAPI.opaquePass = function (prepass) {\n if (prepass) {\n publicAPI.render();\n }\n };\n\n publicAPI.updateUBO = function () {\n // make sure the data is up to date\n var actor = model.WebGPUActor.getRenderable();\n var ppty = actor.getProperty();\n var utime = model.UBO.getSendTime();\n\n if (publicAPI.getMTime() > utime || ppty.getMTime() > utime || model.renderable.getMTime() > utime) {\n var keyMats = model.WebGPUActor.getKeyMatrices(model.WebGPURenderer);\n model.UBO.setArray('BCWCMatrix', keyMats.bcwc);\n model.UBO.setArray('BCSCMatrix', keyMats.bcsc);\n model.UBO.setArray('MCWCNormals', keyMats.normalMatrix);\n var aColor = ppty.getAmbientColorByReference();\n model.UBO.setValue('AmbientIntensity', ppty.getAmbient());\n model.UBO.setArray('AmbientColor', [aColor[0], aColor[1], aColor[2], 1.0]);\n model.UBO.setValue('DiffuseIntensity', ppty.getDiffuse());\n aColor = ppty.getDiffuseColorByReference();\n model.UBO.setArray('DiffuseColor', [aColor[0], aColor[1], aColor[2], 1.0]);\n model.UBO.setValue('SpecularIntensity', ppty.getSpecular());\n model.UBO.setValue('SpecularPower', ppty.getSpecularPower());\n aColor = ppty.getSpecularColorByReference();\n model.UBO.setArray('SpecularColor', [aColor[0], aColor[1], aColor[2], 1.0]);\n model.UBO.setValue('Opacity', ppty.getOpacity());\n model.UBO.setValue('PropID', model.WebGPUActor.getPropID());\n var device = model.WebGPURenderWindow.getDevice();\n model.UBO.sendIfNeeded(device);\n }\n };\n\n publicAPI.render = function () {\n publicAPI.invokeEvent(StartEvent);\n\n if (!model.renderable.getStatic()) {\n model.renderable.update();\n }\n\n model.currentInput = model.renderable.getInputData();\n publicAPI.invokeEvent(EndEvent);\n model.renderEncoder = model.WebGPURenderer.getRenderEncoder();\n publicAPI.buildPrimitives(); // update descriptor sets\n\n publicAPI.updateUBO();\n };\n\n publicAPI.replaceShaderPosition = function (hash, pipeline, vertexInput) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addBuiltinOutput('vec4', '[[builtin(position)]] Position');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Position::Impl', [' output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix*vertexBC;']).result;\n vDesc.setCode(code);\n };\n\n publicAPI.replaceShaderNormal = function (hash, pipeline, vertexInput) {\n if (vertexInput.hasAttribute('normalMC')) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addOutput('vec3', 'normalVC');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Normal::Impl', [' output.normalVC = normalize((rendererUBO.WCVCNormals * mapperUBO.MCWCNormals * normalMC).xyz);']).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n code = fDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Normal::Impl', [' var normal: vec3 = input.normalVC;', ' if (!input.frontFacing) { normal = -normal; }']).result;\n fDesc.setCode(code);\n }\n }; // we only apply lighting when there is a \"var normal\" declaration in the\n // fragment shader code. That is the lighting trigger.\n\n\n publicAPI.replaceShaderLight = function (hash, pipeline, vertexInput) {\n var fDesc = pipeline.getShaderDescription('fragment');\n var code = fDesc.getCode();\n\n if (code.includes('var normal')) {\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Light::Impl', [' var df: f32 = max(0.0, normal.z);', ' var sf: f32 = pow(df, mapperUBO.SpecularPower);', ' var diffuse: vec3 = df * diffuseColor.rgb;', ' var specular: vec3 = sf * mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;']).result;\n fDesc.setCode(code);\n } else {\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Light::Impl', [' var diffuse: vec3 = diffuseColor.rgb;', ' var specular: vec3 = mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;']).result;\n fDesc.setCode(code);\n }\n };\n\n publicAPI.replaceShaderColor = function (hash, pipeline, vertexInput) {\n if (!vertexInput.hasAttribute('colorVI')) return;\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addOutput('vec4', 'color');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Color::Impl', [' output.color = colorVI;']).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n code = fDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Color::Impl', ['ambientColor = input.color;', 'diffuseColor = input.color;', 'opacity = mapperUBO.Opacity * input.color.a;']).result;\n fDesc.setCode(code);\n };\n\n publicAPI.replaceShaderTCoord = function (hash, pipeline, vertexInput) {\n if (!vertexInput.hasAttribute('tcoord')) return;\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addOutput('vec2', 'tcoordVS');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::TCoord::Impl', [' output.tcoordVS = tcoord;']).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n code = fDesc.getCode(); // todo handle multiple textures? Blend multiply ?\n\n if (model.textures.length) {\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::TCoord::Impl', ['var tcolor: vec4 = textureSample(Texture0, Texture0Sampler, input.tcoordVS);', 'computedColor = computedColor*tcolor;']).result;\n }\n\n fDesc.setCode(code);\n };\n\n publicAPI.replaceShaderSelect = function (hash, pipeline, vertexInput) {\n if (hash.includes('sel')) {\n var fDesc = pipeline.getShaderDescription('fragment');\n var code = fDesc.getCode(); // by default there are no composites, so just 0\n\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Select::Impl', [' var compositeID: u32 = 0u;']).result;\n fDesc.setCode(code);\n }\n };\n\n publicAPI.getUsage = function (rep, i) {\n if (rep === Representation.POINTS || i === 0) {\n return BufferUsage.Verts;\n }\n\n if (i === 1) {\n return BufferUsage.Lines;\n }\n\n if (rep === Representation.WIREFRAME) {\n if (i === 2) {\n return BufferUsage.LinesFromTriangles;\n }\n\n return BufferUsage.LinesFromStrips;\n }\n\n if (i === 2) {\n return BufferUsage.Triangles;\n }\n\n return BufferUsage.Strips;\n };\n\n publicAPI.getHashFromUsage = function (usage) {\n return \"pt\".concat(usage);\n };\n\n publicAPI.getTopologyFromUsage = function (usage) {\n switch (usage) {\n case BufferUsage.Triangles:\n return 'triangle-list';\n\n case BufferUsage.Verts:\n return 'point-list';\n\n default:\n case BufferUsage.Lines:\n return 'line-list';\n }\n };\n\n publicAPI.buildVertexInput = function (pd, cells, primType) {\n var actor = model.WebGPUActor.getRenderable();\n var representation = actor.getProperty().getRepresentation();\n var device = model.WebGPURenderWindow.getDevice();\n var vertexInput = model.primitives[primType].getVertexInput(); // hash = all things that can change the values on the buffer\n // since mtimes are unique we can use\n // - cells mtime - because cells drive how we pack\n // - rep (point/wireframe/surface) - again because of packing\n // - relevant dataArray mtime - the source data\n // - shift - not currently captured\n // - scale - not currently captured\n // - format\n // - usage\n // - packExtra - covered by format\n // - prim type (vert/lines/polys/strips) - covered by cells mtime\n\n var hash = cells.getMTime() + representation; // points\n\n var points = pd.getPoints();\n\n if (points) {\n var shift = model.WebGPUActor.getBufferShift(model.WebGPURenderer);\n var buffRequest = {\n hash: hash + points.getMTime(),\n dataArray: points,\n source: points,\n cells: cells,\n primitiveType: primType,\n representation: representation,\n time: Math.max(points.getMTime(), cells.getMTime(), model.WebGPUActor.getKeyMatricesTime().getMTime()),\n shift: shift,\n usage: BufferUsage.PointArray,\n format: 'float32x4',\n packExtra: true\n };\n var buff = device.getBufferManager().getBuffer(buffRequest);\n vertexInput.addBuffer(buff, ['vertexBC']);\n } else {\n vertexInput.removeBufferIfPresent('vertexBC');\n } // normals, only used for surface rendering\n\n\n var usage = publicAPI.getUsage(representation, primType);\n\n if (usage === BufferUsage.Triangles || usage === BufferUsage.Strips) {\n var normals = pd.getPointData().getNormals();\n var _buffRequest = {\n cells: cells,\n representation: representation,\n primitiveType: primType,\n format: 'snorm8x4',\n packExtra: true,\n shift: 0,\n scale: 127\n };\n\n if (normals) {\n _buffRequest.hash = hash + normals.getMTime();\n _buffRequest.dataArray = normals;\n _buffRequest.source = normals;\n _buffRequest.time = Math.max(normals.getMTime(), cells.getMTime());\n _buffRequest.usage = BufferUsage.PointArray;\n\n var _buff = device.getBufferManager().getBuffer(_buffRequest);\n\n vertexInput.addBuffer(_buff, ['normalMC']);\n } else if (primType === PrimitiveTypes.Triangles) {\n _buffRequest.hash = hash + points.getMTime();\n _buffRequest.dataArray = points;\n _buffRequest.source = points;\n _buffRequest.time = Math.max(points.getMTime(), cells.getMTime());\n _buffRequest.usage = BufferUsage.NormalsFromPoints;\n\n var _buff2 = device.getBufferManager().getBuffer(_buffRequest);\n\n vertexInput.addBuffer(_buff2, ['normalMC']);\n } else {\n vertexInput.removeBufferIfPresent('normalMC');\n }\n } else {\n vertexInput.removeBufferIfPresent('normalMC');\n } // deal with colors but only if modified\n\n\n var haveColors = false;\n\n if (model.renderable.getScalarVisibility()) {\n var c = model.renderable.getColorMapColors();\n\n if (c) {\n var scalarMode = model.renderable.getScalarMode();\n var haveCellScalars = false; // We must figure out how the scalars should be mapped to the polydata.\n\n if ((scalarMode === ScalarMode.USE_CELL_DATA || scalarMode === ScalarMode.USE_CELL_FIELD_DATA || scalarMode === ScalarMode.USE_FIELD_DATA || !pd.getPointData().getScalars()) && scalarMode !== ScalarMode.USE_POINT_FIELD_DATA && c) {\n haveCellScalars = true;\n }\n\n var _buffRequest2 = {\n hash: hash + points.getMTime(),\n dataArray: c,\n source: c,\n cells: cells,\n primitiveType: primType,\n representation: representation,\n time: Math.max(c.getMTime(), cells.getMTime()),\n usage: BufferUsage.PointArray,\n format: 'unorm8x4',\n cellData: haveCellScalars,\n cellOffset: 0\n };\n\n var _buff3 = device.getBufferManager().getBuffer(_buffRequest2);\n\n vertexInput.addBuffer(_buff3, ['colorVI']);\n haveColors = true;\n }\n }\n\n if (!haveColors) {\n vertexInput.removeBufferIfPresent('colorVI');\n }\n\n var tcoords = null;\n\n if (model.renderable.getInterpolateScalarsBeforeMapping() && model.renderable.getColorCoordinates()) {\n tcoords = model.renderable.getColorCoordinates();\n } else {\n tcoords = pd.getPointData().getTCoords();\n }\n\n if (tcoords) {\n var _buffRequest3 = {\n hash: hash + tcoords.getMTime(),\n dataArray: tcoords,\n source: tcoords,\n cells: cells,\n primitiveType: primType,\n representation: representation,\n time: Math.max(tcoords.getMTime(), cells.getMTime()),\n usage: BufferUsage.PointArray,\n format: 'float32x2'\n };\n\n var _buff4 = device.getBufferManager().getBuffer(_buffRequest3);\n\n vertexInput.addBuffer(_buff4, ['tcoord']);\n } else {\n vertexInput.removeBufferIfPresent('tcoord');\n }\n };\n\n publicAPI.updateTextures = function () {\n // we keep track of new and used textures so\n // that we can clean up any unused textures so we don't hold onto them\n var usedTextures = [];\n var newTextures = []; // do we have a scalar color texture\n\n var idata = model.renderable.getColorTextureMap(); // returns an imagedata\n\n if (idata) {\n if (!model.colorTexture) {\n model.colorTexture = vtk_js_Sources_Rendering_Core_Texture__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n }\n\n model.colorTexture.setInputData(idata);\n newTextures.push(model.colorTexture);\n } // actor textures?\n\n\n var actor = model.WebGPUActor.getRenderable();\n var textures = actor.getTextures();\n\n for (var i = 0; i < textures.length; i++) {\n if (textures[i].getInputData()) {\n newTextures.push(textures[i]);\n }\n\n if (textures[i].getImage() && textures[i].getImageLoaded()) {\n newTextures.push(textures[i]);\n }\n }\n\n var usedCount = 0;\n\n for (var _i = 0; _i < newTextures.length; _i++) {\n var srcTexture = newTextures[_i];\n var treq = {};\n\n if (srcTexture.getInputData()) {\n treq.imageData = srcTexture.getInputData();\n treq.source = treq.imageData;\n } else if (srcTexture.getImage()) {\n treq.image = srcTexture.getImage();\n treq.source = treq.image;\n }\n\n var newTex = model.device.getTextureManager().getTexture(treq);\n\n if (newTex.getReady()) {\n // is this a new texture\n var found = false;\n\n for (var t = 0; t < model.textures.length; t++) {\n if (model.textures[t] === newTex) {\n usedCount++;\n found = true;\n usedTextures[t] = true;\n }\n }\n\n if (!found) {\n usedTextures[model.textures.length] = true;\n var tview = newTex.createView();\n tview.setName(\"Texture\".concat(usedCount++));\n model.textures.push(newTex);\n model.textureViews.push(tview);\n var interpolate = srcTexture.getInterpolate() ? 'linear' : 'nearest';\n tview.addSampler(model.device, {\n minFilter: interpolate,\n maxFilter: interpolate\n });\n }\n }\n } // remove unused textures\n\n\n for (var _i2 = model.textures.length - 1; _i2 >= 0; _i2--) {\n if (!usedTextures[_i2]) {\n model.textures.splice(_i2, 1);\n model.textureViews.splice(_i2, 1);\n }\n }\n }; // compute a unique hash for a pipeline, this needs to be unique enough to\n // capture any pipeline code changes (which includes shader changes)\n // or vertex input changes/ bind groups/ etc\n\n\n publicAPI.computePipelineHash = function (vertexInput, usage) {\n var pipelineHash = 'pd';\n\n if (vertexInput.hasAttribute(\"normalMC\")) {\n pipelineHash += \"n\";\n }\n\n if (vertexInput.hasAttribute(\"colorVI\")) {\n pipelineHash += \"c\";\n }\n\n if (vertexInput.hasAttribute(\"tcoord\")) {\n pipelineHash += \"t\";\n }\n\n if (model.textures.length) {\n pipelineHash += \"tx\".concat(model.textures.length);\n }\n\n if (model.SSBO) {\n pipelineHash += \"ssbo\";\n }\n\n var uhash = publicAPI.getHashFromUsage(usage);\n pipelineHash += uhash;\n pipelineHash += model.renderEncoder.getPipelineHash();\n return pipelineHash;\n }; // was originally buildIBOs() but not using IBOs right now\n\n\n publicAPI.buildPrimitives = function () {\n var poly = model.currentInput;\n var prims = [poly.getVerts(), poly.getLines(), poly.getPolys(), poly.getStrips()];\n var device = model.WebGPURenderWindow.getDevice();\n model.renderable.mapScalars(poly, 1.0); // handle textures\n\n publicAPI.updateTextures(); // handle per primitive type\n\n for (var i = PrimitiveTypes.Points; i <= PrimitiveTypes.Triangles; i++) {\n if (prims[i].getNumberOfValues() > 0) {\n var actor = model.WebGPUActor.getRenderable();\n var rep = actor.getProperty().getRepresentation();\n var usage = publicAPI.getUsage(rep, i);\n var primHelper = model.primitives[i];\n publicAPI.buildVertexInput(model.currentInput, prims[i], i);\n primHelper.setPipelineHash(publicAPI.computePipelineHash(primHelper.getVertexInput(), usage));\n primHelper.setTextureViews(model.textureViews);\n primHelper.setWebGPURenderer(model.WebGPURenderer);\n primHelper.setNumberOfInstances(1);\n var vbo = primHelper.getVertexInput().getBuffer('vertexBC');\n primHelper.setNumberOfVertices(vbo.getSizeInBytes() / vbo.getStrideInBytes());\n primHelper.setTopology(publicAPI.getTopologyFromUsage(usage));\n primHelper.build(model.renderEncoder, device);\n primHelper.registerToDraw();\n }\n }\n };\n\n publicAPI.setShaderReplacement = function (name, func) {\n for (var i = PrimitiveTypes.Start; i < PrimitiveTypes.End; i++) {\n var sr = model.primitives[i].getShaderReplacements();\n sr.set(name, func);\n }\n };\n\n publicAPI.setFragmentShaderTemplate = function (val) {\n model.fragmentShaderTemplate = val;\n\n for (var i = PrimitiveTypes.Start; i < PrimitiveTypes.End; i++) {\n model.primitives[i].setFragmentShaderTemplate(val);\n }\n };\n\n publicAPI.setVertexShaderTemplate = function (val) {\n model.fragmentShaderTemplate = val;\n\n for (var i = PrimitiveTypes.Start; i < PrimitiveTypes.End; i++) {\n model.primitives[i].setVertexShaderTemplate(val);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n colorTexture: null,\n renderEncoder: null,\n textures: null,\n textureViews: null,\n primitives: null,\n tmpMat4: null,\n fragmentShaderTemplate: null,\n vertexShaderTemplate: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_9__[\"default\"].extend(publicAPI, model, initialValues);\n model.tmpMat3 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(new Float64Array(9));\n model.tmpMat4 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.fragmentShaderTemplate = model.fragmentShaderTemplate || vtkWebGPUPolyDataFS;\n model.vertexShaderTemplate = model.vertexShaderTemplate || vtkWebGPUPolyDataVS;\n model.UBO = vtk_js_Sources_Rendering_WebGPU_UniformBuffer__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.UBO.setName('mapperUBO');\n model.UBO.addEntry('BCWCMatrix', 'mat4x4');\n model.UBO.addEntry('BCSCMatrix', 'mat4x4');\n model.UBO.addEntry('MCWCNormals', 'mat4x4');\n model.UBO.addEntry('AmbientColor', 'vec4');\n model.UBO.addEntry('DiffuseColor', 'vec4');\n model.UBO.addEntry('AmbientIntensity', 'f32');\n model.UBO.addEntry('DiffuseIntensity', 'f32');\n model.UBO.addEntry('SpecularColor', 'vec4');\n model.UBO.addEntry('SpecularIntensity', 'f32');\n model.UBO.addEntry('Opacity', 'f32');\n model.UBO.addEntry('SpecularPower', 'f32');\n model.UBO.addEntry('PropID', 'u32'); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"get\"](publicAPI, model, ['fragmentShaderTemplate', 'vertexShaderTemplate', 'UBO']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['renderEncoder']);\n model.textures = [];\n model.textureViews = [];\n model.primitives = []; // Object methods\n\n vtkWebGPUPolyDataMapper(publicAPI, model);\n\n for (var i = PrimitiveTypes.Start; i < PrimitiveTypes.End; i++) {\n model.primitives[i] = vtk_js_Sources_Rendering_WebGPU_MapperHelper__WEBPACK_IMPORTED_MODULE_8__[\"default\"].newInstance();\n model.primitives[i].setUBO(model.UBO);\n model.primitives[i].setVertexShaderTemplate(publicAPI.getVertexShaderTemplate());\n model.primitives[i].setFragmentShaderTemplate(publicAPI.getFragmentShaderTemplate());\n }\n\n publicAPI.setShaderReplacement('replaceShaderPosition', publicAPI.replaceShaderPosition);\n publicAPI.setShaderReplacement('replaceShaderLight', publicAPI.replaceShaderLight);\n publicAPI.setShaderReplacement('replaceShaderTCoord', publicAPI.replaceShaderTCoord);\n publicAPI.setShaderReplacement('replaceShaderNormal', publicAPI.replaceShaderNormal);\n publicAPI.setShaderReplacement('replaceShaderSelect', publicAPI.replaceShaderSelect);\n publicAPI.setShaderReplacement('replaceShaderColor', publicAPI.replaceShaderColor);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkWebGPUPolyDataMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_10__[\"registerOverride\"])('vtkMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/PolyDataMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Geometry.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Geometry.js ***! - \***************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Camera__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Camera */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Camera/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Renderer */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Renderer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Actor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Actor */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_PolyDataMapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/PolyDataMapper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/PolyDataMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Texture__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Texture */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper/index.js\");\n// Common\n\n // Geometry\n\n // import 'vtk.js/Sources/Rendering/WebGPU/Actor2D';\n\n // import 'vtk.js/Sources/Rendering/WebGPU/Skybox';\n\n // Pixel mapping\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Geometry.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Glyph.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Glyph.js ***! - \************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Glyph3DMapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Glyph3DMapper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Glyph3DMapper/index.js\");\n// Geometry advanced\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Glyph.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Volume.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Volume.js ***! - \*************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Camera__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Camera */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Camera/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Renderer */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Renderer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Volume__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Volume */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Volume/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper/index.js\");\n// Common\n\n // Volume\n// import 'vtk.js/Sources/Rendering/WebGPU/ImageMapper';\n// import 'vtk.js/Sources/Rendering/WebGPU/ImageSlice';\n\n // Pixel mapping\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Volume.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Renderer/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Renderer/index.js ***! - \************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BindGroup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BindGroup */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BindGroup/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_FullScreenQuad__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/FullScreenQuad */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/FullScreenQuad/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_UniformBuffer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/UniformBuffer */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/UniformBuffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\n\n\n\n\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkDebugMacro\"];\nvar clearFragTemplate = \"\\n//VTK::Renderer::Dec\\n\\n//VTK::Mapper::Dec\\n\\n//VTK::TCoord::Dec\\n\\n//VTK::RenderEncoder::Dec\\n\\n//VTK::IOStructs::Dec\\n\\n[[stage(fragment)]]\\nfn main(\\n//VTK::IOStructs::Input\\n)\\n//VTK::IOStructs::Output\\n{\\n var output: fragmentOutput;\\n\\n var computedColor: vec4 = mapperUBO.BackgroundColor;\\n\\n //VTK::RenderEncoder::Impl\\n return output;\\n}\\n\"; // ----------------------------------------------------------------------------\n// vtkWebGPURenderer methods\n// ----------------------------------------------------------------------------\n\n/* eslint-disable no-bitwise */\n\nfunction vtkWebGPURenderer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPURenderer'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n if (!model.renderable) {\n return;\n } // make sure we have a camera\n\n\n if (!model.renderable.isActiveCameraCreated()) {\n model.renderable.resetCamera();\n }\n\n publicAPI.updateLights();\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getActiveCamera());\n publicAPI.addMissingNodes(model.renderable.getViewPropsWithNestedProps());\n publicAPI.removeUnusedNodes();\n publicAPI.updateStabilizedMatrix();\n }\n };\n\n publicAPI.updateStabilizedMatrix = function () {\n // This method is designed to help with floating point\n // issues when rendering datasets that push the limits of\n // resolutions on float.\n //\n // One of the most common cases is when the dataset is located far\n // away from the origin relative to the clipping range we are looking\n // at. For that case we want to perform the floating point sensitive\n // multiplications on the CPU in double. To this end we want the\n // vertex rendering ops to look something like\n //\n // Compute shifted points and load those into the VBO\n // pointCoordsSC = WorldToStabilizedMatrix * pointCoords;\n //\n // In the vertex shader do the following\n // positionVC = StabilizedToDeviceMatrix * ModelToStabilizedMatrix*vertexIn;\n //\n // We use two matrices because it is expensive to change the\n // WorldToStabilized matrix as we have to reupload all pointCoords\n // So that matrix (MCSCMatrix) is fairly static, the Stabilized to\n // Device matrix is the one that gets updated every time the camera\n // changes.\n //\n // The basic idea is that we should translate the data so that\n // when the center of the view frustum moves a lot\n // we recenter it. The center of the view frustum is roughly\n // camPos + dirOfProj*(far + near)*0.5\n var cam = model.renderable.getActiveCamera();\n var clipRange = cam.getClippingRange();\n var pos = cam.getPositionByReference();\n var dop = cam.getDirectionOfProjectionByReference();\n var center = [];\n var offset = [];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].scale(offset, dop, 0.5 * (clipRange[0] + clipRange[1]));\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].add(center, pos, offset);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].sub(offset, center, model.stabilizedCenter);\n var length = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].len(offset);\n\n if (length / (clipRange[1] - clipRange[0]) > model.recenterThreshold) {\n model.stabilizedCenter = center;\n model.stabilizedTime.modified();\n }\n };\n\n publicAPI.updateLights = function () {\n var count = 0;\n var lights = model.renderable.getLightsByReference();\n\n for (var index = 0; index < lights.length; ++index) {\n if (lights[index].getSwitch() > 0.0) {\n count++;\n }\n }\n\n if (!count) {\n vtkDebugMacro('No lights are on, creating one.');\n model.renderable.createLight();\n }\n\n return count;\n }; // register pipeline callbacks from a mapper\n\n\n publicAPI.registerPipelineCallback = function (pipeline, cb) {\n // if there is a matching pipeline just add the cb\n for (var i = 0; i < model.pipelineCallbacks.length; i++) {\n if (model.pipelineCallbacks[i].pipeline === pipeline) {\n model.pipelineCallbacks[i].callbacks.push(cb);\n return;\n }\n }\n\n model.pipelineCallbacks.push({\n pipeline: pipeline,\n callbacks: [cb]\n });\n };\n\n publicAPI.updateUBO = function () {\n // make sure the data is up to date\n // has the camera changed?\n var cam = model.renderable.getActiveCamera();\n var webgpuCamera = publicAPI.getViewNodeFor(cam);\n var utime = model.UBO.getSendTime();\n\n if (model.parent.getMTime() > utime || publicAPI.getMTime() > utime || cam.getMTime() > utime || model.renderable.getMTime() > utime) {\n var keyMats = webgpuCamera.getKeyMatrices(publicAPI);\n model.UBO.setArray('WCVCMatrix', keyMats.wcvc);\n model.UBO.setArray('SCPCMatrix', keyMats.scpc);\n model.UBO.setArray('PCSCMatrix', keyMats.pcsc);\n model.UBO.setArray('SCVCMatrix', keyMats.scvc);\n model.UBO.setArray('VCPCMatrix', keyMats.vcpc);\n model.UBO.setArray('WCVCNormals', keyMats.normalMatrix);\n model.UBO.setValue('cameraParallel', cam.getParallelProjection());\n var device = model.parent.getDevice();\n model.UBO.sendIfNeeded(device);\n }\n };\n\n publicAPI.scissorAndViewport = function (encoder) {\n var tsize = publicAPI.getYInvertedTiledSizeAndOrigin();\n encoder.getHandle().setViewport(tsize.lowerLeftU, tsize.lowerLeftV, tsize.usize, tsize.vsize, 0.0, 1.0); // set scissor\n\n encoder.getHandle().setScissorRect(tsize.lowerLeftU, tsize.lowerLeftV, tsize.usize, tsize.vsize);\n };\n\n publicAPI.bindUBO = function (renderEncoder) {\n renderEncoder.activateBindGroup(model.bindGroup);\n }; // Renders myself\n\n\n publicAPI.opaquePass = function (prepass) {\n if (prepass) {\n // clear last pipelines\n model.pipelineCallbacks = [];\n model.renderEncoder.begin(model.parent.getCommandEncoder());\n publicAPI.updateUBO();\n } else {\n publicAPI.scissorAndViewport(model.renderEncoder);\n publicAPI.clear(); // loop over registered pipelines\n\n for (var i = 0; i < model.pipelineCallbacks.length; i++) {\n var pStruct = model.pipelineCallbacks[i];\n var pl = pStruct.pipeline;\n model.renderEncoder.setPipeline(pl);\n publicAPI.bindUBO(model.renderEncoder);\n\n for (var cb = 0; cb < pStruct.callbacks.length; cb++) {\n pStruct.callbacks[cb](model.renderEncoder);\n }\n }\n\n model.renderEncoder.end();\n }\n };\n\n publicAPI.clear = function () {\n if (model.renderable.getTransparent() || model.suppressClear) {\n return;\n }\n\n var device = model.parent.getDevice();\n\n if (!model.clearFSQ) {\n model.clearFSQ = vtk_js_Sources_Rendering_WebGPU_FullScreenQuad__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n model.clearFSQ.setDevice(device);\n model.clearFSQ.setPipelineHash('clearfsq');\n model.clearFSQ.setFragmentShaderTemplate(clearFragTemplate);\n var ubo = vtk_js_Sources_Rendering_WebGPU_UniformBuffer__WEBPACK_IMPORTED_MODULE_6__[\"default\"].newInstance();\n ubo.setName('mapperUBO');\n ubo.addEntry('BackgroundColor', 'vec4');\n model.clearFSQ.setUBO(ubo);\n }\n\n var background = model.renderable.getBackgroundByReference();\n model.clearFSQ.getUBO().setArray('BackgroundColor', background);\n model.clearFSQ.getUBO().sendIfNeeded(device);\n model.clearFSQ.render(model.renderEncoder, device);\n };\n\n publicAPI.translucentPass = function (prepass) {\n if (prepass) {\n // clear last pipelines\n model.pipelineCallbacks = [];\n model.renderEncoder.begin(model.parent.getCommandEncoder());\n } else {\n publicAPI.scissorAndViewport(model.renderEncoder); // loop over registered pipelines\n\n for (var i = 0; i < model.pipelineCallbacks.length; i++) {\n var pStruct = model.pipelineCallbacks[i];\n var pl = pStruct.pipeline;\n model.renderEncoder.setPipeline(pl);\n publicAPI.bindUBO(model.renderEncoder);\n\n for (var cb = 0; cb < pStruct.callbacks.length; cb++) {\n pStruct.callbacks[cb](model.renderEncoder);\n }\n }\n\n model.renderEncoder.end();\n }\n };\n\n publicAPI.volumeDepthRangePass = function (prepass) {\n if (prepass) {\n // clear last pipelines\n model.pipelineCallbacks = [];\n model.renderEncoder.begin(model.parent.getCommandEncoder());\n } else {\n publicAPI.scissorAndViewport(model.renderEncoder); // loop over registered pipelines\n\n for (var i = 0; i < model.pipelineCallbacks.length; i++) {\n var pStruct = model.pipelineCallbacks[i];\n var pl = pStruct.pipeline;\n model.renderEncoder.setPipeline(pl);\n publicAPI.bindUBO(model.renderEncoder);\n\n for (var cb = 0; cb < pStruct.callbacks.length; cb++) {\n pStruct.callbacks[cb](model.renderEncoder);\n }\n }\n\n model.renderEncoder.end();\n }\n };\n\n publicAPI.getAspectRatio = function () {\n var size = model.parent.getSizeByReference();\n var viewport = model.renderable.getViewportByReference();\n return size[0] * (viewport[2] - viewport[0]) / ((viewport[3] - viewport[1]) * size[1]);\n };\n\n publicAPI.getYInvertedTiledSizeAndOrigin = function () {\n var res = publicAPI.getTiledSizeAndOrigin();\n var size = model.parent.getSizeByReference();\n res.lowerLeftV = size[1] - res.vsize - res.lowerLeftV;\n return res;\n };\n\n publicAPI.getTiledSizeAndOrigin = function () {\n var vport = model.renderable.getViewportByReference(); // if there is no window assume 0 1\n\n var tileViewPort = [0.0, 0.0, 1.0, 1.0]; // find the lower left corner of the viewport, taking into account the\n // lower left boundary of this tile\n\n var vpu = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[0] - tileViewPort[0], 0.0, 1.0);\n var vpv = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[1] - tileViewPort[1], 0.0, 1.0); // store the result as a pixel value\n\n var ndvp = model.parent.normalizedDisplayToDisplay(vpu, vpv);\n var lowerLeftU = Math.round(ndvp[0]);\n var lowerLeftV = Math.round(ndvp[1]); // find the upper right corner of the viewport, taking into account the\n // lower left boundary of this tile\n\n var vpu2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[2] - tileViewPort[0], 0.0, 1.0);\n var vpv2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[3] - tileViewPort[1], 0.0, 1.0); // also watch for the upper right boundary of the tile\n\n if (vpu2 > tileViewPort[2] - tileViewPort[0]) {\n vpu2 = tileViewPort[2] - tileViewPort[0];\n }\n\n if (vpv2 > tileViewPort[3] - tileViewPort[1]) {\n vpv2 = tileViewPort[3] - tileViewPort[1];\n }\n\n var ndvp2 = model.parent.normalizedDisplayToDisplay(vpu2, vpv2); // now compute the size of the intersection of the viewport with the\n // current tile\n\n var usize = Math.round(ndvp2[0]) - lowerLeftU;\n var vsize = Math.round(ndvp2[1]) - lowerLeftV;\n\n if (usize < 0) {\n usize = 0;\n }\n\n if (vsize < 0) {\n vsize = 0;\n }\n\n return {\n usize: usize,\n vsize: vsize,\n lowerLeftU: lowerLeftU,\n lowerLeftV: lowerLeftV\n };\n };\n\n publicAPI.getPropFromID = function (id) {\n for (var i = 0; i < model.children.length; i++) {\n var res = model.children[i].getPropID ? model.children[i].getPropID() : -1;\n\n if (res === id) {\n return model.children[i];\n }\n }\n\n return null;\n };\n\n publicAPI.releaseGraphicsResources = function () {\n if (model.selector !== null) {\n model.selector.releaseGraphicsResources();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bindGroup: null,\n selector: null,\n renderEncoder: null,\n recenterThreshold: 20.0,\n suppressClear: false,\n stabilizedCenter: [0.0, 0.0, 0.0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues);\n model.UBO = vtk_js_Sources_Rendering_WebGPU_UniformBuffer__WEBPACK_IMPORTED_MODULE_6__[\"default\"].newInstance();\n model.UBO.setName('rendererUBO');\n model.UBO.addEntry('WCVCMatrix', 'mat4x4');\n model.UBO.addEntry('SCPCMatrix', 'mat4x4');\n model.UBO.addEntry('PCSCMatrix', 'mat4x4');\n model.UBO.addEntry('SCVCMatrix', 'mat4x4');\n model.UBO.addEntry('VCPCMatrix', 'mat4x4');\n model.UBO.addEntry('WCVCNormals', 'mat4x4');\n model.UBO.addEntry('cameraParallel', 'u32');\n model.bindGroup = vtk_js_Sources_Rendering_WebGPU_BindGroup__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n model.bindGroup.setName('rendererBG');\n model.bindGroup.addBindable(model.UBO);\n model.tmpMat4 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.stabilizedTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.stabilizedTime, {\n mtime: 0\n }); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"get\"](publicAPI, model, ['bindGroup', 'stabilizedTime']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"getArray\"](publicAPI, model, ['stabilizedCenter']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['renderEncoder', 'selector', 'suppressClear', 'UBO']); // Object methods\n\n vtkWebGPURenderer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkWebGPURenderer'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_7__[\"registerOverride\"])('vtkRenderer', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Renderer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Sampler/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Sampler/index.js ***! - \***********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\n/* eslint-disable no-bitwise */\n// ----------------------------------------------------------------------------\n// vtkWebGPUSampler methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUSampler(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUSampler');\n\n publicAPI.create = function (device) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n model.device = device;\n model.handle = model.device.getHandle().createSampler({\n magFilter: options.magFilter ? options.magFilter : 'nearest',\n minFilter: options.minFilter ? options.minFilter : 'nearest'\n });\n model.bindGroupTime.modified();\n };\n\n publicAPI.getShaderCode = function (binding, group) {\n var result = \"[[binding(\".concat(binding, \"), group(\").concat(group, \")]] var \").concat(model.name, \": sampler;\");\n return result;\n };\n\n publicAPI.getBindGroupEntry = function () {\n var foo = {\n resource: model.handle\n };\n return foo;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n device: null,\n handle: null,\n name: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.bindGroupLayoutEntry = {\n /* eslint-disable no-undef */\n visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT,\n\n /* eslint-enable no-undef */\n sampler: {// type: 'filtering',\n }\n };\n model.bindGroupTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.bindGroupTime, {\n mtime: 0\n });\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['bindGroupTime', 'handle']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['bindGroupLayoutEntry', 'device', 'name']);\n vtkWebGPUSampler(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Sampler/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderModule__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderModule */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderModule/index.js\");\n\n // perform in place string substitutions, indicate if a substitution was done\n// this is useful for building up shader strings which typically involve\n// lots of string substitutions. Return true if a substitution was done.\n\nfunction substitute(source, search, replace) {\n var all = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var replaceStr = Array.isArray(replace) ? replace.join('\\n') : replace;\n var replaced = false;\n\n if (source.search(search) !== -1) {\n replaced = true;\n }\n\n var gflag = '';\n\n if (all) {\n gflag = 'g';\n }\n\n var regex = new RegExp(search, gflag);\n var resultstr = source.replace(regex, replaceStr);\n return {\n replace: replaced,\n result: resultstr\n };\n} // ----------------------------------------------------------------------------\n// vtkWebGPUShaderCache methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkWebGPUShaderCache(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUShaderCache');\n\n publicAPI.getShaderModule = function (shaderDesc) {\n // has it already been created?\n var sType = shaderDesc.getType();\n var sHash = shaderDesc.getHash();\n\n var keys = model._shaderModules.keys();\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key.getHash() === sHash && key.getType() === sType) {\n return model._shaderModules.get(key);\n }\n } // console.log(JSON.stringify(shaderDesc));\n\n\n var sm = vtk_js_Sources_Rendering_WebGPU_ShaderModule__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n sm.initialize(model.device, shaderDesc);\n\n model._shaderModules.set(shaderDesc, sm);\n\n return sm;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n shaderModules: null,\n device: null,\n window: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Internal objects\n\n model._shaderModules = new Map(); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['device', 'window']); // Object methods\n\n vtkWebGPUShaderCache(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUShaderCache'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n substitute: substitute\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderDescription/index.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderDescription/index.js ***! - \*********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderCache */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js\");\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUShaderDescription methods\n// ----------------------------------------------------------------------------\n// shader description\n\nfunction vtkWebGPUShaderDescription(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUShaderDescription');\n\n publicAPI.hasOutput = function (name) {\n return model.outputNames.includes(name);\n };\n\n publicAPI.addOutput = function (type, name) {\n model.outputTypes.push(type);\n model.outputNames.push(name);\n };\n\n publicAPI.addBuiltinOutput = function (type, name) {\n model.builtinOutputTypes.push(type);\n model.builtinOutputNames.push(name);\n };\n\n publicAPI.addBuiltinInput = function (type, name) {\n model.builtinInputTypes.push(type);\n model.builtinInputNames.push(name);\n }; // perform shader replacements for the input and outputs\n // of this shader. That includes vertex inputs if specified\n\n\n publicAPI.replaceShaderCode = function (priorStage, vertexInput) {\n var inputImpl = [];\n var iodec = [];\n\n if (vertexInput) {\n inputImpl.push(vertexInput.getShaderCode());\n }\n\n if (priorStage || model.builtinInputNames.length) {\n var inputStruct = [];\n inputStruct.push(\"struct \".concat(model.type, \"Input\\n{\"));\n\n if (priorStage) {\n var inputNames = priorStage.getOutputNamesByReference();\n var inputTypes = priorStage.getOutputTypesByReference();\n\n for (var i = 0; i < inputNames.length; i++) {\n inputStruct.push(\" [[location(\".concat(i, \")]] \").concat(inputNames[i], \" : \").concat(inputTypes[i], \";\"));\n }\n }\n\n for (var _i = 0; _i < model.builtinInputNames.length; _i++) {\n inputStruct.push(\" \".concat(model.builtinInputNames[_i], \" : \").concat(model.builtinInputTypes[_i], \";\"));\n }\n\n if (inputStruct.length > 1) {\n inputStruct.push('};');\n iodec = inputStruct;\n inputImpl[inputImpl.length - 1] += ',';\n inputImpl.push(\"input: \".concat(model.type, \"Input\"));\n }\n }\n\n if (inputImpl.length) {\n model.code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_1__[\"default\"].substitute(model.code, '//VTK::IOStructs::Input', inputImpl).result;\n }\n\n if (model.outputNames.length + model.builtinOutputNames.length) {\n var outputStruct = [\"struct \".concat(model.type, \"Output\\n{\")];\n\n for (var _i2 = 0; _i2 < model.outputNames.length; _i2++) {\n outputStruct.push(\" [[location(\".concat(_i2, \")]] \").concat(model.outputNames[_i2], \" : \").concat(model.outputTypes[_i2], \";\"));\n }\n\n for (var _i3 = 0; _i3 < model.builtinOutputNames.length; _i3++) {\n outputStruct.push(\" \".concat(model.builtinOutputNames[_i3], \" : \").concat(model.builtinOutputTypes[_i3], \";\"));\n }\n\n outputStruct.push('};');\n iodec = iodec.concat(outputStruct);\n model.code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_1__[\"default\"].substitute(model.code, '//VTK::IOStructs::Output', [\"-> \".concat(model.type, \"Output\")]).result;\n }\n\n model.code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_1__[\"default\"].substitute(model.code, '//VTK::IOStructs::Dec', iodec).result;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n type: null,\n // 'vertex' or 'fragment'\n hash: null,\n code: null,\n outputNames: null,\n outputTypes: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n model.outputNames = [];\n model.outputTypes = [];\n model.builtinOutputNames = [];\n model.builtinOutputTypes = [];\n model.builtinInputNames = [];\n model.builtinInputTypes = []; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['type', 'hash', 'code']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['outputTypes', 'outputNames']); // Object methods\n\n vtkWebGPUShaderDescription(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUShaderDescription'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderDescription/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderModule/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderModule/index.js ***! - \****************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkWebGPUShaderModule methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUShaderModule(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUShaderModule');\n\n publicAPI.initialize = function (device, shaderDesc) {\n model.device = device; // console.log(shaderDesc.getCode());\n\n model.handle = model.device.getHandle().createShaderModule({\n code: shaderDesc.getCode()\n });\n }; // publicAPI.setLastCameraMTime = (mtime) => {\n // model.lastCameraMTime = mtime;\n // };\n\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n device: null,\n handle: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['lastCameraMTime']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['device', 'handle']); // Object methods\n\n vtkWebGPUShaderModule(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUShaderModule'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderModule/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/StorageBuffer/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/StorageBuffer/index.js ***! - \*****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BufferManager */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Types */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js\");\n\n\n\nvar BufferUsage = vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].BufferUsage;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkWebGPUStorageBuffer - similar to the UniformBuffer class\n// but YOU are responsible for layout issues and alignment.\n// The order you add entries is the order they will be layed out\n// in memory. But you must follow layout rules.\n// ----------------------------------------------------------------------------\n// ----------------------------------------------------------------------------\n// vtkWebGPUStorageBuffer methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUStorageBuffer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUStorageBuffer');\n\n publicAPI.addEntry = function (name, type) {\n if (model._bufferEntryNames.has(name)) {\n vtkErrorMacro(\"entry named \".concat(name, \" already exists\"));\n return;\n }\n\n model._bufferEntryNames.set(name, model.bufferEntries.length);\n\n var sizeInBytes = vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getByteStrideFromShaderFormat(type);\n model.bufferEntries.push({\n name: name,\n type: type,\n sizeInBytes: sizeInBytes,\n offset: model.sizeInBytes,\n nativeType: vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getNativeTypeFromShaderFormat(type)\n });\n model.sizeInBytes += sizeInBytes;\n };\n\n publicAPI.send = function (device) {\n if (!model._buffer) {\n var req = {\n nativeArray: model.Float32Array,\n time: 0,\n usage: BufferUsage.Storage\n };\n model._buffer = device.getBufferManager().getBuffer(req);\n model.bindGroupTime.modified();\n\n model._sendTime.modified();\n\n return;\n }\n\n device.getHandle().queue.writeBuffer(model._buffer.getHandle(), 0, model.arrayBuffer, 0, model.sizeInBytes * model.numberOfInstances);\n\n model._sendTime.modified();\n };\n\n publicAPI.createView = function (type) {\n if (type in model === false) {\n if (!model.arrayBuffer) {\n model.arrayBuffer = new ArrayBuffer(model.sizeInBytes * model.numberOfInstances);\n }\n\n model[type] = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newTypedArray(type, model.arrayBuffer);\n }\n };\n\n publicAPI.setValue = function (name, instance, val) {\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n view[(entry.offset + instance * model.sizeInBytes) / view.BYTES_PER_ELEMENT] = val;\n };\n\n publicAPI.setArray = function (name, instance, arr) {\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n var ioffset = (entry.offset + instance * model.sizeInBytes) / view.BYTES_PER_ELEMENT;\n\n for (var i = 0; i < arr.length; i++) {\n view[ioffset + i] = arr[i];\n }\n };\n\n publicAPI.setAllInstancesFromArray = function (name, arr) {\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n var numComponents = arr.length / model.numberOfInstances;\n\n for (var inst = 0; inst < model.numberOfInstances; inst++) {\n var ioffset = (entry.offset + inst * model.sizeInBytes) / view.BYTES_PER_ELEMENT;\n\n for (var i = 0; i < numComponents; i++) {\n view[ioffset + i] = arr[inst * numComponents + i];\n }\n }\n };\n\n publicAPI.setAllInstancesFromArrayColorToFloat = function (name, arr) {\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n var numComponents = arr.length / model.numberOfInstances;\n\n for (var inst = 0; inst < model.numberOfInstances; inst++) {\n var ioffset = (entry.offset + inst * model.sizeInBytes) / view.BYTES_PER_ELEMENT;\n\n for (var i = 0; i < numComponents; i++) {\n view[ioffset + i] = arr[inst * numComponents + i] / 255.0;\n }\n }\n };\n\n publicAPI.setAllInstancesFromArray3x3To4x4 = function (name, arr) {\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n var numComponents = 9;\n\n for (var inst = 0; inst < model.numberOfInstances; inst++) {\n var ioffset = (entry.offset + inst * model.sizeInBytes) / view.BYTES_PER_ELEMENT;\n\n for (var j = 0; j < 3; j++) {\n for (var i = 0; i < 3; i++) {\n view[ioffset + j * 4 + i] = arr[inst * numComponents + j * 3 + i];\n }\n }\n }\n };\n\n publicAPI.getSendTime = function () {\n return model.sendTime.getMTime();\n };\n\n publicAPI.getShaderCode = function (binding, group) {\n var lines = [\"struct \".concat(model.name, \"StructEntry\\n{\")];\n\n for (var i = 0; i < model.bufferEntries.length; i++) {\n var entry = model.bufferEntries[i];\n lines.push(\" \".concat(entry.name, \": \").concat(entry.type, \";\"));\n }\n\n lines.push(\"\\n};\\n[[block]] struct \".concat(model.name, \"Struct\\n{\\n values: array<\").concat(model.name, \"StructEntry>;\\n};\\n[[binding(\").concat(binding, \"), group(\").concat(group, \")]] var \").concat(model.name, \": [[access(read)]] \").concat(model.name, \"Struct;\\n\"));\n return lines.join('\\n');\n };\n\n publicAPI.getBindGroupEntry = function () {\n var foo = {\n resource: {\n buffer: model._buffer.getHandle()\n }\n };\n return foo;\n };\n\n publicAPI.clearData = function () {\n model.numberOfInstances = 0;\n model.sizeInBytes = 0;\n model.bufferEntries = [];\n model._bufferEntryNames = new Map();\n model._buffer = null;\n delete model.arrayBuffer;\n delete model.Float32Array;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bufferEntries: null,\n bufferEntryNames: null,\n sizeInBytes: 0,\n name: null,\n numberOfInstances: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Internal objects\n\n model._bufferEntryNames = new Map();\n model.bufferEntries = [];\n model._sendTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model._sendTime, {\n mtime: 0\n });\n model.bindGroupTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.bindGroupTime, {\n mtime: 0\n }); // default SSBO desc\n\n model.bindGroupLayoutEntry = model.bindGroupLayoutEntry || {\n buffer: {\n type: 'read-only-storage'\n }\n };\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['bindGroupTime']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['device', 'bindGroupLayoutEntry', 'name', 'numberOfInstances', 'sizeInBytes']); // Object methods\n\n vtkWebGPUStorageBuffer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUStorageBuffer'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/StorageBuffer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Texture/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Texture/index.js ***! - \***********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BufferManager */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_TextureView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/TextureView */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/TextureView/index.js\");\n\n\n\nvar BufferUsage = vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].BufferUsage; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n// ----------------------------------------------------------------------------\n// vtkWebGPUTexture methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUTexture(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUTexture');\n\n publicAPI.create = function (device, options) {\n model.device = device;\n model.width = options.width;\n model.height = options.height;\n model.depth = options.depth ? options.depth : 1;\n var dimension = model.depth === 1 ? '2d' : '3d';\n model.format = options.format ? options.format : 'rgbaunorm';\n /* eslint-disable no-undef */\n\n /* eslint-disable no-bitwise */\n\n model.usage = options.usage ? options.usage : GPUTextureUsage.SAMPLED | GPUTextureUsage.COPY_DST;\n /* eslint-enable no-undef */\n\n /* eslint-enable no-bitwise */\n\n model.handle = model.device.getHandle().createTexture({\n size: [model.width, model.height, model.depth],\n format: model.format,\n // 'rgba8unorm',\n usage: model.usage,\n dimension: dimension\n });\n };\n\n publicAPI.assignFromHandle = function (device, handle, options) {\n model.device = device;\n model.handle = handle;\n model.width = options.width;\n model.height = options.height;\n model.depth = options.depth ? options.depth : 1;\n model.format = options.format ? options.format : 'rgbaunorm';\n /* eslint-disable no-undef */\n\n /* eslint-disable no-bitwise */\n\n model.usage = options.usage ? options.usage : GPUTextureUsage.SAMPLED | GPUTextureUsage.COPY_DST;\n /* eslint-enable no-undef */\n\n /* eslint-enable no-bitwise */\n }; // set the data\n\n\n publicAPI.writeImageData = function (req) {\n var bufferBytesPerRow = model.width * 4;\n\n if (req.dataArray) {\n // create and write the buffer\n var buffRequest = {\n dataArray: req.dataArray,\n time: req.dataArray.getMTime(),\n\n /* eslint-disable no-undef */\n usage: BufferUsage.Texture,\n\n /* eslint-enable no-undef */\n format: 'unorm8x4'\n }; // bytesPerRow must be a multiple of 256 so we might need to rebuild\n // the data here before passing to the buffer. If it is unorm8x4 then\n // we need to have width be a multiple of 64\n\n if (model.width % 64) {\n var oArray = req.dataArray.getData();\n var bufferWidth = 64 * Math.floor((model.width + 63) / 64);\n var nArray = new Uint8Array(bufferWidth * model.height * 4);\n\n for (var v = 0; v < model.height; v++) {\n nArray.set(oArray.subarray(v * 4 * model.width, (v + 1) * 4 * model.width), v * 4 * bufferWidth);\n }\n\n buffRequest.nativeArray = nArray;\n bufferBytesPerRow = bufferWidth * 4;\n }\n\n var buff = model.device.getBufferManager().getBuffer(buffRequest);\n model.buffer = buff;\n }\n\n if (req.image) {\n var canvas = document.createElement('canvas');\n canvas.width = req.image.width;\n canvas.height = req.image.height;\n var ctx = canvas.getContext('2d');\n ctx.translate(0, canvas.height);\n ctx.scale(1, -1);\n ctx.drawImage(req.image, 0, 0, req.image.width, req.image.height, 0, 0, canvas.width, canvas.height);\n var imageData = ctx.getImageData(0, 0, req.image.width, req.image.height); // create and write the buffer\n\n var _buffRequest = {\n nativeArray: imageData.data,\n time: 0,\n\n /* eslint-disable no-undef */\n usage: BufferUsage.Texture,\n\n /* eslint-enable no-undef */\n format: 'unorm8x4'\n };\n\n var _buff = model.device.getBufferManager().getBuffer(_buffRequest);\n\n model.buffer = _buff;\n } // get a buffer for the image\n\n\n var cmdEnc = model.device.createCommandEncoder();\n cmdEnc.copyBufferToTexture({\n buffer: model.buffer.getHandle(),\n offset: 0,\n bytesPerRow: bufferBytesPerRow,\n rowsPerImage: model.height\n }, {\n texture: model.handle\n }, [model.width, model.height, model.depth]);\n model.device.submitCommandEncoder(cmdEnc);\n model.ready = true;\n };\n\n publicAPI.resizeToMatch = function (tex) {\n if (tex.getWidth() !== model.width || tex.getHeight() !== model.height || tex.getDepth() !== model.depth) {\n model.width = tex.getWidth();\n model.height = tex.getHeight();\n model.depth = tex.getDepth();\n model.handle = model.device.getHandle().createTexture({\n size: [model.width, model.height, model.depth],\n format: model.format,\n usage: model.usage\n });\n }\n };\n\n publicAPI.resize = function (width, height) {\n var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n if (width !== model.width || height !== model.height || depth !== model.depth) {\n model.width = width;\n model.height = height;\n model.depth = depth;\n model.handle = model.device.getHandle().createTexture({\n size: [model.width, model.height, model.depth],\n format: model.format,\n usage: model.usage\n });\n }\n };\n\n publicAPI.createView = function (options) {\n var view = vtk_js_Sources_Rendering_WebGPU_TextureView__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n view.create(publicAPI, options);\n return view;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n device: null,\n handle: null,\n buffer: null,\n ready: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['handle', 'ready', 'width', 'height', 'depth', 'format', 'usage']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['device']);\n vtkWebGPUTexture(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Texture/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/TextureView/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/TextureView/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Sampler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Sampler */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Sampler/index.js\");\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUTextureView methods\n// ----------------------------------------------------------------------------\n\n/* eslint-disable no-bitwise */\n\nfunction vtkWebGPUTextureView(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUTextureView');\n\n publicAPI.create = function (texture, options) {\n model.texture = texture;\n model.options = options;\n model.textureHandle = texture.getHandle();\n model.handle = model.textureHandle.createView(model.options);\n };\n\n publicAPI.getBindGroupEntry = function () {\n var foo = {\n resource: publicAPI.getHandle()\n };\n return foo;\n };\n\n publicAPI.getShaderCode = function (binding, group) {\n var result = \"[[binding(\".concat(binding, \"), group(\").concat(group, \")]] var \").concat(model.name, \": texture_2d;\");\n return result;\n };\n\n publicAPI.addSampler = function (device, options) {\n var newSamp = vtk_js_Sources_Rendering_WebGPU_Sampler__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n newSamp.create(device, options);\n publicAPI.setSampler(newSamp);\n model.sampler.setName(\"\".concat(model.name, \"Sampler\"));\n };\n\n publicAPI.setName = function (val) {\n if (model.sampler) {\n model.sampler.setName(\"\".concat(val, \"Sampler\"));\n }\n\n if (model.name === val) {\n return;\n }\n\n model.name = val;\n publicAPI.modified();\n }; // if the texture has changed then get a new view\n\n\n publicAPI.getHandle = function () {\n if (model.texture.getHandle() !== model.textureHandle) {\n model.textureHandle = model.texture.getHandle();\n model.handle = model.textureHandle.createView(model.options);\n model.bindGroupTime.modified();\n }\n\n return model.handle;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n texture: null,\n handle: null,\n name: null,\n sampler: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.bindGroupLayoutEntry = {\n /* eslint-disable no-undef */\n visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT,\n\n /* eslint-enable no-undef */\n texture: {// sampleType: 'float',\n // viewDimension: '2d',\n // multisampled: false,\n }\n };\n model.bindGroupTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.bindGroupTime, {\n mtime: 0\n });\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['bindGroupTime', 'name', 'texture']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['bindGroupLayoutEntry', 'sampler']);\n vtkWebGPUTextureView(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/TextureView/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js ***! - \*********************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkWebGPUDevice static functions\n//\n// WebGPU uses types in a many places and calls, and often those types\n// need to be associated with byte sizes, alignments, native arrays etc.\n// The folowing methods are designed to help vtk.js introspect those types.\n// WebGPU currently tends to use multiple type formats:\n// - buffer types such as float32x4\n// - shader types suchs as vec4\n// - texture types such as rgba32float\n// ----------------------------------------------------------------------------\n// see https://gpuweb.github.io/gpuweb/#enumdef-gpuvertexformat\n// for possible formats\n\nfunction getByteStrideFromBufferFormat(format) {\n if (!format || format.length < 5) return 0; // options are x2, x3, x4 or nothing\n\n var numComp = 1;\n\n if (format[format.length - 2] === 'x') {\n numComp = format[format.length - 1];\n }\n\n var sizeStart = numComp === 1 ? format.length - 1 : format.length - 3; // options are 8, 16, 32 resulting in 8, 6, 2 as the last char\n // plugged into the formula below gives 1, 2, 4 respectively\n\n var num = Number(format[sizeStart]);\n\n if (Number.isNaN(num)) {\n Object(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"])(\"unknown format \".concat(format));\n return 0;\n }\n\n var typeSize = 5 - num / 2;\n return numComp * typeSize;\n} // see https://gpuweb.github.io/gpuweb/#enumdef-gpuvertexformat\n// for possible formats\n\n\nfunction getNativeTypeFromBufferFormat(format) {\n if (!format || format.length < 5) return 0; // raw types are Uint Int or Float as follows\n\n var result;\n\n if (format[0] === 'f') {\n result = 'Float';\n } else if (format[0] === 's') {\n result = 'Int';\n } else if (format[0] === 'u') {\n result = 'Uint';\n } else {\n Object(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"])(\"unknown format \".concat(format));\n return undefined;\n } // options are 8, 16, 32 resulting in 8, 6, 2 as the last char\n // plugged into the formula below gives 1, 2, 4 respectively\n\n\n var base = format.split('x')[0];\n var num = Number(base[base.length - 1]);\n\n if (Number.isNaN(num)) {\n Object(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"])(\"unknown format \".concat(format));\n return undefined;\n }\n\n result += 8 * (5 - num / 2);\n result += 'Array';\n return result;\n}\n\nfunction getShaderTypeFromBufferFormat(format) {\n var dataType;\n\n if (format[0] === 'f' || format[1] === 'n') {\n dataType = 'f32';\n } else if (format[0] === 's' && format[1] === 'i') {\n dataType = 'i32';\n } else if (format[0] === 'u' && format[1] === 'i') {\n dataType = 'u32';\n } else {\n Object(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"])(\"unknown format \".concat(format));\n return undefined;\n } // options are x2, x3, x4 or nothing\n\n\n var numComp = 1;\n\n if (format[format.length - 2] === 'x') {\n numComp = Number(format[format.length - 1]);\n }\n\n if (numComp === 4) return \"vec4<\".concat(dataType, \">\");\n if (numComp === 3) return \"vec3<\".concat(dataType, \">\");\n if (numComp === 2) return \"vec2<\".concat(dataType, \">\");\n return dataType;\n}\n\nfunction getByteStrideFromShaderFormat(format) {\n if (!format) return 0;\n var numComp = 1;\n\n if (format.substring(0, 3) === 'vec') {\n numComp = format[3];\n } else if (format.substring(0, 3) === 'mat') {\n numComp = format[3] * format[5];\n }\n\n var typeSize = 4;\n return numComp * typeSize;\n}\n\nfunction getNativeTypeFromShaderFormat(format) {\n if (!format) return undefined;\n if (format.includes('f32')) return 'Float32Array';\n if (format.includes('i32')) return 'Int32Array';\n if (format.includes('u32')) return 'Uint32Array';\n Object(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"])(\"unknown format \".concat(format));\n return undefined;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getByteStrideFromBufferFormat: getByteStrideFromBufferFormat,\n getNativeTypeFromBufferFormat: getNativeTypeFromBufferFormat,\n getShaderTypeFromBufferFormat: getShaderTypeFromBufferFormat,\n getByteStrideFromShaderFormat: getByteStrideFromShaderFormat,\n getNativeTypeFromShaderFormat: getNativeTypeFromShaderFormat\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/UniformBuffer/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/UniformBuffer/index.js ***! - \*****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BufferManager */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Types */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\nvar BufferUsage = vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].BufferUsage;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkWebGPUUniformBuffer methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUUniformBuffer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUUniformBuffer');\n\n publicAPI.addEntry = function (name, type) {\n if (model._bufferEntryNames.has(name)) {\n vtkErrorMacro(\"entry named \".concat(name, \" already exists\"));\n return;\n }\n\n model.sortDirty = true;\n\n model._bufferEntryNames.set(name, model.bufferEntries.length);\n\n model.bufferEntries.push({\n name: name,\n type: type,\n sizeInBytes: vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getByteStrideFromShaderFormat(type),\n offset: -1,\n nativeType: vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getNativeTypeFromShaderFormat(type),\n packed: false\n });\n }; // UBOs have layout rules in terms of how memory is aligned so we\n // have to be careful how we order the entries. For example a vec4\n // must be aligned on a 16 byte offset, etc. See\n // https://gpuweb.github.io/gpuweb/wgsl/#memory-layouts\n // for more details. Right now you can create a situation that would fail\n // in the future we could add dummy spacer entries where needed to\n // handle alignment issues\n\n\n publicAPI.sortBufferEntries = function () {\n if (!model.sortDirty) {\n return;\n }\n\n var currOffset = 0;\n var newEntries = []; // pack anything whose size is a multiple of 16 bytes first\n // this includes a couple types that don't require 16 byte alignment\n // such as mat2x2 but that is OK\n\n for (var i = 0; i < model.bufferEntries.length; i++) {\n var entry = model.bufferEntries[i];\n\n if (entry.packed === false && entry.sizeInBytes % 16 === 0) {\n entry.packed = true;\n entry.offset = currOffset;\n newEntries.push(entry);\n currOffset += entry.sizeInBytes;\n }\n } // now it gets tough, we have the following common types (f32, i32, u32)\n // - vec2 8 byte size, 8 byte alignment\n // - vec3 12 byte size, 16 byte alignment\n // - f32 4 byte size, 4 byte alignment\n // try adding 12 byte, 4 byte pairs\n\n\n for (var _i = 0; _i < model.bufferEntries.length; _i++) {\n var _entry = model.bufferEntries[_i];\n\n if (_entry.packed === false && _entry.sizeInBytes === 12) {\n for (var i2 = 0; i2 < model.bufferEntries.length; i2++) {\n var entry2 = model.bufferEntries[i2];\n\n if (entry2.packed === false && entry2.sizeInBytes === 4) {\n _entry.packed = true;\n _entry.offset = currOffset;\n newEntries.push(_entry);\n currOffset += _entry.sizeInBytes;\n entry2.packed = true;\n entry2.offset = currOffset;\n newEntries.push(entry2);\n currOffset += entry2.sizeInBytes;\n break;\n }\n }\n }\n } // try adding 8 byte, 8 byte pairs\n\n\n for (var _i2 = 0; _i2 < model.bufferEntries.length; _i2++) {\n var _entry2 = model.bufferEntries[_i2];\n\n if (!_entry2.packed && _entry2.sizeInBytes % 8 === 0) {\n for (var _i3 = _i2 + 1; _i3 < model.bufferEntries.length; _i3++) {\n var _entry3 = model.bufferEntries[_i3];\n\n if (!_entry3.packed && _entry3.sizeInBytes % 8 === 0) {\n _entry2.packed = true;\n _entry2.offset = currOffset;\n newEntries.push(_entry2);\n currOffset += _entry2.sizeInBytes;\n _entry3.packed = true;\n _entry3.offset = currOffset;\n newEntries.push(_entry3);\n currOffset += _entry3.sizeInBytes;\n break;\n }\n }\n }\n } // try adding 8 byte, 4 byte 4 byte triplets\n\n\n for (var _i4 = 0; _i4 < model.bufferEntries.length; _i4++) {\n var _entry4 = model.bufferEntries[_i4];\n\n if (!_entry4.packed && _entry4.sizeInBytes % 8 === 0) {\n var found = false;\n\n for (var _i5 = 0; !found && _i5 < model.bufferEntries.length; _i5++) {\n var _entry5 = model.bufferEntries[_i5];\n\n if (!_entry5.packed && _entry5.sizeInBytes === 4) {\n for (var i3 = _i5 + 1; i3 < model.bufferEntries.length; i3++) {\n var entry3 = model.bufferEntries[i3];\n\n if (!entry3.packed && entry3.sizeInBytes === 4) {\n _entry4.packed = true;\n _entry4.offset = currOffset;\n newEntries.push(_entry4);\n currOffset += _entry4.sizeInBytes;\n _entry5.packed = true;\n _entry5.offset = currOffset;\n newEntries.push(_entry5);\n currOffset += _entry5.sizeInBytes;\n entry3.packed = true;\n entry3.offset = currOffset;\n newEntries.push(entry3);\n currOffset += entry3.sizeInBytes;\n found = true;\n break;\n }\n }\n }\n }\n }\n } // Add anything remaining that is larger than 4 bytes and hope we get lucky.\n // Likely if there is more than one item added here it will result\n // in a failed UBO\n\n\n for (var _i6 = 0; _i6 < model.bufferEntries.length; _i6++) {\n var _entry6 = model.bufferEntries[_i6];\n\n if (!_entry6.packed && _entry6.sizeInBytes > 4) {\n _entry6.packed = true;\n _entry6.offset = currOffset;\n newEntries.push(_entry6);\n currOffset += _entry6.sizeInBytes;\n }\n } // finally add remaining 4 byte items\n\n\n for (var _i7 = 0; _i7 < model.bufferEntries.length; _i7++) {\n var _entry7 = model.bufferEntries[_i7];\n\n if (!_entry7.packed) {\n _entry7.packed = true;\n _entry7.offset = currOffset;\n newEntries.push(_entry7);\n currOffset += _entry7.sizeInBytes;\n }\n } // update entries and entryNames\n\n\n model.bufferEntries = newEntries;\n\n model._bufferEntryNames.clear();\n\n for (var _i8 = 0; _i8 < model.bufferEntries.length; _i8++) {\n model._bufferEntryNames.set(model.bufferEntries[_i8].name, _i8);\n }\n\n model.sizeInBytes = currOffset;\n model.sortDirty = false;\n };\n\n publicAPI.sendIfNeeded = function (device) {\n if (!model.UBO) {\n var req = {\n nativeArray: model.Float32Array,\n time: 0,\n usage: BufferUsage.UniformArray\n };\n model.UBO = device.getBufferManager().getBuffer(req);\n model.bindGroupTime.modified();\n model.sendDirty = false;\n } // send data down if needed\n\n\n if (model.sendDirty) {\n device.getHandle().queue.writeBuffer(model.UBO.getHandle(), 0, model.arrayBuffer, 0, model.sizeInBytes);\n model.sendDirty = false;\n } // always updated as mappers depend on this time\n // it is more of a sentIfNeededTime\n\n\n model.sendTime.modified();\n };\n\n publicAPI.createView = function (type) {\n if (type in model === false) {\n if (!model.arrayBuffer) {\n model.arrayBuffer = new ArrayBuffer(model.sizeInBytes);\n }\n\n model[type] = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newTypedArray(type, model.arrayBuffer);\n }\n };\n\n publicAPI.setValue = function (name, val) {\n publicAPI.sortBufferEntries();\n\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n\n if (entry.lastValue !== val) {\n view[entry.offset / view.BYTES_PER_ELEMENT] = val;\n model.sendDirty = true;\n }\n\n entry.lastValue = val;\n };\n\n publicAPI.setArray = function (name, arr) {\n publicAPI.sortBufferEntries();\n\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n var changed = false;\n\n for (var i = 0; i < arr.length; i++) {\n if (!entry.lastValue || entry.lastValue[i] !== arr[i]) {\n view[entry.offset / view.BYTES_PER_ELEMENT + i] = arr[i];\n changed = true;\n }\n }\n\n if (changed) {\n model.sendDirty = true;\n entry.lastValue = _toConsumableArray(arr);\n }\n };\n\n publicAPI.getBindGroupEntry = function () {\n var foo = {\n resource: {\n buffer: model.UBO.getHandle()\n }\n };\n return foo;\n };\n\n publicAPI.getSendTime = function () {\n return model.sendTime.getMTime();\n };\n\n publicAPI.getShaderCode = function (binding, group) {\n // sort the entries\n publicAPI.sortBufferEntries();\n var lines = [\"[[block]] struct \".concat(model.name, \"Struct\\n{\")];\n\n for (var i = 0; i < model.bufferEntries.length; i++) {\n var entry = model.bufferEntries[i];\n lines.push(\" \".concat(entry.name, \": \").concat(entry.type, \";\"));\n }\n\n lines.push(\"};\\n[[binding(\".concat(binding, \"), group(\").concat(group, \")]] var \").concat(model.name, \": \").concat(model.name, \"Struct;\"));\n return lines.join('\\n');\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bufferEntries: null,\n bufferEntryNames: null,\n sizeInBytes: 0,\n name: null,\n bindGroupLayoutEntry: null,\n bindGroupEntry: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Internal objects\n\n model._bufferEntryNames = new Map();\n model.bufferEntries = []; // default UBO desc\n\n model.bindGroupLayoutEntry = model.bindGroupLayoutEntry || {\n buffer: {\n type: 'uniform'\n }\n };\n model.sendTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.sendTime, {\n mtime: 0\n });\n model.bindGroupTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.bindGroupTime, {\n mtime: 0\n });\n model.sendDirty = true;\n model.sortDirty = true;\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['binding', 'bindGroupTime']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['bindGroupLayoutEntry', 'device', 'name', 'sizeInBytes']); // Object methods\n\n vtkWebGPUUniformBuffer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUUniformBuffer'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/UniformBuffer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/VertexInput/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/VertexInput/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Types */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js\");\n\n\n\nfunction arraysEqual(a, b) {\n if (a === b) return true;\n if (a == null || b == null) return false;\n if (a.length !== b.length) return false;\n\n for (var i = 0; i < a.length; ++i) {\n if (!b.includes(a[i])) return false;\n }\n\n return true;\n} // ----------------------------------------------------------------------------\n// vtkWebGPUVertexInput methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkWebGPUVertexInput(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUVertexInput');\n\n publicAPI.addBuffer = function (buffer, inames) {\n var stepMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'vertex';\n var names = inames;\n\n if (!Array.isArray(names)) {\n names = [names];\n } // only add if it is a new setting\n\n\n for (var i = 0; i < model.inputs.length; i++) {\n if (arraysEqual(model.inputs[i].names, names)) {\n if (model.inputs[i].buffer === buffer) {\n return;\n }\n\n model.inputs[i].buffer = buffer;\n return;\n }\n } // when adding a new entry, make sure we sort the array\n // as the order is important to the shader and must always\n // be the same, so alphabetical is an easy option\n\n\n model.inputs.push({\n buffer: buffer,\n stepMode: stepMode,\n names: names\n });\n model.inputs = model.inputs.sort(function (v1, v2) {\n if (v1.names[0] < v2.names[0]) {\n return -1;\n }\n\n if (v1.names[0] > v2.names[0]) {\n return 1;\n }\n\n return 0;\n });\n };\n\n publicAPI.removeBufferIfPresent = function (name) {\n for (var i = 0; i < model.inputs.length; i++) {\n if (model.inputs[i].names.includes(name)) {\n model.inputs.splice(i, 1);\n }\n }\n };\n\n publicAPI.getBuffer = function (name) {\n for (var i = 0; i < model.inputs.length; i++) {\n if (model.inputs[i].names.includes(name)) {\n return model.inputs[i].buffer;\n }\n }\n\n return null;\n };\n\n publicAPI.hasAttribute = function (name) {\n for (var i = 0; i < model.inputs.length; i++) {\n if (model.inputs[i].names.includes(name)) {\n return true;\n }\n }\n\n return false;\n };\n\n publicAPI.getAttributeTime = function (name) {\n for (var i = 0; i < model.inputs.length; i++) {\n if (model.inputs[i].names.includes(name)) {\n return model.inputs[i].buffer.getSourceTime();\n }\n }\n\n return 0;\n };\n\n publicAPI.getShaderCode = function () {\n var result = '';\n var nameCount = 0;\n\n for (var i = 0; i < model.inputs.length; i++) {\n for (var nm = 0; nm < model.inputs[i].names.length; nm++) {\n var arrayInfo = model.inputs[i].buffer.getArrayInformation()[nm];\n var type = vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getShaderTypeFromBufferFormat(arrayInfo.format);\n\n if (nameCount > 0) {\n result += ',\\n';\n }\n\n result = \"\".concat(result, \" [[location(\").concat(nameCount, \")]] \").concat(model.inputs[i].names[nm], \" : \").concat(type);\n nameCount++;\n }\n }\n\n return result;\n };\n\n publicAPI.getVertexInputInformation = function () {\n var info = {};\n\n if (model.inputs.length) {\n var vertexBuffers = [];\n var nameCount = 0;\n\n for (var i = 0; i < model.inputs.length; i++) {\n var buf = model.inputs[i].buffer;\n var buffer = {\n arrayStride: buf.getStrideInBytes(),\n stepMode: model.inputs[i].stepMode,\n attributes: []\n };\n var arrayInfo = buf.getArrayInformation();\n\n for (var nm = 0; nm < model.inputs[i].names.length; nm++) {\n buffer.attributes.push({\n shaderLocation: nameCount,\n offset: arrayInfo[nm].offset,\n format: arrayInfo[nm].format\n });\n nameCount++;\n }\n\n vertexBuffers.push(buffer);\n }\n\n info.buffers = vertexBuffers;\n }\n\n return info;\n };\n\n publicAPI.bindBuffers = function (renderEncoder) {\n for (var i = 0; i < model.inputs.length; i++) {\n renderEncoder.setVertexBuffer(i, model.inputs[i].buffer.getHandle());\n }\n };\n\n publicAPI.getReady = function () {};\n\n publicAPI.releaseGraphicsResources = function () {\n if (model.created) {\n model.inputs = [];\n model.bindingDescriptions = [];\n model.attributeDescriptions = [];\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n inputs: null,\n bindingDescriptions: false,\n attributeDescriptions: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"obj\"](publicAPI, model);\n model.bindingDescriptions = [];\n model.attributeDescriptions = [];\n model.inputs = [];\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['created', 'device', 'handle']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkWebGPUVertexInput(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkWebGPUVertexInput'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/VertexInput/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js ***! - \*******************************************************************************/ -/*! exports provided: registerOverride, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerOverride\", function() { return registerOverride; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory/index.js\");\n\n\nvar CLASS_MAPPING = Object.create(null);\nfunction registerOverride(className, fn) {\n CLASS_MAPPING[className] = fn;\n} // ----------------------------------------------------------------------------\n// vtkWebGPUViewNodeFactory methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUViewNodeFactory(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUViewNodeFactory');\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Static class mapping shared across instances\n\n model.overrides = CLASS_MAPPING; // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object methods\n\n vtkWebGPUViewNodeFactory(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUViewNodeFactory'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Volume/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Volume/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUVolume methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUVolume(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUVolume'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (prepass) {\n model.WebGPURenderer = publicAPI.getFirstAncestorOfType('vtkWebGPURenderer');\n model.WebGPURenderWindow = model.WebGPURenderer.getFirstAncestorOfType('vtkWebGPURenderWindow'); // for the future if we support hardware selection of volumes\n\n if (model.propID === undefined) {\n model.propID = model.WebGPURenderWindow.getUniquePropID();\n }\n\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getMapper());\n publicAPI.removeUnusedNodes();\n }\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n } // Check for the special case when the mapper's bounds are unknown\n\n\n var bds = model.renderable.getMapper().getBounds();\n\n if (!bds || bds.length !== 6 || bds[0] > bds[1]) {\n return;\n }\n\n renderPass.addVolume(publicAPI);\n }\n };\n\n publicAPI.getBoundingCubePoints = function (result, offset) {\n var bounds = model.renderable.getMapper().getBounds();\n var m = model.renderable.getMatrix();\n var count = 0;\n\n for (var iz = 4; iz < 6; iz++) {\n var z = bounds[iz];\n\n for (var iy = 2; iy < 4; iy++) {\n var y = bounds[iy];\n\n for (var ix = 0; ix < 2; ix++) {\n var x = bounds[ix];\n var poffset = offset + count * 3;\n result[poffset++] = m[0] * x + m[1] * y + m[2] * z + m[3];\n result[poffset++] = m[4] * x + m[5] * y + m[6] * z + m[7];\n result[poffset++] = m[8] * x + m[9] * y + m[10] * z + m[11];\n count++;\n }\n }\n }\n };\n\n publicAPI.traverseVolumePass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || model.WebGPURenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.children[0].traverse(renderPass);\n publicAPI.apply(renderPass, false);\n };\n\n publicAPI.getKeyMatrices = function (wgpuRen) {\n // has the actor or stabilization center changed?\n if (Math.max(model.renderable.getMTime(), wgpuRen.getStabilizedTime().getMTime()) > model.keyMatricesTime.getMTime()) {\n model.renderable.computeMatrix();\n var mcwc = model.renderable.getMatrix(); // compute the net shift\n\n var center = wgpuRen.getStabilizedCenterByReference();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.bcwc, mcwc); // to get to stabilized we also need the center\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.keyMatrices.bcsc, model.keyMatrices.bcwc, [-center[0], -center[1], -center[2]]);\n model.keyMatricesTime.modified();\n }\n\n return model.keyMatrices;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n propID: undefined,\n keyMatricesTime: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatricesTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(model.keyMatricesTime, {\n mtime: 0\n });\n model.keyMatrices = {\n bcwc: new Float64Array(16),\n bcsc: new Float64Array(16)\n };\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get(publicAPI, model, ['propID', 'keyMatricesTime']); // Object methods\n\n vtkWebGPUVolume(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkWebGPUVolume'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkVolume', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Volume/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/Constants.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/Constants.js ***! - \******************************************************************************/ -/*! exports provided: WIDGET_PRIORITY, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WIDGET_PRIORITY\", function() { return WIDGET_PRIORITY; });\nvar WIDGET_PRIORITY = 0.5;\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n WIDGET_PRIORITY: WIDGET_PRIORITY\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/index.js ***! - \**************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorObserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorObserver */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorObserver/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Prop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Prop */ \"./node_modules/vtk.js/Sources/Rendering/Core/Prop/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_AbstractWidget_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/AbstractWidget/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/Constants.js\");\n\n\n\n\n // ----------------------------------------------------------------------------\n\nfunction vtkAbstractWidget(publicAPI, model) {\n model.classHierarchy.push('vtkAbstractWidget');\n model.actorToRepresentationMap = new WeakMap(); // --------------------------------------------------------------------------\n\n publicAPI.getBounds = model.widgetState.getBounds;\n\n publicAPI.getNestedProps = function () {\n return model.representations;\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.activateHandle = function (_ref) {\n var selectedState = _ref.selectedState,\n representation = _ref.representation;\n model.widgetState.activateOnly(selectedState);\n model.activeState = selectedState;\n\n if (selectedState && selectedState.updateManipulator) {\n selectedState.updateManipulator();\n }\n\n publicAPI.invokeActivateHandle({\n selectedState: selectedState,\n representation: representation\n });\n\n if (publicAPI.updateCursor) {\n publicAPI.updateCursor();\n }\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.deactivateAllHandles = function () {\n model.widgetState.deactivate();\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.hasActor = function (actor) {\n return model.actorToRepresentationMap.has(actor);\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.grabFocus = function () {\n model.hasFocus = true;\n };\n\n publicAPI.loseFocus = function () {\n model.hasFocus = false;\n };\n\n publicAPI.hasFocus = function () {\n return model.hasFocus;\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.placeWidget = function (bounds) {\n return model.widgetState.placeWidget(bounds);\n };\n\n publicAPI.getPlaceFactor = function () {\n return model.widgetState.getPlaceFactor();\n };\n\n publicAPI.setPlaceFactor = function (factor) {\n return model.widgetState.setPlaceFactor(factor);\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.getRepresentationFromActor = function (actor) {\n return model.actorToRepresentationMap.get(actor);\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.updateRepresentationForRender = function () {\n var renderingType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_3__[\"RenderingTypes\"].FRONT_BUFFER;\n\n for (var i = 0; i < model.representations.length; i++) {\n var representation = model.representations[i];\n representation.updateActorVisibility(renderingType, model.visibility, model.contextVisibility, model.handleVisibility);\n }\n };\n\n publicAPI.getViewWidgets = function () {\n return model.factory.getViewIds().map(function (viewId) {\n return model.factory.getWidgetForView({\n viewId: viewId\n });\n });\n }; // --------------------------------------------------------------------------\n // Initialization calls\n // --------------------------------------------------------------------------\n\n\n publicAPI.setPriority(vtk_js_Sources_Widgets_Core_AbstractWidget_Constants__WEBPACK_IMPORTED_MODULE_4__[\"WIDGET_PRIORITY\"]);\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n contextVisibility: true,\n handleVisibility: true,\n hasFocus: false\n};\n/**\n * @param {*} publicAPI public methods to populate\n * @param {*} model internal values to populate\n * @param {object} initialValues Contains at least\n * {viewType, renderer, camera, openGLRenderWindow, factory}\n */\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Rendering_Core_Prop__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_Rendering_Core_InteractorObserver__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['contextVisibility', 'handleVisibility', 'widgetManager']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['representations', 'widgetState']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'ActivateHandle');\n vtkAbstractWidget(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkAbstractWidget'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidgetFactory/index.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidgetFactory/index.js ***! - \*********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_AbstractWidget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/AbstractWidget */ \"./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\nfunction NoOp() {} // ----------------------------------------------------------------------------\n\n\nfunction vtkAbstractWidgetFactory(publicAPI, model) {\n model.classHierarchy.push('vtkAbstractWidgetFactory'); // DO NOT share on the model ------------------------------------------------\n\n var viewToWidget = {}; // DO NOT share on the model ------------------------------------------------\n // Can be called with just ViewId after the widget has been registered\n\n publicAPI.getWidgetForView = function (_ref) {\n var viewId = _ref.viewId,\n renderer = _ref.renderer,\n viewType = _ref.viewType,\n initialValues = _ref.initialValues;\n\n if (!viewToWidget[viewId]) {\n if (!renderer) {\n return null;\n }\n\n var _extractRenderingComp = Object(vtk_js_Sources_Widgets_Core_WidgetManager__WEBPACK_IMPORTED_MODULE_2__[\"extractRenderingComponents\"])(renderer),\n interactor = _extractRenderingComp.interactor,\n apiSpecificRenderWindow = _extractRenderingComp.apiSpecificRenderWindow,\n camera = _extractRenderingComp.camera;\n\n var widgetModel = {};\n var widgetPublicAPI = {\n onWidgetChange: publicAPI.onWidgetChange\n };\n Object.assign(widgetModel, model, {\n viewType: viewType,\n renderer: renderer,\n camera: camera,\n apiSpecificRenderWindow: apiSpecificRenderWindow,\n factory: publicAPI\n });\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].safeArrays(widgetModel);\n vtk_js_Sources_Widgets_Core_AbstractWidget__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(widgetPublicAPI, widgetModel, initialValues); // Create representations for that view\n\n /* eslint-disable no-shadow */\n\n var widgetInitialValues = initialValues; // Avoid shadowing\n\n widgetModel.representations = publicAPI.getRepresentationsForViewType(viewType).map(function (_ref2) {\n var builder = _ref2.builder,\n labels = _ref2.labels,\n initialValues = _ref2.initialValues;\n return builder.newInstance(_objectSpread(_objectSpread({\n labels: labels\n }, initialValues), widgetInitialValues));\n });\n /* eslint-enable no-shadow */\n\n widgetModel.representations.forEach(function (r) {\n r.setInputData(widgetModel.widgetState);\n r.getActors().forEach(function (actor) {\n widgetModel.actorToRepresentationMap.set(actor, r);\n });\n });\n model.behavior(widgetPublicAPI, widgetModel); // Forward representation methods\n\n ['coincidentTopologyParameters'].concat(_toConsumableArray(model.methodsToLink || [])).forEach(function (methodName) {\n var _methods;\n\n var set = \"set\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(methodName));\n var get = \"get\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(methodName));\n var methods = (_methods = {}, _defineProperty(_methods, methodName, []), _defineProperty(_methods, set, []), _defineProperty(_methods, get, []), _methods);\n widgetModel.representations.forEach(function (representation) {\n if (representation[methodName]) {\n methods[methodName].push(representation[methodName]);\n }\n\n if (representation[set]) {\n methods[set].push(representation[set]);\n }\n\n if (representation[get]) {\n methods[get].push(representation[get]);\n }\n });\n Object.keys(methods).forEach(function (name) {\n var calls = methods[name];\n\n if (calls.length === 1) {\n widgetPublicAPI[name] = calls[0];\n } else if (calls.length > 1) {\n widgetPublicAPI[name] = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain.apply(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"], _toConsumableArray(calls));\n }\n });\n }); // Custom delete to detach from parent\n\n widgetPublicAPI.delete = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(function () {\n delete viewToWidget[viewId];\n }, widgetPublicAPI.delete);\n widgetPublicAPI.setInteractor(interactor);\n var viewWidget = Object.freeze(widgetPublicAPI);\n viewToWidget[viewId] = viewWidget;\n return viewWidget;\n }\n\n return viewToWidget[viewId];\n }; // List of all the views the widget has been registered to.\n\n\n publicAPI.getViewIds = function () {\n return Object.keys(viewToWidget);\n }; // --------------------------------------------------------------------------\n // Widget visibility / enable\n // --------------------------------------------------------------------------\n // Call methods on all its view widgets\n\n\n publicAPI.setVisibility = function (value) {\n var viewIds = Object.keys(viewToWidget);\n\n for (var i = 0; i < viewIds.length; i++) {\n viewToWidget[viewIds[i]].setVisibility(value);\n }\n };\n\n publicAPI.setPickable = function (value) {\n var viewIds = Object.keys(viewToWidget);\n\n for (var i = 0; i < viewIds.length; i++) {\n viewToWidget[viewIds[i]].setPickable(value);\n }\n };\n\n publicAPI.setDragable = function (value) {\n var viewIds = Object.keys(viewToWidget);\n\n for (var i = 0; i < viewIds.length; i++) {\n viewToWidget[viewIds[i]].setDragable(value);\n }\n };\n\n publicAPI.setContextVisibility = function (value) {\n var viewIds = Object.keys(viewToWidget);\n\n for (var i = 0; i < viewIds.length; i++) {\n viewToWidget[viewIds[i]].setContextVisibility(value);\n }\n };\n\n publicAPI.setHandleVisibility = function (value) {\n var viewIds = Object.keys(viewToWidget);\n\n for (var i = 0; i < viewIds.length; i++) {\n viewToWidget[viewIds[i]].setHandleVisibility(value);\n }\n }; // --------------------------------------------------------------------------\n // Place Widget API\n // --------------------------------------------------------------------------\n\n\n publicAPI.placeWidget = function (bounds) {\n return model.widgetState.placeWidget(bounds);\n };\n\n publicAPI.getPlaceFactor = function () {\n return model.widgetState.getPlaceFactor();\n };\n\n publicAPI.setPlaceFactor = function (factor) {\n return model.widgetState.setPlaceFactor(factor);\n }; // --------------------------------------------------------------------------\n // Event Widget API\n // --------------------------------------------------------------------------\n\n\n var unsubscribe = NoOp;\n publicAPI.delete = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.delete, function () {\n return unsubscribe();\n }); // Defer after object instantiation so model.widgetState actually exist\n\n setTimeout(function () {\n unsubscribe = model.widgetState.onModified(function () {\n return publicAPI.invokeWidgetChange(model.widgetState);\n }).unsubscribe;\n }, 0);\n} // ----------------------------------------------------------------------------\n\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['widgetState']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'WidgetChange');\n vtkAbstractWidgetFactory(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkAbstractWidget'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidgetFactory/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/boundsMixin.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/boundsMixin.js ***! - \******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\nfunction vtkBoundsMixin(publicAPI, model) {\n var sourceBounds = [];\n\n var bbox = _toConsumableArray(vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"].INIT_BOUNDS);\n\n publicAPI.containsPoint = function (x, y, z) {\n if (Array.isArray(x)) {\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"].containsPoint(bbox, x[0], x[1], x[2]);\n }\n\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"].containsPoint(bbox, x, y, z);\n };\n\n publicAPI.placeWidget = function (bounds) {\n model.bounds = [];\n var center = [(bounds[0] + bounds[1]) / 2.0, (bounds[2] + bounds[3]) / 2.0, (bounds[4] + bounds[5]) / 2.0];\n\n for (var i = 0; i < 6; i++) {\n var axisCenter = center[Math.floor(i / 2)];\n sourceBounds[i] = bounds[i];\n model.bounds[i] = (bounds[i] - axisCenter) * model.placeFactor + axisCenter;\n }\n\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setBounds(bbox, model.bounds);\n publicAPI.invokeBoundsChange(model.bounds);\n publicAPI.modified();\n };\n\n publicAPI.setPlaceFactor = function (factor) {\n if (model.placeFactor !== factor) {\n model.placeFactor = factor;\n model.bounds = [];\n var center = [(sourceBounds[0] + sourceBounds[1]) / 2.0, (sourceBounds[2] + sourceBounds[3]) / 2.0, (sourceBounds[4] + sourceBounds[5]) / 2.0];\n\n for (var i = 0; i < 6; i++) {\n var axisCenter = center[Math.floor(i / 2)];\n model.bounds[i] = (sourceBounds[i] - axisCenter) * model.placeFactor + axisCenter;\n }\n\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setBounds(bbox, model.bounds);\n publicAPI.invokeBoundsChange(model.bounds);\n publicAPI.modified();\n }\n };\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bounds: [-1, 1, -1, 1, -1, 1],\n placeFactor: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['bounds'], 6);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['placeFactor']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'BoundsChange');\n model.bounds = model.bounds.slice();\n vtkBoundsMixin(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/boundsMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/colorMixin.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/colorMixin.js ***! - \*****************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VALUES = {\n color: 0.5\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['color']);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/colorMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/cornerMixin.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/cornerMixin.js ***! - \******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n // ----------------------------------------------------------------------------\n\nfunction vtkCornerMixin(publicAPI, model) {\n publicAPI.translate = function (dx, dy, dz) {\n var _publicAPI$getCornerB = publicAPI.getCornerByReference(),\n _publicAPI$getCornerB2 = _slicedToArray(_publicAPI$getCornerB, 3),\n x = _publicAPI$getCornerB2[0],\n y = _publicAPI$getCornerB2[1],\n z = _publicAPI$getCornerB2[2];\n\n publicAPI.setCorner(x + dx, y + dy, z + dz);\n };\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n corner: [0, 0, 0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['corner'], 3);\n vtkCornerMixin(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/cornerMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/directionMixin.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/directionMixin.js ***! - \*********************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/MatrixBuilder */ \"./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js\");\n\n // ----------------------------------------------------------------------------\n\nfunction vtkDirectionMixin(publicAPI, model) {\n var transform = model.angleUnit === 'degree' ? vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_1__[\"default\"].buildFromDegree() : vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_1__[\"default\"].buildFromRadian();\n\n publicAPI.rotateFromDirections = function (originDirection, targetDirection) {\n transform.identity().rotateFromDirections(originDirection, targetDirection).apply(model.direction);\n publicAPI.modified();\n };\n\n publicAPI.rotate = function (angle, axis) {\n transform.identity().rotate(angle, axis).apply(model.direction);\n };\n\n publicAPI.rotateX = function (angle) {\n transform.identity().rotateX(angle).apply(model.direction);\n };\n\n publicAPI.rotateY = function (angle) {\n transform.identity().rotateY(angle).apply(model.direction);\n };\n\n publicAPI.rotateZ = function (angle) {\n transform.identity().rotateZ(angle).apply(model.direction);\n };\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n direction: [1, 0, 0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['direction'], 3);\n vtkDirectionMixin(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/directionMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/index.js ***! - \************************************************************************/ -/*! exports provided: createBuilder, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createBuilder\", function() { return createBuilder; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetState */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetState/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_boundsMixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/boundsMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/boundsMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_colorMixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/colorMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/colorMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_cornerMixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/cornerMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/cornerMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_directionMixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/directionMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/directionMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_manipulatorMixin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/manipulatorMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/manipulatorMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_nameMixin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/nameMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/nameMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_orientationMixin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/orientationMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/orientationMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_originMixin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/originMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/originMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_scale1Mixin__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/scale1Mixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale1Mixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_scale3Mixin__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/scale3Mixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale3Mixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_textMixin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/textMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/textMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_visibleMixin__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/visibleMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/visibleMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_shapeMixin__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/shapeMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/shapeMixin.js\");\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// Global type lookup map\n// ----------------------------------------------------------------------------\n\nvar MIXINS = {\n bounds: vtk_js_Sources_Widgets_Core_StateBuilder_boundsMixin__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n color: vtk_js_Sources_Widgets_Core_StateBuilder_colorMixin__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n corner: vtk_js_Sources_Widgets_Core_StateBuilder_cornerMixin__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n direction: vtk_js_Sources_Widgets_Core_StateBuilder_directionMixin__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n manipulator: vtk_js_Sources_Widgets_Core_StateBuilder_manipulatorMixin__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n name: vtk_js_Sources_Widgets_Core_StateBuilder_nameMixin__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n orientation: vtk_js_Sources_Widgets_Core_StateBuilder_orientationMixin__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n origin: vtk_js_Sources_Widgets_Core_StateBuilder_originMixin__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n scale1: vtk_js_Sources_Widgets_Core_StateBuilder_scale1Mixin__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n scale3: vtk_js_Sources_Widgets_Core_StateBuilder_scale3Mixin__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n text: vtk_js_Sources_Widgets_Core_StateBuilder_textMixin__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n visible: vtk_js_Sources_Widgets_Core_StateBuilder_visibleMixin__WEBPACK_IMPORTED_MODULE_13__[\"default\"],\n shape: vtk_js_Sources_Widgets_Core_StateBuilder_shapeMixin__WEBPACK_IMPORTED_MODULE_14__[\"default\"]\n}; // ----------------------------------------------------------------------------\n\nfunction newInstance(mixins, initialValues) {\n var publicAPI = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var skipWidgetState = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n if (!skipWidgetState) {\n vtk_js_Sources_Widgets_Core_WidgetState__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n }\n\n for (var i = 0; i < mixins.length; i++) {\n var mixin = MIXINS[mixins[i]];\n\n if (mixin) {\n mixin.extend(publicAPI, model, initialValues);\n } else {\n vtkErrorMacro('Invalid mixin name:', mixins[i]);\n }\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].safeArrays(model);\n return Object.freeze(publicAPI);\n} // ----------------------------------------------------------------------------\n\n\nvar Builder = /*#__PURE__*/function () {\n function Builder() {\n _classCallCheck(this, Builder);\n\n this.publicAPI = {};\n this.model = {};\n vtk_js_Sources_Widgets_Core_WidgetState__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(this.publicAPI, this.model); // The root state should always have the bounds/placeWidget/widgetFactor\n\n vtk_js_Sources_Widgets_Core_StateBuilder_boundsMixin__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(this.publicAPI, this.model);\n }\n /* eslint-disable no-shadow */\n\n\n _createClass(Builder, [{\n key: \"addDynamicMixinState\",\n value: function addDynamicMixinState(_ref) {\n var _this = this;\n\n var labels = _ref.labels,\n mixins = _ref.mixins,\n name = _ref.name,\n initialValues = _ref.initialValues;\n var listName = \"\".concat(name, \"List\");\n this.model[listName] = []; // Create new Instance method\n\n this.publicAPI[\"add\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(name))] = function () {\n var instance = newInstance(mixins, initialValues);\n\n _this.publicAPI.bindState(instance, labels);\n\n _this.model[listName].push(instance);\n\n _this.publicAPI.modified();\n\n return instance;\n };\n\n this.publicAPI[\"remove\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(name))] = function (instanceOrIndex) {\n var removeIndex = _this.model[listName].indexOf(instanceOrIndex);\n\n if (removeIndex === -1 && instanceOrIndex < _this.model[listName].length) {\n removeIndex = instanceOrIndex;\n }\n\n var instance = _this.model[listName][removeIndex];\n\n if (instance) {\n _this.publicAPI.unbindState(instance);\n }\n\n _this.model[listName].splice(removeIndex, 1);\n\n _this.publicAPI.modified();\n };\n\n this.publicAPI[\"get\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(name), \"List\")] = function () {\n return _this.model[listName].slice();\n };\n\n this.publicAPI[\"clear\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(name), \"List\")] = function () {\n while (_this.model[listName].length) {\n var instance = _this.model[listName].pop();\n\n if (instance) {\n _this.publicAPI.unbindState(instance);\n }\n }\n\n _this.publicAPI.modified();\n };\n\n return this;\n }\n }, {\n key: \"addStateFromMixin\",\n value: function addStateFromMixin(_ref2) {\n var labels = _ref2.labels,\n mixins = _ref2.mixins,\n name = _ref2.name,\n initialValues = _ref2.initialValues;\n var instance = newInstance(mixins, initialValues);\n this.model[name] = instance;\n this.publicAPI.bindState(instance, labels);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(this.publicAPI, this.model, [name]);\n return this;\n }\n }, {\n key: \"addStateFromInstance\",\n value: function addStateFromInstance(_ref3) {\n var labels = _ref3.labels,\n name = _ref3.name,\n instance = _ref3.instance;\n this.model[name] = instance;\n this.publicAPI.bindState(instance, labels);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(this.publicAPI, this.model, [name]);\n return this;\n }\n }, {\n key: \"addField\",\n value: function addField(_ref4) {\n var name = _ref4.name,\n initialValue = _ref4.initialValue;\n\n if (Array.isArray(initialValue)) {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(this.publicAPI, this.model, [name], initialValue.length);\n } else {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(this.publicAPI, this.model, [name]);\n }\n\n this.model[name] = initialValue;\n return this;\n }\n }, {\n key: \"build\",\n value: function build() {\n for (var _len = arguments.length, mixins = new Array(_len), _key = 0; _key < _len; _key++) {\n mixins[_key] = arguments[_key];\n }\n\n return newInstance(mixins, {}, this.publicAPI, this.model, true);\n }\n }]);\n\n return Builder;\n}(); // ----------------------------------------------------------------------------\n// Public API\n// ----------------------------------------------------------------------------\n\n\nfunction createBuilder() {\n return new Builder();\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n createBuilder: createBuilder\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/manipulatorMixin.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/manipulatorMixin.js ***! - \***********************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n\nfunction vtkManipulatorMixin(publicAPI, model) {\n publicAPI.updateManipulator = function () {\n if (model.manipulator) {\n var origin = model.origin,\n normal = model.normal,\n direction = model.direction;\n var _model$manipulator = model.manipulator,\n setOrigin = _model$manipulator.setOrigin,\n setCenter = _model$manipulator.setCenter,\n setNormal = _model$manipulator.setNormal,\n setDirection = _model$manipulator.setDirection;\n\n if (origin && setOrigin) {\n setOrigin(origin);\n } else if (origin && setCenter) {\n setCenter(origin);\n }\n\n if (direction && setDirection) {\n setDirection(direction);\n } else if (direction && !normal && setNormal) {\n setNormal(direction);\n } else if (normal && setDirection) {\n setDirection(normal);\n }\n }\n };\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n manipulator: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['manipulator']);\n vtkManipulatorMixin(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/manipulatorMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/nameMixin.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/nameMixin.js ***! - \****************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VALUES = {\n name: ''\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['name']);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/nameMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/orientationMixin.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/orientationMixin.js ***! - \***********************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n\n\nfunction eq(v1, v2) {\n return v1.length === 3 && v2.length === 3 && v1[0] === v2[0] && v1[1] === v2[1] && v1[2] === v2[2];\n}\n\nfunction isSame(o, p1, p2, before) {\n return eq(o, before.o) && eq(p1, before.p1) && eq(p2, before.p2);\n} // function axis(o, p1, p2) {\n// if (o[0] === p1[0] && p1[0] === p2[0]) {\n// return 'X';\n// }\n// if (o[1] === p1[1] && p1[1] === p2[1]) {\n// return 'Y';\n// }\n// if (o[2] === p1[2] && p1[2] === p2[2]) {\n// return 'Z';\n// }\n// return '?';\n// }\n// ----------------------------------------------------------------------------\n\n\nfunction vtkOrientationMixin(publicAPI, model) {\n var previousPoints = {\n o: [],\n p1: [],\n p2: []\n };\n\n publicAPI.normalize = function () {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"normalize\"](model.up);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"normalize\"](model.right);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"normalize\"](model.direction);\n publicAPI.modified();\n };\n\n publicAPI.updateFromOriginRightUp = function (o, p1, p2) {\n if (isSame(o, p1, p2, previousPoints)) {\n return;\n }\n\n previousPoints.o = o.slice();\n previousPoints.p1 = p1.slice();\n previousPoints.p2 = p2.slice();\n model.up = [p2[0] - o[0], p2[1] - o[1], p2[2] - o[2]];\n model.right = [p1[0] - o[0], p1[1] - o[1], p1[2] - o[2]];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"cross\"](model.up, model.right, model.direction);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"cross\"](model.direction, model.up, model.right);\n publicAPI.normalize();\n publicAPI.modified();\n };\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n up: [0, 1, 0],\n right: [1, 0, 0],\n direction: [0, 0, 1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['up', 'right', 'direction'], 3);\n vtkOrientationMixin(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/orientationMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/originMixin.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/originMixin.js ***! - \******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n // ----------------------------------------------------------------------------\n\nfunction vtkOriginMixin(publicAPI, model) {\n publicAPI.translate = function (dx, dy, dz) {\n var _publicAPI$getOriginB = publicAPI.getOriginByReference(),\n _publicAPI$getOriginB2 = _slicedToArray(_publicAPI$getOriginB, 3),\n x = _publicAPI$getOriginB2[0],\n y = _publicAPI$getOriginB2[1],\n z = _publicAPI$getOriginB2[2];\n\n publicAPI.setOrigin(x + dx, y + dy, z + dz);\n };\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n origin: [0, 0, 0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['origin'], 3);\n vtkOriginMixin(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/originMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale1Mixin.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale1Mixin.js ***! - \******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VALUES = {\n scale1: 0.5\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['scale1']);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale1Mixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale3Mixin.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale3Mixin.js ***! - \******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VALUES = {\n scale3: [1, 1, 1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['scale3'], 3);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale3Mixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/shapeMixin.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/shapeMixin.js ***! - \*****************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n\nvar DEFAULT_VALUES = {\n shape: ''\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['shape']);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/shapeMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/textMixin.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/textMixin.js ***! - \****************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VALUES = {\n text: 'DefaultText'\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['text']);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/textMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/visibleMixin.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/visibleMixin.js ***! - \*******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VALUES = {\n visible: true\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['visible']);\n publicAPI.isVisible = publicAPI.getVisible;\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/visibleMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js ***! - \*****************************************************************************/ -/*! exports provided: ViewTypes, RenderingTypes, CaptureOn, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ViewTypes\", function() { return ViewTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RenderingTypes\", function() { return RenderingTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CaptureOn\", function() { return CaptureOn; });\nvar ViewTypes = {\n DEFAULT: 0,\n GEOMETRY: 1,\n SLICE: 2,\n VOLUME: 3,\n YZ_PLANE: 4,\n // Sagittal\n XZ_PLANE: 5,\n // Coronal\n XY_PLANE: 6 // Axial\n\n};\nvar RenderingTypes = {\n PICKING_BUFFER: 0,\n FRONT_BUFFER: 1\n};\nvar CaptureOn = {\n MOUSE_MOVE: 0,\n MOUSE_RELEASE: 1\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ViewTypes: ViewTypes,\n RenderingTypes: RenderingTypes,\n CaptureOn: CaptureOn\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/index.js ***! - \*************************************************************************/ -/*! exports provided: extractRenderingComponents, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extractRenderingComponents\", function() { return extractRenderingComponents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSet_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSet/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSet/Constants.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_SelectionNode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/SelectionNode */ \"./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_SVG_SVGRepresentation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Widgets/SVG/SVGRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/SVG/SVGRepresentation/index.js\");\n/* harmony import */ var _vdom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./vdom */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/vdom.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\n\n\nvar ViewTypes = vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ViewTypes,\n RenderingTypes = vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"default\"].RenderingTypes,\n CaptureOn = vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CaptureOn;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].vtkErrorMacro;\nvar createSvgElement = vtk_js_Sources_Widgets_SVG_SVGRepresentation__WEBPACK_IMPORTED_MODULE_5__[\"default\"].createSvgElement,\n createSvgDomElement = vtk_js_Sources_Widgets_SVG_SVGRepresentation__WEBPACK_IMPORTED_MODULE_5__[\"default\"].createSvgDomElement;\nvar viewIdCount = 1; // ----------------------------------------------------------------------------\n// Helper\n// ----------------------------------------------------------------------------\n\nfunction extractRenderingComponents(renderer) {\n var camera = renderer.getActiveCamera();\n var renderWindow = renderer.getRenderWindow();\n var interactor = renderWindow.getInteractor();\n var apiSpecificRenderWindow = interactor.getView();\n return {\n renderer: renderer,\n renderWindow: renderWindow,\n interactor: interactor,\n apiSpecificRenderWindow: apiSpecificRenderWindow,\n camera: camera\n };\n} // ----------------------------------------------------------------------------\n\nfunction createSvgRoot(id) {\n var svgRoot = createSvgDomElement('svg');\n svgRoot.setAttribute('style', 'position: absolute; top: 0; left: 0; width: 100%; height: 100%;');\n svgRoot.setAttribute('version', '1.1');\n svgRoot.setAttribute('baseProfile', 'full');\n return svgRoot;\n} // ----------------------------------------------------------------------------\n// vtkWidgetManager methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkWidgetManager(publicAPI, model) {\n if (!model.viewId) {\n model.viewId = \"view-\".concat(viewIdCount++);\n }\n\n model.classHierarchy.push('vtkWidgetManager');\n var propsWeakMap = new WeakMap();\n var widgetToSvgMap = new WeakMap();\n var svgVTrees = new WeakMap();\n var subscriptions = []; // --------------------------------------------------------------------------\n // Internal variable\n // --------------------------------------------------------------------------\n\n model.svgRoot = createSvgRoot(model.viewId); // --------------------------------------------------------------------------\n // API internal\n // --------------------------------------------------------------------------\n\n function updateWidgetWeakMap(widget) {\n var representations = widget.getRepresentations();\n\n for (var i = 0; i < representations.length; i++) {\n var representation = representations[i];\n var origin = {\n widget: widget,\n representation: representation\n };\n var actors = representation.getActors();\n\n for (var j = 0; j < actors.length; j++) {\n var actor = actors[j];\n propsWeakMap.set(actor, origin);\n }\n }\n }\n\n function getViewWidget(widget) {\n return widget && (widget.isA('vtkAbstractWidget') ? widget : widget.getWidgetForView({\n viewId: model.viewId\n }));\n } // --------------------------------------------------------------------------\n // internal SVG API\n // --------------------------------------------------------------------------\n\n\n var pendingSvgRenders = new WeakMap();\n\n function enableSvgLayer() {\n var container = model.apiSpecificRenderWindow.getReferenceByName('el');\n var canvas = model.apiSpecificRenderWindow.getCanvas();\n container.insertBefore(model.svgRoot, canvas.nextSibling);\n var containerStyles = window.getComputedStyle(container);\n\n if (containerStyles.position === 'static') {\n container.style.position = 'relative';\n }\n }\n\n function disableSvgLayer() {\n var container = model.apiSpecificRenderWindow.getReferenceByName('el');\n container.removeChild(model.svgRoot);\n }\n\n function removeFromSvgLayer(viewWidget) {\n var group = widgetToSvgMap.get(viewWidget);\n\n if (group) {\n widgetToSvgMap.delete(viewWidget);\n svgVTrees.delete(viewWidget);\n model.svgRoot.removeChild(group);\n }\n }\n\n function setSvgSize() {\n var _model$apiSpecificRen = model.apiSpecificRenderWindow.getSize(),\n _model$apiSpecificRen2 = _slicedToArray(_model$apiSpecificRen, 2),\n cwidth = _model$apiSpecificRen2[0],\n cheight = _model$apiSpecificRen2[1];\n\n var ratio = window.devicePixelRatio || 1;\n var bwidth = String(cwidth / ratio);\n var bheight = String(cheight / ratio);\n var viewBox = \"0 0 \".concat(cwidth, \" \").concat(cheight);\n var origWidth = model.svgRoot.getAttribute('width');\n var origHeight = model.svgRoot.getAttribute('height');\n var origViewBox = model.svgRoot.getAttribute('viewBox');\n\n if (origWidth !== bwidth) {\n model.svgRoot.setAttribute('width', bwidth);\n }\n\n if (origHeight !== bheight) {\n model.svgRoot.setAttribute('height', bheight);\n }\n\n if (origViewBox !== viewBox) {\n model.svgRoot.setAttribute('viewBox', viewBox);\n }\n }\n\n function updateSvg() {\n if (model.useSvgLayer) {\n var _loop = function _loop(i) {\n var widget = model.widgets[i];\n var svgReps = widget.getRepresentations().filter(function (r) {\n return r.isA('vtkSVGRepresentation');\n });\n var pendingContent = [];\n\n if (widget.getVisibility()) {\n pendingContent = svgReps.filter(function (r) {\n return r.getVisibility();\n }).map(function (r) {\n return r.render();\n });\n }\n\n var promise = Promise.all(pendingContent);\n var renders = pendingSvgRenders.get(widget) || [];\n renders.push(promise);\n pendingSvgRenders.set(widget, renders);\n promise.then(function (vnodes) {\n var pendingRenders = pendingSvgRenders.get(widget) || [];\n var idx = pendingRenders.indexOf(promise);\n\n if (model.deleted || widget.isDeleted() || idx === -1) {\n return;\n } // throw away previous renders\n\n\n pendingRenders = pendingRenders.slice(idx + 1);\n pendingSvgRenders.set(widget, pendingRenders);\n var oldVTree = svgVTrees.get(widget);\n var newVTree = createSvgElement('g');\n\n for (var ni = 0; ni < vnodes.length; ni++) {\n newVTree.appendChild(vnodes[ni]);\n }\n\n var widgetGroup = widgetToSvgMap.get(widget);\n var node = widgetGroup;\n var patchFns = Object(_vdom__WEBPACK_IMPORTED_MODULE_6__[\"diff\"])(oldVTree, newVTree);\n\n for (var j = 0; j < patchFns.length; j++) {\n node = patchFns[j](node);\n }\n\n if (!widgetGroup && node) {\n // add\n model.svgRoot.appendChild(node);\n widgetToSvgMap.set(widget, node);\n } else if (widgetGroup && !node) {\n // delete\n widgetGroup.remove();\n widgetToSvgMap.delete(widget);\n }\n\n svgVTrees.set(widget, newVTree);\n });\n };\n\n for (var i = 0; i < model.widgets.length; i++) {\n _loop(i);\n }\n }\n } // --------------------------------------------------------------------------\n // Widget scaling\n // --------------------------------------------------------------------------\n\n\n function updateDisplayScaleParams() {\n var apiSpecificRenderWindow = model.apiSpecificRenderWindow,\n camera = model.camera,\n renderer = model.renderer;\n\n if (renderer && apiSpecificRenderWindow && camera) {\n var _apiSpecificRenderWin = apiSpecificRenderWindow.getSize(),\n _apiSpecificRenderWin2 = _slicedToArray(_apiSpecificRenderWin, 2),\n rwW = _apiSpecificRenderWin2[0],\n rwH = _apiSpecificRenderWin2[1];\n\n var _renderer$getViewport = renderer.getViewport(),\n _renderer$getViewport2 = _slicedToArray(_renderer$getViewport, 4),\n vxmin = _renderer$getViewport2[0],\n vymin = _renderer$getViewport2[1],\n vxmax = _renderer$getViewport2[2],\n vymax = _renderer$getViewport2[3];\n\n var rendererPixelDims = [rwW * (vxmax - vxmin), rwH * (vymax - vymin)];\n var cameraPosition = camera.getPosition();\n var cameraDir = camera.getDirectionOfProjection();\n var isParallel = camera.getParallelProjection();\n var dispHeightFactor = isParallel ? camera.getParallelScale() : 2 * Math.tan(Object(vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"radiansFromDegrees\"])(camera.getViewAngle()) / 2);\n model.widgets.forEach(function (w) {\n w.getNestedProps().forEach(function (r) {\n if (r.getScaleInPixels()) {\n r.setDisplayScaleParams({\n dispHeightFactor: dispHeightFactor,\n cameraPosition: cameraPosition,\n cameraDir: cameraDir,\n isParallel: isParallel,\n rendererPixelDims: rendererPixelDims\n });\n }\n });\n });\n }\n } // --------------------------------------------------------------------------\n // API public\n // --------------------------------------------------------------------------\n\n\n function updateWidgetForRender(w) {\n w.updateRepresentationForRender(model.renderingType);\n }\n\n function renderPickingBuffer() {\n model.renderingType = RenderingTypes.PICKING_BUFFER;\n model.widgets.forEach(updateWidgetForRender);\n }\n\n function renderFrontBuffer() {\n model.renderingType = RenderingTypes.FRONT_BUFFER;\n model.widgets.forEach(updateWidgetForRender);\n }\n\n function captureBuffers(x1, y1, x2, y2) {\n renderPickingBuffer();\n model.selector.setArea(x1, y1, x2, y2);\n model.selector.releasePixBuffers();\n model.previousSelectedData = null;\n return model.selector.captureBuffers();\n }\n\n publicAPI.enablePicking = function () {\n model.pickingEnabled = true;\n model.pickingAvailable = true;\n publicAPI.renderWidgets();\n };\n\n publicAPI.renderWidgets = function () {\n if (model.pickingEnabled && model.captureOn === CaptureOn.MOUSE_RELEASE) {\n var _model$apiSpecificRen3 = model.apiSpecificRenderWindow.getSize(),\n _model$apiSpecificRen4 = _slicedToArray(_model$apiSpecificRen3, 2),\n w = _model$apiSpecificRen4[0],\n h = _model$apiSpecificRen4[1];\n\n model.pickingAvailable = captureBuffers(0, 0, w, h);\n }\n\n renderFrontBuffer();\n publicAPI.modified();\n };\n\n publicAPI.disablePicking = function () {\n model.pickingEnabled = false;\n model.pickingAvailable = false;\n };\n\n publicAPI.setRenderer = function (renderer) {\n Object.assign(model, extractRenderingComponents(renderer));\n\n while (subscriptions.length) {\n subscriptions.pop().unsubscribe();\n }\n\n model.selector = model.apiSpecificRenderWindow.getSelector();\n model.selector.setFieldAssociation(vtk_js_Sources_Common_DataModel_DataSet_Constants__WEBPACK_IMPORTED_MODULE_1__[\"FieldAssociations\"].FIELD_ASSOCIATION_POINTS);\n model.selector.attach(model.apiSpecificRenderWindow, model.renderer);\n subscriptions.push(model.interactor.onRenderEvent(updateSvg));\n subscriptions.push(model.apiSpecificRenderWindow.onModified(setSvgSize));\n setSvgSize();\n subscriptions.push(model.apiSpecificRenderWindow.onModified(updateDisplayScaleParams));\n subscriptions.push(model.camera.onModified(updateDisplayScaleParams));\n updateDisplayScaleParams();\n subscriptions.push(model.interactor.onStartAnimation(function () {\n model.isAnimating = true;\n }));\n subscriptions.push(model.interactor.onEndAnimation(function () {\n model.isAnimating = false;\n publicAPI.renderWidgets();\n }));\n subscriptions.push(model.interactor.onMouseMove(function (_ref) {\n var position = _ref.position;\n\n if (model.isAnimating || !model.pickingAvailable) {\n return;\n }\n\n publicAPI.updateSelectionFromXY(position.x, position.y);\n\n var _publicAPI$getSelecte = publicAPI.getSelectedData(),\n requestCount = _publicAPI$getSelecte.requestCount,\n selectedState = _publicAPI$getSelecte.selectedState,\n representation = _publicAPI$getSelecte.representation,\n widget = _publicAPI$getSelecte.widget;\n\n if (requestCount) {\n // Call activate only once\n return;\n } // Default cursor behavior\n\n\n model.apiSpecificRenderWindow.setCursor(widget ? 'pointer' : 'default');\n\n if (model.widgetInFocus === widget && widget.hasFocus()) {\n widget.activateHandle({\n selectedState: selectedState,\n representation: representation\n }); // Ken FIXME\n\n model.interactor.render();\n model.interactor.render();\n } else {\n for (var i = 0; i < model.widgets.length; i++) {\n var w = model.widgets[i];\n\n if (w === widget && w.getPickable()) {\n w.activateHandle({\n selectedState: selectedState,\n representation: representation\n });\n model.activeWidget = w;\n } else {\n w.deactivateAllHandles();\n }\n } // Ken FIXME\n\n\n model.interactor.render();\n model.interactor.render();\n }\n }));\n publicAPI.modified();\n\n if (model.pickingEnabled) {\n // also sets pickingAvailable\n publicAPI.enablePicking();\n }\n\n if (model.useSvgLayer) {\n enableSvgLayer();\n }\n };\n\n function addWidgetInternal(viewWidget) {\n viewWidget.setWidgetManager(publicAPI);\n updateWidgetWeakMap(viewWidget);\n updateDisplayScaleParams(); // Register to renderer\n\n model.renderer.addActor(viewWidget);\n }\n\n publicAPI.addWidget = function (widget, viewType, initialValues) {\n if (!model.renderer) {\n vtkErrorMacro('Widget manager MUST BE link to a view before registering widgets');\n return null;\n }\n\n var viewId = model.viewId,\n renderer = model.renderer;\n var w = widget.getWidgetForView({\n viewId: viewId,\n renderer: renderer,\n viewType: viewType || ViewTypes.DEFAULT,\n initialValues: initialValues\n });\n\n if (model.widgets.indexOf(w) === -1) {\n model.widgets.push(w);\n addWidgetInternal(w);\n publicAPI.modified();\n }\n\n return w;\n };\n\n function removeWidgetInternal(viewWidget) {\n model.renderer.removeActor(viewWidget);\n removeFromSvgLayer(viewWidget);\n viewWidget.delete();\n }\n\n function onWidgetRemoved() {\n model.renderer.getRenderWindow().getInteractor().render();\n publicAPI.renderWidgets();\n }\n\n publicAPI.removeWidgets = function () {\n model.widgets.forEach(removeWidgetInternal);\n model.widgets = [];\n model.widgetInFocus = null;\n onWidgetRemoved();\n };\n\n publicAPI.removeWidget = function (widget) {\n var viewWidget = getViewWidget(widget);\n var index = model.widgets.indexOf(viewWidget);\n\n if (index !== -1) {\n model.widgets.splice(index, 1);\n var isWidgetInFocus = model.widgetInFocus === viewWidget;\n\n if (isWidgetInFocus) {\n publicAPI.releaseFocus();\n }\n\n removeWidgetInternal(viewWidget);\n onWidgetRemoved();\n }\n };\n\n publicAPI.updateSelectionFromXY = function (x, y) {\n if (model.pickingEnabled) {\n // First pick SVG representation\n for (var i = 0; i < model.widgets.length; ++i) {\n var widget = model.widgets[i];\n var hoveredSVGReps = widget.getRepresentations().filter(function (r) {\n return r.isA('vtkSVGRepresentation') && r.getHover() != null;\n });\n\n if (hoveredSVGReps.length) {\n var selection = vtk_js_Sources_Common_DataModel_SelectionNode__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n selection.getProperties().compositeID = hoveredSVGReps[0].getHover();\n selection.getProperties().widget = widget;\n selection.getProperties().representation = hoveredSVGReps[0];\n model.selections = [selection];\n return;\n }\n } // Then pick regular representations.\n\n\n var pickingAvailable = model.pickingAvailable;\n\n if (model.captureOn === CaptureOn.MOUSE_MOVE) {\n pickingAvailable = captureBuffers(x, y, x, y);\n renderFrontBuffer();\n }\n\n if (pickingAvailable) {\n model.selections = model.selector.generateSelection(x, y, x, y);\n }\n }\n };\n\n publicAPI.updateSelectionFromMouseEvent = function (event) {\n var pageX = event.pageX,\n pageY = event.pageY;\n\n var _model$apiSpecificRen5 = model.apiSpecificRenderWindow.getCanvas().getBoundingClientRect(),\n top = _model$apiSpecificRen5.top,\n left = _model$apiSpecificRen5.left,\n height = _model$apiSpecificRen5.height;\n\n var x = pageX - left;\n var y = height - (pageY - top);\n publicAPI.updateSelectionFromXY(x, y);\n };\n\n publicAPI.getSelectedData = function () {\n if (!model.selections || !model.selections.length) {\n model.previousSelectedData = null;\n return {};\n }\n\n var _model$selections$0$g = model.selections[0].getProperties(),\n propID = _model$selections$0$g.propID,\n compositeID = _model$selections$0$g.compositeID,\n prop = _model$selections$0$g.prop;\n\n var _model$selections$0$g2 = model.selections[0].getProperties(),\n widget = _model$selections$0$g2.widget,\n representation = _model$selections$0$g2.representation; // prop is undefined for SVG representation, widget is undefined for handle\n // representation.\n\n\n if (model.previousSelectedData && model.previousSelectedData.prop === prop && model.previousSelectedData.widget === widget && model.previousSelectedData.compositeID === compositeID) {\n model.previousSelectedData.requestCount++;\n return model.previousSelectedData;\n }\n\n if (propsWeakMap.has(prop)) {\n var props = propsWeakMap.get(prop);\n widget = props.widget;\n representation = props.representation;\n }\n\n if (widget && representation) {\n var selectedState = representation.getSelectedState(prop, compositeID);\n model.previousSelectedData = {\n requestCount: 0,\n propID: propID,\n compositeID: compositeID,\n prop: prop,\n widget: widget,\n representation: representation,\n selectedState: selectedState\n };\n return model.previousSelectedData;\n }\n\n model.previousSelectedData = null;\n return {};\n };\n\n publicAPI.grabFocus = function (widget) {\n var viewWidget = getViewWidget(widget);\n\n if (model.widgetInFocus && model.widgetInFocus !== viewWidget) {\n model.widgetInFocus.loseFocus();\n }\n\n model.widgetInFocus = viewWidget;\n\n if (model.widgetInFocus) {\n model.widgetInFocus.grabFocus();\n }\n };\n\n publicAPI.releaseFocus = function () {\n return publicAPI.grabFocus(null);\n };\n\n publicAPI.setUseSvgLayer = function (useSvgLayer) {\n if (useSvgLayer !== model.useSvgLayer) {\n model.useSvgLayer = useSvgLayer;\n\n if (model.renderer) {\n if (useSvgLayer) {\n enableSvgLayer(); // force a render so svg widgets can be drawn\n\n updateSvg();\n } else {\n disableSvgLayer();\n }\n }\n\n return true;\n }\n\n return false;\n };\n\n var superDelete = publicAPI.delete;\n\n publicAPI.delete = function () {\n while (subscriptions.length) {\n subscriptions.pop().unsubscribe();\n }\n\n superDelete();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n viewId: null,\n widgets: [],\n renderer: null,\n viewType: ViewTypes.DEFAULT,\n pickingAvailable: false,\n isAnimating: false,\n pickingEnabled: true,\n selections: null,\n previousSelectedData: null,\n widgetInFocus: null,\n useSvgLayer: true,\n captureOn: CaptureOn.MOUSE_MOVE\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].setGet(publicAPI, model, ['captureOn', {\n type: 'enum',\n name: 'viewType',\n enum: ViewTypes\n }]);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].get(publicAPI, model, ['selections', 'widgets', 'viewId', 'pickingEnabled', 'useSvgLayer']); // Object specific methods\n\n vtkWidgetManager(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance(extend, 'vtkWidgetManager'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n Constants: vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/vdom.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/vdom.js ***! - \************************************************************************/ -/*! exports provided: render, diff */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"diff\", function() { return diff; });\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar SVG_XMLNS = 'http://www.w3.org/2000/svg';\n\nfunction attrDelta(oldObj, newObj) {\n var set = [];\n var remove = [];\n var oldKeysArray = Object.keys(oldObj);\n var newKeysArray = Object.keys(newObj);\n var oldKeys = new Set(oldKeysArray);\n var newKeys = new Set(newKeysArray);\n\n for (var i = 0; i < oldKeysArray.length; i++) {\n var key = oldKeysArray[i];\n\n if (newKeys.has(key)) {\n if (oldObj[key] !== newObj[key]) {\n set.push([key, newObj[key]]);\n }\n } else {\n remove.push(key);\n }\n }\n\n for (var _i = 0; _i < newKeysArray.length; _i++) {\n var _key = newKeysArray[_i];\n\n if (!oldKeys.has(_key)) {\n set.push([_key, newObj[_key]]);\n }\n }\n\n return [set, remove];\n}\n\nfunction render(vnode) {\n var node = document.createElementNS(SVG_XMLNS, vnode.name);\n var keys = Object.keys(vnode.attrs);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n node.setAttribute(key, vnode.attrs[key]);\n } // TODO: support removing event listener (e.g. use snabbdom)\n\n\n Object.keys(vnode.eventListeners).forEach(function (key) {\n node.addEventListener(key, vnode.eventListeners[key]);\n });\n\n if (vnode.textContent) {\n node.textContent = vnode.textContent;\n } else {\n for (var _i2 = 0; _i2 < vnode.children.length; _i2++) {\n node.appendChild(render(vnode.children[_i2]));\n }\n }\n\n return node;\n}\n/**\n * Returns a set of patch functions to be applied to a document node.\n *\n * Patch functions must return the effective result node.\n */\n\nfunction diff(oldVTree, newVTree) {\n if (newVTree.textContent !== null && newVTree.children.length) {\n throw new Error('Tree cannot have both children and textContent!');\n }\n\n if (!oldVTree) {\n return [function () {\n return render(newVTree);\n }];\n }\n\n if (!newVTree) {\n return [function (node) {\n return node.remove();\n }];\n }\n\n if (oldVTree.name !== newVTree.name) {\n return [function (node) {\n var newNode = render(newVTree);\n node.replaceWith(newNode);\n return newNode;\n }];\n }\n\n var patchFns = [];\n\n var _attrDelta = attrDelta(oldVTree.attrs, newVTree.attrs),\n _attrDelta2 = _slicedToArray(_attrDelta, 2),\n attrsSet = _attrDelta2[0],\n attrsRemove = _attrDelta2[1];\n\n if (attrsSet.length || attrsRemove.length) {\n patchFns.push(function (node) {\n for (var i = 0; i < attrsSet.length; i++) {\n var _attrsSet$i = _slicedToArray(attrsSet[i], 2),\n name = _attrsSet$i[0],\n value = _attrsSet$i[1];\n\n node.setAttribute(name, value);\n }\n\n for (var _i3 = 0; _i3 < attrsRemove.length; _i3++) {\n var _name = attrsRemove[_i3];\n node.removeAttribute(_name);\n }\n\n return node;\n });\n }\n\n if (oldVTree.textContent !== newVTree.textContent && newVTree.textContent !== null) {\n patchFns.push(function (node) {\n node.textContent = newVTree.textContent;\n return node;\n });\n }\n\n if (newVTree.textContent === null) {\n var min = Math.min(oldVTree.children.length, newVTree.children.length);\n\n var _loop = function _loop(i) {\n var childPatches = diff(oldVTree.children[i], newVTree.children[i]);\n patchFns.push(function (node) {\n for (var p = 0; p < childPatches.length; p++) {\n childPatches[p](node.children[i]);\n }\n\n return node;\n });\n };\n\n for (var i = 0; i < min; i++) {\n _loop(i);\n }\n\n if (oldVTree.children.length < newVTree.children.length) {\n var _loop2 = function _loop2(_i4) {\n patchFns.push(function (node) {\n node.appendChild(render(newVTree.children[_i4]));\n return node;\n });\n };\n\n for (var _i4 = min; _i4 < newVTree.children.length; _i4++) {\n _loop2(_i4);\n }\n } else {\n var _loop3 = function _loop3(_i5) {\n patchFns.push(function (node) {\n node.children[_i5].remove();\n\n return node;\n });\n };\n\n // always delete nodes in reverse\n for (var _i5 = oldVTree.children.length - 1; _i5 >= min; _i5--) {\n _loop3(_i5);\n }\n }\n }\n\n return patchFns;\n}\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/vdom.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/WidgetState/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/WidgetState/index.js ***! - \***********************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_LABEL = 'default';\n\nfunction removeObjectInArray(array, obj) {\n var idx = array.indexOf(obj);\n\n if (idx !== -1) {\n array.splice(idx, 1);\n }\n} // ----------------------------------------------------------------------------\n\n\nfunction vtkWidgetState(publicAPI, model) {\n model.classHierarchy.push('vtkWidgetState');\n var subscriptions = [];\n model.labels = {};\n model.nestedStates = []; // --------------------------------------------------------------------------\n // labels can be a string or an array of strings.\n // If nothing (or empty array) provided the default label will be used.\n // --------------------------------------------------------------------------\n\n publicAPI.bindState = function (nested) {\n var labels = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [DEFAULT_LABEL];\n model.nestedStates.push(nested);\n subscriptions.push(nested.onModified(publicAPI.modified));\n\n if (Array.isArray(labels) && labels.length) {\n for (var i = 0; i < labels.length; i++) {\n var label = labels[i];\n\n if (!model.labels[label]) {\n model.labels[label] = [];\n }\n\n model.labels[label].push(nested);\n }\n } else {\n // Need to bind to a label\n var labelToUse = Array.isArray(labels) ? DEFAULT_LABEL : labels || DEFAULT_LABEL;\n\n if (!model.labels[labelToUse]) {\n model.labels[labelToUse] = [];\n }\n\n model.labels[labelToUse].push(nested);\n }\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.unbindState = function (nested) {\n while (subscriptions.length) {\n subscriptions.pop().unsubscribe();\n }\n\n removeObjectInArray(model.nestedStates, nested);\n\n for (var i = 0; i < model.nestedStates.length; i++) {\n subscriptions.push(model.nestedStates[i].onModified(publicAPI.modified));\n }\n\n Object.keys(model.labels).forEach(function (label) {\n var list = model.labels[label];\n removeObjectInArray(list, nested);\n });\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.unbindAll = function () {\n while (subscriptions.length) {\n subscriptions.pop().unsubscribe();\n }\n\n model.nestedStates = [];\n }; // --------------------------------------------------------------------------\n // Active flag API\n // --------------------------------------------------------------------------\n\n\n publicAPI.activate = function () {\n return publicAPI.setActive(true);\n };\n\n publicAPI.deactivate = function (excludingState) {\n if (excludingState !== publicAPI) {\n publicAPI.setActive(false);\n }\n\n for (var i = 0; i < model.nestedStates.length; i++) {\n model.nestedStates[i].deactivate(excludingState);\n }\n };\n\n publicAPI.activateOnly = function (subState) {\n if (subState) {\n subState.setActive(true);\n } // deactivate current state, but exclude the sub-state\n\n\n publicAPI.deactivate(subState);\n }; // --------------------------------------------------------------------------\n // Nested state methods\n // --------------------------------------------------------------------------\n\n\n publicAPI.getStatesWithLabel = function (name) {\n return model.labels[name];\n };\n\n publicAPI.getAllNestedStates = function () {\n return model.nestedStates;\n }; // --------------------------------------------------------------------------\n // Clean on delete\n // --------------------------------------------------------------------------\n\n\n publicAPI.delete = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.unbindAll, publicAPI.delete);\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n active: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['active']);\n vtkWidgetState(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/WidgetState/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Manipulators/LineManipulator/index.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Manipulators/LineManipulator/index.js ***! - \***********************************************************************************/ -/*! exports provided: projectDisplayToLine, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"projectDisplayToLine\", function() { return projectDisplayToLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n\nfunction projectDisplayToLine(x, y, lineOrigin, lineDirection, renderer, glRenderWindow) {\n var near = glRenderWindow.displayToWorld(x, y, 0, renderer);\n var far = glRenderWindow.displayToWorld(x, y, 1, renderer);\n var viewDir = [0, 0, 0];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"subtract\"](far, near, viewDir);\n var normal = [0, 0, 0];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"cross\"](lineDirection, viewDir, normal);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"cross\"](normal, viewDir, normal);\n var numerator = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"dot\"]([near[0] - lineOrigin[0], near[1] - lineOrigin[1], near[2] - lineOrigin[2]], normal);\n var denominator = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"dot\"](normal, lineDirection);\n var result = lineDirection.slice();\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"multiplyScalar\"](result, numerator / denominator);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"add\"](lineOrigin, result, result);\n return result;\n} // ----------------------------------------------------------------------------\n// vtkLineManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkLineManipulator(publicAPI, model) {\n // Set our classNae\n model.classHierarchy.push('vtkLineManipulator'); // --------------------------------------------------------------------------\n\n publicAPI.handleEvent = function (callData, glRenderWindow) {\n return projectDisplayToLine(callData.position.x, callData.position.y, model.origin, model.normal, callData.pokedRenderer, glRenderWindow);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n origin: [0, 0, 0],\n normal: [0, 0, 1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['origin', 'normal'], 3);\n vtkLineManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkLineManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n projectDisplayToLine: projectDisplayToLine,\n extend: extend,\n newInstance: newInstance\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Manipulators/LineManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Manipulators/PlaneManipulator/index.js": -/*!************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Manipulators/PlaneManipulator/index.js ***! - \************************************************************************************/ -/*! exports provided: intersectDisplayWithPlane, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intersectDisplayWithPlane\", function() { return intersectDisplayWithPlane; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Plane */ \"./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js\");\n\n\nfunction intersectDisplayWithPlane(x, y, planeOrigin, planeNormal, renderer, glRenderWindow) {\n var near = glRenderWindow.displayToWorld(x, y, 0, renderer);\n var far = glRenderWindow.displayToWorld(x, y, 1, renderer);\n return vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_1__[\"default\"].intersectWithLine(near, far, planeOrigin, planeNormal).x;\n} // ----------------------------------------------------------------------------\n// vtkPlaneManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPlaneManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPlaneManipulator'); // --------------------------------------------------------------------------\n\n publicAPI.handleEvent = function (callData, glRenderWindow) {\n return intersectDisplayWithPlane(callData.position.x, callData.position.y, model.origin, model.normal, callData.pokedRenderer, glRenderWindow);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n normal: [0, 0, 1],\n origin: [0, 0, 0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['normal', 'origin'], 3);\n vtkPlaneManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPlaneManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n intersectDisplayWithPlane: intersectDisplayWithPlane,\n extend: extend,\n newInstance: newInstance\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Manipulators/PlaneManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Representations/ContextRepresentation/index.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Representations/ContextRepresentation/index.js ***! - \********************************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n // ----------------------------------------------------------------------------\n// vtkWidgetRepresentation\n// ----------------------------------------------------------------------------\n\nfunction vtkContextRepresentation(publicAPI, model) {\n model.classHierarchy.push('vtkContextRepresentation');\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n behavior: vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_1__[\"Behavior\"].CONTEXT,\n pickable: false,\n dragable: true\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var newDefault = _objectSpread(_objectSpread({}, DEFAULT_VALUES), initialValues);\n\n vtk_js_Sources_Widgets_Representations_WidgetRepresentation__WEBPACK_IMPORTED_MODULE_0__[\"default\"].extend(publicAPI, model, newDefault);\n vtkContextRepresentation(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Representations/ContextRepresentation/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Representations/CroppingOutlineRepresentation/index.js": -/*!****************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Representations/CroppingOutlineRepresentation/index.js ***! - \****************************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Actor */ \"./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_ContextRepresentation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/ContextRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/ContextRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // prettier-ignore\n\nvar OUTLINE_ARRAY = [2, 0, 1, 2, 0, 2, 2, 0, 4, 2, 1, 3, 2, 1, 5, 2, 2, 3, 2, 2, 6, 2, 3, 7, 2, 4, 5, 2, 4, 6, 2, 5, 7, 2, 6, 7]; // ----------------------------------------------------------------------------\n// vtkCroppingOutlineRepresentation methods\n// ----------------------------------------------------------------------------\n// Represents a box outline given 8 points as corners.\n// Does not work with an arbitrary set of points. An oriented bounding box\n// algorithm may be implemented in the future.\n\nfunction vtkCroppingOutlineRepresentation(publicAPI, model) {\n var _model$actor$getPrope;\n\n // Set our className\n model.classHierarchy.push('vtkCroppingOutlineRepresentation'); // --------------------------------------------------------------------------\n // Internal polydata dataset\n // --------------------------------------------------------------------------\n\n model.internalPolyData = vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance({\n mtime: 0\n });\n model.points = new Float32Array(8 * 3);\n model.internalPolyData.getPoints().setData(model.points, 3);\n model.internalPolyData.getLines().setData(Uint16Array.from(OUTLINE_ARRAY)); // --------------------------------------------------------------------------\n // Generic rendering pipeline\n // --------------------------------------------------------------------------\n\n model.mapper = vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n scalarVisibility: false\n });\n model.actor = vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n\n (_model$actor$getPrope = model.actor.getProperty()).setEdgeColor.apply(_model$actor$getPrope, _toConsumableArray(model.edgeColor));\n\n model.mapper.setInputConnection(publicAPI.getOutputPort());\n model.actor.setMapper(model.mapper);\n publicAPI.addActor(model.actor); // --------------------------------------------------------------------------\n\n publicAPI.requestData = function (inData, outData) {\n var list = publicAPI.getRepresentationStates(inData[0]);\n\n if (list.length === 8) {\n var pi = 0;\n\n for (var i = 0; i < list.length; i++) {\n var pt = list[i].getOrigin();\n model.points[pi++] = pt[0];\n model.points[pi++] = pt[1];\n model.points[pi++] = pt[2];\n }\n\n model.internalPolyData.getPoints().modified();\n model.internalPolyData.modified();\n outData[0] = model.internalPolyData;\n } else {\n vtkErrorMacro('CroppingOutlineRepresentation did not get 8 states');\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n edgeColor: [1, 1, 1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Widgets_Representations_ContextRepresentation__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['edgeColor'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['mapper', 'actor']); // Object specific methods\n\n vtkCroppingOutlineRepresentation(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkCroppingOutlineRepresentation'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Representations/CroppingOutlineRepresentation/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Representations/HandleRepresentation/index.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Representations/HandleRepresentation/index.js ***! - \*******************************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n // ----------------------------------------------------------------------------\n// vtkHandleRepresentation methods\n// ----------------------------------------------------------------------------\n\nfunction vtkHandleRepresentation(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkHandleRepresentation');\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n activeScaleFactor: 1.2,\n activeColor: 1,\n useActiveColor: true,\n behavior: vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_2__[\"Behavior\"].HANDLE,\n pickable: true,\n dragable: true\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var newDefault = _objectSpread(_objectSpread({}, DEFAULT_VALUES), initialValues);\n\n vtk_js_Sources_Widgets_Representations_WidgetRepresentation__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, newDefault);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['activeScaleFactor', 'activeColor', 'useActiveColor']);\n vtkHandleRepresentation(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Representations/HandleRepresentation/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Representations/SphereHandleRepresentation/index.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Representations/SphereHandleRepresentation/index.js ***! - \*************************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Actor */ \"./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Glyph3DMapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Glyph3DMapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_HandleRepresentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/HandleRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/HandleRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js\");\n/* harmony import */ var vtk_js_Sources_Filters_Sources_SphereSource__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Filters/Sources/SphereSource */ \"./node_modules/vtk.js/Sources/Filters/Sources/SphereSource/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Constants.js\");\n\n\n\n\n\n\n\n\n // ----------------------------------------------------------------------------\n// vtkSphereHandleRepresentation methods\n// ----------------------------------------------------------------------------\n\nfunction vtkSphereHandleRepresentation(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkSphereHandleRepresentation'); // --------------------------------------------------------------------------\n // Internal polydata dataset\n // --------------------------------------------------------------------------\n\n model.internalPolyData = vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_6__[\"default\"].newInstance({\n mtime: 0\n });\n model.internalArrays = {\n points: model.internalPolyData.getPoints(),\n scale: vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n name: 'scale',\n numberOfComponents: 1,\n empty: true\n }),\n color: vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n name: 'color',\n numberOfComponents: 1,\n empty: true\n })\n };\n model.internalPolyData.getPointData().addArray(model.internalArrays.scale);\n model.internalPolyData.getPointData().addArray(model.internalArrays.color); // --------------------------------------------------------------------------\n // Generic rendering pipeline\n // --------------------------------------------------------------------------\n\n /*\n * displayActors and displayMappers are used to render objects in HTML, allowing objects\n * to be 'rendered' internally in a VTK scene without being visible on the final output\n */\n\n model.displayMapper = vtk_js_Sources_Rendering_Core_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n model.displayActor = vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(); // model.displayActor.getProperty().setOpacity(0); // don't show in 3D\n\n model.displayActor.setMapper(model.displayMapper);\n model.displayMapper.setInputConnection(publicAPI.getOutputPort());\n publicAPI.addActor(model.displayActor);\n model.alwaysVisibleActors = [model.displayActor];\n model.mapper = vtk_js_Sources_Rendering_Core_Glyph3DMapper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n scaleArray: 'scale',\n colorByArrayName: 'color',\n scalarMode: vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__[\"ScalarMode\"].USE_POINT_FIELD_DATA\n });\n model.actor = vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.glyph = vtk_js_Sources_Filters_Sources_SphereSource__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance({\n phiResolution: model.glyphResolution,\n thetaResolution: model.glyphResolution\n });\n model.mapper.setInputConnection(publicAPI.getOutputPort(), 0);\n model.mapper.setInputConnection(model.glyph.getOutputPort(), 1);\n model.actor.setMapper(model.mapper);\n publicAPI.addActor(model.actor); // --------------------------------------------------------------------------\n\n publicAPI.setGlyphResolution = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.setGlyphResolution, function (r) {\n return model.glyph.setPhiResolution(r) && model.glyph.setThetaResolution(r);\n }); // --------------------------------------------------------------------------\n\n function callbackProxy(coords) {\n if (model.displayCallback) {\n var filteredList = [];\n var states = publicAPI.getRepresentationStates();\n\n for (var i = 0; i < states.length; i++) {\n if (states[i].getActive()) {\n filteredList.push(coords[i]);\n }\n }\n\n if (filteredList.length) {\n model.displayCallback(filteredList);\n return;\n }\n }\n\n model.displayCallback();\n }\n\n publicAPI.setDisplayCallback = function (callback) {\n model.displayCallback = callback;\n model.displayMapper.setCallback(callback ? callbackProxy : null);\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.requestData = function (inData, outData) {\n var _model$internalArrays = model.internalArrays,\n points = _model$internalArrays.points,\n scale = _model$internalArrays.scale,\n color = _model$internalArrays.color;\n var list = publicAPI.getRepresentationStates(inData[0]);\n var totalCount = list.length;\n\n if (color.getNumberOfValues() !== totalCount) {\n // Need to resize dataset\n points.setData(new Float32Array(3 * totalCount), 3);\n scale.setData(new Float32Array(totalCount));\n color.setData(new Float32Array(totalCount));\n }\n\n var typedArray = {\n points: points.getData(),\n scale: scale.getData(),\n color: color.getData()\n };\n\n for (var i = 0; i < list.length; i++) {\n var state = list[i];\n var isActive = state.getActive();\n var scaleFactor = isActive ? model.activeScaleFactor : 1;\n var coord = state.getOrigin();\n typedArray.points[i * 3 + 0] = coord[0];\n typedArray.points[i * 3 + 1] = coord[1];\n typedArray.points[i * 3 + 2] = coord[2];\n typedArray.scale[i] = scaleFactor * (!state.isVisible || state.isVisible() ? 1 : 0) * (state.getScale1 ? state.getScale1() : model.defaultScale);\n\n if (publicAPI.getScaleInPixels()) {\n typedArray.scale[i] *= publicAPI.getPixelWorldHeightAtCoord(coord);\n }\n\n typedArray.color[i] = model.useActiveColor && isActive ? model.activeColor : state.getColor();\n }\n\n model.internalPolyData.modified();\n outData[0] = model.internalPolyData;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n glyphResolution: 8,\n defaultScale: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Widgets_Representations_HandleRepresentation__WEBPACK_IMPORTED_MODULE_4__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['glyph', 'mapper', 'actor']); // Object specific methods\n\n vtkSphereHandleRepresentation(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkSphereHandleRepresentation'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Representations/SphereHandleRepresentation/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js ***! - \***********************************************************************************************/ -/*! exports provided: Behavior, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Behavior\", function() { return Behavior; });\nvar Behavior = {\n HANDLE: 0,\n CONTEXT: 1\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n Behavior: Behavior\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/index.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/index.js ***! - \*******************************************************************************************/ -/*! exports provided: mergeStyles, applyStyles, connectPipeline, extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeStyles\", function() { return mergeStyles; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyStyles\", function() { return applyStyles; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"connectPipeline\", function() { return connectPipeline; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Prop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Prop */ \"./node_modules/vtk.js/Sources/Rendering/Core/Prop/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper_CoincidentTopologyHelper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro,\n vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkWarningMacro; // ----------------------------------------------------------------------------\n\nvar STYLE_CATEGORIES = ['active', 'inactive', 'static'];\nfunction mergeStyles(elementNames) {\n for (var _len = arguments.length, stylesToMerge = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n stylesToMerge[_key - 1] = arguments[_key];\n }\n\n var newStyleObject = {\n active: {},\n inactive: {},\n static: {}\n };\n STYLE_CATEGORIES.forEach(function (category) {\n var cat = newStyleObject[category];\n elementNames.forEach(function (name) {\n if (!cat[name]) {\n cat[name] = {};\n }\n\n stylesToMerge.filter(function (s) {\n return s && s[category] && s[category][name];\n }).forEach(function (s) {\n return Object.assign(cat[name], s[category][name]);\n });\n });\n });\n return newStyleObject;\n} // ----------------------------------------------------------------------------\n\nfunction applyStyles(pipelines, styles, activeActor) {\n if (!activeActor) {\n // static\n Object.keys(styles.static).forEach(function (name) {\n if (pipelines[name]) {\n pipelines[name].actor.getProperty().set(styles.static[name]);\n }\n }); // inactive\n\n Object.keys(styles.inactive).forEach(function (name) {\n if (pipelines[name]) {\n pipelines[name].actor.getProperty().set(styles.inactive[name]);\n }\n });\n } else {\n Object.keys(pipelines).forEach(function (name) {\n var style = pipelines[name].actor === activeActor ? styles.active[name] : styles.inactive[name];\n\n if (style) {\n pipelines[name].actor.getProperty().set(style);\n }\n });\n }\n} // ----------------------------------------------------------------------------\n\nfunction connectPipeline(pipeline) {\n if (pipeline.source.isA('vtkDataSet')) {\n pipeline.mapper.setInputData(pipeline.source);\n } else {\n pipeline.mapper.setInputConnection(pipeline.source.getOutputPort());\n }\n\n if (pipeline.glyph) {\n pipeline.mapper.setInputConnection(pipeline.glyph.getOutputPort(), 1);\n }\n\n pipeline.actor.setMapper(pipeline.mapper);\n} // ----------------------------------------------------------------------------\n// vtkWidgetRepresentation\n// ----------------------------------------------------------------------------\n\nfunction vtkWidgetRepresentation(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWidgetRepresentation'); // Internal cache\n\n var cache = {\n mtimes: {},\n states: []\n }; // --------------------------------------------------------------------------\n\n publicAPI.getActors = function () {\n return model.actors;\n };\n\n publicAPI.getNestedProps = publicAPI.getActors; // --------------------------------------------------------------------------\n\n publicAPI.setLabels = function () {\n for (var _len2 = arguments.length, labels = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n labels[_key2] = arguments[_key2];\n }\n\n if (labels.length === 1) {\n model.labels = [].concat(labels[0]);\n } else {\n model.labels = labels;\n }\n\n publicAPI.modified();\n };\n\n publicAPI.getRepresentationStates = function () {\n var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : model.inputData[0];\n\n if (cache.mtimes.representation === publicAPI.getMTime() && cache.mtimes.input === input.getMTime()) {\n return cache.states;\n } // Reinitialize cache\n\n\n cache.mtimes.representation = publicAPI.getMTime();\n cache.mtimes.input = input.getMTime();\n cache.states = []; // Fill states that are going to be used in the representation\n\n model.labels.forEach(function (name) {\n cache.states = cache.states.concat(input.getStatesWithLabel(name) || []);\n });\n return cache.states;\n };\n\n publicAPI.getSelectedState = function (prop, compositeID) {\n var representationStates = publicAPI.getRepresentationStates();\n\n if (compositeID < representationStates.length) {\n return representationStates[compositeID];\n }\n\n vtkErrorMacro(\"Representation \".concat(publicAPI.getClassName(), \" should implement getSelectedState(prop, compositeID) method.\"));\n return null;\n };\n\n publicAPI.updateActorVisibility = function () {\n var renderingType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"RenderingTypes\"].FRONT_BUFFER;\n var widgetVisible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var ctxVisible = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var handleVisible = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var otherFlag = true;\n\n switch (model.behavior) {\n case vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_3__[\"Behavior\"].HANDLE:\n otherFlag = renderingType === vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"RenderingTypes\"].PICKING_BUFFER || handleVisible;\n break;\n\n case vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_3__[\"Behavior\"].CONTEXT:\n otherFlag = renderingType === vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"RenderingTypes\"].FRONT_BUFFER && ctxVisible;\n break;\n\n default:\n otherFlag = true;\n break;\n }\n\n var visibilityFlag = widgetVisible && otherFlag;\n\n for (var i = 0; i < model.actors.length; i++) {\n if (model.visibilityFlagArray) {\n model.actors[i].setVisibility(visibilityFlag && model.visibilityFlagArray[i]);\n } else {\n model.actors[i].setVisibility(visibilityFlag);\n }\n }\n\n if (model.alwaysVisibleActors) {\n for (var _i = 0; _i < model.alwaysVisibleActors.length; _i++) {\n model.alwaysVisibleActors[_i].setVisibility(true);\n }\n }\n };\n\n function applyCoincidentTopologyParametersToMapper(mapper, parameters) {\n if (mapper && mapper.setResolveCoincidentTopologyToPolygonOffset) {\n mapper.setResolveCoincidentTopologyToPolygonOffset();\n vtk_js_Sources_Rendering_Core_Mapper_CoincidentTopologyHelper__WEBPACK_IMPORTED_MODULE_5__[\"CATEGORIES\"].forEach(function (category) {\n if (parameters[category]) {\n var methodName = \"setRelativeCoincidentTopology\".concat(category, \"OffsetParameters\");\n\n if (mapper[methodName]) {\n var _parameters$category = parameters[category],\n factor = _parameters$category.factor,\n offset = _parameters$category.offset;\n mapper[methodName](factor, offset);\n }\n }\n });\n }\n } // Add warning to model.actors.push\n\n\n model.actors.push = function () {\n vtkWarningMacro('You should use publicAPI.addActor() to initialize the actor properly');\n\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n args.forEach(function (actor) {\n return publicAPI.addActor(actor);\n });\n };\n\n publicAPI.addActor = function (actor) {\n applyCoincidentTopologyParametersToMapper(actor.getMapper(), model.coincidentTopologyParameters);\n Array.prototype.push.apply(model.actors, [actor]);\n };\n\n publicAPI.setCoincidentTopologyParameters = function (parameters) {\n model.coincidentTopologyParameters = parameters;\n publicAPI.getActors().forEach(function (actor) {\n applyCoincidentTopologyParametersToMapper(actor.getMapper(), model.coincidentTopologyParameters);\n });\n };\n\n publicAPI.getPixelWorldHeightAtCoord = function (worldCoord) {\n var _model$displayScalePa = model.displayScaleParams,\n dispHeightFactor = _model$displayScalePa.dispHeightFactor,\n cameraPosition = _model$displayScalePa.cameraPosition,\n cameraDir = _model$displayScalePa.cameraDir,\n isParallel = _model$displayScalePa.isParallel,\n rendererPixelDims = _model$displayScalePa.rendererPixelDims;\n var scale = 1;\n\n if (isParallel) {\n scale = dispHeightFactor;\n } else {\n var worldCoordToCamera = _toConsumableArray(worldCoord);\n\n Object(vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"subtract\"])(worldCoordToCamera, cameraPosition, worldCoordToCamera);\n scale = Object(vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"dot\"])(worldCoordToCamera, cameraDir) * dispHeightFactor;\n }\n\n var rHeight = rendererPixelDims[1];\n return scale / rHeight;\n }; // Make sure setting the labels at build time works with string/array...\n\n\n publicAPI.setLabels(model.labels);\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n actors: [],\n labels: [],\n behavior: vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_3__[\"Behavior\"].CONTEXT,\n coincidentTopologyParameters: {\n Point: {\n factor: -1.0,\n offset: -1.0\n },\n Line: {\n factor: -1.0,\n offset: -1.0\n },\n Polygon: {\n factor: -1.0,\n offset: -1.0\n }\n },\n scaleInPixels: false,\n displayScaleParams: {\n dispHeightFactor: 1,\n cameraPosition: [0, 0, 0],\n cameraDir: [1, 0, 0],\n isParallel: false,\n rendererPixelDims: [1, 1]\n }\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_Rendering_Core_Prop__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].algo(publicAPI, model, 1, 1);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['labels', 'coincidentTopologyParameters']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].set(publicAPI, model, ['displayScaleParams']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['scaleInPixels']); // Object specific methods\n\n vtkWidgetRepresentation(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend,\n mergeStyles: mergeStyles,\n applyStyles: applyStyles,\n connectPipeline: connectPipeline\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/SVG/SVGRepresentation/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/SVG/SVGRepresentation/index.js ***! - \****************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Actor */ \"./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js\");\n\n\n\n\n\n\n\nvar SVG_XMLNS = 'http://www.w3.org/2000/svg'; // ----------------------------------------------------------------------------\n\nfunction createSvgElement(tag) {\n return {\n name: tag,\n attrs: {},\n eventListeners: {},\n // implies no children if set\n textContent: null,\n children: [],\n setAttribute: function setAttribute(attr, val) {\n this.attrs[attr] = val;\n },\n removeAttribute: function removeAttribute(attr) {\n delete this.attrs[attr];\n },\n appendChild: function appendChild(n) {\n this.children.push(n);\n },\n addEventListeners: function addEventListeners(event, callback) {\n this.eventListeners[event] = callback;\n }\n };\n} // ----------------------------------------------------------------------------\n\n\nfunction createSvgDomElement(tag) {\n return document.createElementNS(SVG_XMLNS, tag);\n} // ----------------------------------------------------------------------------\n\n\nfunction defer() {\n var resolve;\n var reject;\n var promise = new Promise(function (res, rej) {\n resolve = res;\n reject = rej;\n });\n return {\n promise: promise,\n resolve: resolve,\n reject: reject\n };\n} // ----------------------------------------------------------------------------\n// vtkSVGRepresentation\n// ----------------------------------------------------------------------------\n\n\nfunction vtkSVGRepresentation(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkSVGRepresentation');\n var deferred = null;\n model.psActor = vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n pickable: false\n });\n model.psMapper = vtk_js_Sources_Rendering_Core_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.points = vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.psMapper.setInputData(model.points);\n model.psActor.setMapper(model.psMapper);\n model.psMapper.setCallback(function () {\n if (deferred) {\n var d = deferred;\n deferred = null;\n d.resolve({\n coords: arguments.length <= 0 ? undefined : arguments[0],\n camera: arguments.length <= 1 ? undefined : arguments[1],\n aspect: arguments.length <= 2 ? undefined : arguments[2],\n depthValues: arguments.length <= 3 ? undefined : arguments[3],\n windowSize: arguments.length <= 4 ? undefined : arguments[4]\n });\n }\n });\n publicAPI.addActor(model.psActor); // --------------------------------------------------------------------------\n\n publicAPI.worldPointsToPixelSpace = function (points3d) {\n var pts = new Float32Array(points3d.length * 3);\n\n for (var i = 0; i < points3d.length; i++) {\n pts[i * 3 + 0] = points3d[i][0];\n pts[i * 3 + 1] = points3d[i][1];\n pts[i * 3 + 2] = points3d[i][2];\n }\n\n model.points.getPoints().setData(pts);\n model.points.modified();\n deferred = defer();\n return deferred.promise;\n };\n\n publicAPI.createListenableSvgElement = function (tag, id) {\n var element = createSvgElement(tag);\n\n if (model.pickable) {\n element.addEventListeners('mouseenter', function () {\n publicAPI.setHover(id);\n });\n element.addEventListeners('mouseleave', function () {\n if (publicAPI.getHover() === id) {\n publicAPI.setHover(null);\n }\n });\n }\n\n return element;\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.updateActorVisibility = function () {\n var renderingType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_6__[\"RenderingTypes\"].FRONT_BUFFER;\n var widgetVisible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var ctxVisible = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var handleVisible = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n\n if (model.behavior === vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_5__[\"Behavior\"].CONTEXT) {\n publicAPI.setVisibility(widgetVisible && ctxVisible);\n } else if (model.behavior === vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_5__[\"Behavior\"].HANDLE) {\n publicAPI.setVisibility(widgetVisible && handleVisible);\n }\n }; // --------------------------------------------------------------------------\n // Subclasses must implement this method\n\n\n publicAPI.render = function () {\n throw new Error('Not implemented');\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n/**\n * 'hover' is not null when a pickable SVG element is mouse hovered.\n */\n\n\nvar DEFAULT_VALUES = {\n visibility: true\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Extend methods\n\n vtk_js_Sources_Widgets_Representations_WidgetRepresentation__WEBPACK_IMPORTED_MODULE_4__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['visibility', 'hover']); // Object specific methods\n\n vtkSVGRepresentation(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend,\n createSvgElement: createSvgElement,\n createSvgDomElement: createSvgDomElement\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/SVG/SVGRepresentation/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/behavior.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/behavior.js ***! - \***************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return widgetBehavior; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers */ \"./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\nfunction widgetBehavior(publicAPI, model) {\n var isDragging = null;\n\n publicAPI.setDisplayCallback = function (callback) {\n return model.representations[0].setDisplayCallback(callback);\n };\n\n publicAPI.handleLeftButtonPress = function () {\n if (!model.activeState || !model.activeState.getActive() || !model.pickable) {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].VOID;\n }\n\n isDragging = true;\n model.interactor.requestAnimation(publicAPI);\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENT_ABORT;\n };\n\n publicAPI.handleMouseMove = function (callData) {\n if (isDragging && model.pickable && model.dragable) {\n return publicAPI.handleEvent(callData);\n }\n\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].VOID;\n };\n\n publicAPI.handleLeftButtonRelease = function () {\n if (isDragging && model.pickable) {\n isDragging = false;\n model.interactor.cancelAnimation(publicAPI);\n model.widgetState.deactivate();\n }\n };\n\n publicAPI.handleEvent = function (callData) {\n if (model.pickable && model.activeState && model.activeState.getActive()) {\n var manipulator = model.activeState.getManipulator();\n\n if (manipulator) {\n var name = model.activeState.getName();\n var type = Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"handleTypeFromName\"])(name);\n var index = name.split('').map(function (l) {\n return vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"AXES\"].indexOf(l);\n });\n var planes = model.widgetState.getCroppingPlanes().getPlanes();\n var indexToWorldT = model.widgetState.getIndexToWorldT();\n var worldCoords = [];\n\n if (type === 'corners') {\n // manipulator should be a plane manipulator\n manipulator.setNormal(model.camera.getDirectionOfProjection());\n worldCoords = manipulator.handleEvent(callData, model.apiSpecificRenderWindow);\n }\n\n if (type === 'faces') {\n // constraint axis is line defined by the index and center point.\n // Since our index point is defined inside a box [0, 2, 0, 2, 0, 2],\n // center point is [1, 1, 1].\n var constraintAxis = [1 - index[0], 1 - index[1], 1 - index[2]]; // get center of current crop box\n\n var center = [(planes[0] + planes[1]) / 2, (planes[2] + planes[3]) / 2, (planes[4] + planes[5]) / 2]; // manipulator should be a line manipulator\n\n manipulator.setOrigin(Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"transformVec3\"])(center, indexToWorldT));\n manipulator.setNormal(Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"transformVec3\"])(constraintAxis, indexToWorldT));\n worldCoords = manipulator.handleEvent(callData, model.apiSpecificRenderWindow);\n }\n\n if (type === 'edges') {\n // constrain to a plane with a normal parallel to the edge\n var edgeAxis = index.map(function (a) {\n return a === 1 ? a : 0;\n });\n manipulator.setNormal(Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"transformVec3\"])(edgeAxis, indexToWorldT));\n worldCoords = manipulator.handleEvent(callData, model.apiSpecificRenderWindow);\n }\n\n if (worldCoords.length) {\n var _model$activeState, _model$widgetState$ge;\n\n // transform worldCoords to indexCoords, and then update the croppingPlanes() state with setPlanes().\n var worldToIndexT = model.widgetState.getWorldToIndexT();\n var indexCoords = Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"transformVec3\"])(worldCoords, worldToIndexT);\n\n for (var i = 0; i < 3; i++) {\n if (index[i] === 0) {\n planes[i * 2] = indexCoords[i];\n } else if (index[i] === 2) {\n planes[i * 2 + 1] = indexCoords[i];\n }\n }\n\n (_model$activeState = model.activeState).setOrigin.apply(_model$activeState, _toConsumableArray(worldCoords));\n\n (_model$widgetState$ge = model.widgetState.getCroppingPlanes()).setPlanes.apply(_model$widgetState$ge, _toConsumableArray(planes));\n\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENT_ABORT;\n }\n }\n }\n\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].VOID;\n }; // --------------------------------------------------------------------------\n // initialization\n // --------------------------------------------------------------------------\n\n\n model.camera = model.renderer.getActiveCamera();\n model.classHierarchy.push('vtkImageCroppingWidgetProp');\n}\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/behavior.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers.js ***! - \**************************************************************************************/ -/*! exports provided: AXES, transformVec3, handleTypeFromName */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AXES\", function() { return AXES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformVec3\", function() { return transformVec3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"handleTypeFromName\", function() { return handleTypeFromName; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n // Labels used to encode handle position in the handle state's name property\n\nvar AXES = ['-', '=', '+']; // ----------------------------------------------------------------------------\n\nfunction transformVec3(ain, transform) {\n var vout = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(vout, ain, transform);\n return vout;\n} // ----------------------------------------------------------------------------\n\nfunction handleTypeFromName(name) {\n var _name$split$map = name.split('').map(function (l) {\n return AXES.indexOf(l) - 1;\n }),\n _name$split$map2 = _slicedToArray(_name$split$map, 3),\n i = _name$split$map2[0],\n j = _name$split$map2[1],\n k = _name$split$map2[2];\n\n if (i * j * k !== 0) {\n return 'corners';\n }\n\n if (i * j !== 0 || j * k !== 0 || k * i !== 0) {\n return 'edges';\n }\n\n return 'faces';\n}\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/index.js": -/*!************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/index.js ***! - \************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_AbstractWidgetFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/AbstractWidgetFactory */ \"./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidgetFactory/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Manipulators_PlaneManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Manipulators/PlaneManipulator */ \"./node_modules/vtk.js/Sources/Widgets/Manipulators/PlaneManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Manipulators_LineManipulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Manipulators/LineManipulator */ \"./node_modules/vtk.js/Sources/Widgets/Manipulators/LineManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_SphereHandleRepresentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/SphereHandleRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/SphereHandleRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_CroppingOutlineRepresentation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/CroppingOutlineRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/CroppingOutlineRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_behavior__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/behavior */ \"./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/behavior.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_state__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/state */ \"./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/state.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers */ \"./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n\n\n\n\n // ----------------------------------------------------------------------------\n// ----------------------------------------------------------------------------\n// Factory\n// ----------------------------------------------------------------------------\n\nfunction vtkImageCroppingWidget(publicAPI, model) {\n model.classHierarchy.push('vtkImageCroppingWidget');\n var stateSub = null; // --------------------------------------------------------------------------\n\n function setHandlesEnabled(label, flag) {\n model.widgetState.getStatesWithLabel(label).forEach(function (handle) {\n handle.setVisible(flag);\n });\n } // Set the visibility of the three classes of handles: face, edge, corner\n\n\n publicAPI.setFaceHandlesEnabled = function (flag) {\n return setHandlesEnabled('faces', flag);\n };\n\n publicAPI.setEdgeHandlesEnabled = function (flag) {\n return setHandlesEnabled('edges', flag);\n };\n\n publicAPI.setCornerHandlesEnabled = function (flag) {\n return setHandlesEnabled('corners', flag);\n }; // --------------------------------------------------------------------------\n // Copies the transforms and dimension of a vtkImageData\n\n\n publicAPI.copyImageDataDescription = function (im) {\n var _model$widgetState, _model$widgetState2;\n\n (_model$widgetState = model.widgetState).setIndexToWorldT.apply(_model$widgetState, _toConsumableArray(im.getIndexToWorld()));\n\n (_model$widgetState2 = model.widgetState).setWorldToIndexT.apply(_model$widgetState2, _toConsumableArray(im.getWorldToIndex()));\n\n var dims = im.getDimensions();\n var planeState = model.widgetState.getCroppingPlanes();\n planeState.setPlanes([0, dims[0], 0, dims[1], 0, dims[2]]);\n publicAPI.modified();\n }; // --------------------------------------------------------------------------\n // Updates handle positions based on cropping planes\n\n\n publicAPI.updateHandles = function () {\n var planes = model.widgetState.getCroppingPlanes().getPlanes();\n var midpts = [(planes[0] + planes[1]) / 2, (planes[2] + planes[3]) / 2, (planes[4] + planes[5]) / 2];\n var iAxis = [planes[0], midpts[0], planes[1]];\n var jAxis = [planes[2], midpts[1], planes[3]];\n var kAxis = [planes[4], midpts[2], planes[5]];\n var indexToWorldT = model.widgetState.getIndexToWorldT();\n\n var getAxis = function getAxis(a) {\n return vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_8__[\"AXES\"][a];\n };\n\n for (var i = 0; i < 3; i++) {\n for (var j = 0; j < 3; j++) {\n for (var k = 0; k < 3; k++) {\n // skip center of box\n if (i !== 1 || j !== 1 || k !== 1) {\n var name = [i, j, k].map(getAxis).join('');\n var coord = Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_8__[\"transformVec3\"])([iAxis[i], jAxis[j], kAxis[k]], indexToWorldT);\n\n var _model$widgetState$ge = model.widgetState.getStatesWithLabel(name),\n _model$widgetState$ge2 = _slicedToArray(_model$widgetState$ge, 1),\n handle = _model$widgetState$ge2[0];\n\n handle.setOrigin.apply(handle, _toConsumableArray(coord));\n }\n }\n }\n }\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.delete = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.delete, function () {\n if (stateSub) {\n stateSub.unsubscribe();\n }\n }); // --- Widget Requirement ---------------------------------------------------\n\n model.behavior = vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_behavior__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n model.widgetState = Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_state__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(); // Given a view type (geometry, slice, volume), return a description\n // of what representations to create and what widget state to pass\n // to the respective representations.\n\n publicAPI.getRepresentationsForViewType = function (viewType) {\n switch (viewType) {\n case vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_9__[\"ViewTypes\"].DEFAULT:\n case vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_9__[\"ViewTypes\"].GEOMETRY:\n case vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_9__[\"ViewTypes\"].SLICE:\n case vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_9__[\"ViewTypes\"].VOLUME:\n default:\n return [// Describes constructing a vtkSphereHandleRepresentation, and every\n // time the widget state updates, we will give the representation\n // a list of all handle states (which have the label \"handles\").\n {\n builder: vtk_js_Sources_Widgets_Representations_SphereHandleRepresentation__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n labels: ['handles']\n }, {\n builder: vtk_js_Sources_Widgets_Representations_CroppingOutlineRepresentation__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n // outline is defined by corner points\n labels: ['corners']\n }];\n }\n }; // Update handle positions when cropping planes update\n\n\n stateSub = model.widgetState.getCroppingPlanes().onModified(publicAPI.updateHandles); // Add manipulators to our widgets.\n\n var planeManipulator = vtk_js_Sources_Widgets_Manipulators_PlaneManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n var lineManipulator = vtk_js_Sources_Widgets_Manipulators_LineManipulator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.widgetState.getStatesWithLabel('corners').forEach(function (handle) {\n return handle.setManipulator(planeManipulator);\n });\n model.widgetState.getStatesWithLabel('edges').forEach(function (handle) {\n return handle.setManipulator(planeManipulator);\n });\n model.widgetState.getStatesWithLabel('faces').forEach(function (handle) {\n return handle.setManipulator(lineManipulator);\n });\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Widgets_Core_AbstractWidgetFactory__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtkImageCroppingWidget(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkImageCroppingWidget'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/state.js": -/*!************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/state.js ***! - \************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers */ \"./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers.js\");\n\n // create our state builder\n\nvar builder = vtk_js_Sources_Widgets_Core_StateBuilder__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createBuilder(); // add image data description fields\n\nbuilder.addField({\n name: 'indexToWorldT',\n initialValue: Array(16).fill(0)\n}).addField({\n name: 'worldToIndexT',\n initialValue: Array(16).fill(0)\n}); // make cropping planes a sub-state so we can listen to it\n// separately from the rest of the widget state.\n\nvar croppingState = vtk_js_Sources_Widgets_Core_StateBuilder__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createBuilder().addField({\n name: 'planes',\n // index space\n initialValue: [0, 1, 0, 1, 0, 1]\n}).build(); // add cropping planes state to our primary state\n\nbuilder.addStateFromInstance({\n labels: ['croppingPlanes'],\n name: 'croppingPlanes',\n instance: croppingState\n}); // add all handle states\n// default bounds is [-1, 1] in all dimensions\n\nfor (var i = -1; i < 2; i++) {\n for (var j = -1; j < 2; j++) {\n for (var k = -1; k < 2; k++) {\n // skip center of box\n if (i !== 0 || j !== 0 || k !== 0) {\n var name = vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"AXES\"][i + 1] + vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"AXES\"][j + 1] + vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"AXES\"][k + 1];\n var type = Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"handleTypeFromName\"])(name); // since handle states are rendered via vtkSphereHandleRepresentation,\n // we can dictate the handle origin, size (scale1), color, and visibility.\n\n builder.addStateFromMixin({\n labels: ['handles', name, type],\n mixins: ['name', 'origin', 'color', 'scale1', 'visible', 'manipulator'],\n name: name,\n initialValues: {\n scale1: 10,\n origin: [i, j, k],\n visible: true,\n name: name\n }\n });\n }\n }\n }\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function () {\n return builder.build();\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/state.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/macro.js": -/*!**********************************************!*\ - !*** ./node_modules/vtk.js/Sources/macro.js ***! - \**********************************************/ -/*! exports provided: VOID, setLoggerFunction, vtkLogMacro, vtkInfoMacro, vtkDebugMacro, vtkErrorMacro, vtkWarningMacro, vtkOnceErrorMacro, TYPED_ARRAYS, newTypedArray, newTypedArrayFrom, capitalize, uncapitalize, formatBytesToProperUnit, formatNumbersWithThousandSeparator, setImmediateVTK, obj, get, set, setGet, getArray, setArray, setGetArray, algo, EVENT_ABORT, event, newInstance, chain, isVtkObject, traverseInstanceTree, debounce, throttle, keystore, proxy, proxyPropertyMapping, proxyPropertyState, normalizeWheel, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VOID\", function() { return VOID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setLoggerFunction\", function() { return setLoggerFunction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkLogMacro\", function() { return vtkLogMacro; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkInfoMacro\", function() { return vtkInfoMacro; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkDebugMacro\", function() { return vtkDebugMacro; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkErrorMacro\", function() { return vtkErrorMacro; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkWarningMacro\", function() { return vtkWarningMacro; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkOnceErrorMacro\", function() { return vtkOnceErrorMacro; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TYPED_ARRAYS\", function() { return TYPED_ARRAYS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newTypedArray\", function() { return newTypedArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newTypedArrayFrom\", function() { return newTypedArrayFrom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"capitalize\", function() { return capitalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"uncapitalize\", function() { return uncapitalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"formatBytesToProperUnit\", function() { return formatBytesToProperUnit; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"formatNumbersWithThousandSeparator\", function() { return formatNumbersWithThousandSeparator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setImmediateVTK\", function() { return setImmediateVTK; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"obj\", function() { return obj; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setGet\", function() { return setGet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getArray\", function() { return getArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setArray\", function() { return setArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setGetArray\", function() { return setGetArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"algo\", function() { return algo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EVENT_ABORT\", function() { return EVENT_ABORT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"event\", function() { return event; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"chain\", function() { return chain; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isVtkObject\", function() { return isVtkObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"traverseInstanceTree\", function() { return traverseInstanceTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"debounce\", function() { return debounce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"throttle\", function() { return throttle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keystore\", function() { return keystore; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"proxy\", function() { return proxy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"proxyPropertyMapping\", function() { return proxyPropertyMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"proxyPropertyState\", function() { return proxyPropertyState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalizeWheel\", function() { return normalizeWheel; });\n/* harmony import */ var _vtk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vtk */ \"./node_modules/vtk.js/Sources/vtk.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n\nvar globalMTime = 0;\nvar VOID = Symbol('void');\n\nfunction getCurrentGlobalMTime() {\n return globalMTime;\n} // ----------------------------------------------------------------------------\n// Logging function calls\n// ----------------------------------------------------------------------------\n\n/* eslint-disable no-prototype-builtins */\n\n\nvar fakeConsole = {};\n\nfunction noOp() {}\n\nvar consoleMethods = ['log', 'debug', 'info', 'warn', 'error', 'time', 'timeEnd', 'group', 'groupEnd'];\nconsoleMethods.forEach(function (methodName) {\n fakeConsole[methodName] = noOp;\n});\nglobal.console = console.hasOwnProperty('log') ? console : fakeConsole;\nvar loggerFunctions = {\n debug: noOp,\n // Don't print debug by default\n error: global.console.error || noOp,\n info: global.console.info || noOp,\n log: global.console.log || noOp,\n warn: global.console.warn || noOp\n};\nfunction setLoggerFunction(name, fn) {\n if (loggerFunctions[name]) {\n loggerFunctions[name] = fn || noOp;\n }\n}\nfunction vtkLogMacro() {\n loggerFunctions.log.apply(loggerFunctions, arguments);\n}\nfunction vtkInfoMacro() {\n loggerFunctions.info.apply(loggerFunctions, arguments);\n}\nfunction vtkDebugMacro() {\n loggerFunctions.debug.apply(loggerFunctions, arguments);\n}\nfunction vtkErrorMacro() {\n loggerFunctions.error.apply(loggerFunctions, arguments);\n}\nfunction vtkWarningMacro() {\n loggerFunctions.warn.apply(loggerFunctions, arguments);\n}\nvar ERROR_ONCE_MAP = {};\nfunction vtkOnceErrorMacro(str) {\n if (!ERROR_ONCE_MAP[str]) {\n loggerFunctions.error(str);\n ERROR_ONCE_MAP[str] = true;\n }\n} // ----------------------------------------------------------------------------\n// TypedArray\n// ----------------------------------------------------------------------------\n\nvar TYPED_ARRAYS = Object.create(null);\nTYPED_ARRAYS.Float32Array = Float32Array;\nTYPED_ARRAYS.Float64Array = Float64Array;\nTYPED_ARRAYS.Uint8Array = Uint8Array;\nTYPED_ARRAYS.Int8Array = Int8Array;\nTYPED_ARRAYS.Uint16Array = Uint16Array;\nTYPED_ARRAYS.Int16Array = Int16Array;\nTYPED_ARRAYS.Uint32Array = Uint32Array;\nTYPED_ARRAYS.Int32Array = Int32Array;\nTYPED_ARRAYS.Uint8ClampedArray = Uint8ClampedArray; // TYPED_ARRAYS.BigInt64Array = BigInt64Array;\n// TYPED_ARRAYS.BigUint64Array = BigUint64Array;\n\nfunction newTypedArray(type) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return _construct(TYPED_ARRAYS[type] || Float64Array, args);\n}\nfunction newTypedArrayFrom(type) {\n var _ref;\n\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return (_ref = TYPED_ARRAYS[type] || Float64Array).from.apply(_ref, args);\n} // ----------------------------------------------------------------------------\n// capitilze provided string\n// ----------------------------------------------------------------------------\n\nfunction capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nfunction uncapitalize(str) {\n return str.charAt(0).toLowerCase() + str.slice(1);\n} // ----------------------------------------------------------------------------\n// Convert byte size into a well formatted string\n// ----------------------------------------------------------------------------\n\nfunction formatBytesToProperUnit(size) {\n var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n var chunkSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;\n var units = ['TB', 'GB', 'MB', 'KB'];\n var value = Number(size);\n var currentUnit = 'B';\n\n while (value > chunkSize) {\n value /= chunkSize;\n currentUnit = units.pop();\n }\n\n return \"\".concat(value.toFixed(precision), \" \").concat(currentUnit);\n} // ----------------------------------------------------------------------------\n// Convert thousand number with proper separator\n// ----------------------------------------------------------------------------\n\nfunction formatNumbersWithThousandSeparator(n) {\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';\n var sections = [];\n var size = n;\n\n while (size > 1000) {\n sections.push(\"000\".concat(size % 1000).slice(-3));\n size = Math.floor(size / 1000);\n }\n\n if (size > 0) {\n sections.push(size);\n }\n\n sections.reverse();\n return sections.join(separator);\n} // ----------------------------------------------------------------------------\n// Array helper\n// ----------------------------------------------------------------------------\n\nfunction safeArrays(model) {\n Object.keys(model).forEach(function (key) {\n if (Array.isArray(model[key])) {\n model[key] = [].concat(model[key]);\n }\n });\n} // ----------------------------------------------------------------------------\n// shallow equals\n// ----------------------------------------------------------------------------\n\n\nfunction shallowEquals(a, b) {\n if (a === b) {\n return true;\n }\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n} // ----------------------------------------------------------------------------\n\n\nfunction enumToString(e, value) {\n return Object.keys(e).find(function (key) {\n return e[key] === value;\n });\n}\n\nfunction getStateArrayMapFunc(item) {\n if (item.isA) {\n return item.getState();\n }\n\n return item;\n} // ----------------------------------------------------------------------------\n// setImmediate\n// ----------------------------------------------------------------------------\n\n\nfunction setImmediateVTK(fn) {\n setTimeout(fn, 0);\n} // ----------------------------------------------------------------------------\n// vtkObject: modified(), onModified(callback), delete()\n// ----------------------------------------------------------------------------\n\nfunction obj() {\n var publicAPI = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var model = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n // Ensure each instance as a unique ref of array\n safeArrays(model);\n var callbacks = [];\n\n if (!Number.isInteger(model.mtime)) {\n model.mtime = ++globalMTime;\n }\n\n model.classHierarchy = ['vtkObject'];\n\n function off(index) {\n callbacks[index] = null;\n }\n\n function on(index) {\n function unsubscribe() {\n off(index);\n }\n\n return Object.freeze({\n unsubscribe: unsubscribe\n });\n }\n\n publicAPI.isDeleted = function () {\n return !!model.deleted;\n };\n\n publicAPI.modified = function (otherMTime) {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n\n if (otherMTime && otherMTime < publicAPI.getMTime()) {\n return;\n }\n\n model.mtime = ++globalMTime;\n callbacks.forEach(function (callback) {\n return callback && callback(publicAPI);\n });\n };\n\n publicAPI.onModified = function (callback) {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return null;\n }\n\n var index = callbacks.length;\n callbacks.push(callback);\n return on(index);\n };\n\n publicAPI.getMTime = function () {\n return model.mtime;\n };\n\n publicAPI.isA = function (className) {\n var count = model.classHierarchy.length; // we go backwards as that is more likely for\n // early termination\n\n while (count--) {\n if (model.classHierarchy[count] === className) {\n return true;\n }\n }\n\n return false;\n };\n\n publicAPI.getClassName = function () {\n var depth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n return model.classHierarchy[model.classHierarchy.length - 1 - depth];\n };\n\n publicAPI.set = function () {\n var map = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var noWarning = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var noFunction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var ret = false;\n Object.keys(map).forEach(function (name) {\n var fn = noFunction ? null : publicAPI[\"set\".concat(capitalize(name))];\n\n if (fn && Array.isArray(map[name]) && fn.length > 1) {\n ret = fn.apply(void 0, _toConsumableArray(map[name])) || ret;\n } else if (fn) {\n ret = fn(map[name]) || ret;\n } else {\n // Set data on model directly\n if (['mtime'].indexOf(name) === -1 && !noWarning) {\n vtkWarningMacro(\"Warning: Set value to model directly \".concat(name, \", \").concat(map[name]));\n }\n\n model[name] = map[name];\n ret = true;\n }\n });\n return ret;\n };\n\n publicAPI.get = function () {\n for (var _len3 = arguments.length, list = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n list[_key3] = arguments[_key3];\n }\n\n if (!list.length) {\n return model;\n }\n\n var subset = {};\n list.forEach(function (name) {\n subset[name] = model[name];\n });\n return subset;\n };\n\n publicAPI.getReferenceByName = function (val) {\n return model[val];\n };\n\n publicAPI.delete = function () {\n Object.keys(model).forEach(function (field) {\n return delete model[field];\n });\n callbacks.forEach(function (el, index) {\n return off(index);\n }); // Flag the instance being deleted\n\n model.deleted = true;\n }; // Add serialization support\n\n\n publicAPI.getState = function () {\n var jsonArchive = _objectSpread(_objectSpread({}, model), {}, {\n vtkClass: publicAPI.getClassName()\n }); // Convert every vtkObject to its serializable form\n\n\n Object.keys(jsonArchive).forEach(function (keyName) {\n if (jsonArchive[keyName] === null || jsonArchive[keyName] === undefined || keyName[0] === '_' // protected members start with _\n ) {\n delete jsonArchive[keyName];\n } else if (jsonArchive[keyName].isA) {\n jsonArchive[keyName] = jsonArchive[keyName].getState();\n } else if (Array.isArray(jsonArchive[keyName])) {\n jsonArchive[keyName] = jsonArchive[keyName].map(getStateArrayMapFunc);\n }\n }); // Sort resulting object by key name\n\n var sortedObj = {};\n Object.keys(jsonArchive).sort().forEach(function (name) {\n sortedObj[name] = jsonArchive[name];\n }); // Remove mtime\n\n if (sortedObj.mtime) {\n delete sortedObj.mtime;\n }\n\n return sortedObj;\n }; // Add shallowCopy(otherInstance) support\n\n\n publicAPI.shallowCopy = function (other) {\n var debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (other.getClassName() !== publicAPI.getClassName()) {\n throw new Error(\"Cannot ShallowCopy \".concat(other.getClassName(), \" into \").concat(publicAPI.getClassName()));\n }\n\n var otherModel = other.get();\n var keyList = Object.keys(model).sort();\n var otherKeyList = Object.keys(otherModel).sort();\n otherKeyList.forEach(function (key) {\n var keyIdx = keyList.indexOf(key);\n\n if (keyIdx === -1) {\n if (debug) {\n vtkDebugMacro(\"add \".concat(key, \" in shallowCopy\"));\n }\n } else {\n keyList.splice(keyIdx, 1);\n }\n\n model[key] = otherModel[key];\n });\n\n if (keyList.length && debug) {\n vtkDebugMacro(\"Untouched keys: \".concat(keyList.join(', ')));\n }\n\n publicAPI.modified();\n }; // Allow usage as decorator\n\n\n return publicAPI;\n} // ----------------------------------------------------------------------------\n// getXXX: add getters\n// ----------------------------------------------------------------------------\n\nfunction get(publicAPI, model, fieldNames) {\n fieldNames.forEach(function (field) {\n if (_typeof(field) === 'object') {\n publicAPI[\"get\".concat(capitalize(field.name))] = function () {\n return model[field.name];\n };\n } else {\n publicAPI[\"get\".concat(capitalize(field))] = function () {\n return model[field];\n };\n }\n });\n} // ----------------------------------------------------------------------------\n// setXXX: add setters\n// ----------------------------------------------------------------------------\n\nvar objectSetterMap = {\n enum: function _enum(publicAPI, model, field) {\n return function (value) {\n if (typeof value === 'string') {\n if (field.enum[value] !== undefined) {\n if (model[field.name] !== field.enum[value]) {\n model[field.name] = field.enum[value];\n publicAPI.modified();\n return true;\n }\n\n return false;\n }\n\n vtkErrorMacro(\"Set Enum with invalid argument \".concat(field, \", \").concat(value));\n throw new RangeError('Set Enum with invalid string argument');\n }\n\n if (typeof value === 'number') {\n if (model[field.name] !== value) {\n if (Object.keys(field.enum).map(function (key) {\n return field.enum[key];\n }).indexOf(value) !== -1) {\n model[field.name] = value;\n publicAPI.modified();\n return true;\n }\n\n vtkErrorMacro(\"Set Enum outside numeric range \".concat(field, \", \").concat(value));\n throw new RangeError('Set Enum outside numeric range');\n }\n\n return false;\n }\n\n vtkErrorMacro(\"Set Enum with invalid argument (String/Number) \".concat(field, \", \").concat(value));\n throw new TypeError('Set Enum with invalid argument (String/Number)');\n };\n }\n};\n\nfunction findSetter(field) {\n if (_typeof(field) === 'object') {\n var fn = objectSetterMap[field.type];\n\n if (fn) {\n return function (publicAPI, model) {\n return fn(publicAPI, model, field);\n };\n }\n\n vtkErrorMacro(\"No setter for field \".concat(field));\n throw new TypeError('No setter for field');\n }\n\n return function getSetter(publicAPI, model) {\n return function setter(value) {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return false;\n }\n\n if (model[field] !== value) {\n model[field] = value;\n publicAPI.modified();\n return true;\n }\n\n return false;\n };\n };\n}\n\nfunction set(publicAPI, model, fields) {\n fields.forEach(function (field) {\n if (_typeof(field) === 'object') {\n publicAPI[\"set\".concat(capitalize(field.name))] = findSetter(field)(publicAPI, model);\n } else {\n publicAPI[\"set\".concat(capitalize(field))] = findSetter(field)(publicAPI, model);\n }\n });\n} // ----------------------------------------------------------------------------\n// set/get XXX: add both setters and getters\n// ----------------------------------------------------------------------------\n\nfunction setGet(publicAPI, model, fieldNames) {\n get(publicAPI, model, fieldNames);\n set(publicAPI, model, fieldNames);\n} // ----------------------------------------------------------------------------\n// getXXX: add getters for object of type array with copy to be safe\n// getXXXByReference: add getters for object of type array without copy\n// ----------------------------------------------------------------------------\n\nfunction getArray(publicAPI, model, fieldNames) {\n fieldNames.forEach(function (field) {\n publicAPI[\"get\".concat(capitalize(field))] = function () {\n return [].concat(model[field]);\n };\n\n publicAPI[\"get\".concat(capitalize(field), \"ByReference\")] = function () {\n return model[field];\n };\n });\n} // ----------------------------------------------------------------------------\n// setXXX: add setter for object of type array\n// if 'defaultVal' is supplied, shorter arrays will be padded to 'size' with 'defaultVal'\n// set...From: fast path to copy the content of an array to the current one without call to modified.\n// ----------------------------------------------------------------------------\n\nfunction setArray(publicAPI, model, fieldNames, size) {\n var defaultVal = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;\n fieldNames.forEach(function (field) {\n publicAPI[\"set\".concat(capitalize(field))] = function () {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return false;\n }\n\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n var array = args; // allow an array passed as a single arg.\n\n if (array.length === 1 && array[0].length) {\n /* eslint-disable prefer-destructuring */\n array = array[0];\n /* eslint-enable prefer-destructuring */\n }\n\n if (array.length !== size) {\n if (array.length < size && defaultVal !== undefined) {\n array = Array.from(array);\n\n while (array.length < size) {\n array.push(defaultVal);\n }\n } else {\n throw new RangeError(\"Invalid number of values for array setter (\".concat(field, \")\"));\n }\n }\n\n var changeDetected = model[field].some(function (item, index) {\n return item !== array[index];\n });\n\n if (changeDetected || model[field].length !== array.length) {\n model[field] = Array.from(array);\n publicAPI.modified();\n return true;\n }\n\n return false;\n };\n\n publicAPI[\"set\".concat(capitalize(field), \"From\")] = function (otherArray) {\n var target = model[field];\n otherArray.forEach(function (v, i) {\n target[i] = v;\n });\n };\n });\n} // ----------------------------------------------------------------------------\n// set/get XXX: add setter and getter for object of type array\n// ----------------------------------------------------------------------------\n\nfunction setGetArray(publicAPI, model, fieldNames, size) {\n var defaultVal = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;\n getArray(publicAPI, model, fieldNames);\n setArray(publicAPI, model, fieldNames, size, defaultVal);\n} // ----------------------------------------------------------------------------\n// vtkAlgorithm: setInputData(), setInputConnection(), getOutputData(), getOutputPort()\n// ----------------------------------------------------------------------------\n\nfunction algo(publicAPI, model, numberOfInputs, numberOfOutputs) {\n if (model.inputData) {\n model.inputData = model.inputData.map(_vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n } else {\n model.inputData = [];\n }\n\n if (model.inputConnection) {\n model.inputConnection = model.inputConnection.map(_vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n } else {\n model.inputConnection = [];\n }\n\n if (model.output) {\n model.output = model.output.map(_vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n } else {\n model.output = [];\n }\n\n if (model.inputArrayToProcess) {\n model.inputArrayToProcess = model.inputArrayToProcess.map(_vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n } else {\n model.inputArrayToProcess = [];\n } // Cache the argument for later manipulation\n\n\n model.numberOfInputs = numberOfInputs; // Methods\n\n function setInputData(dataset) {\n var port = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n\n if (port >= model.numberOfInputs) {\n vtkErrorMacro(\"algorithm \".concat(publicAPI.getClassName(), \" only has \").concat(model.numberOfInputs, \" input ports. To add more input ports, use addInputData()\"));\n return;\n }\n\n if (model.inputData[port] !== dataset || model.inputConnection[port]) {\n model.inputData[port] = dataset;\n model.inputConnection[port] = null;\n\n if (publicAPI.modified) {\n publicAPI.modified();\n }\n }\n }\n\n function getInputData() {\n var port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n if (model.inputConnection[port]) {\n model.inputData[port] = model.inputConnection[port]();\n }\n\n return model.inputData[port];\n }\n\n function setInputConnection(outputPort) {\n var port = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n\n if (port >= model.numberOfInputs) {\n var msg = \"algorithm \".concat(publicAPI.getClassName(), \" only has \");\n msg += \"\".concat(model.numberOfInputs);\n msg += ' input ports. To add more input ports, use addInputConnection()';\n vtkErrorMacro(msg);\n return;\n }\n\n model.inputData[port] = null;\n model.inputConnection[port] = outputPort;\n }\n\n function getInputConnection() {\n var port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n return model.inputConnection[port];\n }\n\n function addInputConnection(outputPort) {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n\n model.numberOfInputs++;\n setInputConnection(outputPort, model.numberOfInputs - 1);\n }\n\n function addInputData(dataset) {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n\n model.numberOfInputs++;\n setInputData(dataset, model.numberOfInputs - 1);\n }\n\n function getOutputData() {\n var port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return null;\n }\n\n if (publicAPI.shouldUpdate()) {\n publicAPI.update();\n }\n\n return model.output[port];\n }\n\n publicAPI.shouldUpdate = function () {\n var localMTime = publicAPI.getMTime();\n var count = numberOfOutputs;\n var minOutputMTime = Infinity;\n\n while (count--) {\n if (!model.output[count]) {\n return true;\n }\n\n var mt = model.output[count].getMTime();\n\n if (mt < localMTime) {\n return true;\n }\n\n if (mt < minOutputMTime) {\n minOutputMTime = mt;\n }\n }\n\n count = model.numberOfInputs;\n\n while (count--) {\n if (model.inputConnection[count] && model.inputConnection[count].filter.shouldUpdate()) {\n return true;\n }\n }\n\n count = model.numberOfInputs;\n\n while (count--) {\n if (publicAPI.getInputData(count) && publicAPI.getInputData(count).getMTime() > minOutputMTime) {\n return true;\n }\n }\n\n return false;\n };\n\n function getOutputPort() {\n var port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n var outputPortAccess = function outputPortAccess() {\n return getOutputData(port);\n }; // Add reference to filter\n\n\n outputPortAccess.filter = publicAPI;\n return outputPortAccess;\n } // Handle input if needed\n\n\n if (model.numberOfInputs) {\n // Reserve inputs\n var count = model.numberOfInputs;\n\n while (count--) {\n model.inputData.push(null);\n model.inputConnection.push(null);\n } // Expose public methods\n\n\n publicAPI.setInputData = setInputData;\n publicAPI.setInputConnection = setInputConnection;\n publicAPI.addInputData = addInputData;\n publicAPI.addInputConnection = addInputConnection;\n publicAPI.getInputData = getInputData;\n publicAPI.getInputConnection = getInputConnection;\n }\n\n if (numberOfOutputs) {\n publicAPI.getOutputData = getOutputData;\n publicAPI.getOutputPort = getOutputPort;\n }\n\n publicAPI.update = function () {\n var ins = [];\n\n if (model.numberOfInputs) {\n var _count = 0;\n\n while (_count < model.numberOfInputs) {\n ins[_count] = publicAPI.getInputData(_count);\n _count++;\n }\n }\n\n if (publicAPI.shouldUpdate() && publicAPI.requestData) {\n publicAPI.requestData(ins, model.output);\n }\n };\n\n publicAPI.getNumberOfInputPorts = function () {\n return model.numberOfInputs;\n };\n\n publicAPI.getNumberOfOutputPorts = function () {\n return numberOfOutputs || model.output.length;\n };\n\n publicAPI.getInputArrayToProcess = function (inputPort) {\n var arrayDesc = model.inputArrayToProcess[inputPort];\n var ds = model.inputData[inputPort];\n\n if (arrayDesc && ds) {\n return ds[\"get\".concat(arrayDesc.fieldAssociation)]().getArray(arrayDesc.arrayName);\n }\n\n return null;\n };\n\n publicAPI.setInputArrayToProcess = function (inputPort, arrayName, fieldAssociation) {\n var attributeType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'Scalars';\n\n while (model.inputArrayToProcess.length < inputPort) {\n model.inputArrayToProcess.push(null);\n }\n\n model.inputArrayToProcess[inputPort] = {\n arrayName: arrayName,\n fieldAssociation: fieldAssociation,\n attributeType: attributeType\n };\n };\n} // ----------------------------------------------------------------------------\n// Event handling: onXXX(callback), invokeXXX(args...)\n// ----------------------------------------------------------------------------\n\nvar EVENT_ABORT = Symbol('Event abort');\nfunction event(publicAPI, model, eventName) {\n var callbacks = [];\n var previousDelete = publicAPI.delete;\n var curCallbackID = 1;\n\n function off(callbackID) {\n for (var i = 0; i < callbacks.length; ++i) {\n var _callbacks$i = _slicedToArray(callbacks[i], 1),\n cbID = _callbacks$i[0];\n\n if (cbID === callbackID) {\n callbacks.splice(i, 1);\n return;\n }\n }\n }\n\n function on(callbackID) {\n function unsubscribe() {\n off(callbackID);\n }\n\n return Object.freeze({\n unsubscribe: unsubscribe\n });\n }\n\n function invoke() {\n var _arguments = arguments;\n\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n /* eslint-disable prefer-rest-params */\n // Go through a copy of the callbacks array in case new callbacks\n // get prepended within previous callbacks\n\n\n var currentCallbacks = callbacks.slice();\n\n var _loop = function _loop(index) {\n var _currentCallbacks$ind = _slicedToArray(currentCallbacks[index], 3),\n cb = _currentCallbacks$ind[1],\n priority = _currentCallbacks$ind[2];\n\n if (!cb) {\n return \"continue\"; // eslint-disable-line\n }\n\n if (priority < 0) {\n setTimeout(function () {\n return cb.apply(publicAPI, _arguments);\n }, 1 - priority);\n } else {\n // Abort only if the callback explicitly returns false\n var continueNext = cb.apply(publicAPI, _arguments);\n\n if (continueNext === EVENT_ABORT) {\n return \"break\";\n }\n }\n };\n\n for (var index = 0; index < currentCallbacks.length; ++index) {\n var _ret = _loop(index);\n\n if (_ret === \"continue\") continue;\n if (_ret === \"break\") break;\n }\n /* eslint-enable prefer-rest-params */\n\n }\n\n publicAPI[\"invoke\".concat(capitalize(eventName))] = invoke;\n\n publicAPI[\"on\".concat(capitalize(eventName))] = function (callback) {\n var priority = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.0;\n\n if (!callback.apply) {\n console.error(\"Invalid callback for event \".concat(eventName));\n return null;\n }\n\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return null;\n }\n\n var callbackID = curCallbackID++;\n callbacks.push([callbackID, callback, priority]);\n callbacks.sort(function (cb1, cb2) {\n return cb2[2] - cb1[2];\n });\n return on(callbackID);\n };\n\n publicAPI.delete = function () {\n previousDelete();\n callbacks.forEach(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 1),\n cbID = _ref3[0];\n\n return off(cbID);\n });\n };\n} // ----------------------------------------------------------------------------\n// newInstance\n// ----------------------------------------------------------------------------\n\nfunction newInstance(extend, className) {\n var constructor = function constructor() {\n var initialValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var model = {};\n var publicAPI = {};\n extend(publicAPI, model, initialValues);\n return Object.freeze(publicAPI);\n }; // Register constructor to factory\n\n\n if (className) {\n _vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"].register(className, constructor);\n }\n\n return constructor;\n} // ----------------------------------------------------------------------------\n// Chain function calls\n// ----------------------------------------------------------------------------\n\nfunction chain() {\n for (var _len5 = arguments.length, fn = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n fn[_key5] = arguments[_key5];\n }\n\n return function () {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n return fn.filter(function (i) {\n return !!i;\n }).map(function (i) {\n return i.apply(void 0, args);\n });\n };\n} // ----------------------------------------------------------------------------\n// Some utility methods for vtk objects\n// ----------------------------------------------------------------------------\n\nfunction isVtkObject(instance) {\n return instance && instance.isA && instance.isA('vtkObject');\n}\nfunction traverseInstanceTree(instance, extractFunction) {\n var accumulator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n var visitedInstances = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];\n\n if (isVtkObject(instance)) {\n if (visitedInstances.indexOf(instance) >= 0) {\n // avoid cycles\n return accumulator;\n }\n\n visitedInstances.push(instance);\n var result = extractFunction(instance);\n\n if (result !== undefined) {\n accumulator.push(result);\n } // Now go through this instance's model\n\n\n var model = instance.get();\n Object.keys(model).forEach(function (key) {\n var modelObj = model[key];\n\n if (Array.isArray(modelObj)) {\n modelObj.forEach(function (subObj) {\n traverseInstanceTree(subObj, extractFunction, accumulator, visitedInstances);\n });\n } else {\n traverseInstanceTree(modelObj, extractFunction, accumulator, visitedInstances);\n }\n });\n }\n\n return accumulator;\n} // ----------------------------------------------------------------------------\n// Returns a function, that, as long as it continues to be invoked, will not\n// be triggered. The function will be called after it stops being called for\n// N milliseconds. If `immediate` is passed, trigger the function on the\n// leading edge, instead of the trailing.\n\nfunction debounce(func, wait, immediate) {\n var _this = this;\n\n var timeout;\n return function () {\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n\n var context = _this;\n\n var later = function later() {\n timeout = null;\n\n if (!immediate) {\n func.apply(context, args);\n }\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) {\n func.apply(context, args);\n }\n };\n} // ----------------------------------------------------------------------------\n// Creates a throttled function that only invokes `func` at most once per\n// every `wait` milliseconds.\n\nfunction throttle(callback, delay) {\n var isThrottled = false;\n var argsToUse = null;\n\n function next() {\n isThrottled = false;\n\n if (argsToUse !== null) {\n wrapper.apply(void 0, _toConsumableArray(argsToUse)); // eslint-disable-line\n\n argsToUse = null;\n }\n }\n\n function wrapper() {\n for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n args[_key8] = arguments[_key8];\n }\n\n if (isThrottled) {\n argsToUse = args;\n return;\n }\n\n isThrottled = true;\n callback.apply(void 0, args);\n setTimeout(next, delay);\n }\n\n return wrapper;\n} // ----------------------------------------------------------------------------\n// keystore(publicAPI, model, initialKeystore)\n//\n// - initialKeystore: Initial keystore. This can be either a Map or an\n// object.\n//\n// Generated API\n// setKey(key, value) : mixed (returns value)\n// getKey(key) : mixed\n// getAllKeys() : [mixed]\n// deleteKey(key) : Boolean\n// ----------------------------------------------------------------------------\n\nfunction keystore(publicAPI, model) {\n var initialKeystore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n model.keystore = Object.assign(model.keystore || {}, initialKeystore);\n\n publicAPI.setKey = function (key, value) {\n model.keystore[key] = value;\n };\n\n publicAPI.getKey = function (key) {\n return model.keystore[key];\n };\n\n publicAPI.getAllKeys = function () {\n return Object.keys(model.keystore);\n };\n\n publicAPI.deleteKey = function (key) {\n return delete model.keystore[key];\n };\n\n publicAPI.clearKeystore = function () {\n return publicAPI.getAllKeys().forEach(function (key) {\n return delete model.keystore[key];\n });\n };\n} // ----------------------------------------------------------------------------\n// proxy(publicAPI, model, sectionName, propertyUI)\n//\n// - sectionName: Name of the section for UI\n// - propertyUI: List of props with their UI description\n//\n// Generated API\n// getProxyId() : String\n// listProxyProperties() : [string]\n// updateProxyProperty(name, prop)\n// getProxySection() => List of properties for UI generation\n// ----------------------------------------------------------------------------\n\nvar nextProxyId = 1;\nvar ROOT_GROUP_NAME = '__root__';\nfunction proxy(publicAPI, model) {\n // Proxies are keystores\n keystore(publicAPI, model);\n var parentDelete = publicAPI.delete; // getProxyId\n\n model.proxyId = \"\".concat(nextProxyId++); // ui handling\n\n model.ui = JSON.parse(JSON.stringify(model.ui || [])); // deep copy\n\n get(publicAPI, model, ['proxyId', 'proxyGroup', 'proxyName']);\n setGet(publicAPI, model, ['proxyManager']); // group properties\n\n var propertyMap = {};\n var groupChildrenNames = {};\n\n function registerProperties(descriptionList, currentGroupName) {\n if (!groupChildrenNames[currentGroupName]) {\n groupChildrenNames[currentGroupName] = [];\n }\n\n var childrenNames = groupChildrenNames[currentGroupName];\n\n for (var i = 0; i < descriptionList.length; i++) {\n childrenNames.push(descriptionList[i].name);\n propertyMap[descriptionList[i].name] = descriptionList[i];\n\n if (descriptionList[i].children && descriptionList[i].children.length) {\n registerProperties(descriptionList[i].children, descriptionList[i].name);\n }\n }\n }\n\n registerProperties(model.ui, ROOT_GROUP_NAME);\n\n publicAPI.updateUI = function (ui) {\n model.ui = JSON.parse(JSON.stringify(ui || [])); // deep copy\n\n Object.keys(propertyMap).forEach(function (k) {\n return delete propertyMap[k];\n });\n Object.keys(groupChildrenNames).forEach(function (k) {\n return delete groupChildrenNames[k];\n });\n registerProperties(model.ui, ROOT_GROUP_NAME);\n publicAPI.modified();\n };\n\n function listProxyProperties() {\n var gName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ROOT_GROUP_NAME;\n return groupChildrenNames[gName];\n }\n\n publicAPI.updateProxyProperty = function (propertyName, propUI) {\n var prop = propertyMap[propertyName];\n\n if (prop) {\n Object.assign(prop, propUI);\n } else {\n propertyMap[propertyName] = _objectSpread({}, propUI);\n }\n };\n\n publicAPI.activate = function () {\n if (model.proxyManager) {\n var setActiveMethod = \"setActive\".concat(capitalize(publicAPI.getProxyGroup().slice(0, -1)));\n\n if (model.proxyManager[setActiveMethod]) {\n model.proxyManager[setActiveMethod](publicAPI);\n }\n }\n }; // property link\n\n\n model.propertyLinkSubscribers = {};\n\n publicAPI.registerPropertyLinkForGC = function (otherLink, type) {\n if (!(type in model.propertyLinkSubscribers)) {\n model.propertyLinkSubscribers[type] = [];\n }\n\n model.propertyLinkSubscribers[type].push(otherLink);\n };\n\n publicAPI.gcPropertyLinks = function (type) {\n var subscribers = model.propertyLinkSubscribers[type] || [];\n\n while (subscribers.length) {\n subscribers.pop().unbind(publicAPI);\n }\n };\n\n model.propertyLinkMap = {};\n\n publicAPI.getPropertyLink = function (id) {\n var persistent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (model.propertyLinkMap[id]) {\n return model.propertyLinkMap[id];\n }\n\n var value = null;\n var links = [];\n var count = 0;\n var updateInProgress = false;\n\n function update(source) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (updateInProgress) {\n return null;\n }\n\n var needUpdate = [];\n var sourceLink = null;\n count = links.length;\n\n while (count--) {\n var link = links[count];\n\n if (link.instance === source) {\n sourceLink = link;\n } else {\n needUpdate.push(link);\n }\n }\n\n if (!sourceLink) {\n return null;\n }\n\n var newValue = sourceLink.instance[\"get\".concat(capitalize(sourceLink.propertyName))]();\n\n if (!shallowEquals(newValue, value) || force) {\n value = newValue;\n updateInProgress = true;\n\n while (needUpdate.length) {\n var linkToUpdate = needUpdate.pop();\n linkToUpdate.instance.set(_defineProperty({}, linkToUpdate.propertyName, value));\n }\n\n updateInProgress = false;\n }\n\n if (model.propertyLinkMap[id].persistent) {\n model.propertyLinkMap[id].value = newValue;\n }\n\n return newValue;\n }\n\n function unbind(instance, propertyName) {\n var indexToDelete = [];\n count = links.length;\n\n while (count--) {\n var link = links[count];\n\n if (link.instance === instance && (link.propertyName === propertyName || propertyName === undefined)) {\n link.subscription.unsubscribe();\n indexToDelete.push(count);\n }\n }\n\n while (indexToDelete.length) {\n links.splice(indexToDelete.pop(), 1);\n }\n }\n\n function bind(instance, propertyName) {\n var updateMe = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var subscription = instance.onModified(update);\n var other = links[0];\n links.push({\n instance: instance,\n propertyName: propertyName,\n subscription: subscription\n });\n\n if (updateMe) {\n if (model.propertyLinkMap[id].persistent && model.propertyLinkMap[id].value !== undefined) {\n instance.set(_defineProperty({}, propertyName, model.propertyLinkMap[id].value));\n } else if (other) {\n update(other.instance, true);\n }\n }\n\n return {\n unsubscribe: function unsubscribe() {\n return unbind(instance, propertyName);\n }\n };\n }\n\n function unsubscribe() {\n while (links.length) {\n links.pop().subscription.unsubscribe();\n }\n }\n\n var linkHandler = {\n bind: bind,\n unbind: unbind,\n unsubscribe: unsubscribe,\n persistent: persistent\n };\n model.propertyLinkMap[id] = linkHandler;\n return linkHandler;\n }; // extract values\n\n\n function getProperties() {\n var groupName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ROOT_GROUP_NAME;\n var values = [];\n var id = model.proxyId;\n var propertyNames = listProxyProperties(groupName) || [];\n\n for (var i = 0; i < propertyNames.length; i++) {\n var name = propertyNames[i];\n var method = publicAPI[\"get\".concat(capitalize(name))];\n var value = method ? method() : undefined;\n var prop = {\n id: id,\n name: name,\n value: value\n };\n var children = getProperties(name);\n\n if (children.length) {\n prop.children = children;\n }\n\n values.push(prop);\n }\n\n return values;\n }\n\n publicAPI.listPropertyNames = function () {\n return getProperties().map(function (p) {\n return p.name;\n });\n };\n\n publicAPI.getPropertyByName = function (name) {\n return getProperties().find(function (p) {\n return p.name === name;\n });\n };\n\n publicAPI.getPropertyDomainByName = function (name) {\n return (propertyMap[name] || {}).domain;\n }; // ui section\n\n\n publicAPI.getProxySection = function () {\n return {\n id: model.proxyId,\n name: model.proxyGroup,\n ui: model.ui,\n properties: getProperties()\n };\n }; // free resources\n\n\n publicAPI.delete = function () {\n var list = Object.keys(model.propertyLinkMap);\n var count = list.length;\n\n while (count--) {\n model.propertyLinkMap[list[count]].unsubscribe();\n }\n\n Object.keys(model.propertyLinkSubscribers).forEach(publicAPI.gcPropertyLinks);\n parentDelete();\n };\n\n function registerLinks() {\n // Allow dynamic registration of links at the application level\n if (model.links) {\n for (var i = 0; i < model.links.length; i++) {\n var _model$links$i = model.links[i],\n link = _model$links$i.link,\n property = _model$links$i.property,\n persistent = _model$links$i.persistent,\n updateOnBind = _model$links$i.updateOnBind,\n type = _model$links$i.type;\n\n if (type === 'application') {\n var sLink = model.proxyManager.getPropertyLink(link, persistent);\n publicAPI.registerPropertyLinkForGC(sLink, 'application');\n sLink.bind(publicAPI, property, updateOnBind);\n }\n }\n }\n }\n\n setImmediateVTK(registerLinks);\n} // ----------------------------------------------------------------------------\n// proxyPropertyMapping(publicAPI, model, map)\n//\n// map = {\n// opacity: { modelKey: 'property', property: 'opacity' },\n// }\n//\n// Generated API:\n// Elevate set/get methods from internal object stored in the model to current one\n// ----------------------------------------------------------------------------\n\nfunction proxyPropertyMapping(publicAPI, model, map) {\n var parentDelete = publicAPI.delete;\n var subscriptions = [];\n var propertyNames = Object.keys(map);\n var count = propertyNames.length;\n\n while (count--) {\n var propertyName = propertyNames[count];\n var _map$propertyName = map[propertyName],\n modelKey = _map$propertyName.modelKey,\n property = _map$propertyName.property,\n _map$propertyName$mod = _map$propertyName.modified,\n modified = _map$propertyName$mod === void 0 ? true : _map$propertyName$mod;\n var methodSrc = capitalize(property);\n var methodDst = capitalize(propertyName);\n publicAPI[\"get\".concat(methodDst)] = model[modelKey][\"get\".concat(methodSrc)];\n publicAPI[\"set\".concat(methodDst)] = model[modelKey][\"set\".concat(methodSrc)];\n\n if (modified) {\n subscriptions.push(model[modelKey].onModified(publicAPI.modified));\n }\n }\n\n publicAPI.delete = function () {\n while (subscriptions.length) {\n subscriptions.pop().unsubscribe();\n }\n\n parentDelete();\n };\n} // ----------------------------------------------------------------------------\n// proxyPropertyState(publicAPI, model, state, defaults)\n//\n// state = {\n// representation: {\n// 'Surface with edges': { property: { edgeVisibility: true, representation: 2 } },\n// Surface: { property: { edgeVisibility: false, representation: 2 } },\n// Wireframe: { property: { edgeVisibility: false, representation: 1 } },\n// Points: { property: { edgeVisibility: false, representation: 0 } },\n// },\n// }\n//\n// defaults = {\n// representation: 'Surface',\n// }\n//\n// Generated API\n// get / set Representation ( string ) => push state to various internal objects\n// ----------------------------------------------------------------------------\n\nfunction proxyPropertyState(publicAPI, model) {\n var state = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var defaults = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n model.this = publicAPI;\n\n function applyState(map) {\n var modelKeys = Object.keys(map);\n var count = modelKeys.length;\n\n while (count--) {\n var modelKey = modelKeys[count];\n model[modelKey].set(map[modelKey]);\n }\n }\n\n var modelKeys = Object.keys(defaults);\n var count = modelKeys.length;\n\n var _loop2 = function _loop2() {\n // Add default\n var key = modelKeys[count];\n model[key] = defaults[key]; // Add set method\n\n var mapping = state[key];\n\n publicAPI[\"set\".concat(capitalize(key))] = function (value) {\n if (value !== model[key]) {\n model[key] = value;\n var propValues = mapping[value];\n applyState(propValues);\n publicAPI.modified();\n }\n };\n };\n\n while (count--) {\n _loop2();\n } // Add getter\n\n\n if (modelKeys.length) {\n get(publicAPI, model, modelKeys);\n }\n} // ----------------------------------------------------------------------------\n// From : https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js\n//\n//\n// Copyright (c) 2015, Facebook, Inc.\n// All rights reserved.\n//\n// This source code is licensed under the BSD-style license found in the\n// LICENSE file in the root directory of this source tree. An additional grant\n// of patent rights can be found in the PATENTS file in the same directory.\n//\n//\n// Mouse wheel (and 2-finger trackpad) support on the web sucks. It is\n// complicated, thus this doc is long and (hopefully) detailed enough to answer\n// your questions.\n//\n// If you need to react to the mouse wheel in a predictable way, this code is\n// like your bestest friend.// hugs//\n//\n// As of today, there are 4 DOM event types you can listen to:\n//\n// 'wheel' -- Chrome(31+), FF(17+), IE(9+)\n// 'mousewheel' -- Chrome, IE(6+), Opera, Safari\n// 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother!\n// 'DOMMouseScroll' -- FF(0.9.7+) since 2003\n//\n// So what to do? The is the best:\n//\n// normalizeWheel.getEventType();\n//\n// In your event callback, use this code to get sane interpretation of the\n// deltas. This code will return an object with properties:\n//\n// spinX -- normalized spin speed (use for zoom) - x plane\n// spinY -- \" - y plane\n// pixelX -- normalized distance (to pixels) - x plane\n// pixelY -- \" - y plane\n//\n// Wheel values are provided by the browser assuming you are using the wheel to\n// scroll a web page by a number of lines or pixels (or pages). Values can vary\n// significantly on different platforms and browsers, forgetting that you can\n// scroll at different speeds. Some devices (like trackpads) emit more events\n// at smaller increments with fine granularity, and some emit massive jumps with\n// linear speed or acceleration.\n//\n// This code does its best to normalize the deltas for you:\n//\n// - spin is trying to normalize how far the wheel was spun (or trackpad\n// dragged). This is super useful for zoom support where you want to\n// throw away the chunky scroll steps on the PC and make those equal to\n// the slow and smooth tiny steps on the Mac. Key data: This code tries to\n// resolve a single slow step on a wheel to 1.\n//\n// - pixel is normalizing the desired scroll delta in pixel units. You'll\n// get the crazy differences between browsers, but at least it'll be in\n// pixels!\n//\n// - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This\n// should translate to positive value zooming IN, negative zooming OUT.\n// This matches the newer 'wheel' event.\n//\n// Why are there spinX, spinY (or pixels)?\n//\n// - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn\n// with a mouse. It results in side-scrolling in the browser by default.\n//\n// - spinY is what you expect -- it's the classic axis of a mouse wheel.\n//\n// - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and\n// probably is by browsers in conjunction with fancy 3D controllers .. but\n// you know.\n//\n// Implementation info:\n//\n// Examples of 'wheel' event if you scroll slowly (down) by one step with an\n// average mouse:\n//\n// OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120)\n// OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12)\n// OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A)\n// Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120)\n// Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120)\n//\n// On the trackpad:\n//\n// OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6)\n// OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A)\n//\n// On other/older browsers.. it's more complicated as there can be multiple and\n// also missing delta values.\n//\n// The 'wheel' event is more standard:\n//\n// http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents\n//\n// The basics is that it includes a unit, deltaMode (pixels, lines, pages), and\n// deltaX, deltaY and deltaZ. Some browsers provide other values to maintain\n// backward compatibility with older events. Those other values help us\n// better normalize spin speed. Example of what the browsers provide:\n//\n// | event.wheelDelta | event.detail\n// ------------------+------------------+--------------\n// Safari v5/OS X | -120 | 0\n// Safari v5/Win7 | -120 | 0\n// Chrome v17/OS X | -120 | 0\n// Chrome v17/Win7 | -120 | 0\n// IE9/Win7 | -120 | undefined\n// Firefox v4/OS X | undefined | 1\n// Firefox v4/Win7 | undefined | 3\n//\n// ----------------------------------------------------------------------------\n// Reasonable defaults\n\nvar PIXEL_STEP = 10;\nvar LINE_HEIGHT = 40;\nvar PAGE_HEIGHT = 800;\nfunction normalizeWheel(wheelEvent) {\n var sX = 0; // spinX\n\n var sY = 0; // spinY\n\n var pX = 0; // pixelX\n\n var pY = 0; // pixelY\n // Legacy\n\n if ('detail' in wheelEvent) {\n sY = wheelEvent.detail;\n }\n\n if ('wheelDelta' in wheelEvent) {\n sY = -wheelEvent.wheelDelta / 120;\n }\n\n if ('wheelDeltaY' in wheelEvent) {\n sY = -wheelEvent.wheelDeltaY / 120;\n }\n\n if ('wheelDeltaX' in wheelEvent) {\n sX = -wheelEvent.wheelDeltaX / 120;\n } // side scrolling on FF with DOMMouseScroll\n\n\n if ('axis' in wheelEvent && wheelEvent.axis === wheelEvent.HORIZONTAL_AXIS) {\n sX = sY;\n sY = 0;\n }\n\n pX = sX * PIXEL_STEP;\n pY = sY * PIXEL_STEP;\n\n if ('deltaY' in wheelEvent) {\n pY = wheelEvent.deltaY;\n }\n\n if ('deltaX' in wheelEvent) {\n pX = wheelEvent.deltaX;\n }\n\n if ((pX || pY) && wheelEvent.deltaMode) {\n if (wheelEvent.deltaMode === 1) {\n // delta in LINE units\n pX *= LINE_HEIGHT;\n pY *= LINE_HEIGHT;\n } else {\n // delta in PAGE units\n pX *= PAGE_HEIGHT;\n pY *= PAGE_HEIGHT;\n }\n } // Fall-back if spin cannot be determined\n\n\n if (pX && !sX) {\n sX = pX < 1 ? -1 : 1;\n }\n\n if (pY && !sY) {\n sY = pY < 1 ? -1 : 1;\n }\n\n return {\n spinX: sX,\n spinY: sY,\n pixelX: pX,\n pixelY: pY\n };\n} // ----------------------------------------------------------------------------\n// Default export\n// ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n algo: algo,\n capitalize: capitalize,\n chain: chain,\n debounce: debounce,\n enumToString: enumToString,\n event: event,\n EVENT_ABORT: EVENT_ABORT,\n formatBytesToProperUnit: formatBytesToProperUnit,\n formatNumbersWithThousandSeparator: formatNumbersWithThousandSeparator,\n get: get,\n getArray: getArray,\n getCurrentGlobalMTime: getCurrentGlobalMTime,\n getStateArrayMapFunc: getStateArrayMapFunc,\n isVtkObject: isVtkObject,\n keystore: keystore,\n newInstance: newInstance,\n newTypedArray: newTypedArray,\n newTypedArrayFrom: newTypedArrayFrom,\n normalizeWheel: normalizeWheel,\n obj: obj,\n proxy: proxy,\n proxyPropertyMapping: proxyPropertyMapping,\n proxyPropertyState: proxyPropertyState,\n safeArrays: safeArrays,\n set: set,\n setArray: setArray,\n setGet: setGet,\n setGetArray: setGetArray,\n setImmediate: setImmediateVTK,\n setLoggerFunction: setLoggerFunction,\n throttle: throttle,\n traverseInstanceTree: traverseInstanceTree,\n TYPED_ARRAYS: TYPED_ARRAYS,\n // deprecated todo remove on breaking API revision\n uncapitalize: uncapitalize,\n VOID: VOID,\n vtkDebugMacro: vtkDebugMacro,\n vtkErrorMacro: vtkErrorMacro,\n vtkInfoMacro: vtkInfoMacro,\n vtkLogMacro: vtkLogMacro,\n vtkOnceErrorMacro: vtkOnceErrorMacro,\n vtkWarningMacro: vtkWarningMacro\n});\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/macro.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/vtk.js": -/*!********************************************!*\ - !*** ./node_modules/vtk.js/Sources/vtk.js ***! - \********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return vtk; });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar factoryMapping = {\n vtkObject: function vtkObject() {\n return null;\n }\n};\nfunction vtk(obj) {\n if (obj === null || obj === undefined) {\n return obj;\n }\n\n if (obj.isA) {\n return obj;\n }\n\n if (!obj.vtkClass) {\n if (global.console && global.console.error) {\n global.console.error('Invalid VTK object');\n }\n\n return null;\n }\n\n var constructor = factoryMapping[obj.vtkClass];\n\n if (!constructor) {\n if (global.console && global.console.error) {\n global.console.error(\"No vtk class found for Object of type \".concat(obj.vtkClass));\n }\n\n return null;\n } // Shallow copy object\n\n\n var model = _objectSpread({}, obj); // Convert into vtkObject any nested key\n\n\n Object.keys(model).forEach(function (keyName) {\n if (model[keyName] && _typeof(model[keyName]) === 'object' && model[keyName].vtkClass) {\n model[keyName] = vtk(model[keyName]);\n }\n }); // Return the root\n\n var newInst = constructor(model);\n\n if (newInst && newInst.modified) {\n newInst.modified();\n }\n\n return newInst;\n}\n\nfunction register(vtkClassName, constructor) {\n factoryMapping[vtkClassName] = constructor;\n} // Nest register method under the vtk function\n\n\nvtk.register = register;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/vtk.js?"); - -/***/ }), - -/***/ "./node_modules/webpack/buildin/amd-define.js": -/*!***************************************!*\ - !*** (webpack)/buildin/amd-define.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = function() {\n\tthrow new Error(\"define cannot be used indirect\");\n};\n\n\n//# sourceURL=webpack://diglettk/(webpack)/buildin/amd-define.js?"); - -/***/ }), - -/***/ "./node_modules/webpack/buildin/amd-options.js": -/*!****************************************!*\ - !*** (webpack)/buildin/amd-options.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n\n/* WEBPACK VAR INJECTION */}.call(this, {}))\n\n//# sourceURL=webpack://diglettk/(webpack)/buildin/amd-options.js?"); - -/***/ }), - -/***/ "./node_modules/webpack/buildin/global.js": -/*!***********************************!*\ - !*** (webpack)/buildin/global.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n//# sourceURL=webpack://diglettk/(webpack)/buildin/global.js?"); - -/***/ }), - -/***/ "./node_modules/webpack/buildin/module.js": -/*!***********************************!*\ - !*** (webpack)/buildin/module.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n\n\n//# sourceURL=webpack://diglettk/(webpack)/buildin/module.js?"); - -/***/ }), - -/***/ "./node_modules/webworker-promise/lib/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/webworker-promise/lib/index.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TinyEmitter = __webpack_require__(/*! ./tiny-emitter */ \"./node_modules/webworker-promise/lib/tiny-emitter.js\");\n\nvar MESSAGE_RESULT = 0;\nvar MESSAGE_EVENT = 1;\n\nvar RESULT_ERROR = 0;\nvar RESULT_SUCCESS = 1;\n\nvar Worker = function (_TinyEmitter) {\n _inherits(Worker, _TinyEmitter);\n\n /**\n *\n * @param worker {Worker}\n */\n function Worker(worker) {\n _classCallCheck(this, Worker);\n\n var _this = _possibleConstructorReturn(this, (Worker.__proto__ || Object.getPrototypeOf(Worker)).call(this));\n\n _this._messageId = 1;\n _this._messages = new Map();\n\n _this._worker = worker;\n _this._worker.onmessage = _this._onMessage.bind(_this);\n _this._id = Math.ceil(Math.random() * 10000000);\n return _this;\n }\n\n _createClass(Worker, [{\n key: 'terminate',\n value: function terminate() {\n this._worker.terminate();\n }\n\n /**\n * return true if there is no unresolved jobs\n * @returns {boolean}\n */\n\n }, {\n key: 'isFree',\n value: function isFree() {\n return this._messages.size === 0;\n }\n }, {\n key: 'jobsLength',\n value: function jobsLength() {\n return this._messages.size;\n }\n\n /**\n * @param operationName string\n * @param data any\n * @param transferable array\n * @param onEvent function\n * @returns {Promise}\n */\n\n }, {\n key: 'exec',\n value: function exec(operationName) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n var _this2 = this;\n\n var transferable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n var onEvent = arguments[3];\n\n return new Promise(function (res, rej) {\n var messageId = _this2._messageId++;\n _this2._messages.set(messageId, [res, rej, onEvent]);\n _this2._worker.postMessage([messageId, data, operationName], transferable || []);\n });\n }\n\n /**\n *\n * @param data any\n * @param transferable array\n * @param onEvent function\n * @returns {Promise}\n */\n\n }, {\n key: 'postMessage',\n value: function postMessage() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n var _this3 = this;\n\n var transferable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var onEvent = arguments[2];\n\n return new Promise(function (res, rej) {\n var messageId = _this3._messageId++;\n _this3._messages.set(messageId, [res, rej, onEvent]);\n _this3._worker.postMessage([messageId, data], transferable || []);\n });\n }\n }, {\n key: 'emit',\n value: function emit(eventName) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n this._worker.postMessage({ eventName: eventName, args: args });\n }\n }, {\n key: '_onMessage',\n value: function _onMessage(e) {\n //if we got usual event, just emit it locally\n if (!Array.isArray(e.data) && e.data.eventName) {\n var _get2;\n\n return (_get2 = _get(Worker.prototype.__proto__ || Object.getPrototypeOf(Worker.prototype), 'emit', this)).call.apply(_get2, [this, e.data.eventName].concat(_toConsumableArray(e.data.args)));\n }\n\n var _e$data = _toArray(e.data),\n type = _e$data[0],\n args = _e$data.slice(1);\n\n if (type === MESSAGE_EVENT) this._onEvent.apply(this, _toConsumableArray(args));else if (type === MESSAGE_RESULT) this._onResult.apply(this, _toConsumableArray(args));else throw new Error('Wrong message type \\'' + type + '\\'');\n }\n }, {\n key: '_onResult',\n value: function _onResult(messageId, success, payload) {\n var _messages$get = this._messages.get(messageId),\n _messages$get2 = _slicedToArray(_messages$get, 2),\n res = _messages$get2[0],\n rej = _messages$get2[1];\n\n this._messages.delete(messageId);\n\n return success === RESULT_SUCCESS ? res(payload) : rej(payload);\n }\n }, {\n key: '_onEvent',\n value: function _onEvent(messageId, eventName, data) {\n var _messages$get3 = this._messages.get(messageId),\n _messages$get4 = _slicedToArray(_messages$get3, 3),\n onEvent = _messages$get4[2];\n\n if (onEvent) {\n onEvent(eventName, data);\n }\n }\n }]);\n\n return Worker;\n}(TinyEmitter);\n\nmodule.exports = Worker;\n\n//# sourceURL=webpack://diglettk/./node_modules/webworker-promise/lib/index.js?"); - -/***/ }), - -/***/ "./node_modules/webworker-promise/lib/tiny-emitter.js": -/*!************************************************************!*\ - !*** ./node_modules/webworker-promise/lib/tiny-emitter.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar TinyEmitter = function () {\n function TinyEmitter() {\n _classCallCheck(this, TinyEmitter);\n\n Object.defineProperty(this, '__listeners', {\n value: {},\n enumerable: false,\n writable: false\n });\n }\n\n _createClass(TinyEmitter, [{\n key: 'emit',\n value: function emit(eventName) {\n if (!this.__listeners[eventName]) return this;\n\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = this.__listeners[eventName][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var handler = _step.value;\n\n handler.apply(undefined, args);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return this;\n }\n }, {\n key: 'once',\n value: function once(eventName, handler) {\n var _this = this;\n\n var once = function once() {\n _this.off(eventName, once);\n handler.apply(undefined, arguments);\n };\n\n return this.on(eventName, once);\n }\n }, {\n key: 'on',\n value: function on(eventName, handler) {\n if (!this.__listeners[eventName]) this.__listeners[eventName] = [];\n\n this.__listeners[eventName].push(handler);\n\n return this;\n }\n }, {\n key: 'off',\n value: function off(eventName, handler) {\n if (handler) this.__listeners[eventName] = this.__listeners[eventName].filter(function (h) {\n return h !== handler;\n });else this.__listeners[eventName] = [];\n\n return this;\n }\n }]);\n\n return TinyEmitter;\n}();\n\nmodule.exports = TinyEmitter;\n\n//# sourceURL=webpack://diglettk/./node_modules/webworker-promise/lib/tiny-emitter.js?"); - -/***/ }), - -/***/ "./node_modules/worker-loader/dist/runtime/inline.js": -/*!***********************************************************!*\ - !*** ./node_modules/worker-loader/dist/runtime/inline.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\n/* eslint-env browser */\n\n/* eslint-disable no-undef, no-use-before-define, new-cap */\nmodule.exports = function (content, workerConstructor, workerOptions, url) {\n var globalScope = self || window;\n\n try {\n try {\n var blob;\n\n try {\n // New API\n blob = new globalScope.Blob([content]);\n } catch (e) {\n // BlobBuilder = Deprecated, but widely implemented\n var BlobBuilder = globalScope.BlobBuilder || globalScope.WebKitBlobBuilder || globalScope.MozBlobBuilder || globalScope.MSBlobBuilder;\n blob = new BlobBuilder();\n blob.append(content);\n blob = blob.getBlob();\n }\n\n var URL = globalScope.URL || globalScope.webkitURL;\n var objectURL = URL.createObjectURL(blob);\n var worker = new globalScope[workerConstructor](objectURL, workerOptions);\n URL.revokeObjectURL(objectURL);\n return worker;\n } catch (e) {\n return new globalScope[workerConstructor](\"data:application/javascript,\".concat(encodeURIComponent(content)), workerOptions);\n }\n } catch (e) {\n if (!url) {\n throw Error(\"Inline worker is not supported\");\n }\n\n return new globalScope[workerConstructor](url, workerOptions);\n }\n};\n\n//# sourceURL=webpack://diglettk/./node_modules/worker-loader/dist/runtime/inline.js?"); - -/***/ }), - -/***/ "./src/index.js": -/*!**********************!*\ - !*** ./src/index.js ***! - \**********************/ -/*! exports provided: MPRManager, VRView, loadDemoSerieWithLarvitar, buildVtkVolume */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! regenerator-runtime/runtime */ \"./node_modules/regenerator-runtime/runtime.js\");\n/* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var vtk_js_Sources_Rendering_Profiles_Volume__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Profiles/Volume */ \"./node_modules/vtk.js/Sources/Rendering/Profiles/Volume.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Profiles_Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Profiles/Geometry */ \"./node_modules/vtk.js/Sources/Rendering/Profiles/Geometry.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Profiles_Glyph__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Profiles/Glyph */ \"./node_modules/vtk.js/Sources/Rendering/Profiles/Glyph.js\");\n/* harmony import */ var _vrView__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vrView */ \"./src/vrView.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"VRView\", function() { return _vrView__WEBPACK_IMPORTED_MODULE_4__[\"VRView\"]; });\n\n/* harmony import */ var _mprManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mprManager */ \"./src/mprManager.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MPRManager\", function() { return _mprManager__WEBPACK_IMPORTED_MODULE_5__[\"MPRManager\"]; });\n\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"loadDemoSerieWithLarvitar\", function() { return _utils__WEBPACK_IMPORTED_MODULE_6__[\"loadDemoSerieWithLarvitar\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"buildVtkVolume\", function() { return _utils__WEBPACK_IMPORTED_MODULE_6__[\"buildVtkVolume\"]; });\n\n// NOTE: this is necessary as workaround to this issue:\n// https://github.com/Kitware/vtk-js/issues/1882\n\n\n// Load the rendering pieces we want to use (for both WebGL and WebGPU)\n// Without these, nothing will appear into the scene\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://diglettk/./src/index.js?"); - -/***/ }), - -/***/ "./src/mprManager.js": -/*!***************************!*\ - !*** ./src/mprManager.js ***! - \***************************/ -/*! exports provided: MPRManager */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MPRManager\", function() { return MPRManager; });\n/* harmony import */ var _vtk_vtkInteractorStyleMPRWindowLevel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vtk/vtkInteractorStyleMPRWindowLevel */ \"./src/vtk/vtkInteractorStyleMPRWindowLevel.js\");\n/* harmony import */ var _vtk_vtkInteractorStyleMPRCrosshairs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vtk/vtkInteractorStyleMPRCrosshairs */ \"./src/vtk/vtkInteractorStyleMPRCrosshairs.js\");\n/* harmony import */ var _vtk_vtkInteractorStyleMPRPanZoom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vtk/vtkInteractorStyleMPRPanZoom */ \"./src/vtk/vtkInteractorStyleMPRPanZoom.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Coordinate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Coordinate */ \"./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/MatrixBuilder */ \"./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n/* harmony import */ var _mprView__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mprView */ \"./src/mprView.js\");\n// Use modified MPRSlice interactor\n\n\n\n\n\n\n\n\n\n\n/**\n * Internal state of a single view\n * @typedef {Object} State\n * @property {Number[]} slicePlaneNormal - The slice plane normal as [x,y,z]\n * @property {Number[]} sliceViewUp - The up vector as [x,y,z]\n * @property {Number} slicePlaneXRotation - The x axis rotation in deg\n * @property {Number} slicePlaneYRotation - The y axis rotation in deg\n * @property {Number} viewRotation - The view rotation in deg\n * @property {Number} sliceThickness - The MIP slice thickness in px\n * @property {String} blendMode - The active blending mode (\"MIP\", \"MinIP\", \"Average\")\n * @property {Object} window - wwwl\n * @property {Number} window.ww - Window width\n * @property {Number} window.wl - Window level\n */\n\n/** A manager for MPR views */\nclass MPRManager {\n /**\n * Create a manager.\n * @param {Object} elements - The 3 target HTML elements {key1:{}, key2:{}, key3:{}}.\n * @param {HTMLElement} elements.element - The target HTML elements.\n * @param {String} elements.key - The target HTML elements.\n */\n constructor(elements) {\n this.VERBOSE = false; // TODO setter\n this.syncWindowLevels = true; // TODO setter\n this._activeTool = null;\n\n // TODO input sanity check\n\n this.elements = elements;\n\n this.volume = null;\n\n this.sliceIntersection = [0, 0, 0];\n\n this.mprViews = {};\n\n this.initMPR();\n }\n\n /**\n * wwwl\n * @type {Array}\n */\n set wwwl([ww, wl]) {\n const lower = wl - ww / 2.0;\n const upper = wl + ww / 2.0;\n\n this.volume\n .getProperty()\n .getRGBTransferFunction(0)\n .setMappingRange(lower, upper);\n\n Object.keys(this.elements).forEach((key, i) => {\n this.mprViews[key].wwwl = [ww, wl];\n });\n }\n\n /**\n * Initialize the three MPR views\n * @private\n */\n initMPR() {\n Object.keys(this.elements).forEach((key, i) => {\n try {\n this.mprViews[key] = new _mprView__WEBPACK_IMPORTED_MODULE_6__[\"MPRView\"](key, i, this.elements[key].element);\n } catch (err) {\n console.error(\"Error creating MPRView\", key);\n console.error(err);\n }\n });\n\n if (this.VERBOSE) console.log(\"initialized\");\n }\n\n /**\n * Get initial State object\n * @returns {State} The initial internal state\n */\n getInitialState() {\n // cycle on keys, and reduce extracting only useful properties\n // NOTE: initialize reduce with cloned object!\n let viewsState = Object.keys(this.mprViews).reduce((result, key) => {\n let {\n slicePlaneNormal,\n sliceViewUp,\n slicePlaneXRotation,\n slicePlaneYRotation,\n viewRotation,\n _sliceThickness,\n _blendMode,\n window\n } = result[key];\n result[key] = {\n slicePlaneNormal,\n sliceViewUp,\n slicePlaneXRotation,\n slicePlaneYRotation,\n viewRotation,\n sliceThickness: _sliceThickness,\n blendMode: _blendMode,\n window\n };\n return result;\n }, Object.assign({}, this.mprViews));\n\n return {\n // interactorCenters: { top: [0, 0], left: [0, 0], front: [0, 0] },\n interactorCenters: Object.keys(this.elements).reduce(\n (res, key) => ({ ...res, [key]: [0, 0] }),\n {}\n ),\n sliceIntersection: [...this.sliceIntersection], // clone\n views: viewsState\n };\n }\n\n /**\n * Set the image to render\n * @param {State} state - The current manager state\n * @param {Array} image - The pixel data from DICOM serie\n */\n setImage(state, image) {\n let actor = Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"createVolumeActor\"])(image);\n this.volume = actor;\n this.sliceIntersection = Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"getVolumeCenter\"])(actor.getMapper());\n // update external state\n state.sliceIntersection = [...this.sliceIntersection];\n\n Object.keys(this.elements).forEach(key => {\n this.mprViews[key].initView(\n actor,\n state,\n // on scroll callback (it's fired but too early)\n () => {\n this.onScrolled.call(this, state);\n },\n // on initialized callback (fire when all is set)\n () => {\n this.onScrolled.call(this, state);\n }\n );\n });\n\n if (this._activeTool) {\n this.setTool(this._activeTool, state);\n }\n }\n\n /**\n * Set the active tool\n * @param {String} toolName - \"level\" or \"crosshair\"\n * @param {State} state - The current manager state\n */\n setTool(toolName, state) {\n switch (toolName) {\n case \"level\":\n this.setLevelTool(state);\n break;\n case \"crosshair\":\n this.setCrosshairTool(state);\n break;\n case \"zoom\":\n this.setZoomTool(state);\n break;\n case \"pan\":\n this.setPanTool(state);\n break;\n }\n }\n\n /**\n * Set \"pan\" as active tool\n * @private\n * @param {State} state - The current manager state\n */\n setPanTool(state) {\n Object.entries(state.views).forEach(([key]) => {\n const istyle = _vtk_vtkInteractorStyleMPRPanZoom__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n leftButtonTool: \"pan\"\n });\n istyle.setOnScroll(() => {\n this.onScrolled(state);\n });\n // update interactor center\n istyle.setOnPanChanged(() => {\n this.updateInteractorCenters(state);\n });\n this.mprViews[key].setInteractor(istyle);\n });\n this._activeTool = \"pan\";\n }\n\n /**\n * Set \"zoom\" as active tool\n * @private\n * @param {State} state - The current manager state\n */\n setZoomTool(state) {\n Object.entries(state.views).forEach(([key]) => {\n const istyle = _vtk_vtkInteractorStyleMPRPanZoom__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n leftButtonTool: \"zoom\"\n });\n istyle.setOnScroll(() => {\n this.onScrolled(state);\n });\n // update interactor center\n istyle.setOnZoomChanged(() => {\n this.updateInteractorCenters(state);\n });\n this.mprViews[key].setInteractor(istyle);\n });\n this._activeTool = \"zoom\";\n }\n\n /**\n * Set \"level\" as active tool\n * @private\n * @param {State} state - The current manager state\n */\n setLevelTool(state) {\n Object.entries(state.views).forEach(([key]) => {\n const istyle = _vtk_vtkInteractorStyleMPRWindowLevel__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance();\n istyle.setOnScroll(() => {\n this.onScrolled(state);\n });\n istyle.setOnLevelsChanged(levels => {\n this.updateLevels({ ...levels, srcKey: key }, state);\n });\n this.mprViews[key].setInteractor(istyle);\n });\n this._activeTool = \"level\";\n }\n\n /**\n * Set \"crosshair\" as active tool\n * @private\n * @param {State} state - The current manager state\n */\n setCrosshairTool(state) {\n let self = this;\n Object.entries(state.views).forEach(([key]) => {\n const istyle = _vtk_vtkInteractorStyleMPRCrosshairs__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n istyle.setOnScroll(() => {\n self.onScrolled(state);\n });\n istyle.setOnClickCallback(({ worldPos }) => {\n self.onCrosshairPointSelected({ worldPos, srcKey: key }, state);\n });\n this.mprViews[key].setInteractor(istyle);\n });\n this._activeTool = \"crosshair\";\n }\n\n /**\n * Update slice positions on user interaction (for crosshair tool)\n * @private\n * @param {Object} {}\n */\n onCrosshairPointSelected({ srcKey, worldPos }, externalState) {\n Object.keys(this.elements).forEach(key => {\n if (key !== srcKey) {\n // We are basically doing the same as getSlice but with the world coordinate\n // that we want to jump to instead of the camera focal point.\n // I would rather do the camera adjustment directly but I keep\n // doing it wrong and so this is good enough for now.\n // ~ swerik\n const renderWindow = this.mprViews[\n key\n ]._genericRenderWindow.getRenderWindow();\n\n const istyle = renderWindow.getInteractor().getInteractorStyle();\n const sliceNormal = istyle.getSliceNormal();\n const transform = vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n .buildFromDegree()\n .identity()\n .rotateFromDirections(sliceNormal, [1, 0, 0]);\n\n const mutatedWorldPos = worldPos.slice();\n transform.apply(mutatedWorldPos);\n const slice = mutatedWorldPos[0];\n\n istyle.setSlice(slice);\n\n renderWindow.render();\n }\n\n this.updateInteractorCenters(externalState);\n });\n\n // update both internal & external state\n this.sliceIntersection = [...worldPos];\n externalState.sliceIntersection = [...worldPos];\n }\n\n /**\n * Update wwwl on user interaction (for level tool)\n * @private\n * @param {Object} {}\n * @param {State} state - The current manager state\n */\n updateLevels({ windowCenter, windowWidth, srcKey }, state) {\n state.views[srcKey].window.center = windowCenter;\n state.views[srcKey].window.width = windowWidth;\n\n if (this.syncWindowLevels) {\n Object.keys(this.elements)\n .filter(key => key !== srcKey)\n .forEach(k => {\n this.mprViews[k].wwwl = [windowWidth, windowCenter];\n });\n }\n }\n\n /**\n * Update slice position when scrolling\n * @private\n */\n onScrolled(state) {\n let planes = [];\n\n Object.keys(this.elements).forEach(key => {\n const camera = this.mprViews[key].camera;\n planes.push({\n position: camera.getFocalPoint(),\n normal: camera.getDirectionOfProjection()\n // this[viewportIndex].slicePlaneNormal\n });\n });\n\n const newPoint = Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"getPlaneIntersection\"])(...planes);\n\n if (\n !Number.isNaN(newPoint) &&\n !newPoint.some(coord => Number.isNaN(coord))\n ) {\n this.sliceIntersection = [...newPoint];\n state.sliceIntersection = [...newPoint];\n if (this.VERBOSE) console.log(\"updating slice intersection\", newPoint);\n }\n\n this.updateInteractorCenters(state);\n\n return newPoint;\n }\n\n /**\n * Update slice planes on rotation\n * @param {String} key - One of the initially provided keys (identify a view)\n * @param {String} axis - 'x' or 'y' axis\n * @param {Number} angle - The amount of rotation [deg], absolute\n * @param {State} state - The current manager state\n */\n onRotate(key, axis, angle, state) {\n // Match the source axis to the associated plane\n switch (key) {\n case \"top\":\n if (axis === \"x\") state.views.front.slicePlaneYRotation = angle;\n else if (axis === \"y\") state.views.left.slicePlaneYRotation = angle;\n break;\n case \"left\":\n if (axis === \"x\") state.views.top.slicePlaneXRotation = angle;\n else if (axis === \"y\") state.views.front.slicePlaneXRotation = angle;\n break;\n case \"front\":\n if (axis === \"x\") state.views.top.slicePlaneYRotation = angle;\n else if (axis === \"y\") state.views.left.slicePlaneXRotation = angle;\n break;\n }\n\n // dv: this was a watcher in mpr component, update all except myself ?\n\n Object.keys(this.elements)\n .filter(c => c !== key)\n .forEach(k => {\n this.mprViews[k].updateSlicePlane(state.views[k]);\n });\n\n if (this.VERBOSE) console.log(\"afterOnRotate\", state);\n }\n\n /**\n * Update slice planes on rotation\n * @param {String} key - One of the initially provided keys (identify a view)\n * @param {String} axis - 'x' or 'y' axis\n * @param {Number} thickness - The amount of thickness [px], absolute\n * @param {State} state - The current manager state\n */\n onThickness(key, axis, thickness, state) {\n const shouldBeMIP = thickness > 1;\n let target_view;\n switch (key) {\n case \"top\":\n if (axis === \"x\") target_view = \"front\";\n else if (axis === \"y\") target_view = \"left\";\n break;\n case \"left\":\n if (axis === \"x\") target_view = \"top\";\n else if (axis === \"y\") target_view = \"front\";\n break;\n case \"front\":\n if (axis === \"x\") target_view = \"top\";\n else if (axis === \"y\") target_view = \"left\";\n break;\n }\n\n // if thickness > 1 switch to MIP\n if (shouldBeMIP && this.mprViews[target_view].blendMode === \"none\") {\n this.mprViews[target_view].blendMode = \"MIP\";\n state.mprViews[target_view].blendMode = \"MIP\";\n }\n\n // update both internal and external state\n this.mprViews[target_view].sliceThickness = thickness;\n state.views[target_view].sliceThickness = thickness;\n }\n\n /**\n * Update interactor centers coordinates on canvas\n * @private\n * @param {State} state - The current manager state\n */\n updateInteractorCenters(state) {\n Object.keys(this.elements).forEach(key => {\n // compute interactor centers display position\n const renderer = this.mprViews[key]._genericRenderWindow.getRenderer();\n const wPos = vtk_js_Sources_Rendering_Core_Coordinate__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n wPos.setCoordinateSystemToWorld();\n wPos.setValue(...this.sliceIntersection);\n const displayPosition = wPos.getComputedDisplayValue(renderer);\n if (this.VERBOSE) console.log(\"interactor center\", key, displayPosition);\n // set new interactor center on canvas into external state\n state.interactorCenters[key] = displayPosition;\n });\n }\n\n /**\n * Force views resize\n * @param {String} key - If provided, resize just its view, otherwise all views\n */\n resize(state, key) {\n if (key) {\n this.mprViews[key].onResize();\n } else {\n Object.values(this.mprViews).forEach(view => {\n view.onResize();\n });\n }\n this.updateInteractorCenters(state);\n }\n\n /**\n * Destroy webgl content and release listeners\n */\n destroy() {\n Object.keys(this.elements).forEach(k => {\n this.mprViews[k].destroy();\n });\n }\n}\n\n\n//# sourceURL=webpack://diglettk/./src/mprManager.js?"); - -/***/ }), - -/***/ "./src/mprView.js": -/*!************************!*\ - !*** ./src/mprView.js ***! - \************************/ -/*! exports provided: MPRView */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MPRView\", function() { return MPRView; });\n/* harmony import */ var vtk_js_Sources_Rendering_Misc_GenericRenderWindow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Misc/GenericRenderWindow */ \"./node_modules/vtk.js/Sources/Rendering/Misc/GenericRenderWindow/index.js\");\n/* harmony import */ var _vtk_vtkInteractorMPRSlice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vtk/vtkInteractorMPRSlice */ \"./src/vtk/vtkInteractorMPRSlice.js\");\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n\n\n\n\n\n\n\n/**\n * MPRView class\n * This is not intended to be used directly by user\n * Use MPRManager instead: it will create three instances of MPRView\n * @private\n *\n */\n\n// TODO move to constants (calculate from image directions?)\nconst PLANE_NORMALS = [[0, 0, 1], [-1, 0, 0], [0, 1, 0]];\nconst VIEW_UPS = [[0, -1, 0], [0, 0, 1], [0, 0, 1]];\nclass MPRView {\n constructor(key, i, element) {\n this.VERBOSE = false;\n this._key = key;\n this._element = element;\n this._volume = null;\n this._renderer = null;\n this._parallel = true; // TODO setter\n // this.onCreated = null; // TODO\n // this.onDestroyed = null; // TODO\n\n // init global data\n this.slicePlaneNormal = PLANE_NORMALS[i];\n this.sliceViewUp = VIEW_UPS[i];\n this.slicePlaneXRotation = 0;\n this.slicePlaneYRotation = 0;\n this.viewRotation = 0;\n this._sliceThickness = 0.1;\n this._blendMode = \"MIP\";\n this.window = {\n width: 0,\n center: 0\n };\n\n // cache the view vectors so we can apply the rotations without modifying the original value\n this._cachedSlicePlane = [...this.slicePlaneNormal];\n this._cachedSliceViewUp = [...this.sliceViewUp];\n\n this._genericRenderWindow = vtk_js_Sources_Rendering_Misc_GenericRenderWindow__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance({\n background: [0, 0, 0]\n });\n\n this._genericRenderWindow.setContainer(element);\n\n this._renderWindow = this._genericRenderWindow.getRenderWindow();\n this._renderer = this._genericRenderWindow.getRenderer();\n\n if (this._parallel) {\n this._renderer.getActiveCamera().setParallelProjection(true);\n }\n\n // update view node tree so that vtkOpenGLHardwareSelector can access the vtkOpenGLRenderer instance.\n const oglrw = this._genericRenderWindow.getOpenGLRenderWindow();\n oglrw.buildPass(true);\n\n /*\n // Use for maintaining clipping range for MIP (TODO)\n const interactor = this._renderWindow.getInteractor();\n //const clippingRange = renderer.getActiveCamera().getClippingRange();\n\n interactor.onAnimation(() => {\n renderer.getActiveCamera().setClippingRange(...r);\n });\n */\n\n // force the initial draw to set the canvas to the parent bounds.\n this.onResize();\n }\n\n /**\n * blendMode - \"MIP\", \"MinIP\", \"Average\"\n * @type {String}\n */\n set blendMode(blendMode) {\n this._blendMode = blendMode;\n this.updateBlendMode(this._sliceThickness, this._blendMode);\n }\n\n /**\n * sliceThickness\n * @type {Number}\n */\n set sliceThickness(thickness) {\n this._sliceThickness = thickness;\n const istyle = this._renderWindow.getInteractor().getInteractorStyle();\n // set thickness if the current interactor has it (it should, but just in case)\n istyle.setSlabThickness && istyle.setSlabThickness(this._sliceThickness);\n this.updateBlendMode(this._sliceThickness, this._blendMode);\n }\n\n /**\n * wwwl\n * @type {Array}\n */\n set wwwl([ww, wl]) {\n this.window.center = wl;\n this.window.width = ww;\n\n this._genericRenderWindow.getRenderWindow().render();\n }\n\n /**\n * camera\n * @type {vtkCamera}\n */\n get camera() {\n return this._genericRenderWindow.getRenderer().getActiveCamera();\n }\n\n /**\n * Initialize view: add actor to scene and setup controls & props\n * @param {vtkActor} actor\n * @param {State} data\n * @param {Function} onScrollCb\n */\n initView(actor, data, onScrollCb, onInitialized) {\n // dv: store volumes and element in viewport data\n this._volume = actor;\n\n const istyle = _vtk_vtkInteractorMPRSlice__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n istyle.setOnScroll(onScrollCb);\n const inter = this._renderWindow.getInteractor();\n inter.setInteractorStyle(istyle);\n\n // TODO: assumes the volume is always set for this mounted state...Throw an error?\n if (this.VERBOSE) console.log(this._volumes);\n const istyleVolumeMapper = this._volume.getMapper();\n\n istyle.setVolumeMapper(istyleVolumeMapper);\n\n //start with the volume center slice\n const range = istyle.getSliceRange();\n // if (this.VERBOSE) console.log('view mounted: setting the initial range', range)\n istyle.setSlice((range[0] + range[1]) / 2);\n\n // add the current volumes to the vtk renderer\n this.updateVolumesForRendering();\n\n if (this.VERBOSE) console.log(\"view data\", this._key, data.views[this.key]);\n this.updateSlicePlane(data.views[this._key]);\n\n // set camera to fill viewport\n this.fill2DView(this._genericRenderWindow, this._key);\n\n onInitialized();\n }\n\n /**\n * cleanup the scene and add new volume\n * @private\n */\n updateVolumesForRendering() {\n this._renderer.removeAllVolumes();\n if (this._volume) {\n if (!this._volume.isA(\"vtkVolume\")) {\n console.warn(\"Data to is not vtkVolume data\");\n } else {\n this._renderer.addVolume(this._volume);\n }\n }\n this._renderWindow.render();\n }\n\n /**\n * Recompute slice plane after changes\n * @param {State} viewData\n */\n updateSlicePlane(viewData) {\n // cached things are in viewport data\n let cachedSlicePlane = this._cachedSlicePlane;\n let cachedSliceViewUp = this._cachedSliceViewUp;\n if (this.VERBOSE) console.log(viewData);\n // TODO: optimize so you don't have to calculate EVERYTHING every time?\n\n // rotate around the vector of the cross product of the plane and viewup as the X component\n let sliceXRotVector = [];\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].cross(\n sliceXRotVector,\n viewData.sliceViewUp,\n viewData.slicePlaneNormal\n );\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].normalize(sliceXRotVector, sliceXRotVector);\n\n // rotate the viewUp vector as the Y component\n let sliceYRotVector = viewData.sliceViewUp;\n\n const planeMat = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"mat4\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"mat4\"].rotate(\n planeMat,\n planeMat,\n Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"degrees2radians\"])(viewData.slicePlaneYRotation),\n sliceYRotVector\n );\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"mat4\"].rotate(\n planeMat,\n planeMat,\n Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"degrees2radians\"])(viewData.slicePlaneXRotation),\n sliceXRotVector\n );\n\n if (this.VERBOSE)\n console.log(cachedSlicePlane, viewData.slicePlaneNormal, planeMat);\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].transformMat4(cachedSlicePlane, viewData.slicePlaneNormal, planeMat);\n\n // Rotate the viewUp in 90 degree increments\n const viewRotQuat = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].create();\n // Use - degrees since the axis of rotation should really be the direction of projection, which is the negative of the plane normal\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].setAxisAngle(\n viewRotQuat,\n cachedSlicePlane,\n Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"degrees2radians\"])(-viewData.viewRotation)\n );\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].normalize(viewRotQuat, viewRotQuat);\n\n // rotate the ViewUp with the x and z rotations\n const xQuat = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].setAxisAngle(\n xQuat,\n sliceXRotVector,\n Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"degrees2radians\"])(viewData.slicePlaneXRotation)\n );\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].normalize(xQuat, xQuat);\n const viewUpQuat = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].add(viewUpQuat, xQuat, viewRotQuat);\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].transformQuat(cachedSliceViewUp, viewData.sliceViewUp, viewRotQuat);\n\n // update the view's slice\n const renderWindow = this._genericRenderWindow.getRenderWindow();\n const istyle = renderWindow.getInteractor().getInteractorStyle();\n if (istyle && istyle.setSliceNormal) {\n istyle.setSliceNormal(cachedSlicePlane, cachedSliceViewUp);\n }\n\n renderWindow.render();\n }\n\n // fit to window (vtk.js 11 version: https://github.com/Kitware/paraview-glance/issues/230)\n fill2DView() {\n // Based this code: https://github.com/Kitware/paraview-glance/issues/230#issuecomment-445779222\n const bounds = this._renderer.computeVisiblePropBounds();\n const dim = [\n (bounds[1] - bounds[0]) / 2,\n (bounds[3] - bounds[2]) / 2,\n (bounds[5] - bounds[4]) / 2\n ];\n const w = this._genericRenderWindow.getContainer().clientWidth;\n const h = this._genericRenderWindow.getContainer().clientHeight;\n const r = w / h;\n\n let x;\n let y;\n if (this._key === \"left\") {\n x = dim[1];\n y = dim[2];\n } else if (this._key === \"front\") {\n x = dim[0];\n y = dim[2];\n } else if (this._key === \"top\") {\n x = dim[0];\n y = dim[1];\n }\n if (r >= x / y) {\n // use width\n this._renderer.getActiveCamera().setParallelScale(y + 1);\n } else {\n // use height\n this._renderer.getActiveCamera().setParallelScale(x / r + 1);\n }\n this.onResize();\n }\n\n /**\n * on resize callback\n * @private\n */\n onResize() {\n // TODO: debounce for performance reasons?\n this._genericRenderWindow.resize();\n }\n\n /**\n * update blending after changes\n * @private\n * @param {Number} thickness\n * @param {String} blendMode\n */\n updateBlendMode(thickness, blendMode) {\n if (thickness >= 1) {\n switch (blendMode) {\n case \"MIP\":\n this._volume.getMapper().setBlendModeToMaximumIntensity();\n break;\n case \"MINIP\":\n this._volume.getMapper().setBlendModeToMinimumIntensity();\n break;\n case \"AVG\":\n this._volume.getMapper().setBlendModeToAverageIntensity();\n break;\n case \"none\":\n default:\n this._volume.getMapper().setBlendModeToComposite();\n break;\n }\n } else {\n this._volume.getMapper().setBlendModeToComposite();\n }\n this._renderWindow.render();\n }\n\n /**\n * Setup interactor\n * @param {vtkInteractorStyle} istyle\n */\n setInteractor(istyle) {\n const renderWindow = this._genericRenderWindow.getRenderWindow();\n // We are assuming the old style is always extended from the MPRSlice style\n const oldStyle = renderWindow.getInteractor().getInteractorStyle();\n\n renderWindow.getInteractor().setInteractorStyle(istyle);\n istyle.setInteractor(renderWindow.getInteractor());\n\n // Make sure to set the style to the interactor itself, because reasons...?!\n const inter = renderWindow.getInteractor();\n inter.setInteractorStyle(istyle);\n\n // Copy previous interactors styles into the new one.\n if (istyle.setSliceNormal && oldStyle.getSliceNormal()) {\n // if (VERBOSE) console.log(\"setting slicenormal from old normal\");\n istyle.setSliceNormal(oldStyle.getSliceNormal(), oldStyle.getViewUp());\n }\n if (istyle.setSlabThickness && oldStyle.getSlabThickness()) {\n istyle.setSlabThickness(oldStyle.getSlabThickness());\n }\n istyle.setVolumeMapper(this._volume);\n\n // set current slice (fake) to make distance widget working\n // istyle.setCurrentImageNumber(0);\n }\n\n /**\n * Destroy webgl content and release listeners\n */\n destroy() {\n if (this.VERBOSE) console.log(\"DESTROY\", this._key);\n\n this.VERBOSE = null;\n this._key = null;\n this._element = null;\n // mapper is in common btw views, check that it has not already been deleted by other view\n if (this._volume.getMapper()) {\n this._volume.getMapper().delete();\n }\n this._volume.delete();\n this._volume = null;\n\n this._renderer.delete();\n this._renderer = null;\n this._parallel = null;\n\n this.slicePlaneNormal = null;\n this.sliceViewUp = null;\n this.slicePlaneXRotation = null;\n this.slicePlaneYRotation = null;\n this.viewRotation = null;\n this._sliceThickness = null;\n this._blendMode = null;\n this.window = null;\n\n this._cachedSlicePlane = null;\n this._cachedSliceViewUp = null;\n\n this._genericRenderWindow.delete();\n\n // delete resize listener ?\n }\n}\n\n\n//# sourceURL=webpack://diglettk/./src/mprView.js?"); - -/***/ }), - -/***/ "./src/strategies.js": -/*!***************************!*\ - !*** ./src/strategies.js ***! - \***************************/ -/*! exports provided: applyStrategy */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyStrategy\", function() { return applyStrategy; });\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n\n/**\n * Apply the logic to measure length between two points\n * @param {Object} state - The measurement state\n */\nfunction applyLengthStrategy(state, displayPosition, pickedPoint) {\n if (state.p1[0] && state.p2[0]) {\n state.p1 = displayPosition;\n state.p1_world = pickedPoint;\n state.p2 = [undefined, undefined];\n state.p2_world = [undefined, undefined];\n state.label = undefined;\n } else {\n if (state.p1[0]) {\n state.p2 = displayPosition;\n state.p2_world = pickedPoint;\n } else {\n state.p1 = displayPosition;\n state.p1_world = pickedPoint;\n }\n }\n\n //compute distance\n if (state.p1[0] && state.p2[0]) {\n let dist2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"distance2BetweenPoints\"](state.p1_world, state.p2_world);\n let d = Math.sqrt(dist2).toFixed(1);\n state.label = `${d} mm`;\n } else {\n state.label = \"\";\n }\n}\n\n/**\n * Apply the logic to measure angle between two segments\n * @param {Object} state - The measurement state\n */\nfunction applyAngleStrategy(state, displayPosition, pickedPoint) {\n if (state.p1[0] && state.p2[0] && state.p3[0]) {\n state.p1 = displayPosition;\n state.p1_world = pickedPoint;\n state.p2 = state.p3 = [undefined, undefined];\n state.p2_world = state.p3_world = [undefined, undefined];\n state.label = undefined;\n } else {\n if (state.p1[0] && state.p2[0]) {\n state.p3 = displayPosition;\n state.p3_world = pickedPoint;\n } else if (state.p1[0]) {\n state.p2 = displayPosition;\n state.p2_world = pickedPoint;\n } else {\n state.p1 = displayPosition;\n state.p1_world = pickedPoint;\n }\n }\n\n // compute angle\n if (state.p1[0] && state.p2[0] && state.p3[0]) {\n let vA = new Array(3);\n let vB = new Array(3);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](state.p2_world, state.p3_world, vA);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](state.p2_world, state.p1_world, vB);\n let angle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"angleBetweenVectors\"](vA, vB);\n let a = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"degreesFromRadians\"](angle).toFixed(1);\n state.label = `${a}°`;\n } else {\n state.label = \"\";\n }\n}\n\nconst STRATEGIES = {\n Length: applyLengthStrategy,\n Angle: applyAngleStrategy\n};\n\nfunction applyStrategy(state, displayPosition, pickedPoint, mode) {\n return STRATEGIES[mode](state, displayPosition, pickedPoint);\n}\n\n\n//# sourceURL=webpack://diglettk/./src/strategies.js?"); - -/***/ }), - -/***/ "./src/utils.js": -/*!**********************!*\ - !*** ./src/utils.js ***! - \**********************/ -/*! exports provided: buildVtkVolume, fitToWindow, loadDemoSerieWithLarvitar, createRGBStringFromRGBValues, degrees2radians, getVolumeCenter, getVOI, getPlaneIntersection, createVolumeActor */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildVtkVolume\", function() { return buildVtkVolume; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fitToWindow\", function() { return fitToWindow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadDemoSerieWithLarvitar\", function() { return loadDemoSerieWithLarvitar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createRGBStringFromRGBValues\", function() { return createRGBStringFromRGBValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"degrees2radians\", function() { return degrees2radians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getVolumeCenter\", function() { return getVolumeCenter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getVOI\", function() { return getVOI; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPlaneIntersection\", function() { return getPlaneIntersection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createVolumeActor\", function() { return createVolumeActor; });\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/ImageData */ \"./node_modules/vtk.js/Sources/Common/DataModel/ImageData/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Plane */ \"./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Volume__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Volume */ \"./node_modules/vtk.js/Sources/Rendering/Core/Volume/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_VolumeMapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/VolumeMapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/index.js\");\n\n\n\n\n\n\nfunction buildVtkVolume(header, data) {\n const dims = [\n header.volume.cols,\n header.volume.rows,\n header.volume.imageIds.length\n ];\n const numScalars = dims[0] * dims[1] * dims[2];\n\n if (numScalars < 1 || dims[1] < 2 || dims[1] < 2 || dims[2] < 2) {\n return;\n }\n\n const volume = vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n const origin = header.volume.imagePosition;\n const spacing = header.volume.pixelSpacing.concat(\n header.volume.sliceThickness // TODO check\n );\n\n volume.setDimensions(dims);\n volume.setOrigin(origin);\n volume.setSpacing(spacing);\n\n const scalars = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance({\n name: \"Scalars\",\n values: data,\n numberOfComponents: 1\n });\n\n volume.getPointData().setScalars(scalars);\n\n volume.modified();\n\n return volume;\n}\n\n// fit to window\nfunction fitToWindow(genericRenderWindow, dir) {\n const bounds = genericRenderWindow.getRenderer().computeVisiblePropBounds();\n const dim = [\n (bounds[1] - bounds[0]) / 2,\n (bounds[3] - bounds[2]) / 2,\n (bounds[5] - bounds[4]) / 2\n ];\n const w = genericRenderWindow.getContainer().clientWidth;\n const h = genericRenderWindow.getContainer().clientHeight;\n const r = w / h;\n\n let x;\n let y;\n if (dir === \"x\") {\n x = dim[1];\n y = dim[2];\n } else if (dir === \"y\") {\n x = dim[0];\n y = dim[2];\n } else if (dir === \"z\") {\n x = dim[0];\n y = dim[1];\n }\n if (r >= x / y) {\n // use width\n genericRenderWindow\n .getRenderer()\n .getActiveCamera()\n .setParallelScale(y + 1);\n } else {\n // use height\n genericRenderWindow\n .getRenderer()\n .getActiveCamera()\n .setParallelScale(x / r + 1);\n }\n}\n\nlet larvitarInitialized = false;\n\nfunction loadDemoSerieWithLarvitar(name, lrv, cb) {\n let demoFiles = [];\n let counter = 0;\n let demoFileList = getDemoFileNames();\n\n function getDemoFileNames() {\n let numberOfFiles = name == \"knee\" ? 24 : 364;\n let demoFileList = [];\n for (let i = 1; i < numberOfFiles; i++) {\n let filename = `${name} (${i})`;\n demoFileList.push(filename);\n }\n return demoFileList;\n }\n\n async function createFile(fileName, cb) {\n let response = await fetch(\"./demo/\" + fileName);\n let data = await response.blob();\n let file = new File([data], fileName);\n demoFiles.push(file);\n counter++;\n if (counter == demoFileList.length) {\n cb();\n }\n }\n\n if (!larvitarInitialized) {\n // init all larvitar\n lrv.initLarvitarStore();\n lrv.initializeImageLoader();\n lrv.initializeCSTools();\n lrv.larvitar_store.addViewport(\"viewer\");\n larvitarInitialized = true;\n }\n\n // load dicom and render\n demoFileList.forEach(function(demoFile) {\n createFile(demoFile, () => {\n lrv.resetImageParsing();\n lrv.readFiles(demoFiles, function(seriesStack, err) {\n // return the first series of the study\n let seriesId = _.keys(seriesStack)[0];\n let serie = seriesStack[seriesId];\n\n // hack to avoid load and cache (render + timeout)\n lrv.renderImage(serie, \"viewer\");\n if (cb) {\n setTimeout(cb, 3000, serie); // increase timeout if \"getPixelData\" error\n }\n });\n });\n });\n}\n\n/**\n * Function to create synthetic image data with correct dimensions\n * Can be use for debug\n * @private\n * @param {Array} dims - Array[int]\n */\n// eslint-disable-next-line no-unused-vars\nfunction createSyntheticImageData(dims) {\n const imageData = vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n const newArray = new Uint8Array(dims[0] * dims[1] * dims[2]);\n const s = 0.1;\n imageData.setSpacing(s, s, s);\n imageData.setExtent(0, 127, 0, 127, 0, 127);\n let i = 0;\n for (let z = 0; z < dims[2]; z++) {\n for (let y = 0; y < dims[1]; y++) {\n for (let x = 0; x < dims[0]; x++) {\n newArray[i++] = (256 * (i % (dims[0] * dims[1]))) / (dims[0] * dims[1]);\n }\n }\n }\n\n const da = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance({\n numberOfComponents: 1,\n values: newArray\n });\n da.setName(\"scalars\");\n\n imageData.getPointData().setScalars(da);\n\n return imageData;\n}\n\nfunction createRGBStringFromRGBValues(rgb) {\n if (rgb.length !== 3) {\n return \"rgb(0, 0, 0)\";\n }\n return `rgb(${(rgb[0] * 255).toString()}, ${(rgb[1] * 255).toString()}, ${(\n rgb[2] * 255\n ).toString()})`;\n}\n\nfunction degrees2radians(degrees) {\n return (degrees * Math.PI) / 180;\n}\n\nfunction getVolumeCenter(volumeMapper) {\n const bounds = volumeMapper.getBounds();\n return [\n (bounds[0] + bounds[1]) / 2.0,\n (bounds[2] + bounds[3]) / 2.0,\n (bounds[4] + bounds[5]) / 2.0\n ];\n}\n\nfunction getVOI(volume) {\n // Note: This controls window/level\n\n // TODO: Make this work reactively with onModified...\n const rgbTransferFunction = volume.getProperty().getRGBTransferFunction(0);\n const range = rgbTransferFunction.getMappingRange();\n const windowWidth = range[0] + range[1];\n const windowCenter = range[0] + windowWidth / 2;\n\n return {\n windowCenter,\n windowWidth\n };\n}\n\n/**\n * Planes are of type `{position:[x,y,z], normal:[x,y,z]}`\n * returns an [x,y,z] array, or NaN if they do not intersect.\n * @private\n */\nconst getPlaneIntersection = (plane1, plane2, plane3) => {\n try {\n let line = vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_2__[\"default\"].intersectWithPlane(\n plane1.position,\n plane1.normal,\n plane2.position,\n plane2.normal\n );\n if (line.intersection) {\n const { l0, l1 } = line;\n const intersectionLocation = vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_2__[\"default\"].intersectWithLine(\n l0,\n l1,\n plane3.position,\n plane3.normal\n );\n if (intersectionLocation.intersection) {\n return intersectionLocation.x;\n }\n }\n } catch (err) {\n console.log(\"some issue calculating the plane intersection\", err);\n }\n return NaN;\n};\n\nfunction createVolumeActor(contentData) {\n const volumeActor = vtk_js_Sources_Rendering_Core_Volume__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n const volumeMapper = vtk_js_Sources_Rendering_Core_VolumeMapper__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n volumeMapper.setSampleDistance(1);\n volumeActor.setMapper(volumeMapper);\n\n volumeMapper.setInputData(contentData);\n\n // set a default wwwl\n const dataRange = contentData\n .getPointData()\n .getScalars()\n .getRange();\n\n // FIXME: custom range mapping\n const rgbTransferFunction = volumeActor\n .getProperty()\n .getRGBTransferFunction(0);\n rgbTransferFunction.setMappingRange(dataRange[0], dataRange[1]);\n\n // update slice min/max values for interface\n // Crate imageMapper for I,J,K planes\n // const dataRange = data\n // .getPointData()\n // .getScalars()\n // .getRange();\n // const extent = data.getExtent();\n // this.window = {\n // min: 0,\n // max: dataRange[1] * 2,\n // value: dataRange[1]\n // };\n // this.level = {\n // min: -dataRange[1],\n // max: dataRange[1],\n // value: (dataRange[0] + dataRange[1]) / 2\n // };\n // this.updateColorLevel();\n // this.updateColorWindow();\n\n // TODO: find the volume center and set that as the slice intersection point.\n // TODO: Refactor the MPR slice to set the focal point instead of defaulting to volume center\n\n return volumeActor;\n}\n\n\n//# sourceURL=webpack://diglettk/./src/utils.js?"); - -/***/ }), - -/***/ "./src/vrView.js": -/*!***********************!*\ - !*** ./src/vrView.js ***! - \***********************/ -/*! exports provided: VRView */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VRView\", function() { return VRView; });\n/* harmony import */ var vtk_js_Sources_Rendering_Misc_GenericRenderWindow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Misc/GenericRenderWindow */ \"./node_modules/vtk.js/Sources/Rendering/Misc/GenericRenderWindow/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ColorTransferFunction */ \"./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PiecewiseFunction */ \"./node_modules/vtk.js/Sources/Common/DataModel/PiecewiseFunction/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget */ \"./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/index.js\");\n/* harmony import */ var vtk_js_Sources_Filters_General_ImageCropFilter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Filters/General/ImageCropFilter */ \"./node_modules/vtk.js/Sources/Filters/General/ImageCropFilter/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps */ \"./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Widgets_PiecewiseGaussianWidget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget */ \"./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Style_InteractorStyleManipulator__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Style/InteractorStyleManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_PointPicker__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/PointPicker */ \"./node_modules/vtk.js/Sources/Rendering/Core/PointPicker/index.js\");\n/* harmony import */ var vtk_js_Sources_Filters_Sources_PlaneSource__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! vtk.js/Sources/Filters/Sources/PlaneSource */ \"./node_modules/vtk.js/Sources/Filters/Sources/PlaneSource/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Actor */ \"./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Filters_Sources_SphereSource__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! vtk.js/Sources/Filters/Sources/SphereSource */ \"./node_modules/vtk.js/Sources/Filters/Sources/SphereSource/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Coordinate__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Coordinate */ \"./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/index.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n/* harmony import */ var _strategies__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./strategies */ \"./src/strategies.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n//TODO interactions:\r\n\r\n/**\r\n * setTool(\"Length/Angle\", {mouseButtonMask:1}, measurementState); => per cambiare interactors tasto sx\r\n * setupMouseButtons(config); => inizializzare il tasto dx del mouse\r\n * measurementState = {\r\n * p1: [0, 0],\r\n * p2: [0, 0],\r\n * p3: [0, 0],\r\n * label: `string`\r\n * }\r\n */\r\n\r\n/** A class representing a Volume Rendering scene */\r\nclass VRView {\r\n /**\r\n * Create a volume rendering scene\r\n * @param {HTMLElement} element - the target html element to render the scene\r\n */\r\n constructor(element) {\r\n this.VERBOSE = false;\r\n\r\n this.element = element;\r\n this.renderer = null;\r\n this.renderWindow = null;\r\n this._genericRenderWindow = null;\r\n this.actor = null;\r\n this._raysDistance = 2.5;\r\n this._blurOnInteraction = null;\r\n this._rescaleLUT = false; // cannot initialize true (must set lut before)\r\n\r\n // piecewise gaussian widget stuff\r\n this.PGwidgetElement = null;\r\n this.PGwidget = null;\r\n this.gaussians = null;\r\n this._PGwidgetLoaded = false;\r\n\r\n // crop widget\r\n this._cropWidget = null;\r\n\r\n // normalized ww wl\r\n this.ww = 0.25;\r\n this.wl = 0.3;\r\n\r\n // absolute ww wl\r\n this.wwwl = [0, 0];\r\n\r\n // measurement state\r\n this._measurementState = null;\r\n\r\n this.initVR();\r\n }\r\n\r\n /**\r\n * wwwl\r\n * @type {Array}\r\n */\r\n set wwwl(value) {\r\n if (!this.actor) {\r\n return;\r\n }\r\n\r\n const dataArray = this.actor\r\n .getMapper()\r\n .getInputData()\r\n .getPointData()\r\n .getScalars();\r\n\r\n const range = dataArray.getRange();\r\n let rel_ww = value[0] / (range[1] - range[0]);\r\n let rel_wl = (value[1] - range[0]) / range[1];\r\n\r\n this.wl = rel_wl;\r\n this.ww = rel_ww;\r\n\r\n if (this.PGwidget) {\r\n this.updateWidget();\r\n }\r\n }\r\n\r\n get wwwl() {\r\n const dataArray = this.actor\r\n .getMapper()\r\n .getInputData()\r\n .getPointData()\r\n .getScalars();\r\n\r\n const range = dataArray.getRange();\r\n\r\n let abs_ww = rel_ww * (range[1] - range[0]);\r\n let abs_wl = rel_wl * range[1] + range[0];\r\n return [abs_ww, abs_wl];\r\n }\r\n\r\n /**\r\n * raysDistance\r\n * @type {Number}\r\n */\r\n set resolution(value) {\r\n this._raysDistance = 5 / value;\r\n this.actor.getMapper().setSampleDistance(this._raysDistance);\r\n this.renderWindow.render();\r\n }\r\n\r\n get resolution() {\r\n return Math.round(this._raysDistance * 5);\r\n }\r\n\r\n /**\r\n * Presets\r\n * @type {Array}\r\n */\r\n get presetsList() {\r\n return vtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_6__[\"default\"].rgbPresetNames;\r\n }\r\n\r\n /**\r\n * PGwidgetElement (set null to hide)\r\n * @type {HTMLelement}\r\n */\r\n set widgetElement(element) {\r\n this.PGwidgetElement = element;\r\n let h = element.offsetHeight ? element.offsetHeight - 5 : 100;\r\n let w = element.offsetWidth ? element.offsetWidth - 5 : 300;\r\n this.PGwidget.setSize(w, h);\r\n this.PGwidget.setContainer(this.PGwidgetElement);\r\n this.PGwidget.render();\r\n }\r\n\r\n /**\r\n * Flag to set lut rescaling on opacity range\r\n * @type {bool}\r\n */\r\n set rescaleLUT(bool) {\r\n this._rescaleLUT = bool;\r\n let range;\r\n if (this._rescaleLUT && this.PGwidget) {\r\n range = this.PGwidget.getOpacityRange();\r\n } else {\r\n range = this.actor\r\n .getMapper()\r\n .getInputData()\r\n .getPointData()\r\n .getScalars()\r\n .getRange();\r\n }\r\n this.ctfun.setMappingRange(...range);\r\n this.ctfun.updateRange();\r\n }\r\n\r\n /**\r\n * Crop widget on / off\r\n * @type {bool}\r\n */\r\n set cropWidget(visible) {\r\n if (!this._cropWidget) this.setupCropWidget();\r\n this._cropWidget.setVisibility(visible);\r\n this._widgetManager.renderWidgets();\r\n this.renderWindow.render();\r\n }\r\n\r\n /**\r\n * Set colormap and opacity function\r\n * lutName - as in presets list\r\n * @type {String}\r\n */\r\n set lut(lutName) {\r\n // set up color transfer function\r\n const lookupTable = vtk_js_Sources_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\r\n lookupTable.applyColorMap(vtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getPresetByName(lutName));\r\n\r\n // update lookup table mapping range based on input dataset\r\n let range;\r\n\r\n if (this._rescaleLUT && this._PGwidgetLoaded) {\r\n range = this.PGwidget.getOpacityRange();\r\n } else {\r\n range = this.actor\r\n .getMapper()\r\n .getInputData()\r\n .getPointData()\r\n .getScalars()\r\n .getRange();\r\n }\r\n\r\n lookupTable.setMappingRange(...range);\r\n lookupTable.updateRange();\r\n\r\n this.actor.getProperty().setRGBTransferFunction(0, lookupTable);\r\n\r\n // set up opacity function (values will be set by PGwidget)\r\n const piecewiseFun = vtk_js_Sources_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\r\n this.actor.getProperty().setScalarOpacity(0, piecewiseFun);\r\n\r\n this.ctfun = lookupTable;\r\n this.ofun = piecewiseFun;\r\n\r\n this.updateWidget();\r\n }\r\n\r\n /**\r\n * Initialize rendering scene\r\n * @private\r\n */\r\n initVR() {\r\n const genericRenderWindow = vtk_js_Sources_Rendering_Misc_GenericRenderWindow__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance();\r\n genericRenderWindow.setContainer(this.element);\r\n genericRenderWindow.setBackground([0, 0, 0]);\r\n\r\n //add custom resize cb\r\n genericRenderWindow.onResize(() => {\r\n // bypass genericRenderWindow resize method (do not consider devicePixelRatio)\r\n // https://kitware.github.io/vtk-js/api/Rendering_Misc_GenericRenderWindow.html\r\n let size = [\r\n genericRenderWindow.getContainer().getBoundingClientRect().width,\r\n genericRenderWindow.getContainer().getBoundingClientRect().height\r\n ];\r\n genericRenderWindow\r\n .getRenderWindow()\r\n .getViews()[0]\r\n .setSize(size);\r\n\r\n if (this.VERBOSE) console.log(\"resize\", size);\r\n });\r\n\r\n // resize callback\r\n window.addEventListener(\"resize\", evt => {\r\n genericRenderWindow.resize();\r\n });\r\n\r\n genericRenderWindow.resize();\r\n\r\n this.renderer = genericRenderWindow.getRenderer();\r\n this.renderWindow = genericRenderWindow.getRenderWindow();\r\n this._genericRenderWindow = genericRenderWindow;\r\n\r\n this.setupPGwidget();\r\n }\r\n\r\n /**\r\n * Set the image to be rendered\r\n * @param {ArrayBuffer} image - The image content data as buffer array\r\n */\r\n setImage(image) {\r\n // clean scene\r\n this.renderer.removeAllVolumes();\r\n let actor = Object(_utils__WEBPACK_IMPORTED_MODULE_19__[\"createVolumeActor\"])(image);\r\n this.actor = actor;\r\n this.lut = \"Grayscale\";\r\n this.renderer.addVolume(actor);\r\n this.setCamera(actor.getCenter());\r\n\r\n if (this.PGwidget) {\r\n this.updateWidget();\r\n this.setWidgetCallbacks();\r\n }\r\n\r\n // TODO implement a strategy to set rays distance\r\n // TODO interactors switching (ex. blurring or wwwl or crop)\r\n\r\n this.setupInteractor();\r\n\r\n this.blurOnInteraction = true;\r\n\r\n this._genericRenderWindow.resize();\r\n this.renderer.resetCamera();\r\n this.renderWindow.render();\r\n }\r\n\r\n /**\r\n * Set camera lookat point\r\n * @param {Array} center - As [x,y,z]\r\n */\r\n setCamera(center) {\r\n this.renderer.resetCamera();\r\n this.renderer.getActiveCamera().zoom(1.5);\r\n this.renderer.getActiveCamera().elevation(70);\r\n this.renderer.getActiveCamera().setViewUp(0, 0, 1);\r\n this.renderer\r\n .getActiveCamera()\r\n .setFocalPoint(center[0], center[1], center[2]);\r\n this.renderer\r\n .getActiveCamera()\r\n .setPosition(center[0], center[1] - 2000, center[2]);\r\n this.renderer.getActiveCamera().setThickness(10000);\r\n this.renderer.getActiveCamera().setParallelProjection(true);\r\n }\r\n\r\n /**\r\n * Get vtk LUTs list\r\n * @returns {Array} - Lut list as array of strings\r\n */\r\n getLutList() {\r\n return vtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_6__[\"default\"].rgbPresetNames;\r\n }\r\n\r\n /**\r\n * Set actor appearance properties\r\n * TODO\r\n */\r\n setActorProperties() {\r\n // this.actor.getProperty().setRGBTransferFunction(0, lutFuncs.ctfun);\r\n // this.actor.getProperty().setScalarOpacity(0, lutFuncs.ofun);\r\n this.actor.getProperty().setScalarOpacityUnitDistance(0, 30.0);\r\n this.actor.getProperty().setInterpolationTypeToLinear();\r\n this.actor.getProperty().setUseGradientOpacity(0, true);\r\n this.actor.getProperty().setGradientOpacityMinimumValue(0, 2);\r\n this.actor.getProperty().setGradientOpacityMinimumOpacity(0, 0.0);\r\n this.actor.getProperty().setGradientOpacityMaximumValue(0, 20);\r\n this.actor.getProperty().setGradientOpacityMaximumOpacity(0, 2.0);\r\n this.actor.getProperty().setShade(true);\r\n this.actor.getProperty().setAmbient(state.ambient);\r\n this.actor.getProperty().setDiffuse(state.diffuse);\r\n this.actor.getProperty().setSpecular(state.specular);\r\n this.actor.getProperty().setSpecularPower(state.specularPower);\r\n }\r\n\r\n /**\r\n * Setup crop widget\r\n */\r\n setupCropWidget() {\r\n // setup widget manager and widget\r\n const widgetManager = vtk_js_Sources_Widgets_Core_WidgetManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\r\n // widgetManager.setUseSvgLayer(false);\r\n widgetManager.setRenderer(this.renderer);\r\n\r\n // widget factory\r\n const widget = vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\r\n // instance of a widget associated with a renderer\r\n const viewWidget = widgetManager.addWidget(widget);\r\n\r\n // setup crop filter\r\n const cropFilter = vtk_js_Sources_Filters_General_ImageCropFilter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\r\n // listen to cropping widget state to inform the crop filter\r\n const cropState = widget.getWidgetState().getCroppingPlanes();\r\n cropState.onModified(() => {\r\n cropFilter.setCroppingPlanes(cropState.getPlanes());\r\n });\r\n\r\n // wire up the reader, crop filter, and mapper\r\n let mapper = this.actor.getMapper();\r\n let image = mapper.getInputData();\r\n cropFilter.setCroppingPlanes(...image.getExtent());\r\n widget.copyImageDataDescription(image);\r\n\r\n widget.set({\r\n faceHandlesEnabled: true,\r\n edgeHandlesEnabled: true,\r\n cornerHandlesEnabled: true\r\n });\r\n\r\n cropFilter.setInputData(image);\r\n mapper.setInputConnection(cropFilter.getOutputPort());\r\n\r\n widgetManager.enablePicking();\r\n\r\n this._widgetManager = widgetManager;\r\n this._cropWidget = widget; // or viewWidget ?\r\n\r\n this.renderWindow.render();\r\n }\r\n\r\n /**\r\n * Append a vtkPiecewiseGaussianWidget into the target element\r\n * @private\r\n * @param {HTMLElement} widgetContainer - The target element to place the widget\r\n */\r\n setupPGwidget() {\r\n let containerWidth = this.PGwidgetElement\r\n ? this.PGwidgetElement.offsetWidth - 5\r\n : 300;\r\n let containerHeight = this.PGwidgetElement\r\n ? this.PGwidgetElement.offsetHeight - 5\r\n : 100;\r\n\r\n const PGwidget = vtk_js_Sources_Interaction_Widgets_PiecewiseGaussianWidget__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance({\r\n numberOfBins: 256,\r\n size: [containerWidth, containerHeight]\r\n });\r\n // TODO expose style\r\n PGwidget.updateStyle({\r\n backgroundColor: \"rgba(255, 255, 255, 0.6)\",\r\n histogramColor: \"rgba(50, 50, 50, 0.8)\",\r\n strokeColor: \"rgb(0, 0, 0)\",\r\n activeColor: \"rgb(255, 255, 255)\",\r\n handleColor: \"rgb(50, 150, 50)\",\r\n buttonDisableFillColor: \"rgba(255, 255, 255, 0.5)\",\r\n buttonDisableStrokeColor: \"rgba(0, 0, 0, 0.5)\",\r\n buttonStrokeColor: \"rgba(0, 0, 0, 1)\",\r\n buttonFillColor: \"rgba(255, 255, 255, 1)\",\r\n strokeWidth: 1,\r\n activeStrokeWidth: 1.5,\r\n buttonStrokeWidth: 1,\r\n handleWidth: 1,\r\n iconSize: 0, // Can be 0 if you want to remove buttons (dblClick for (+) / rightClick for (-))\r\n padding: 1\r\n });\r\n\r\n // to hide widget\r\n PGwidget.setContainer(this.PGwidgetElement); // Set to null to hide\r\n\r\n // resize callback\r\n window.addEventListener(\"resize\", evt => {\r\n PGwidget.setSize(\r\n this.PGwidgetElement.offsetWidth - 5,\r\n this.PGwidgetElement.offsetHeight - 5\r\n );\r\n PGwidget.render();\r\n });\r\n\r\n this.PGwidget = PGwidget;\r\n }\r\n\r\n /**\r\n * Update the PGwidget after an image has been loaded\r\n * @private\r\n */\r\n updateWidget() {\r\n const dataArray = this.actor\r\n .getMapper()\r\n .getInputData()\r\n .getPointData()\r\n .getScalars();\r\n\r\n this.PGwidget.setDataArray(dataArray.getData());\r\n\r\n let gaussians = this.PGwidget.getGaussians();\r\n\r\n if (gaussians.length > 0) {\r\n let gaussian = gaussians[0];\r\n\r\n gaussian.position = this.wl;\r\n gaussian.width = this.ww;\r\n\r\n this.PGwidget.setGaussians([gaussian]);\r\n } else {\r\n // TODO initilize in a smarter way\r\n const default_opacity = 1.0;\r\n const default_skew = 0.0;\r\n const default_bias = 0.0;\r\n this.PGwidget.addGaussian(\r\n this.wl,\r\n default_opacity,\r\n this.ww,\r\n default_bias,\r\n default_skew\r\n ); // x, y, ampiezza, sbilanciamento, andamento\r\n }\r\n\r\n this.PGwidget.applyOpacity(this.ofun);\r\n this.PGwidget.setColorTransferFunction(this.ctfun);\r\n this.ctfun.onModified(() => {\r\n this.PGwidget.render();\r\n this.renderWindow.render();\r\n });\r\n\r\n this._PGwidgetLoaded = true;\r\n }\r\n\r\n /**\r\n * Binds callbacks to user interactions on PGwidget\r\n * @private\r\n */\r\n setWidgetCallbacks() {\r\n this.PGwidget.bindMouseListeners();\r\n\r\n this.PGwidget.onAnimation(start => {\r\n if (start) {\r\n this.renderWindow.getInteractor().requestAnimation(this.PGwidget);\r\n } else {\r\n this.renderWindow.getInteractor().cancelAnimation(this.PGwidget);\r\n }\r\n });\r\n\r\n this.PGwidget.onOpacityChange(widget => {\r\n this.PGwidget = widget;\r\n this.gaussians = widget.getGaussians().slice(); // store\r\n this.PGwidget.applyOpacity(this.ofun);\r\n if (!this.renderWindow.getInteractor().isAnimating()) {\r\n this.renderWindow.render();\r\n }\r\n\r\n if (this._rescaleLUT && this.PGwidget) {\r\n const range = this.PGwidget.getOpacityRange();\r\n this.ctfun.setMappingRange(...range);\r\n this.ctfun.updateRange();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Set distance between rays\r\n * @param {*} distance\r\n */\r\n setSampleDistance(distance) {\r\n this.actor.getMapper().setSampleDistance(distance);\r\n }\r\n\r\n /**\r\n * Toggle blurring on interaction (Increase performance)\r\n * @type {bool} toggle - if true, blur on interaction\r\n */\r\n set blurOnInteraction(toggle) {\r\n this._blurOnInteraction = toggle;\r\n let interactor = this.renderWindow.getInteractor();\r\n let mapper = this.actor.getMapper();\r\n\r\n if (toggle) {\r\n interactor.onLeftButtonPress(() => {\r\n mapper.setSampleDistance(this._raysDistance * 5);\r\n });\r\n\r\n interactor.onLeftButtonRelease(() => {\r\n mapper.setSampleDistance(this._raysDistance);\r\n // update picking plane\r\n let camera = this.renderer.getActiveCamera();\r\n if (this._pickingPlane)\r\n this._pickingPlane.setNormal(camera.getDirectionOfProjection());\r\n this.renderWindow.render();\r\n });\r\n } else {\r\n interactor.onLeftButtonPress(() => {\r\n mapper.setSampleDistance(this._raysDistance);\r\n });\r\n\r\n interactor.onLeftButtonRelease(() => {\r\n mapper.setSampleDistance(this._raysDistance);\r\n // update picking plane\r\n let camera = this.renderer.getActiveCamera();\r\n if (this._pickingPlane)\r\n this._pickingPlane.setNormal(camera.getDirectionOfProjection());\r\n this.renderWindow.render();\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Init interactor\r\n * @private\r\n */\r\n setupInteractor() {\r\n // TODO setup from user\r\n const rotateManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_8__[\"default\"].newInstance(\r\n { button: 1 }\r\n );\r\n const panManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_9__[\"default\"].newInstance({\r\n button: 3,\r\n control: true\r\n });\r\n const zoomManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_10__[\"default\"].newInstance({\r\n button: 3,\r\n scrollEnabled: true\r\n });\r\n const rangeManipulator = vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_11__[\"default\"].newInstance({\r\n button: 1,\r\n shift: true\r\n });\r\n\r\n let self = this;\r\n\r\n function getWL() {\r\n return self.wl;\r\n }\r\n\r\n function getWW() {\r\n return self.ww;\r\n }\r\n\r\n function setWL(v) {\r\n let wl = self.wl + (v - self.wl) / 25;\r\n self.wl = wl;\r\n\r\n let gaussians = self.PGwidget.getGaussians().slice(); // NOTE: slice() to clone!\r\n gaussians[0].position = self.wl; //TODO: foreach\r\n self.PGwidget.setGaussians(gaussians);\r\n }\r\n\r\n function setWW(v) {\r\n let ww = self.ww + (v - self.ww) / 5;\r\n self.ww = ww;\r\n\r\n let gaussians = self.PGwidget.getGaussians().slice(); // NOTE: slice() to clone!\r\n gaussians[0].width = self.ww; //TODO: foreach\r\n self.PGwidget.setGaussians(gaussians);\r\n }\r\n\r\n rangeManipulator.setVerticalListener(-1, 1, 0.001, getWL, setWL);\r\n rangeManipulator.setHorizontalListener(0.1, 2.1, 0.001, getWW, setWW);\r\n\r\n const interactorStyle = vtk_js_Sources_Interaction_Style_InteractorStyleManipulator__WEBPACK_IMPORTED_MODULE_12__[\"default\"].newInstance();\r\n interactorStyle.addMouseManipulator(rangeManipulator);\r\n interactorStyle.addMouseManipulator(rotateManipulator);\r\n interactorStyle.addMouseManipulator(panManipulator);\r\n interactorStyle.addMouseManipulator(zoomManipulator);\r\n interactorStyle.setCenterOfRotation(this.actor.getCenter());\r\n this.renderWindow.getInteractor().setInteractorStyle(interactorStyle);\r\n\r\n // clear measurements on interactions\r\n this.renderWindow\r\n .getInteractor()\r\n .onMouseWheel(() => this.resetMeasurementState());\r\n this.renderWindow\r\n .getInteractor()\r\n .onRightButtonPress(() => this.resetMeasurementState());\r\n }\r\n\r\n /**\r\n * Reset measurement state to default\r\n * @param {*} measurementState\r\n */\r\n resetMeasurementState(state) {\r\n if (this._measurementState) {\r\n this._measurementState.p1 = new Array(2);\r\n this._measurementState.p2 = new Array(2);\r\n this._measurementState.p3 = new Array(2);\r\n this._measurementState.p1_world = new Array(2);\r\n this._measurementState.p2_world = new Array(2);\r\n this._measurementState.p3_world = new Array(2);\r\n this._measurementState.label = null;\r\n } else if (state) {\r\n state.p1 = new Array(2);\r\n state.p2 = new Array(2);\r\n state.p3 = new Array(2);\r\n state.p1_world = new Array(2);\r\n state.p2_world = new Array(2);\r\n state.p3_world = new Array(2);\r\n state.label = null;\r\n }\r\n }\r\n\r\n /**\r\n * Set active tool\r\n * (\"Length/Angle\", {mouseButtonMask:1}, measurementState)\r\n * * @param {*} toolName\r\n * @param {*} options\r\n * @param {*} measurementState\r\n */\r\n setTool(toolName, options, measurementState) {\r\n if (this._leftButtonCb) {\r\n this._leftButtonCb.unsubscribe();\r\n }\r\n\r\n switch (toolName) {\r\n case \"Length\":\r\n this._initPicker(measurementState, toolName);\r\n break;\r\n case \"Angle\":\r\n this._initPicker(measurementState, toolName);\r\n break;\r\n case \"Rotation\":\r\n this.resetMeasurementState(measurementState);\r\n this.setupInteractor();\r\n break;\r\n default:\r\n console.warn(\"No tool found for\", toolName);\r\n }\r\n }\r\n\r\n /**\r\n * initPicker\r\n */\r\n _initPicker(state, mode) {\r\n // no blur when measure\r\n this.blurOnInteraction = false;\r\n\r\n // de-activate rotation\r\n let rotateManipulator = this.renderWindow\r\n .getInteractor()\r\n .getInteractorStyle()\r\n .getMouseManipulators()\r\n .filter(i => {\r\n return i.getClassName() == \"vtkMouseCameraTrackballRotateManipulator\";\r\n })\r\n .pop();\r\n this.renderWindow\r\n .getInteractor()\r\n .getInteractorStyle()\r\n .removeMouseManipulator(rotateManipulator);\r\n\r\n // ----------------------------------------------------------------------------\r\n // Setup picking interaction\r\n // ----------------------------------------------------------------------------\r\n // Only try to pick points\r\n const picker = vtk_js_Sources_Rendering_Core_PointPicker__WEBPACK_IMPORTED_MODULE_13__[\"default\"].newInstance();\r\n picker.setPickFromList(1);\r\n picker.initializePickList();\r\n\r\n if (!this._pickingPlane) {\r\n // add a 1000x1000 plane\r\n // TODO this is slow the first time we pick, maybe we could use cellPicker and decrease resolution\r\n const plane = vtk_js_Sources_Filters_Sources_PlaneSource__WEBPACK_IMPORTED_MODULE_14__[\"default\"].newInstance({\r\n xResolution: 1000,\r\n yResolution: 1000\r\n });\r\n let camera = this.renderer.getActiveCamera();\r\n plane.setPoint1(0, 0, 1000);\r\n plane.setPoint2(1000, 0, 0);\r\n plane.setCenter(this.actor.getCenter());\r\n plane.setNormal(camera.getDirectionOfProjection());\r\n\r\n const mapper = vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_15__[\"default\"].newInstance();\r\n mapper.setInputConnection(plane.getOutputPort());\r\n const planeActor = vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_16__[\"default\"].newInstance();\r\n planeActor.setMapper(mapper);\r\n planeActor.getProperty().setOpacity(0.01); // with opacity = 0 it is ignored by picking\r\n this.renderer.addActor(planeActor);\r\n\r\n this._pickingPlane = plane;\r\n this._planeActor = planeActor;\r\n }\r\n\r\n // add picking plane to pick list\r\n picker.addPickList(this._planeActor);\r\n\r\n // Pick on mouse left click\r\n this._leftButtonCb = this.renderWindow\r\n .getInteractor()\r\n .onLeftButtonPress(callData => {\r\n if (this.renderer !== callData.pokedRenderer) {\r\n return;\r\n }\r\n\r\n const pos = callData.position;\r\n const point = [pos.x, pos.y, 0.0];\r\n picker.pick(point, this.renderer);\r\n\r\n if (picker.getActors().length === 0) {\r\n const pickedPoint = picker.getPickPosition();\r\n if (this.VERBOSE)\r\n console.log(`No point picked, default: ${pickedPoint}`);\r\n // const sphere = vtkSphereSource.newInstance();\r\n // sphere.setCenter(pickedPoint);\r\n // sphere.setRadius(0.01);\r\n // const sphereMapper = vtkMapper.newInstance();\r\n // sphereMapper.setInputData(sphere.getOutputData());\r\n // const sphereActor = vtkActor.newInstance();\r\n // sphereActor.setMapper(sphereMapper);\r\n // sphereActor.getProperty().setColor(1.0, 0.0, 0.0);\r\n // this.renderer.addActor(sphereActor);\r\n } else {\r\n const pickedPoints = picker.getPickedPositions();\r\n const pickedPoint = pickedPoints[0]; // always a single point on a plane\r\n if (this.VERBOSE) console.log(`Picked: ${pickedPoint}`);\r\n // const sphere = vtkSphereSource.newInstance();\r\n // sphere.setCenter(pickedPoint);\r\n // sphere.setRadius(10);\r\n // const sphereMapper = vtkMapper.newInstance();\r\n // sphereMapper.setInputData(sphere.getOutputData());\r\n // const sphereActor = vtkActor.newInstance();\r\n // sphereActor.setMapper(sphereMapper);\r\n // sphereActor.getProperty().setColor(0.0, 1.0, 0.0);\r\n // this.renderer.addActor(sphereActor);\r\n\r\n // canvas coord\r\n const wPos = vtk_js_Sources_Rendering_Core_Coordinate__WEBPACK_IMPORTED_MODULE_18__[\"default\"].newInstance();\r\n wPos.setCoordinateSystemToWorld();\r\n wPos.setValue(...pickedPoint);\r\n const displayPosition = wPos.getComputedDisplayValue(this.renderer);\r\n\r\n // apply changes on state based on active tool\r\n Object(_strategies__WEBPACK_IMPORTED_MODULE_20__[\"applyStrategy\"])(state, displayPosition, pickedPoint, mode);\r\n\r\n if (this.VERBOSE) console.log(state);\r\n this._measurementState = state;\r\n }\r\n\r\n this.renderWindow.render();\r\n });\r\n }\r\n\r\n /**\r\n * Reset view\r\n */\r\n resetView() {\r\n let center = this.actor.getCenter();\r\n console.log(center);\r\n this.setCamera(center);\r\n this.renderWindow.render();\r\n }\r\n\r\n /**\r\n * on resize callback\r\n */\r\n resize() {\r\n // TODO: debounce for performance reasons?\r\n this._genericRenderWindow.resize();\r\n }\r\n\r\n /**\r\n * Destroy webgl content and release listeners\r\n */\r\n destroy() {\r\n // leave these comments for now\r\n\r\n // this.PGwidget.delete();\r\n // this.actor.getMapper().delete();\r\n // this.actor.delete();\r\n // this.renderWindow.getInteractor().delete();\r\n // this.renderWindow.delete();\r\n // this.renderer.delete();\r\n\r\n // this.renderer.delete();\r\n // this.renderer = null;\r\n // this.renderWindow.getInteractor().delete();\r\n // this.renderWindow.delete();\r\n // this.renderWindow = null;\r\n\r\n this.element = null;\r\n this._genericRenderWindow.delete();\r\n this._genericRenderWindow = null;\r\n this.actor.getMapper().delete();\r\n this.actor.delete();\r\n this.actor = null;\r\n\r\n if (this._planeActor) {\r\n this._planeActor.getMapper().delete();\r\n this._planeActor.delete();\r\n this._planeActor = null;\r\n }\r\n\r\n if (this.PGwidgetElement) {\r\n this.PGwidgetElement = null;\r\n this.PGwidget.delete();\r\n this.PGwidget = null;\r\n this.gaussians = null;\r\n }\r\n\r\n if (this._cropWidget) {\r\n this._cropWidget.delete();\r\n this._cropWidget = null;\r\n }\r\n }\r\n}\r\n\n\n//# sourceURL=webpack://diglettk/./src/vrView.js?"); - -/***/ }), - -/***/ "./src/vtk/vtkInteractorMPRSlice.js": -/*!******************************************!*\ - !*** ./src/vtk/vtkInteractorMPRSlice.js ***! - \******************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/MatrixBuilder */ \"./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Style_InteractorStyleManipulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Style/InteractorStyleManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js\");\n/**\n * Based on the vtk.js's MPR Slice interactor Style, but with improvements.\n */\n\n// Temporarily using a modified version of this interactor to deal with a camera subscription issue\n\n\n\n\n\n\n\n\n\n// ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction boundsToCorners(bounds) {\n return [\n [bounds[0], bounds[2], bounds[4]],\n [bounds[0], bounds[2], bounds[5]],\n [bounds[0], bounds[3], bounds[4]],\n [bounds[0], bounds[3], bounds[5]],\n [bounds[1], bounds[2], bounds[4]],\n [bounds[1], bounds[2], bounds[5]],\n [bounds[1], bounds[3], bounds[4]],\n [bounds[1], bounds[3], bounds[5]]\n ];\n}\n\n// ----------------------------------------------------------------------------\n\nfunction clamp(value, min, max) {\n if (value < min) {\n return min;\n }\n if (value > max) {\n return max;\n }\n return value;\n}\n\n// ----------------------------------------------------------------------------\n// vtkInteractorStyleMPRSlice methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyleMPRSlice(publicAPI, model) {\n // Set our className\n model.classHierarchy.push(\"vtkInteractorStyleMPRSlice\");\n\n model.trackballManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance(\n {\n button: 1\n }\n );\n model.panManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance({\n button: 1,\n shift: true\n });\n model.zoomManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_6__[\"default\"].newInstance({\n button: 3\n });\n\n model.scrollManipulator = vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance({\n scrollEnabled: true,\n dragEnabled: false\n });\n\n // cache for sliceRange\n const cache = {\n sliceNormal: [0, 0, 0],\n sliceRange: [0, 0],\n slicePosition: [0, 0, 0]\n };\n\n function updateScrollManipulator() {\n const range = publicAPI.getSliceRange();\n // console.log(\"updating the manipulator\", range);\n model.scrollManipulator.removeScrollListener();\n // The Scroll listener has min, max, step, and getValue setValue as params.\n // Internally, it checks that the result of the GET has changed, and only calls SET if it is new.\n model.scrollManipulator.setScrollListener(\n range[0],\n range[1],\n 1,\n publicAPI.getSlice,\n publicAPI.setSlice\n );\n }\n\n function setManipulators() {\n publicAPI.removeAllMouseManipulators();\n publicAPI.addMouseManipulator(model.trackballManipulator);\n publicAPI.addMouseManipulator(model.panManipulator);\n publicAPI.addMouseManipulator(model.zoomManipulator);\n publicAPI.addMouseManipulator(model.scrollManipulator);\n updateScrollManipulator();\n }\n\n let cameraSub = null;\n let interactorSub = null;\n const superSetInteractor = publicAPI.setInteractor;\n publicAPI.setInteractor = interactor => {\n superSetInteractor(interactor);\n if (cameraSub) {\n cameraSub.unsubscribe();\n cameraSub = null;\n }\n\n if (interactorSub) {\n interactorSub.unsubscribe();\n interactorSub = null;\n }\n\n if (interactor) {\n const renderer = interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n\n cameraSub = camera.onModified(() => {\n updateScrollManipulator();\n publicAPI.modified();\n });\n\n interactorSub = interactor.onAnimation(() => {\n const { slabThickness } = model;\n\n const dist = camera.getDistance();\n const near = dist - slabThickness / 2;\n const far = dist + slabThickness / 2;\n\n camera.setClippingRange(near, far);\n });\n }\n };\n\n publicAPI.handleMouseMove = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.handleMouseMove, () => {\n const renderer = model.interactor.getCurrentRenderer();\n const { slabThickness } = model;\n const camera = renderer.getActiveCamera();\n const dist = camera.getDistance();\n const near = dist - slabThickness / 2;\n const far = dist + slabThickness / 2;\n\n camera.setClippingRange(near, far);\n });\n\n const superSetVolumeMapper = publicAPI.setVolumeMapper;\n publicAPI.setVolumeMapper = mapper => {\n if (superSetVolumeMapper(mapper)) {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n if (mapper) {\n // prevent zoom manipulator from messing with our focal point\n // TODO: remove the zoom maninipulator instead?\n camera.setFreezeFocalPoint(true);\n\n // NOTE: Disabling this because it makes it more difficult to switch\n // interactor styles. Need to find a better way to do this!\n //publicAPI.setSliceNormal(...publicAPI.getSliceNormal());\n } else {\n camera.setFreezeFocalPoint(false);\n }\n }\n };\n\n publicAPI.getSlice = () => {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n const sliceNormal = publicAPI.getSliceNormal();\n\n // Get rotation matrix from normal to +X (since bounds is aligned to XYZ)\n const transform = vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n .buildFromDegree()\n .identity()\n .rotateFromDirections(sliceNormal, [1, 0, 0]);\n\n const fp = camera.getFocalPoint();\n transform.apply(fp);\n return fp[0];\n };\n\n publicAPI.setSlice = slice => {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n\n // console.log(\"slice\", slice);\n\n if (model.volumeMapper) {\n const range = publicAPI.getSliceRange();\n const bounds = model.volumeMapper.getBounds();\n\n const clampedSlice = clamp(slice, ...range);\n\n const center = [\n (bounds[0] + bounds[1]) / 2.0,\n (bounds[2] + bounds[3]) / 2.0,\n (bounds[4] + bounds[5]) / 2.0\n ];\n\n const distance = camera.getDistance();\n const dop = camera.getDirectionOfProjection();\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalize(dop);\n\n const midPoint = (range[1] + range[0]) / 2.0;\n const zeroPoint = [\n center[0] - dop[0] * midPoint,\n center[1] - dop[1] * midPoint,\n center[2] - dop[2] * midPoint\n ];\n const slicePoint = [\n zeroPoint[0] + dop[0] * clampedSlice,\n zeroPoint[1] + dop[1] * clampedSlice,\n zeroPoint[2] + dop[2] * clampedSlice\n ];\n\n const cameraPos = [\n slicePoint[0] - dop[0] * distance,\n slicePoint[1] - dop[1] * distance,\n slicePoint[2] - dop[2] * distance\n ];\n\n camera.setPosition(...cameraPos);\n camera.setFocalPoint(...slicePoint);\n\n // run Callback\n const onScroll = publicAPI.getOnScroll();\n if (onScroll) onScroll(slicePoint);\n }\n };\n\n publicAPI.getSliceRange = () => {\n if (model.volumeMapper) {\n const sliceNormal = publicAPI.getSliceNormal();\n\n if (\n sliceNormal[0] === cache.sliceNormal[0] &&\n sliceNormal[1] === cache.sliceNormal[1] &&\n sliceNormal[2] === cache.sliceNormal[2]\n ) {\n return cache.sliceRange;\n }\n\n const bounds = model.volumeMapper.getBounds();\n const points = boundsToCorners(bounds);\n\n // Get rotation matrix from normal to +X (since bounds is aligned to XYZ)\n const transform = vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n .buildFromDegree()\n .identity()\n .rotateFromDirections(sliceNormal, [1, 0, 0]);\n\n points.forEach(pt => transform.apply(pt));\n\n // range is now maximum X distance\n let minX = Infinity;\n let maxX = -Infinity;\n for (let i = 0; i < 8; i++) {\n const x = points[i][0];\n if (x > maxX) {\n maxX = x;\n }\n if (x < minX) {\n minX = x;\n }\n }\n\n cache.sliceNormal = sliceNormal;\n cache.sliceRange = [minX, maxX];\n return cache.sliceRange;\n }\n return [0, 0];\n };\n\n // Slice normal is just camera DOP\n publicAPI.getSliceNormal = () => {\n if (model.volumeMapper && model.interactor) {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n return camera.getDirectionOfProjection();\n }\n return [0, 0, 0];\n };\n\n // Thought this was a good idea, but no.\n // publicAPI.getSliceNormal = () => cache.sliceNormal;\n\n /**\n * Move the camera to the given slice normal and viewup direction. Viewup can be used to rotate the display of the image around the direction of view.\n *\n * TODO: setting the slice ALWAYS resets to the volume center, but we need to be able to rotate from an arbitrary position, AKA the intersection of all 3 slice planes.\n */\n // in world space\n publicAPI.setSliceNormal = (normal, viewUp = [0, 1, 0]) => {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n\n // Copy arguments to the model, so they can be GET-ed later\n model.sliceNormal = [...normal];\n model.viewUp = [...viewUp];\n\n //copy arguments for internal editing so we don't cause sideeffects\n const _normal = [...normal];\n const _viewUp = [...viewUp];\n\n if (model.volumeMapper) {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalize(_normal);\n let mapper = model.volumeMapper;\n // get the mapper if the model is actually the actor, not the mapper\n if (!model.volumeMapper.getInputData && model.volumeMapper.getMapper) {\n mapper = model.volumeMapper.getMapper();\n }\n let volumeCoordinateSpace = vec9toMat3(\n mapper.getInputData().getDirection()\n );\n // Transpose the volume's coordinate space to create a transformation matrix\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"default\"].transpose3x3(volumeCoordinateSpace, volumeCoordinateSpace);\n // Convert the provided normal into the volume's space\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"default\"].multiply3x3_vect3(volumeCoordinateSpace, _normal, _normal);\n\n let center = camera.getFocalPoint();\n let dist = camera.getDistance();\n let angle = camera.getViewAngle();\n\n if (Number.isNaN(dist) || dist === undefined) {\n // Default the volume center\n const bounds = model.volumeMapper.getBounds();\n // diagonal will be used as \"width\" of camera scene\n const diagonal = Math.sqrt(\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"default\"].distance2BetweenPoints(\n [bounds[0], bounds[2], bounds[4]],\n [bounds[1], bounds[3], bounds[5]]\n )\n );\n\n // center will be used as initial focal point\n center = [\n (bounds[0] + bounds[1]) / 2.0,\n (bounds[2] + bounds[3]) / 2.0,\n (bounds[4] + bounds[5]) / 2.0\n ];\n\n angle = 90;\n\n // distance from camera to focal point\n dist = diagonal / (2 * Math.tan((angle / 360) * Math.PI));\n }\n\n const cameraPos = [\n center[0] - _normal[0] * dist,\n center[1] - _normal[1] * dist,\n center[2] - _normal[2] * dist\n ];\n\n // set viewUp based on DOP rotation\n // const oldDop = camera.getDirectionOfProjection();\n // const transform = vtkMatrixBuilder\n // .buildFromDegree()\n // .identity()\n // .rotateFromDirections(oldDop, normal);\n // const viewUp = [0, 1, 0];\n // transform.apply(viewUp);\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"default\"].multiply3x3_vect3(volumeCoordinateSpace, _viewUp, _viewUp);\n\n const { slabThickness } = model;\n\n camera.setPosition(...cameraPos);\n camera.setDistance(dist);\n // should be set after pos and distance\n camera.setDirectionOfProjection(..._normal);\n camera.setViewUp(..._viewUp);\n camera.setViewAngle(angle);\n camera.setClippingRange(\n dist - slabThickness / 2,\n dist + slabThickness / 2\n );\n\n publicAPI.setCenterOfRotation(center);\n }\n };\n\n publicAPI.setSlabThickness = slabThickness => {\n model.slabThickness = slabThickness;\n\n // Update the camera clipping range if the slab\n // thickness property is changed\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n const dist = camera.getDistance();\n\n camera.setClippingRange(dist - slabThickness / 2, dist + slabThickness / 2);\n };\n\n setManipulators();\n}\n\n// ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\nconst DEFAULT_VALUES = {\n slabThickness: 0.1\n};\n\n// ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model, initialValues = {}) {\n Object.assign(model, DEFAULT_VALUES, initialValues);\n\n // Inheritance\n vtk_js_Sources_Interaction_Style_InteractorStyleManipulator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues);\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, [\"volumeMapper\", \"onScroll\"]);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, [\"slabThickness\", \"viewUp\"]);\n\n // Object specific methods\n vtkInteractorStyleMPRSlice(publicAPI, model);\n}\n\n// ----------------------------------------------------------------------------\n\nconst newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(\n extend,\n \"vtkInteractorStyleMPRSlice\"\n);\n\n// ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object.assign({ newInstance, extend }));\n\n// TODO: work with VTK to change the internal formatting of arrays.\nfunction vec9toMat3(vec9) {\n if (vec9.length !== 9) {\n throw Error(\"Array not length 9\");\n }\n //prettier-ignore\n return [\n [vec9[0], vec9[1], vec9[2]],\n [vec9[3], vec9[4], vec9[5]],\n [vec9[6], vec9[7], vec9[8]],\n ];\n}\n\n\n//# sourceURL=webpack://diglettk/./src/vtk/vtkInteractorMPRSlice.js?"); - -/***/ }), - -/***/ "./src/vtk/vtkInteractorStyleMPRCrosshairs.js": -/*!****************************************************!*\ - !*** ./src/vtk/vtkInteractorStyleMPRCrosshairs.js ***! - \****************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js\");\n/* harmony import */ var _vtkInteractorMPRSlice_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./vtkInteractorMPRSlice.js */ \"./src/vtk/vtkInteractorMPRSlice.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Coordinate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Coordinate */ \"./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/index.js\");\n/**\n * Extends the vtkInteractorStyleMPRSlice by adding a click handler for selecting a point in rendered space and converting to 3d space, then calling the registered callback to update other views to that same point.\n */\n\n\n\n\n\n\n\n\n\n\nconst { States } = vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n\n// ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\n// ----------------------------------------------------------------------------\n// vtkInteractorStyleMPRCrosshairs methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyleMPRCrosshairs(publicAPI, model) {\n // Set our className\n model.classHierarchy.push(\"vtkInteractorStyleMPRCrosshairs\");\n\n // set fixed manipulators\n model.trackballManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(\n {\n button: 1\n }\n );\n model.panManipulatorShift = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance(\n {\n button: 3,\n shift: true\n }\n );\n model.panManipulatorCtrl = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n button: 3,\n control: true\n });\n model.zoomManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n button: 3\n });\n model.scrollManipulator = vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance({\n scrollEnabled: true,\n dragEnabled: false\n });\n\n function updateScrollManipulator() {\n const range = publicAPI.getSliceRange();\n model.scrollManipulator.removeScrollListener();\n model.scrollManipulator.setScrollListener(\n range[0],\n range[1],\n 1,\n publicAPI.getSlice,\n publicAPI.setSlice\n );\n }\n\n function setManipulators() {\n publicAPI.removeAllMouseManipulators();\n publicAPI.addMouseManipulator(model.trackballManipulator);\n publicAPI.addMouseManipulator(model.panManipulatorShift);\n publicAPI.addMouseManipulator(model.panManipulatorCtrl);\n publicAPI.addMouseManipulator(model.zoomManipulator);\n publicAPI.addMouseManipulator(model.scrollManipulator);\n updateScrollManipulator();\n }\n\n function launchCallback(callData) {\n // console.log(callData);\n const pos = [callData.position.x, callData.position.y];\n const renderer = callData.pokedRenderer;\n const onClickCallback = publicAPI.getOnClickCallback();\n const dPos = vtk_js_Sources_Rendering_Core_Coordinate__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n dPos.setCoordinateSystemToDisplay();\n dPos.setValue(pos[0], pos[1], 0);\n const worldPos = dPos.getComputedWorldValue(renderer);\n\n if (worldPos.length) {\n onClickCallback({ worldPos, displayPos: pos });\n }\n\n publicAPI.invokeInteractionEvent({ type: \"InteractionEvent\" });\n }\n\n const superHandleMouseMove = publicAPI.handleMouseMove;\n publicAPI.handleMouseMove = callData => {\n if (model.state === States.IS_SLICE) {\n launchCallback(callData);\n }\n\n if (superHandleMouseMove) {\n superHandleMouseMove(callData);\n }\n };\n\n const superHandleLeftButtonPress = publicAPI.handleLeftButtonPress;\n publicAPI.handleLeftButtonPress = callData => {\n if (!callData.shiftKey && !callData.controlKey) {\n if (model.volumeMapper) {\n launchCallback(callData);\n publicAPI.startSlice();\n }\n } else if (superHandleLeftButtonPress) {\n superHandleLeftButtonPress(callData);\n }\n };\n\n const superSetVolumeMapper = publicAPI.setVolumeMapper;\n publicAPI.setVolumeMapper = mapper => {\n if (superSetVolumeMapper(mapper)) {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n if (mapper) {\n // prevent zoom manipulator from messing with our focal point\n camera.setFreezeFocalPoint(true);\n\n // NOTE: Disabling this because it makes it more difficult to switch\n // interactor styles. Need to find a better way to do this!\n //publicAPI.setSliceNormal(...publicAPI.getSliceNormal());\n } else {\n camera.setFreezeFocalPoint(false);\n }\n }\n };\n\n publicAPI.superHandleLeftButtonRelease = publicAPI.handleLeftButtonRelease;\n publicAPI.handleLeftButtonRelease = () => {\n switch (model.state) {\n case States.IS_SLICE:\n publicAPI.endSlice();\n break;\n\n default:\n publicAPI.superHandleLeftButtonRelease();\n break;\n }\n };\n\n setManipulators();\n}\n\n// ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\nconst DEFAULT_VALUES = {};\n\n// ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model, initialValues = {}) {\n Object.assign(model, DEFAULT_VALUES, initialValues);\n\n // Inheritance\n _vtkInteractorMPRSlice_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].extend(publicAPI, model, initialValues);\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, [\"volumeMapper\", \"onClickCallback\"]);\n\n // Object specific methods\n vtkInteractorStyleMPRCrosshairs(publicAPI, model);\n}\n\n// ----------------------------------------------------------------------------\n\nconst newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(\n extend,\n \"vtkInteractorStyleMPRCrosshairs\"\n);\n\n// ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object.assign({ newInstance, extend }));\n\n\n//# sourceURL=webpack://diglettk/./src/vtk/vtkInteractorStyleMPRCrosshairs.js?"); - -/***/ }), - -/***/ "./src/vtk/vtkInteractorStyleMPRPanZoom.js": -/*!*************************************************!*\ - !*** ./src/vtk/vtkInteractorStyleMPRPanZoom.js ***! - \*************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js\");\n/* harmony import */ var _vtkInteractorMPRSlice_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./vtkInteractorMPRSlice.js */ \"./src/vtk/vtkInteractorMPRSlice.js\");\n\n\n\n\n\n\n\n\nconst { States } = vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\n\n// ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\n// ----------------------------------------------------------------------------\n// vtkInteractorStyleMPRPan methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyleMPRPanZoom(publicAPI, model) {\n // Set our className\n model.classHierarchy.push(\"vtkInteractorStyleMPRPanZoom\");\n\n // set fixed manipulators\n model.panManipulatorShift = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(\n {\n button: 3,\n shift: true\n }\n );\n\n model.panManipulatorCtrl = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance({\n button: 3,\n control: true\n });\n\n // TODO: The inherited zoom manipulator does not appear to be working?\n model.zoomManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n button: 3\n });\n model.scrollManipulator = vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n scrollEnabled: true,\n dragEnabled: false\n });\n\n function updateScrollManipulator() {\n const range = publicAPI.getSliceRange();\n model.scrollManipulator.removeScrollListener();\n model.scrollManipulator.setScrollListener(\n range[0],\n range[1],\n 1,\n publicAPI.getSlice,\n publicAPI.setSlice\n );\n }\n\n function setManipulators() {\n publicAPI.removeAllMouseManipulators();\n publicAPI.addMouseManipulator(model.panManipulatorShift);\n publicAPI.addMouseManipulator(model.panManipulatorCtrl);\n publicAPI.addMouseManipulator(model.zoomManipulator);\n publicAPI.addMouseManipulator(model.scrollManipulator);\n publicAPI.addMouseManipulator(model.leftManipulator);\n updateScrollManipulator();\n }\n\n publicAPI.setLeftButton = tool => {\n if (tool == \"zoom\") {\n model.leftManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance(\n {\n button: 1\n }\n );\n } else if (tool == \"pan\") {\n model.leftManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(\n {\n button: 1\n }\n );\n } else {\n console.error(\"No tool found for\", tool);\n }\n setManipulators();\n };\n\n // set default left button manipulator\n if (!model.leftButtonTool) {\n model.leftButtonTool = \"pan\";\n }\n publicAPI.setLeftButton(model.leftButtonTool);\n\n setManipulators();\n\n // chain a callback to super interactor\n const superSetInteractor = publicAPI.setInteractor;\n publicAPI.setInteractor = interactor => {\n superSetInteractor(interactor);\n\n if (interactor === null) {\n // NOTE: check null AFTER calling super setInteractor\n return;\n }\n\n let interactionCb =\n model.leftButtonTool == \"pan\"\n ? publicAPI.getOnPanChanged()\n : publicAPI.getOnZoomChanged();\n interactor.onAnimation(interactionCb);\n };\n}\n\n// ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\nconst DEFAULT_VALUES = {\n wlStartPos: [0, 0],\n levelScale: 1\n};\n\n// ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model, initialValues = {}) {\n Object.assign(model, DEFAULT_VALUES, initialValues);\n\n // Inheritance\n _vtkInteractorMPRSlice_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].extend(publicAPI, model, initialValues);\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, [\n \"volumeMapper\",\n \"onPanChanged\",\n \"onZoomChanged\",\n \"levelScale\"\n ]);\n\n // Object specific methods\n vtkInteractorStyleMPRPanZoom(publicAPI, model);\n}\n\n// ----------------------------------------------------------------------------\n\nconst newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(\n extend,\n \"vtkInteractorStyleMPRPanZoom\"\n);\n\n// ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object.assign({ newInstance, extend }));\n\n\n//# sourceURL=webpack://diglettk/./src/vtk/vtkInteractorStyleMPRPanZoom.js?"); - -/***/ }), - -/***/ "./src/vtk/vtkInteractorStyleMPRWindowLevel.js": -/*!*****************************************************!*\ - !*** ./src/vtk/vtkInteractorStyleMPRWindowLevel.js ***! - \*****************************************************/ -/*! exports provided: toWindowLevel, toLowHighRange, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toWindowLevel\", function() { return toWindowLevel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toLowHighRange\", function() { return toLowHighRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js\");\n/* harmony import */ var _vtkInteractorMPRSlice_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./vtkInteractorMPRSlice.js */ \"./src/vtk/vtkInteractorMPRSlice.js\");\n\n\n\n\n\n\n\n\n\n// import {\n// toWindowLevel,\n// toLowHighRange\n// } from \"../lib/windowLevelRangeConverter\";\n\nfunction toWindowLevel(low, high) {\n const windowWidth = Math.abs(low - high);\n const windowCenter = low + windowWidth / 2;\n\n return { windowWidth, windowCenter };\n}\n\nfunction toLowHighRange(windowWidth, windowCenter) {\n const lower = windowCenter - windowWidth / 2.0;\n const upper = windowCenter + windowWidth / 2.0;\n\n return { lower, upper };\n}\n\nconst { States } = vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n\n// ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\n// ----------------------------------------------------------------------------\n// vtkInteractorStyleMPRWindowLevel methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyleMPRWindowLevel(publicAPI, model) {\n // Set our className\n model.classHierarchy.push(\"vtkInteractorStyleMPRWindowLevel\");\n\n model.trackballManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(\n {\n button: 1\n }\n );\n model.panManipulatorShift = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance(\n {\n button: 3,\n shift: true\n }\n );\n model.panManipulatorCtrl = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n button: 3,\n control: true\n });\n // TODO: The inherited zoom manipulator does not appear to be working?\n model.zoomManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n button: 3\n });\n model.scrollManipulator = vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance({\n scrollEnabled: true,\n dragEnabled: false\n });\n\n function updateScrollManipulator() {\n const range = publicAPI.getSliceRange();\n model.scrollManipulator.removeScrollListener();\n model.scrollManipulator.setScrollListener(\n range[0],\n range[1],\n 1,\n publicAPI.getSlice,\n publicAPI.setSlice\n );\n }\n\n function setManipulators() {\n publicAPI.removeAllMouseManipulators();\n publicAPI.addMouseManipulator(model.trackballManipulator);\n publicAPI.addMouseManipulator(model.panManipulatorShift);\n publicAPI.addMouseManipulator(model.panManipulatorCtrl);\n publicAPI.addMouseManipulator(model.zoomManipulator);\n publicAPI.addMouseManipulator(model.scrollManipulator);\n updateScrollManipulator();\n }\n\n const superHandleMouseMove = publicAPI.handleMouseMove;\n publicAPI.handleMouseMove = callData => {\n const pos = [callData.position.x, callData.position.y];\n\n if (model.state === States.IS_WINDOW_LEVEL) {\n publicAPI.windowLevelFromMouse(pos);\n publicAPI.invokeInteractionEvent({ type: \"InteractionEvent\" });\n }\n\n if (superHandleMouseMove) {\n superHandleMouseMove(callData);\n }\n };\n\n const superSetVolumeMapper = publicAPI.setVolumeMapper;\n publicAPI.setVolumeMapper = mapper => {\n if (superSetVolumeMapper(mapper)) {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n if (mapper) {\n // prevent zoom manipulator from messing with our focal point\n camera.setFreezeFocalPoint(true);\n\n // NOTE: Disabling this because it makes it more difficult to switch\n // interactor styles. Need to find a better way to do this!\n // publicAPI.setSliceNormal(...publicAPI.getSliceNormal());\n } else {\n camera.setFreezeFocalPoint(false);\n }\n }\n };\n\n publicAPI.windowLevelFromMouse = ([mx, my]) => {\n const range = model.volumeMapper\n .getMapper()\n .getInputData()\n .getPointData()\n .getScalars()\n .getRange();\n const imageDynamicRange = range[1] - range[0];\n const multiplier = (imageDynamicRange / 1024) * model.levelScale;\n\n const dx = (mx - model.wlStartPos[0]) * multiplier;\n // scale the center at a smaller scale\n const dy = (my - model.wlStartPos[1]) * multiplier * 0.5;\n\n let { windowWidth, windowCenter } = publicAPI.getWindowLevel();\n\n windowWidth = Math.max(1, Math.round(windowWidth + dx));\n windowCenter = Math.round(windowCenter + dy);\n\n publicAPI.setWindowLevel(windowWidth, windowCenter);\n\n model.wlStartPos = [mx, my];\n\n const onLevelsChanged = publicAPI.getOnLevelsChanged();\n if (onLevelsChanged) {\n onLevelsChanged({ windowCenter, windowWidth });\n }\n };\n\n publicAPI.getWindowLevel = () => {\n const range = model.volumeMapper\n .getProperty()\n .getRGBTransferFunction(0)\n .getMappingRange()\n .slice();\n return toWindowLevel(...range);\n };\n publicAPI.setWindowLevel = (windowWidth, windowCenter) => {\n const lowHigh = toLowHighRange(windowWidth, windowCenter);\n\n model.volumeMapper\n .getProperty()\n .getRGBTransferFunction(0)\n .setMappingRange(lowHigh.lower, lowHigh.upper);\n };\n\n const superHandleLeftButtonPress = publicAPI.handleLeftButtonPress;\n publicAPI.handleLeftButtonPress = callData => {\n model.wlStartPos = [callData.position.x, callData.position.y];\n if (!callData.shiftKey && !callData.controlKey) {\n publicAPI.startWindowLevel();\n } else if (superHandleLeftButtonPress) {\n superHandleLeftButtonPress(callData);\n }\n };\n\n publicAPI.superHandleLeftButtonRelease = publicAPI.handleLeftButtonRelease;\n publicAPI.handleLeftButtonRelease = () => {\n switch (model.state) {\n case States.IS_WINDOW_LEVEL:\n publicAPI.endWindowLevel();\n break;\n\n default:\n publicAPI.superHandleLeftButtonRelease();\n break;\n }\n };\n\n setManipulators();\n}\n\n// ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\nconst DEFAULT_VALUES = {\n wlStartPos: [0, 0],\n levelScale: 1\n};\n\n// ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model, initialValues = {}) {\n Object.assign(model, DEFAULT_VALUES, initialValues);\n\n // Inheritance\n _vtkInteractorMPRSlice_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].extend(publicAPI, model, initialValues);\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, [\n \"volumeMapper\",\n \"onLevelsChanged\",\n \"levelScale\"\n ]);\n\n // Object specific methods\n vtkInteractorStyleMPRWindowLevel(publicAPI, model);\n}\n\n// ----------------------------------------------------------------------------\n\nconst newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(\n extend,\n \"vtkInteractorStyleMPRWindowLevel\"\n);\n\n// ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object.assign({ newInstance, extend }));\n\n\n//# sourceURL=webpack://diglettk/./src/vtk/vtkInteractorStyleMPRWindowLevel.js?"); - -/***/ }), - -/***/ 0: -/*!************************!*\ - !*** crypto (ignored) ***! - \************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("/* (ignored) */\n\n//# sourceURL=webpack://diglettk/crypto_(ignored)?"); - -/***/ }) - -/******/ }); -}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.diglettk=t():e.diglettk=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=29)}([function(e,t,n){"use strict";(function(e){n.d(t,"k",function(){return b}),n.d(t,"l",function(){return T}),n.d(t,"m",function(){return C}),n.d(t,"e",function(){return w}),n.d(t,"f",function(){return x}),n.d(t,"g",function(){return R}),n.d(t,"b",function(){return E}),n.d(t,"h",function(){return L}),n.d(t,"i",function(){return N}),n.d(t,"c",function(){return B}),n.d(t,"j",function(){return F}),n.d(t,"d",function(){return _});var r=n(1);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e){"@babel/helpers - typeof";return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?t-1:0),r=1;r1?n-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};M(t);var n=[];function r(e){n[e]=null}return Number.isInteger(t.mtime)||(t.mtime=++g),t.classHierarchy=["vtkObject"],e.isDeleted=function(){return!!t.deleted},e.modified=function(r){t.deleted?T("instance deleted - cannot call any method"):r&&r0&&void 0!==arguments[0]?arguments[0]:0;return t.classHierarchy[t.classHierarchy.length-1-e]},e.set=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1;return Object.keys(n).forEach(function(i){var s=a?null:e["set".concat(O(i))];s&&Array.isArray(n[i])&&s.length>1?o=s.apply(void 0,u(n[i]))||o:s?o=s(n[i])||o:(-1!==["mtime"].indexOf(i)||r||C("Warning: Set value to model directly ".concat(i,", ").concat(n[i])),t[i]=n[i],o=!0)}),o},e.get=function(){for(var e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]&&arguments[1];if(n.getClassName()!==e.getClassName())throw new Error("Cannot ShallowCopy ".concat(n.getClassName()," into ").concat(e.getClassName()));var a=n.get(),o=Object.keys(t).sort();Object.keys(a).sort().forEach(function(e){var n=o.indexOf(e);-1===n?r&&b("add ".concat(e," in shallowCopy")):o.splice(n,1),t[e]=a[e]}),o.length&&r&&b("Untouched keys: ".concat(o.join(", "))),e.modified()},e}function E(e,t,n){n.forEach(function(n){"object"===o(n)?e["get".concat(O(n.name))]=function(){return t[n.name]}:e["get".concat(O(n))]=function(){return t[n]}})}P.Float32Array=Float32Array,P.Float64Array=Float64Array,P.Uint8Array=Uint8Array,P.Int8Array=Int8Array,P.Uint16Array=Uint16Array,P.Int16Array=Int16Array,P.Uint32Array=Uint32Array,P.Int32Array=Int32Array,P.Uint8ClampedArray=Uint8ClampedArray;var D={enum:function(e,t,n){return function(r){if("string"==typeof r){if(void 0!==n.enum[r])return t[n.name]!==n.enum[r]&&(t[n.name]=n.enum[r],e.modified(),!0);throw T("Set Enum with invalid argument ".concat(n,", ").concat(r)),new RangeError("Set Enum with invalid string argument")}if("number"==typeof r){if(t[n.name]!==r){if(-1!==Object.keys(n.enum).map(function(e){return n.enum[e]}).indexOf(r))return t[n.name]=r,e.modified(),!0;throw T("Set Enum outside numeric range ".concat(n,", ").concat(r)),new RangeError("Set Enum outside numeric range")}return!1}throw T("Set Enum with invalid argument (String/Number) ".concat(n,", ").concat(r)),new TypeError("Set Enum with invalid argument (String/Number)")}}};function V(e){if("object"===o(e)){var t=D[e.type];if(t)return function(n,r){return t(n,r,e)};throw T("No setter for field ".concat(e)),new TypeError("No setter for field")}return function(t,n){return function(r){return n.deleted?(T("instance deleted - cannot call any method"),!1):n[e]!==r&&(n[e]=r,t.modified(),!0)}}}function L(e,t,n){n.forEach(function(n){"object"===o(n)?e["set".concat(O(n.name))]=V(n)(e,t):e["set".concat(O(n))]=V(n)(e,t)})}function N(e,t,n){E(e,t,n),L(e,t,n)}function B(e,t,n){n.forEach(function(n){e["get".concat(O(n))]=function(){return[].concat(t[n])},e["get".concat(O(n),"ByReference")]=function(){return t[n]}})}function k(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;n.forEach(function(n){e["set".concat(O(n))]=function(){if(t.deleted)return T("instance deleted - cannot call any method"),!1;for(var o=arguments.length,i=new Array(o),s=0;s4&&void 0!==arguments[4]?arguments[4]:void 0;B(e,t,n),k(e,t,n,r,a)}var G=Symbol("Event abort");function _(e,t){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={};return e(n,{},t),Object.freeze(n)};return t&&r.a.register(t,n),n}function U(e){return e&&e.isA&&e.isA("vtkObject")}function j(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.keystore=Object.assign(t.keystore||{},n),e.setKey=function(e,n){t.keystore[e]=n},e.getKey=function(e){return t.keystore[e]},e.getAllKeys=function(){return Object.keys(t.keystore)},e.deleteKey=function(e){return delete t.keystore[e]},e.clearKeystore=function(){return e.getAllKeys().forEach(function(e){return delete t.keystore[e]})}}var W=1,z="__root__";var H=10,K=40,X=800;t.a={algo:function(e,t,n,a){function o(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.deleted?T("instance deleted - cannot call any method"):r>=t.numberOfInputs?T("algorithm ".concat(e.getClassName()," only has ").concat(t.numberOfInputs," input ports. To add more input ports, use addInputData()")):(t.inputData[r]!==n||t.inputConnection[r])&&(t.inputData[r]=n,t.inputConnection[r]=null,e.modified&&e.modified())}function i(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t.deleted)T("instance deleted - cannot call any method");else{if(r>=t.numberOfInputs){var a="algorithm ".concat(e.getClassName()," only has ");return a+="".concat(t.numberOfInputs),void T(a+=" input ports. To add more input ports, use addInputConnection()")}t.inputData[r]=null,t.inputConnection[r]=n}}function s(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.deleted?(T("instance deleted - cannot call any method"),null):(e.shouldUpdate()&&e.update(),t.output[n])}if(t.inputData?t.inputData=t.inputData.map(r.a):t.inputData=[],t.inputConnection?t.inputConnection=t.inputConnection.map(r.a):t.inputConnection=[],t.output?t.output=t.output.map(r.a):t.output=[],t.inputArrayToProcess?t.inputArrayToProcess=t.inputArrayToProcess.map(r.a):t.inputArrayToProcess=[],t.numberOfInputs=n,e.shouldUpdate=function(){for(var n=e.getMTime(),r=a,o=1/0;r--;){if(!t.output[r])return!0;var i=t.output[r].getMTime();if(io)return!0;return!1},t.numberOfInputs){for(var l=t.numberOfInputs;l--;)t.inputData.push(null),t.inputConnection.push(null);e.setInputData=o,e.setInputConnection=i,e.addInputData=function(e){t.deleted?T("instance deleted - cannot call any method"):(t.numberOfInputs++,o(e,t.numberOfInputs-1))},e.addInputConnection=function(e){t.deleted?T("instance deleted - cannot call any method"):(t.numberOfInputs++,i(e,t.numberOfInputs-1))},e.getInputData=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.inputConnection[e]&&(t.inputData[e]=t.inputConnection[e]()),t.inputData[e]},e.getInputConnection=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.inputConnection[e]}}a&&(e.getOutputData=s,e.getOutputPort=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=function(){return s(t)};return n.filter=e,n}),e.update=function(){var n=[];if(t.numberOfInputs)for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:"Scalars";t.inputArrayToProcess.length1&&void 0!==arguments[1]?arguments[1]:0;if(!e.apply)return console.error("Invalid callback for event ".concat(n)),null;if(t.deleted)return T("instance deleted - cannot call any method"),null;var o=i++;return r.push([o,e,a]),r.sort(function(e,t){return t[2]-e[2]}),function(e){return Object.freeze({unsubscribe:function(){s(e)}})}(o)},e.delete=function(){o(),r.forEach(function(e){return s(a(e,1)[0])})}},EVENT_ABORT:G,formatBytesToProperUnit:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,r=["TB","GB","MB","KB"],a=Number(e),o="B";a>n;)a/=n,o=r.pop();return"".concat(a.toFixed(t)," ").concat(o)},formatNumbersWithThousandSeparator:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",n=[],r=e;r>1e3;)n.push("000".concat(r%1e3).slice(-3)),r=Math.floor(r/1e3);return r>0&&n.push(r),n.reverse(),n.join(t)},get:E,getArray:B,getCurrentGlobalMTime:function(){return g},getStateArrayMapFunc:A,isVtkObject:U,keystore:j,newInstance:_,newTypedArray:w,newTypedArrayFrom:x,normalizeWheel:function(e){var t=0,n=0,r=0,a=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=t*H,a=n*H,"deltaY"in e&&(a=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||a)&&e.deltaMode&&(1===e.deltaMode?(r*=K,a*=K):(r*=X,a*=X)),r&&!t&&(t=r<1?-1:1),a&&!n&&(n=a<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:a}},obj:R,proxy:function(e,t){j(e,t);var n=e.delete;t.proxyId="".concat(W++),t.ui=JSON.parse(JSON.stringify(t.ui||[])),E(e,t,["proxyId","proxyGroup","proxyName"]),N(e,t,["proxyManager"]);var r={},a={};function o(e,t){a[t]||(a[t]=[]);for(var n=a[t],i=0;i0&&void 0!==arguments[0]?arguments[0]:z,r=[],o=t.proxyId,s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z;return a[e]}(n)||[],l=0;l1&&void 0!==arguments[1]&&arguments[1];if(t.propertyLinkMap[e])return t.propertyLinkMap[e];var r=null,a=[],o=0,i=!1;function s(n){var s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(i)return null;var u=[],c=null;for(o=a.length;o--;){var d=a[o];d.instance===n?c=d:u.push(d)}if(!c)return null;var f=c.instance["get".concat(O(c.propertyName))]();if(!function(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],i=n.onModified(s),c=a[0];return a.push({instance:n,propertyName:r,subscription:i}),o&&(t.propertyLinkMap[e].persistent&&void 0!==t.propertyLinkMap[e].value?n.set(l({},r,t.propertyLinkMap[e].value)):c&&s(c.instance,!0)),{unsubscribe:function(){return u(n,r)}}},unbind:u,unsubscribe:function(){for(;a.length;)a.pop().subscription.unsubscribe()},persistent:n};return t.propertyLinkMap[e]=c,c},e.listPropertyNames=function(){return i().map(function(e){return e.name})},e.getPropertyByName=function(e){return i().find(function(t){return t.name===e})},e.getPropertyDomainByName=function(e){return(r[e]||{}).domain},e.getProxySection=function(){return{id:t.proxyId,name:t.proxyGroup,ui:t.ui,properties:i()}},e.delete=function(){for(var r=Object.keys(t.propertyLinkMap),a=r.length;a--;)t.propertyLinkMap[r[a]].unsubscribe();Object.keys(t.propertyLinkSubscribers).forEach(e.gcPropertyLinks),n()},I(function(){if(t.links)for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.this=e;for(var a=Object.keys(r),o=a.length,i=function(){var i=a[o];t[i]=r[i];var s=n[i];e["set".concat(O(i))]=function(n){n!==t[i]&&(t[i]=n,function(e){for(var n=Object.keys(e),r=n.length;r--;){var a=n[r];t[a].set(e[a])}}(s[n]),e.modified())}};o--;)i();a.length&&E(e,t,a)},safeArrays:M,set:L,setArray:k,setGet:N,setGetArray:F,setImmediate:I,setLoggerFunction:function(e,t){y[e]&&(y[e]=t||h)},throttle:function(e,t){var n=!1,r=null;function a(){n=!1,null!==r&&(o.apply(void 0,u(r)),r=null)}function o(){for(var o=arguments.length,i=new Array(o),s=0;s2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(U(t)){if(a.indexOf(t)>=0)return r;a.push(t);var o=n(t);void 0!==o&&r.push(o);var i=t.get();Object.keys(i).forEach(function(t){var o=i[t];Array.isArray(o)?o.forEach(function(t){e(t,n,r,a)}):e(o,n,r,a)})}return r},TYPED_ARRAYS:P,uncapitalize:function(e){return e.charAt(0).toLowerCase()+e.slice(1)},VOID:m,vtkDebugMacro:b,vtkErrorMacro:T,vtkInfoMacro:function(){y.info.apply(y,arguments)},vtkLogMacro:function(){y.log.apply(y,arguments)},vtkOnceErrorMacro:function(e){S[e]||(y.error(e),S[e]=!0)},vtkWarningMacro:C}}).call(this,n(7))},function(e,t,n){"use strict";(function(e){function r(e){"@babel/helpers - typeof";return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",function(){return s});var i={vtkObject:function(){return null}};function s(t){if(null===t||void 0===t)return t;if(t.isA)return t;if(!t.vtkClass)return e.console&&e.console.error&&e.console.error("Invalid VTK object"),null;var n=i[t.vtkClass];if(!n)return e.console&&e.console.error&&e.console.error("No vtk class found for Object of type ".concat(t.vtkClass)),null;var l=function(e){for(var t=1;t 0\nuniform float vSpecularPower;\nuniform float vAmbient;\nuniform float vDiffuse;\nuniform float vSpecular;\n//VTK::Light::Dec\n#endif\n\n// possibly define vtkGradientOpacityOn\n//VTK::GradientOpacityOn\n#ifdef vtkGradientOpacityOn\nuniform float goscale0;\nuniform float goshift0;\nuniform float gomin0;\nuniform float gomax0;\n#if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\nuniform float goscale1;\nuniform float goshift1;\nuniform float gomin1;\nuniform float gomax1;\n#if vtkNumComponents >= 3\nuniform float goscale2;\nuniform float goshift2;\nuniform float gomin2;\nuniform float gomax2;\n#endif\n#if vtkNumComponents >= 4\nuniform float goscale3;\nuniform float goshift3;\nuniform float gomin3;\nuniform float gomax3;\n#endif\n#endif\n#endif\n\n// if you want to see the raw tiled\n// data in webgl1 uncomment the following line\n// #define debugtile\n\n// camera values\nuniform float camThick;\nuniform float camNear;\nuniform float camFar;\nuniform int cameraParallel;\n\n// values describing the volume geometry\nuniform vec3 vOriginVC;\nuniform vec3 vSpacing;\nuniform ivec3 volumeDimensions; // 3d texture dimensions\nuniform vec3 vPlaneNormal0;\nuniform float vPlaneDistance0;\nuniform vec3 vPlaneNormal1;\nuniform float vPlaneDistance1;\nuniform vec3 vPlaneNormal2;\nuniform float vPlaneDistance2;\nuniform vec3 vPlaneNormal3;\nuniform float vPlaneDistance3;\nuniform vec3 vPlaneNormal4;\nuniform float vPlaneDistance4;\nuniform vec3 vPlaneNormal5;\nuniform float vPlaneDistance5;\n\n//VTK::ClipPlane::Dec\n\n// opacity and color textures\nuniform sampler2D otexture;\nuniform float oshift0;\nuniform float oscale0;\nuniform sampler2D ctexture;\nuniform float cshift0;\nuniform float cscale0;\n\n// jitter texture\nuniform sampler2D jtexture;\n\n// some 3D texture values\nuniform float sampleDistance;\nuniform vec3 vVCToIJK;\n\n// the heights defined below are the locations\n// for the up to four components of the tfuns\n// the tfuns have a height of 2XnumComps pixels so the\n// values are computed to hit the middle of the two rows\n// for that component\n#ifdef vtkIndependentComponentsOn\n#if vtkNumComponents == 2\nuniform float mix0;\nuniform float mix1;\n#define height0 0.25\n#define height1 0.75\n#endif\n#if vtkNumComponents == 3\nuniform float mix0;\nuniform float mix1;\nuniform float mix2;\n#define height0 0.17\n#define height1 0.5\n#define height2 0.83\n#endif\n#if vtkNumComponents == 4\nuniform float mix0;\nuniform float mix1;\nuniform float mix2;\nuniform float mix3;\n#define height0 0.125\n#define height1 0.375\n#define height2 0.625\n#define height3 0.875\n#endif\n#endif\n\n#if vtkNumComponents >= 2\nuniform float oshift1;\nuniform float oscale1;\nuniform float cshift1;\nuniform float cscale1;\n#endif\n#if vtkNumComponents >= 3\nuniform float oshift2;\nuniform float oscale2;\nuniform float cshift2;\nuniform float cscale2;\n#endif\n#if vtkNumComponents >= 4\nuniform float oshift3;\nuniform float oscale3;\nuniform float cshift3;\nuniform float cscale3;\n#endif\n\n// declaration for intermixed geometry\n//VTK::ZBuffer::Dec\n\n// Lighting values\n//VTK::Light::Dec\n\n//=======================================================================\n// Webgl2 specific version of functions\n#if __VERSION__ == 300\n\nuniform highp sampler3D texture1;\n\nvec4 getTextureValue(vec3 pos)\n{\n vec4 tmp = texture(texture1, pos);\n#if vtkNumComponents == 1\n tmp.a = tmp.r;\n#endif\n#if vtkNumComponents == 2\n tmp.a = tmp.g;\n#endif\n#if vtkNumComponents == 3\n tmp.a = length(tmp.rgb);\n#endif\n return tmp;\n}\n\n//=======================================================================\n// WebGL1 specific version of functions\n#else\n\nuniform sampler2D texture1;\n\nuniform float texWidth;\nuniform float texHeight;\nuniform int xreps;\nuniform int xstride;\nuniform int ystride;\n\n// if computing triliear values from multiple z slices\n#ifdef vtkTriliearOn\nvec4 getTextureValue(vec3 ijk)\n{\n float zoff = 1.0/float(volumeDimensions.z);\n vec4 val1 = getOneTextureValue(ijk);\n vec4 val2 = getOneTextureValue(vec3(ijk.xy, ijk.z + zoff));\n\n float indexZ = float(volumeDimensions)*ijk.z;\n float zmix = indexZ - floor(indexZ);\n\n return mix(val1, val2, zmix);\n}\n\nvec4 getOneTextureValue(vec3 ijk)\n#else // nearest or fast linear\nvec4 getTextureValue(vec3 ijk)\n#endif\n{\n vec3 tdims = vec3(volumeDimensions);\n\n#ifdef debugtile\n vec2 tpos = vec2(ijk.x, ijk.y);\n vec4 tmp = texture2D(texture1, tpos);\n tmp.a = 1.0;\n\n#else\n int z = int(ijk.z * tdims.z);\n int yz = z / xreps;\n int xz = z - yz*xreps;\n\n int tileWidth = volumeDimensions.x/xstride;\n int tileHeight = volumeDimensions.y/ystride;\n\n xz *= tileWidth;\n yz *= tileHeight;\n\n float ni = float(xz) + (ijk.x*float(tileWidth));\n float nj = float(yz) + (ijk.y*float(tileHeight));\n\n vec2 tpos = vec2(ni/texWidth, nj/texHeight);\n\n vec4 tmp = texture2D(texture1, tpos);\n\n#if vtkNumComponents == 1\n tmp.a = tmp.r;\n#endif\n#if vtkNumComponents == 2\n tmp.g = tmp.a;\n#endif\n#if vtkNumComponents == 3\n tmp.a = length(tmp.rgb);\n#endif\n#endif\n\n return tmp;\n}\n\n// End of Webgl1 specific code\n//=======================================================================\n#endif\n\n//=======================================================================\n// compute the normal and gradient magnitude for a position\nvec4 computeNormal(vec3 pos, float scalar, vec3 tstep)\n{\n vec4 result;\n\n result.x = getTextureValue(pos + vec3(tstep.x, 0.0, 0.0)).a - scalar;\n result.y = getTextureValue(pos + vec3(0.0, tstep.y, 0.0)).a - scalar;\n result.z = getTextureValue(pos + vec3(0.0, 0.0, tstep.z)).a - scalar;\n\n // divide by spacing\n result.xyz /= vSpacing;\n\n result.w = length(result.xyz);\n\n // rotate to View Coords\n result.xyz =\n result.x * vPlaneNormal0 +\n result.y * vPlaneNormal2 +\n result.z * vPlaneNormal4;\n\n if (result.w > 0.0)\n {\n result.xyz /= result.w;\n }\n return result;\n}\n\n#ifdef vtkImageLabelOutlineOn\nvec3 fragCoordToIndexSpace(vec4 fragCoord) {\n vec4 pcPos = vec4(\n (fragCoord.x / vpWidth - 0.5) * 2.0,\n (fragCoord.y / vpHeight - 0.5) * 2.0,\n (fragCoord.z - 0.5) * 2.0,\n 1.0);\n\n vec4 worldCoord = PCWCMatrix * pcPos;\n vec4 vertex = (worldCoord/worldCoord.w);\n\n return (vWCtoIDX * vertex).xyz / vec3(volumeDimensions);\n}\n#endif\n\n//=======================================================================\n// compute the normals and gradient magnitudes for a position\n// for independent components\nmat4 computeMat4Normal(vec3 pos, vec4 tValue, vec3 tstep)\n{\n mat4 result;\n vec4 distX = getTextureValue(pos + vec3(tstep.x, 0.0, 0.0)) - tValue;\n vec4 distY = getTextureValue(pos + vec3(0.0, tstep.y, 0.0)) - tValue;\n vec4 distZ = getTextureValue(pos + vec3(0.0, 0.0, tstep.z)) - tValue;\n\n // divide by spacing\n distX /= vSpacing.x;\n distY /= vSpacing.y;\n distZ /= vSpacing.z;\n\n mat3 rot;\n rot[0] = vPlaneNormal0;\n rot[1] = vPlaneNormal2;\n rot[2] = vPlaneNormal4;\n\n#if !defined(vtkComponent0Proportional)\n result[0].xyz = vec3(distX.r, distY.r, distZ.r);\n result[0].a = length(result[0].xyz);\n result[0].xyz *= rot;\n if (result[0].w > 0.0)\n {\n result[0].xyz /= result[0].w;\n }\n#endif\n\n// optionally compute the 2nd component\n#if vtkNumComponents >= 2 && !defined(vtkComponent1Proportional)\n result[1].xyz = vec3(distX.g, distY.g, distZ.g);\n result[1].a = length(result[1].xyz);\n result[1].xyz *= rot;\n if (result[1].w > 0.0)\n {\n result[1].xyz /= result[1].w;\n }\n#endif\n\n// optionally compute the 3rd component\n#if vtkNumComponents >= 3 && !defined(vtkComponent2Proportional)\n result[2].xyz = vec3(distX.b, distY.b, distZ.b);\n result[2].a = length(result[2].xyz);\n result[2].xyz *= rot;\n if (result[2].w > 0.0)\n {\n result[2].xyz /= result[2].w;\n }\n#endif\n\n// optionally compute the 4th component\n#if vtkNumComponents >= 4 && !defined(vtkComponent3Proportional)\n result[3].xyz = vec3(distX.a, distY.a, distZ.a);\n result[3].a = length(result[3].xyz);\n result[3].xyz *= rot;\n if (result[3].w > 0.0)\n {\n result[3].xyz /= result[3].w;\n }\n#endif\n\n return result;\n}\n\n//=======================================================================\n// Given a normal compute the gradient opacity factors\n//\nfloat computeGradientOpacityFactor(\n vec4 normal, float goscale, float goshift, float gomin, float gomax)\n{\n#if defined(vtkGradientOpacityOn)\n return clamp(normal.a*goscale + goshift, gomin, gomax);\n#else\n return 1.0;\n#endif\n}\n\n#if vtkLightComplexity > 0\nvoid applyLighting(inout vec3 tColor, vec4 normal)\n{\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n //VTK::Light::Impl\n tColor.rgb = tColor.rgb*(diffuse*vDiffuse + vAmbient) + specular*vSpecular;\n}\n#endif\n\n//=======================================================================\n// Given a texture value compute the color and opacity\n//\nvec4 getColorForValue(vec4 tValue, vec3 posIS, vec3 tstep)\n{\n#ifdef vtkImageLabelOutlineOn\n vec3 centerPosIS = fragCoordToIndexSpace(gl_FragCoord); // pos in texture space\n vec4 centerValue = getTextureValue(centerPosIS);\n bool pixelOnBorder = false;\n vec4 tColor = texture2D(ctexture, vec2(centerValue.r * cscale0 + cshift0, 0.5));\n\n // Get alpha of segment from opacity function.\n tColor.a = texture2D(otexture, vec2(centerValue.r * oscale0 + oshift0, 0.5)).r;\n\n // Only perform outline check on fragments rendering voxels that aren't invisible.\n // Saves a bunch of needless checks on the background.\n // TODO define epsilon when building shader?\n if (float(tColor.a) > 0.01) {\n for (int i = -outlineThickness; i <= outlineThickness; i++) {\n for (int j = -outlineThickness; j <= outlineThickness; j++) {\n if (i == 0 || j == 0) {\n continue;\n }\n\n vec4 neighborPixelCoord = vec4(gl_FragCoord.x + float(i),\n gl_FragCoord.y + float(j),\n gl_FragCoord.z, gl_FragCoord.w);\n\n vec3 neighborPosIS = fragCoordToIndexSpace(neighborPixelCoord);\n vec4 value = getTextureValue(neighborPosIS);\n\n // If any of my neighbours are not the same value as I\n // am, this means I am on the border of the segment.\n // We can break the loops\n if (any(notEqual(value, centerValue))) {\n pixelOnBorder = true;\n break;\n }\n }\n\n if (pixelOnBorder == true) {\n break;\n }\n }\n\n // If I am on the border, I am displayed at full opacity\n if (pixelOnBorder == true) {\n tColor.a = 1.0;\n }\n }\n\n#else\n // compute the normal and gradient magnitude if needed\n // We compute it as a vec4 if possible otherwise a mat4\n //\n vec4 goFactor = vec4(1.0,1.0,1.0,1.0);\n\n // compute the normal vectors as needed\n #if (vtkLightComplexity > 0) || defined(vtkGradientOpacityOn)\n #if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\n mat4 normalMat = computeMat4Normal(posIS, tValue, tstep);\n #if !defined(vtkComponent0Proportional)\n vec4 normal0 = normalMat[0];\n #endif\n #if !defined(vtkComponent1Proportional)\n vec4 normal1 = normalMat[1];\n #endif\n #if vtkNumComponents > 2\n #if !defined(vtkComponent2Proportional)\n vec4 normal2 = normalMat[2];\n #endif\n #if vtkNumComponents > 3\n #if !defined(vtkComponent3Proportional)\n vec4 normal3 = normalMat[3];\n #endif\n #endif\n #endif\n #else\n vec4 normal0 = computeNormal(posIS, tValue.a, tstep);\n #endif\n #endif\n\n // compute gradient opacity factors as needed\n #if defined(vtkGradientOpacityOn)\n #if !defined(vtkComponent0Proportional)\n goFactor.x =\n computeGradientOpacityFactor(normal0, goscale0, goshift0, gomin0, gomax0);\n #endif\n #if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\n #if !defined(vtkComponent1Proportional)\n goFactor.y =\n computeGradientOpacityFactor(normal1, goscale1, goshift1, gomin1, gomax1);\n #endif\n #if vtkNumComponents > 2\n #if !defined(vtkComponent2Proportional)\n goFactor.z =\n computeGradientOpacityFactor(normal2, goscale2, goshift2, gomin2, gomax2);\n #endif\n #if vtkNumComponents > 3\n #if !defined(vtkComponent3Proportional)\n goFactor.w =\n computeGradientOpacityFactor(normal3, goscale3, goshift3, gomin3, gomax3);\n #endif\n #endif\n #endif\n #endif\n #endif\n\n // single component is always independent\n #if vtkNumComponents == 1\n vec4 tColor = texture2D(ctexture, vec2(tValue.r * cscale0 + cshift0, 0.5));\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, 0.5)).r;\n #endif\n\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\n vec4 tColor = mix0*texture2D(ctexture, vec2(tValue.r * cscale0 + cshift0, height0));\n #if !defined(vtkComponent0Proportional)\n tColor.a = goFactor.x*mix0*texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, height0)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, height0)).r;\n tColor *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix0));\n #endif\n\n vec3 tColor1 = mix1*texture2D(ctexture, vec2(tValue.g * cscale1 + cshift1, height1)).rgb;\n #if !defined(vtkComponent1Proportional)\n tColor.a += goFactor.y*mix1*texture2D(otexture, vec2(tValue.g * oscale1 + oshift1, height1)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.g * oscale1 + oshift1, height1)).r;\n tColor1 *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix1));\n #endif\n\n #if vtkNumComponents >= 3\n vec3 tColor2 = mix2*texture2D(ctexture, vec2(tValue.b * cscale2 + cshift2, height2)).rgb;\n #if !defined(vtkComponent2Proportional)\n tColor.a += goFactor.z*mix2*texture2D(otexture, vec2(tValue.b * oscale2 + oshift2, height2)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.b * oscale2 + oshift2, height2)).r;\n tColor2 *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix2));\n #endif\n\n #if vtkNumComponents >= 4\n vec3 tColor3 = mix3*texture2D(ctexture, vec2(tValue.a * cscale3 + cshift3, height3)).rgb;\n #if !defined(vtkComponent3Proportional)\n tColor.a += goFactor.w*mix3*texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, height3)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, height3)).r;\n tColor3 *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix3));\n #endif\n #endif\n #endif\n #else // then not independent\n\n #if vtkNumComponents == 2\n float lum = tValue.r * cscale0 + cshift0;\n float alpha = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale1 + oshift1, 0.5)).r;\n vec4 tColor = vec4(lum, lum, lum, alpha);\n #endif\n #if vtkNumComponents == 3\n vec4 tColor;\n tColor.r = tValue.r * cscale0 + cshift0;\n tColor.g = tValue.g * cscale1 + cshift1;\n tColor.b = tValue.b * cscale2 + cshift2;\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale0 + oshift0, 0.5)).r;\n #endif\n #if vtkNumComponents == 4\n vec4 tColor;\n tColor.r = tValue.r * cscale0 + cshift0;\n tColor.g = tValue.g * cscale1 + cshift1;\n tColor.b = tValue.b * cscale2 + cshift2;\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, 0.5)).r;\n #endif\n #endif // dependent\n\n // apply lighting if requested as appropriate\n #if vtkLightComplexity > 0\n #if !defined(vtkComponent0Proportional)\n applyLighting(tColor.rgb, normal0);\n #endif\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\n #if !defined(vtkComponent1Proportional)\n applyLighting(tColor1, normal1);\n #endif\n #if vtkNumComponents >= 3\n #if !defined(vtkComponent2Proportional)\n applyLighting(tColor2, normal2);\n #endif\n #if vtkNumComponents >= 4\n #if !defined(vtkComponent3Proportional)\n applyLighting(tColor3, normal3);\n #endif\n #endif\n #endif\n #endif\n#endif\n\n// perform final independent blend as needed\n#if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\n tColor.rgb += tColor1;\n#if vtkNumComponents >= 3\n tColor.rgb += tColor2;\n#if vtkNumComponents >= 4\n tColor.rgb += tColor3;\n#endif\n#endif\n#endif\n\n#endif\n\n\n\n\n\n\n\nreturn tColor;\n}\n\n\n\n//=======================================================================\n// Apply the specified blend mode operation along the ray's path.\n//\nvoid applyBlend(vec3 posIS, vec3 endIS, float sampleDistanceIS, vec3 tdims)\n{\n vec3 tstep = 1.0/tdims;\n\n // start slightly inside and apply some jitter\n vec3 delta = endIS - posIS;\n vec3 stepIS = normalize(delta)*sampleDistanceIS;\n float raySteps = length(delta)/sampleDistanceIS;\n\n // avoid 0.0 jitter\n float jitter = 0.01 + 0.99*texture2D(jtexture, gl_FragCoord.xy/32.0).r;\n float stepsTraveled = jitter;\n\n // local vars for the loop\n vec4 color = vec4(0.0, 0.0, 0.0, 0.0);\n vec4 tValue;\n vec4 tColor;\n\n // if we have less than one step then pick the middle point\n // as our value\n // if (raySteps <= 1.0)\n // {\n // posIS = (posIS + endIS)*0.5;\n // }\n\n // Perform initial step at the volume boundary\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n #if vtkBlendMode == 0 // COMPOSITE_BLEND\n // now map through opacity and color\n tColor = getColorForValue(tValue, posIS, tstep);\n\n // handle very thin volumes\n if (raySteps <= 1.0)\n {\n tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps);\n gl_FragData[0] = tColor;\n return;\n }\n\n tColor.a = 1.0 - pow(1.0 - tColor.a, jitter);\n color = vec4(tColor.rgb*tColor.a, tColor.a);\n posIS += (jitter*stepIS);\n\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\n {\n if (stepsTraveled + 1.0 >= raySteps) { break; }\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // now map through opacity and color\n tColor = getColorForValue(tValue, posIS, tstep);\n\n float mix = (1.0 - color.a);\n\n // this line should not be needed but nvidia seems to not handle\n // the break correctly on windows/chrome 58 angle\n //mix = mix * sign(max(raySteps - stepsTraveled - 1.0, 0.0));\n\n color = color + vec4(tColor.rgb*tColor.a, tColor.a)*mix;\n stepsTraveled++;\n posIS += stepIS;\n if (color.a > 0.99) { color.a = 1.0; break; }\n }\n\n if (color.a < 0.99 && (raySteps - stepsTraveled) > 0.0)\n {\n posIS = endIS;\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // now map through opacity and color\n tColor = getColorForValue(tValue, posIS, tstep);\n tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps - stepsTraveled);\n\n float mix = (1.0 - color.a);\n color = color + vec4(tColor.rgb*tColor.a, tColor.a)*mix;\n }\n\n gl_FragData[0] = vec4(color.rgb/color.a, color.a);\n #endif\n #if vtkBlendMode == 1 || vtkBlendMode == 2\n // MAXIMUM_INTENSITY_BLEND || MINIMUM_INTENSITY_BLEND\n // Find maximum/minimum intensity along the ray.\n\n // Define the operation we will use (min or max)\n #if vtkBlendMode == 1\n #define OP max\n #else\n #define OP min\n #endif\n\n // If the clipping range is shorter than the sample distance\n // we can skip the sampling loop along the ray.\n if (raySteps <= 1.0)\n {\n gl_FragData[0] = getColorForValue(tValue, posIS, tstep);\n return;\n }\n\n vec4 value = tValue;\n posIS += (jitter*stepIS);\n\n // Sample along the ray until MaximumSamplesValue,\n // ending slightly inside the total distance\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\n {\n // If we have reached the last step, break\n if (stepsTraveled + 1.0 >= raySteps) { break; }\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // Update the maximum value if necessary\n value = OP(tValue, value);\n\n // Otherwise, continue along the ray\n stepsTraveled++;\n posIS += stepIS;\n }\n\n // Perform the last step along the ray using the\n // residual distance\n posIS = endIS;\n tValue = getTextureValue(posIS);\n value = OP(tValue, value);\n\n // Now map through opacity and color\n gl_FragData[0] = getColorForValue(value, posIS, tstep);\n #endif\n #if vtkBlendMode == 3 //AVERAGE_INTENSITY_BLEND\n vec4 averageIPScalarRangeMin = vec4 (\n //VTK::AverageIPScalarRangeMin,\n //VTK::AverageIPScalarRangeMin,\n //VTK::AverageIPScalarRangeMin,\n 1.0);\n vec4 averageIPScalarRangeMax = vec4(\n //VTK::AverageIPScalarRangeMax,\n //VTK::AverageIPScalarRangeMax,\n //VTK::AverageIPScalarRangeMax,\n 1.0);\n\n vec4 sum = vec4(0.);\n\n averageIPScalarRangeMin.a = tValue.a;\n averageIPScalarRangeMax.a = tValue.a;\n\n if (all(greaterThanEqual(tValue, averageIPScalarRangeMin)) &&\n all(lessThanEqual(tValue, averageIPScalarRangeMax))) {\n sum += tValue;\n }\n\n if (raySteps <= 1.0) {\n gl_FragData[0] = getColorForValue(sum, posIS, tstep);\n return;\n }\n\n posIS += (jitter*stepIS);\n\n // Sample along the ray until MaximumSamplesValue,\n // ending slightly inside the total distance\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\n {\n // If we have reached the last step, break\n if (stepsTraveled + 1.0 >= raySteps) { break; }\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // One can control the scalar range by setting the AverageIPScalarRange to disregard scalar values, not in the range of interest, from the average computation.\n // Notes:\n // - We are comparing all values in the texture to see if any of them\n // are outside of the scalar range. In the future we might want to allow\n // scalar ranges for each component.\n // - We are setting the alpha channel for averageIPScalarRangeMin and\n // averageIPScalarRangeMax so that we do not trigger this 'continue'\n // based on the alpha channel comparison.\n // - There might be a better way to do this. I'm not sure if there is an\n // equivalent of 'any' which only operates on RGB, though I suppose\n // we could write an 'anyRGB' function and see if that is faster.\n averageIPScalarRangeMin.a = tValue.a;\n averageIPScalarRangeMax.a = tValue.a;\n if (any(lessThan(tValue, averageIPScalarRangeMin)) ||\n any(greaterThan(tValue, averageIPScalarRangeMax))) {\n continue;\n }\n\n // Sum the values across each step in the path\n sum += tValue;\n\n // Otherwise, continue along the ray\n stepsTraveled++;\n posIS += stepIS;\n }\n\n // Perform the last step along the ray using the\n // residual distance\n posIS = endIS;\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // One can control the scalar range by setting the AverageIPScalarRange to disregard scalar values, not in the range of interest, from the average computation\n if (all(greaterThanEqual(tValue, averageIPScalarRangeMin)) &&\n all(lessThanEqual(tValue, averageIPScalarRangeMax))) {\n sum += tValue;\n\n stepsTraveled++;\n }\n\n sum /= vec4(stepsTraveled, stepsTraveled, stepsTraveled, 1.0);\n\n gl_FragData[0] = getColorForValue(sum, posIS, tstep);\n #endif\n}\n\n//=======================================================================\n// Compute a new start and end point for a given ray based\n// on the provided bounded clipping plane (aka a rectangle)\nvoid getRayPointIntersectionBounds(\n vec3 rayPos, vec3 rayDir,\n vec3 planeDir, float planeDist,\n inout vec2 tbounds, vec3 vPlaneX, vec3 vPlaneY,\n float vSize1, float vSize2)\n{\n float result = dot(rayDir, planeDir);\n if (result == 0.0)\n {\n return;\n }\n result = -1.0 * (dot(rayPos, planeDir) + planeDist) / result;\n vec3 xposVC = rayPos + rayDir*result;\n vec3 vxpos = xposVC - vOriginVC;\n vec2 vpos = vec2(\n dot(vxpos, vPlaneX),\n dot(vxpos, vPlaneY));\n\n // on some apple nvidia systems this does not work\n // if (vpos.x < 0.0 || vpos.x > vSize1 ||\n // vpos.y < 0.0 || vpos.y > vSize2)\n // even just\n // if (vpos.x < 0.0 || vpos.y < 0.0)\n // fails\n // so instead we compute a value that represents in and out\n //and then compute the return using this value\n float xcheck = max(0.0, vpos.x * (vpos.x - vSize1)); // 0 means in bounds\n float check = sign(max(xcheck, vpos.y * (vpos.y - vSize2))); // 0 means in bounds, 1 = out\n\n tbounds = mix(\n vec2(min(tbounds.x, result), max(tbounds.y, result)), // in value\n tbounds, // out value\n check); // 0 in 1 out\n}\n\n//=======================================================================\n// given a\n// - ray direction (rayDir)\n// - starting point (vertexVCVSOutput)\n// - bounding planes of the volume\n// - optionally depth buffer values\n// - far clipping plane\n// compute the start/end distances of the ray we need to cast\nvec2 computeRayDistances(vec3 rayDir, vec3 tdims)\n{\n vec2 dists = vec2(100.0*camFar, -1.0);\n\n vec3 vSize = vSpacing*(tdims - 1.0);\n\n // all this is in View Coordinates\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal0, vPlaneDistance0, dists, vPlaneNormal2, vPlaneNormal4,\n vSize.y, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal1, vPlaneDistance1, dists, vPlaneNormal2, vPlaneNormal4,\n vSize.y, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal2, vPlaneDistance2, dists, vPlaneNormal0, vPlaneNormal4,\n vSize.x, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal3, vPlaneDistance3, dists, vPlaneNormal0, vPlaneNormal4,\n vSize.x, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal4, vPlaneDistance4, dists, vPlaneNormal0, vPlaneNormal2,\n vSize.x, vSize.y);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal5, vPlaneDistance5, dists, vPlaneNormal0, vPlaneNormal2,\n vSize.x, vSize.y);\n\n //VTK::ClipPlane::Impl\n\n // do not go behind front clipping plane\n dists.x = max(0.0,dists.x);\n\n // do not go PAST far clipping plane\n float farDist = -camThick/rayDir.z;\n dists.y = min(farDist,dists.y);\n\n // Do not go past the zbuffer value if set\n // This is used for intermixing opaque geometry\n //VTK::ZBuffer::Impl\n\n return dists;\n}\n\n//=======================================================================\n// Compute the index space starting position (pos) and end\n// position\n//\nvoid computeIndexSpaceValues(out vec3 pos, out vec3 endPos, out float sampleDistanceIS, vec3 rayDir, vec2 dists)\n{\n // compute starting and ending values in volume space\n pos = vertexVCVSOutput + dists.x*rayDir;\n pos = pos - vOriginVC;\n // convert to volume basis and origin\n pos = vec3(\n dot(pos, vPlaneNormal0),\n dot(pos, vPlaneNormal2),\n dot(pos, vPlaneNormal4));\n\n endPos = vertexVCVSOutput + dists.y*rayDir;\n endPos = endPos - vOriginVC;\n endPos = vec3(\n dot(endPos, vPlaneNormal0),\n dot(endPos, vPlaneNormal2),\n dot(endPos, vPlaneNormal4));\n\n float delta = length(endPos - pos);\n\n pos *= vVCToIJK;\n endPos *= vVCToIJK;\n\n float delta2 = length(endPos - pos);\n sampleDistanceIS = sampleDistance*delta2/delta;\n}\n\nvoid main()\n{\n\n vec3 rayDirVC;\n\n if (cameraParallel == 1)\n {\n // Camera is parallel, so the rayDir is just the direction of the camera.\n rayDirVC = vec3(0.0, 0.0, -1.0);\n } else {\n // camera is at 0,0,0 so rayDir for perspective is just the vc coord\n rayDirVC = normalize(vertexVCVSOutput);\n }\n\n vec3 tdims = vec3(volumeDimensions);\n\n // compute the start and end points for the ray\n vec2 rayStartEndDistancesVC = computeRayDistances(rayDirVC, tdims);\n\n // do we need to composite? aka does the ray have any length\n // If not, bail out early\n if (rayStartEndDistancesVC.y <= rayStartEndDistancesVC.x)\n {\n discard;\n }\n\n // IS = Index Space\n vec3 posIS;\n vec3 endIS;\n float sampleDistanceIS;\n computeIndexSpaceValues(posIS, endIS, sampleDistanceIS, rayDirVC, rayStartEndDistancesVC);\n\n // Perform the blending operation along the ray\n applyBlend(posIS, endIS, sampleDistanceIS, tdims);\n}\n"},function(e,t,n){var r;!function(a){"use strict";function o(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function i(e,t,n,r,a,i){return o(function(e,t){return e<>>32-t}(o(o(t,e),o(r,i)),a),n)}function s(e,t,n,r,a,o,s){return i(t&n|~t&r,e,t,a,o,s)}function l(e,t,n,r,a,o,s){return i(t&r|n&~r,e,t,a,o,s)}function u(e,t,n,r,a,o,s){return i(t^n^r,e,t,a,o,s)}function c(e,t,n,r,a,o,s){return i(n^(t|~r),e,t,a,o,s)}function d(e,t){var n,r,a,i,d;e[t>>5]|=128<>>9<<4)]=t;var f=1732584193,p=-271733879,g=-1732584194,m=271733878;for(n=0;n>5]>>>t%32&255);return n}function p(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<>>4&15)+"0123456789abcdef".charAt(15&t);return r}function m(e){return unescape(encodeURIComponent(e))}function v(e){return function(e){return f(d(p(e),8*e.length))}(m(e))}function h(e,t){return function(e,t){var n,r,a=p(e),o=[],i=[];for(o[15]=i[15]=void 0,a.length>16&&(a=d(a,8*e.length)),n=0;n<16;n+=1)o[n]=909522486^a[n],i[n]=1549556828^a[n];return r=d(o.concat(p(t)),512+8*t.length),f(d(i.concat(r),640))}(m(e),m(t))}function y(e,t,n){return t?n?h(t,e):function(e,t){return g(h(e,t))}(t,e):n?v(e):function(e){return g(v(e))}(e)}void 0===(r=function(){return y}.call(t,n,t,e))||(e.exports=r)}()},function(e){e.exports=[{Name:"KAAMS",IndexedColors:[1,1,1,1,0,0,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,.63,.63,1,.67,.5,.33,1,.5,.75,.53,.35,.7,1,.75,.5],Annotations:[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11]},{ColorSpace:"Diverging",Name:"Cool to Warm",NanColor:[1,1,0],RGBPoints:[0,.23137254902,.298039215686,.752941176471,.5,.865,.865,.865,1,.705882352941,.0156862745098,.149019607843]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Cool to Warm (Extended)",NanColor:[.25,0,0],RGBPoints:[0,0,0,.34902,.03125,.039216,.062745,.380392,.0625,.062745,.117647,.411765,.09375,.090196,.184314,.45098,.125,.12549,.262745,.501961,.15625,.160784,.337255,.541176,.1875,.2,.396078,.568627,.21875,.239216,.454902,.6,.25,.286275,.521569,.65098,.28125,.337255,.592157,.701961,.3125,.388235,.654902,.74902,.34375,.466667,.737255,.819608,.375,.572549,.819608,.878431,.40625,.654902,.866667,.909804,.4375,.752941,.917647,.941176,.46875,.823529,.956863,.968627,.5,.988235,.960784,.901961,.5,.941176,.984314,.988235,.52,.988235,.945098,.85098,.54,.980392,.898039,.784314,.5625,.968627,.835294,.698039,.59375,.94902,.733333,.588235,.625,.929412,.65098,.509804,.65625,.909804,.564706,.435294,.6875,.878431,.458824,.352941,.71875,.839216,.388235,.286275,.75,.760784,.294118,.211765,.78125,.701961,.211765,.168627,.8125,.65098,.156863,.129412,.84375,.6,.094118,.094118,.875,.54902,.066667,.098039,.90625,.501961,.05098,.12549,.9375,.45098,.054902,.172549,.96875,.4,.054902,.192157,1,.34902,.070588,.211765]},{ColorSpace:"Diverging",Name:"Warm to Cool",NanColor:[1,1,0],RGBPoints:[0,.705882352941,.0156862745098,.149019607843,.5,.865,.865,.865,1,.23137254902,.298039215686,.752941176471]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Warm to Cool (Extended)",NanColor:[.250004,0,0],RGBPoints:[0,.34902,0,.129412,.025,.4,.00392157,.101961,.05,.470588,.0156863,.0901961,.075,.54902,.027451,.0705882,.1,.619608,.0627451,.0431373,.125,.690196,.12549,.0627451,.15,.741176,.184314,.0745098,.175,.788235,.266667,.0941176,.2,.811765,.345098,.113725,.225,.831373,.411765,.133333,.25,.85098,.47451,.145098,.275,.870588,.54902,.156863,.3,.878431,.619608,.168627,.325,.890196,.658824,.196078,.35,.909804,.717647,.235294,.375,.929412,.776471,.278431,.395522,.94902,.823529,.321569,.418905,.968627,.87451,.407843,.444278,.980392,.917647,.509804,.470149,.988235,.956863,.643137,.483582,.992157,.964706,.713725,.499,.988235,.980392,.870588,.5,1,1,1,.501,.913725,.988235,.937255,.516418,.827451,.980392,.886275,.531343,.764706,.980392,.866667,.546766,.658824,.980392,.843137,.564179,.572549,.964706,.835294,.587562,.423529,.941176,.87451,.60597,.262745,.901961,.862745,.629851,.0705882,.854902,.870588,.651741,.0509804,.8,.85098,.681592,.0235294,.709804,.831373,.712935,.0313725,.615686,.811765,.75,.0313725,.537255,.788235,.775,.0392157,.466667,.768627,.8,.0509804,.396078,.741176,.825,.054902,.317647,.709804,.85,.054902,.243137,.678431,.875,.0431373,.164706,.639216,.9,.0313725,.0980392,.6,.925,.0392157,.0392157,.560784,.95,.105882,.0509804,.509804,.975,.113725,.0235294,.45098,1,.12549,0,.380392]},{ColorSpace:"RGB",Name:"Rainbow Desaturated",NanColor:[1,1,0],RGBPoints:[0,.278431372549,.278431372549,.858823529412,.143,0,0,.360784313725,.285,0,1,1,.429,0,.501960784314,0,.571,1,1,0,.714,1,.380392156863,0,.857,.419607843137,0,0,1,.878431372549,.301960784314,.301960784314]},{ColorSpace:"RGB",Name:"Cold and Hot",NanColor:[1,1,0],RGBPoints:[0,0,1,1,.45,0,0,1,.5,0,0,.501960784314,.55,1,0,0,1,1,1,0]},{ColorSpace:"RGB",Name:"Black-Body Radiation",NanColor:[0,.498039215686,1],RGBPoints:[0,0,0,0,.4,.901960784314,0,0,.8,.901960784314,.901960784314,0,1,1,1,1]},{ColorSpace:"RGB",Name:"X Ray",NanColor:[1,0,0],RGBPoints:[0,1,1,1,1,0,0,0]},{ColorSpace:"RGB",Name:"Grayscale",NanColor:[1,0,0],RGBPoints:[0,0,0,0,1,1,1,1]},{ColorSpace:"RGB",Name:"BkRd",NanColor:[0,1,1],RGBPoints:[0,0,0,0,1,1,0,0]},{ColorSpace:"RGB",Name:"BkGn",NanColor:[1,0,1],RGBPoints:[0,0,0,0,1,0,1,0]},{ColorSpace:"RGB",Name:"BkBu",NanColor:[1,1,0],RGBPoints:[0,0,0,0,1,0,0,1]},{ColorSpace:"RGB",Name:"BkMa",NanColor:[0,1,0],RGBPoints:[0,0,0,0,1,1,0,1]},{ColorSpace:"RGB",Name:"BkCy",NanColor:[0,1,1],RGBPoints:[0,0,0,0,1,0,1,1]},{ColorSpace:"RGB",Name:"Black, Blue and White",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.333,0,0,.501960784314,.666,0,.501960784314,1,1,1,1,1]},{ColorSpace:"RGB",Name:"Black, Orange and White",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.333,.501960784314,0,0,.666,1,.501960784314,0,1,1,1,1]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Linear YGB 1211g",NanColor:[.25,0,0],RGBPoints:[0,1,.988235,.968627,.02,1,.952941,.878431,.05,.968627,.905882,.776471,.1,.94902,.898039,.647059,.15,.901961,.878431,.556863,.2,.847059,.858824,.482353,.25,.690196,.819608,.435294,.3,.513725,.768627,.384314,.35,.337255,.721569,.337255,.4,.278431,.658824,.392157,.45,.231373,.639216,.435294,.5,.203922,.6,.486275,.55,.172549,.568627,.537255,.6,.141176,.517647,.54902,.65,.133333,.458824,.541176,.7,.12549,.396078,.529412,.75,.117647,.321569,.521569,.8,.121569,.258824,.509804,.85,.133333,.227451,.501961,.9,.145098,.192157,.490196,.95,.188235,.164706,.470588,1,.258824,.196078,.439216]},{ColorSpace:"CIELAB",Creator:"Francesca Samsel",Name:"Linear Green (Gr4L)",NanColor:[.25,0,0],RGBPoints:[0,.054902,.109804,.121569,.05,.07451,.172549,.180392,.1,.086275,.231373,.219608,.15,.094118,.278431,.25098,.2,.109804,.34902,.278431,.25,.113725,.4,.278431,.3,.117647,.45098,.270588,.35,.117647,.490196,.243137,.4,.113725,.521569,.203922,.45,.109804,.54902,.152941,.5,.082353,.588235,.082353,.55,.109804,.631373,.05098,.6,.211765,.678431,.082353,.65,.317647,.721569,.113725,.7,.431373,.760784,.160784,.75,.556863,.8,.239216,.8,.666667,.839216,.294118,.85,.784314,.878431,.396078,.9,.886275,.921569,.533333,.95,.960784,.94902,.670588,1,1,.984314,.901961]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Linear Blue (8_31f)",NanColor:[.25,0,0],RGBPoints:[0,.960784,1,.980392,.05,.815686,.960784,.913725,.1,.670588,.929412,.870588,.15,.556863,.901961,.843137,.2,.478431,.870588,.823529,.25,.439216,.831373,.803922,.3,.4,.8,.788235,.35,.376471,.768627,.768627,.4,.34902,.709804,.729412,.45,.32549,.654902,.690196,.5,.301961,.607843,.658824,.55,.247059,.545098,.619608,.6,.239216,.494118,.580392,.65,.227451,.439216,.541176,.7,.227451,.403922,.521569,.75,.231373,.368627,.501961,.8,.227451,.321569,.470588,.85,.219608,.282353,.439216,.9,.192157,.235294,.4,.95,.160784,.184314,.34902,1,.133333,.12549,.301961]},{ColorSpace:"HSV",Name:"Blue to Red Rainbow",NanColor:[.498039215686,.498039215686,.498039215686],RGBPoints:[0,0,0,1,1,1,0,0]},{ColorSpace:"HSV",Name:"Red to Blue Rainbow",NanColor:[.498039215686,.498039215686,.498039215686],RGBPoints:[0,1,0,0,1,0,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended White",NanColor:[1,1,0],RGBPoints:[0,1,1,1,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended Grey",NanColor:[1,1,0],RGBPoints:[0,.317647058824,.341176470588,.43137254902,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended Black",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Blue to Yellow",NanColor:[1,0,0],RGBPoints:[0,.0392156862745,.0392156862745,.949019607843,1,.949019607843,.949019607843,.0392156862745]},{ColorSpace:"HSV",Name:"blot",RGBPoints:[0,0,0,1,.166,0,0,1,.167,1,0,1,.332,1,0,1,.333,0,1,1,.5,0,1,1,.501,0,1,0,.666,0,1,0,.667,1,1,0,.832,1,1,0,.833,1,0,0,1,1,0,0]},{ColorSpace:"Lab",Name:"CIELab Blue to Red",NanColor:[1,1,0],RGBPoints:[0,0,.6,.749019607843,1,.76862745098,.466666666667,.341176470588]},{ColorSpace:"RGB",Name:"jet",RGBPoints:[-1,0,0,.5625,-.777778,0,0,1,-.269841,0,1,1,-.015873,.5,1,.5,.238095,1,1,0,.746032,1,0,0,1,.5,0,0]},{ColorSpace:"RGB",Name:"rainbow",RGBPoints:[-1,0,0,1,-.5,0,1,1,0,0,1,0,.5,1,1,0,1,1,0,0]},{ColorSpace:"Lab",Name:"erdc_rainbow_bright",RGBPoints:[-1,.32549,.14902,.960784,-.866221,.297047,.375586,.963836,-.732441,.180302,.536818,.964627,-.598662,.1302,.649207,.929647,-.464883,.0445143,.749654,.855998,-.331104,.0271325,.830713,.721527,-.197324,.259504,.866145,.543555,-.0635452,.428364,.890725,.329819,.0702341,.568503,.898508,.187623,.204013,.738259,.890317,.0825461,.337793,.84546,.86136,.0147555,.471572,.912191,.808018,0,.605351,.962848,.710445,0,.73913,.999469,.600258,.0176284,.87291,.994156,.445975,.193912,1,.980407,.247105,.262699]},{ColorSpace:"Lab",Name:"erdc_rainbow_dark",RGBPoints:[-1,0,0,.423499,-.866221,0,.119346,.529237,-.732441,0,.238691,.634976,-.598662,0,.346852,.68788,-.464883,0,.45022,.718141,-.331104,0,.553554,.664839,-.197324,0,.651082,.519303,-.0635452,.115841,.72479,.352857,.0702341,.326771,.781195,.140187,.204013,.522765,.798524,.0284624,.337793,.703162,.788685,.00885756,.471572,.845118,.751133,0,.605351,.955734,.690825,0,.73913,.995402,.567916,.0618524,.87291,.987712,.403398,.164851,1,.980407,.247105,.262699]},{ColorSpace:"Lab",Name:"nic_CubicL",RGBPoints:[-1,.479965,.0118108,.5307,-.87451,.522213,.0551282,.706919,-.74902,.50839,.237278,.867764,-.623529,.451617,.373834,.987255,-.498039,.39365,.497255,.97506,-.372549,.328631,.599639,.891843,-.247059,.250043,.690286,.778553,-.121569,.249656,.764905,.645857,.00392157,.297954,.821466,.50449,.129412,.337509,.872595,.358447,.254902,.430011,.913789,.297079,.380392,.587191,.931381,.333353,.505882,.727937,.93591,.353742,.631373,.826403,.921081,.365066,.756863,.893201,.846317,.372662,.882353,.965347,.73884,.378506,1,.983235,.597451,.366856]},{ColorSpace:"Lab",Name:"nic_CubicYF",RGBPoints:[-1,.5151,.0482,.6697,-.87451,.520711,.168955,.800574,-.74902,.493694,.278596,.911824,-.623529,.440026,.369475,.984978,-.498039,.398932,.457593,.987053,-.372549,.350651,.540644,.929608,-.247059,.298827,.615625,.857729,-.121569,.239928,.685061,.769531,.00392157,.228832,.739349,.673287,.129412,.263297,.78608,.569988,.254902,.298107,.828337,.460214,.380392,.33092,.864071,.352674,.505882,.38306,.898169,.287309,.631373,.49023,.917481,.307961,.756863,.62372,.926026,.332309,.882353,.717458,.92527,.342476,1,.8,.9255,.3529]},{ColorSpace:"Lab",Name:"gist_earth",RGBPoints:[-1,0,0,0,-.87451,.239216,.027451,.415686,-.74902,.0901961,.254902,.556863,-.623529,.0941176,.352941,.54902,-.498039,.105882,.435294,.533333,-.372549,.12549,.52549,.501961,-.247059,.156863,.596078,.443137,-.121569,.196078,.65098,.380392,.00392157,.282353,.717647,.301961,.129412,.466667,.772549,.27451,.254902,.678431,.784314,.309804,.380392,.901961,.756863,.376471,.505882,.992157,.705882,.521569,.631373,1,.721569,.701961,.756863,1,.784314,.784314,.882353,1,.866667,.866667,1,1,1,1]},{ColorSpace:"Lab",Name:"2hot",RGBPoints:[-1,.0416667,0,0,-.873016,.208333,0,0,-.746032,.375,0,0,-.619048,.541667,0,0,-.492063,.708333,0,0,-.365079,.854137,0,0,-.238095,.937488,.039062,0,-.111111,1,.208333,0,.015873,1,.375,0,.142857,1,.541667,0,.269841,1,.708333,0,.396825,1,.858805,.03125,.52381,1,.947392,.15625,.650794,1,1,.3125,.777778,1,1,.5625,.904762,1,1,.8125,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_red2yellow_BW",RGBPoints:[-1,7.54296e-7,0,109827e-10,-.87451,.18285,.0264094,0,-.74902,.3066,0,0,-.623529,.422841,0,0,-.498039,.522945,0,0,-.372549,.605721,0,0,-.247059,.672502,.14168,0,-.121569,.728167,.244025,0,.00392157,.781215,.333454,0,.129412,.825,.423586,0,.254902,.855893,.516793,0,.380392,.880491,.608846,0,.505882,.910305,.695505,0,.631373,.94109,.779067,.223528,.756863,.967873,.858572,.473521,.882353,.986815,.933211,.751583,1,1,1,.999997]},{ColorSpace:"Lab",Name:"erdc_marine2gold_BW",RGBPoints:[-1,1.11641e-7,0,162551e-11,-.87451,.0413146,.0619808,.209857,-.74902,.0185557,.101341,.350684,-.623529,.00486405,.149847,.461054,-.498039,.0836345,.210845,.517906,-.372549,.173222,.276134,.541793,-.247059,.259857,.343877,.535869,-.121569,.362299,.408124,.504293,.00392157,.468266,.468276,.468257,.129412,.582781,.527545,.374914,.254902,.691591,.585251,.274266,.380392,.784454,.645091,.247332,.505882,.862299,.710383,.27518,.631373,.920863,.782923,.351563,.756863,.955792,.859699,.533541,.882353,.976162,.93433,.780671,1,1,1,.999983]},{ColorSpace:"Lab",Name:"erdc_blue2gold_BW",RGBPoints:[-1,0,0,0,-.87451,.0742735,.0440331,.230013,-.74902,.125276,.0258685,.415826,-.623529,.143879,.0163031,.591346,-.498039,.212261,.0627855,.705239,-.372549,.306048,.141178,.763636,-.247059,.391537,.232286,.773263,-.121569,.461734,.336633,.708321,.00392157,.54209,.427581,.590007,.129412,.61704,.508623,.460978,.254902,.702703,.579586,.309117,.380392,.790336,.644811,.170397,.505882,.870173,.710733,.117134,.631373,.93656,.781991,.157144,.756863,.965672,.862068,.409836,.882353,.985751,.936296,.714162,1,1,1,.999999]},{ColorSpace:"Lab",Name:"erdc_sapphire2gold_BW",RGBPoints:[-1,.107704,.107708,.107694,-.87451,.1851,.112354,.308554,-.74902,.236782,.114233,.48788,-.623529,.28296,.126187,.639464,-.498039,.344787,.171643,.739713,-.372549,.413325,.242371,.76913,-.247059,.481863,.3131,.719841,-.121569,.550402,.383829,.612222,.00392157,.61894,.454558,.51126,.129412,.687478,.525287,.39993,.254902,.756017,.596016,.289923,.380392,.824555,.666745,.255498,.505882,.892979,.736822,.27696,.631373,.938851,.804966,.351734,.756863,.966491,.874853,.53572,.882353,.982105,.94153,.782579,1,1,1,.999986]},{ColorSpace:"Lab",Name:"erdc_red2purple_BW",RGBPoints:[-1,0,0,0,-.87451,.167793,.0166271,.0431278,-.74902,.262608,.0107595,.0791181,-.623529,.351902,.0101858,.100926,-.498039,.441257,.0160835,.131919,-.372549,.5221,.0555972,.195625,-.247059,.593852,.104294,.310234,-.121569,.654628,.158115,.448486,.00392157,.707443,.220914,.570253,.129412,.749504,.293268,.67897,.254902,.781587,.370517,.779269,.380392,.809951,.451099,.855831,.505882,.84424,.531462,.900451,.631373,.865174,.620901,.91606,.756863,.875041,.714054,.910284,.882353,.880764,.80554,.896276,1,.887572,.887591,.887556]},{ColorSpace:"Lab",Name:"erdc_purple2pink_BW",RGBPoints:[-1,0,0,0,-.87451,.117562,.0291202,.175876,-.74902,.178368,.0458476,.285454,-.623529,.237731,.0680173,.387717,-.498039,.300877,.0956291,.484802,-.372549,.370929,.136858,.554985,-.247059,.449033,.189273,.58863,-.121569,.529971,.245796,.598587,.00392157,.609914,.300643,.610244,.129412,.697079,.351286,.616371,.254902,.785858,.401991,.617376,.380392,.862517,.45745,.64463,.505882,.91359,.525462,.705336,.631373,.932583,.61064,.767412,.756863,.922478,.706966,.817522,.882353,.901302,.803071,.856311,1,.887571,.887591,.887549]},{ColorSpace:"Lab",Name:"erdc_pbj_lin",RGBPoints:[-1,0,0,0,-.87451,.091821,.0611476,.10617,-.74902,.160311,.0900022,.192713,-.623529,.22484,.12126,.272128,-.498039,.291263,.157469,.340828,-.372549,.360015,.200388,.388903,-.247059,.437497,.250058,.387201,-.121569,.512636,.304969,.355955,.00392157,.582603,.360874,.33488,.129412,.655126,.416374,.306351,.254902,.725889,.473329,.279051,.380392,.778125,.537928,.302697,.505882,.815894,.606931,.382431,.631373,.839159,.679308,.497608,.756863,.854748,.751666,.631792,.882353,.869483,.822508,.768592,1,.887572,.887589,.887565]},{ColorSpace:"Lab",Name:"erdc_blue2green_muted",RGBPoints:[-1,.107704,.107708,.107695,-.87451,.141522,.13066,.270741,-.74902,.180123,.146119,.42308,-.623529,.210161,.169674,.551795,-.498039,.239701,.212939,.634969,-.372549,.253916,.282947,.653641,-.247059,.242791,.366933,.608521,-.121569,.226302,.446776,.52693,.00392157,.236237,.514689,.458798,.129412,.274641,.577589,.376069,.254902,.349625,.633993,.288131,.380392,.4437,.683677,.260497,.505882,.536247,.731214,.285424,.631373,.628472,.777128,.349151,.756863,.718259,.819287,.496825,.882353,.804768,.856164,.703299,1,.887571,.887591,.887548]},{ColorSpace:"Lab",Name:"erdc_blue2green_BW",RGBPoints:[-1,3.63578e-7,0,529374e-11,-.87451,.0539915,.0577948,.212806,-.74902,.0620393,.0758942,.388959,-.623529,.0697499,.102032,.54177,-.498039,.113295,.156156,.64334,-.372549,.152047,.243196,.670283,-.247059,.158096,.344084,.622864,-.121569,.151142,.43922,.532767,.00392157,.17155,.521588,.457719,.129412,.225861,.599141,.363997,.254902,.32328,.67007,.259083,.380392,.442344,.733697,.223754,.505882,.558409,.794941,.257411,.631373,.673875,.854344,.340822,.756863,.787244,.909326,.524717,.882353,.896483,.958063,.775914,1,1,1,.999982]},{ColorSpace:"Lab",Name:"GREEN-WHITE_LINEAR",RGBPoints:[-1,0,0,0,-.87451,0,.062745,0,-.74902,0,.12549,0,-.623529,0,.188235,0,-.498039,0,.25098,0,-.372549,0,.313725,0,-.247059,0,.376471,0,-.121569,.094118,.439216,0,.00392157,.196078,.501961,0,.129412,.294118,.564706,0,.254902,.396078,.627451,0,.380392,.498039,.690196,0,.505882,.6,.752941,.145098,.631373,.701961,.815686,.364706,.756863,.8,.878431,.580392,.882353,.901961,.941176,.796078,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_green2yellow_BW",RGBPoints:[-1,0,0,0,-.87451,0,.105542,.0603919,-.74902,0,.159454,.104148,-.623529,0,.219502,.15542,-.498039,0,.282276,.203811,-.372549,0,.346331,.235652,-.247059,0,.411765,.235428,-.121569,0,.477177,.217977,.00392157,.0593644,.541635,.21361,.129412,.233081,.604722,.210591,.254902,.369803,.664942,.226536,.380392,.498446,.722367,.288237,.505882,.601929,.782244,.380815,.631373,.703207,.840497,.512134,.756863,.803186,.896433,.674462,.882353,.903834,.950266,.846715,1,1,1,.999981]},{ColorSpace:"Lab",Name:"blue2cyan",RGBPoints:[-1,0,0,0,-.87451,0,.152941,.364706,-.74902,0,.254902,.470588,-.623529,0,.34902,.572549,-.498039,0,.443137,.670588,-.372549,0,.537255,.772549,-.247059,0,.627451,.870588,-.121569,0,.717647,.964706,.00392157,.0784314,.772549,1,.129412,.207843,.858824,1,.254902,.32549,.941176,1,.380392,.45098,1,1,.505882,.560784,1,1,.631373,.662745,1,1,.756863,.760784,1,1,.882353,.870588,1,1,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_blue2cyan_BW",RGBPoints:[-1,4.05298e-7,0,59012e-10,-.87451,.0207526,.0740933,.18093,-.74902,0,.121033,.30343,-.623529,0,.166892,.416095,-.498039,0,.216768,.524796,-.372549,.0164769,.275471,.608585,-.247059,.0544527,.344824,.659267,-.121569,.0880643,.419118,.688675,.00392157,.127938,.492556,.720256,.129412,.149476,.566946,.756918,.254902,.188961,.641333,.792122,.380392,.245482,.715336,.827609,.505882,.329216,.786235,.874761,.631373,.453558,.852803,.918466,.756863,.626281,.910493,.954,.882353,.82257,.958709,.980146,1,1,1,.999989]},{ColorSpace:"Lab",Name:"erdc_blue_BW",RGBPoints:[-1,0,0,0,-.87451,.0425591,.0763529,.150682,-.74902,.0569472,.119154,.275403,-.623529,.0635978,.164772,.395427,-.498039,.0774342,.213851,.510014,-.372549,.106815,.267034,.615102,-.247059,.122093,.324649,.720068,-.121569,.160851,.387068,.806956,.00392157,.213754,.453516,.878012,.129412,.26722,.524656,.932436,.254902,.326844,.599279,.968038,.380392,.403403,.674712,.984784,.505882,.499703,.745519,1,.631373,.615055,.813983,1,.756863,.74405,.879228,1,.882353,.877909,.941913,1,1,1,1,.999996]},{ColorSpace:"Lab",Name:"BLUE-WHITE",RGBPoints:[-1,0,0,0,-.87451,0,0,.082353,-.74902,0,0,.168627,-.623529,0,0,.254902,-.498039,0,0,.337255,-.372549,0,0,.423529,-.247059,0,0,.509804,-.121569,0,.101961,.592157,.00392157,0,.203922,.678431,.129412,0,.301961,.764706,.254902,0,.403922,.85098,.380392,0,.505882,.933333,.505882,0,.603922,1,.631373,.254902,.705882,1,.756863,.509804,.807843,1,.882353,.764706,.905882,1,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_purple_BW",RGBPoints:[-1,4.264e-8,0,6.20844e-7,-.87451,.100579,.0593111,.145666,-.74902,.167794,.0889224,.254953,-.623529,.231446,.123339,.360511,-.498039,.296699,.163027,.461278,-.372549,.363211,.209286,.55306,-.247059,.431136,.260776,.637195,-.121569,.498202,.320012,.705799,.00392157,.567456,.380459,.778091,.129412,.629381,.445284,.8448,.254902,.688373,.517374,.895694,.380392,.74891,.590906,.93976,.505882,.805017,.667956,.977626,.631373,.850914,.752618,.992396,.756863,.89724,.838454,.994093,.882353,.948461,.922603,.994449,1,1,1,.999967]},{ColorSpace:"Lab",Name:"erdc_magenta_BW",RGBPoints:[-1,0,0,254023e-10,-.87451,.128696,.0456782,.11635,-.74902,.228133,.0476299,.201452,-.623529,.327273,.0374065,.282107,-.498039,.420953,.0408166,.35709,-.372549,.511562,.0642203,.430511,-.247059,.599552,.102686,.504257,-.121569,.684646,.150536,.579429,.00392157,.765817,.205978,.656062,.129412,.839176,.27229,.731807,.254902,.89536,.357594,.797309,.380392,.930238,.457825,.846984,.505882,.945921,.564536,.880571,.631373,.948995,.670753,.902279,.756863,.947124,.772819,.918171,.882353,.947265,.869424,.934352,1,.954719,.95475,.954726]},{ColorSpace:"Lab",Name:"magenta",RGBPoints:[-1,0,0,0,-.87451,.364706,0,.152941,-.74902,.470588,0,.254902,-.623529,.572549,0,.34902,-.498039,.670588,0,.443137,-.372549,.772549,0,.537255,-.247059,.870588,0,.627451,-.121569,.964706,0,.717647,.00392157,1,.0784314,.772549,.129412,1,.207843,.858824,.254902,1,.32549,.941176,.380392,1,.45098,1,.505882,1,.560784,1,.631373,1,.662745,1,.756863,1,.760784,1,.882353,1,.870588,1,1,1,1,1]},{ColorSpace:"Lab",Name:"RED-PURPLE",RGBPoints:[-1,0,0,0,-.87451,.188235,0,.007843,-.74902,.345098,0,.035294,-.623529,.439216,0,.098039,-.498039,.533333,0,.152941,-.372549,.627451,.015686,.211765,-.247059,.721569,.031373,.266667,-.121569,.8,.047059,.329412,.00392157,.862745,.047059,.403922,.129412,.941176,.062745,.466667,.254902,.988235,.078431,.54902,.380392,.988235,.141176,.643137,.505882,.988235,.25098,.729412,.631373,.988235,.376471,.811765,.756863,.988235,.54902,.886275,.882353,.988235,.752941,.952941,1,.996078,.996078,.996078]},{ColorSpace:"Lab",Name:"erdc_red_BW",RGBPoints:[-1,0,0,0,-.87451,.147204,.0480135,.0401815,-.74902,.253411,.0617478,.0301333,-.623529,.356059,.0746331,.0446897,-.498039,.457731,.0934935,.0636931,-.372549,.557199,.122714,.0860013,-.247059,.665179,.144238,.105585,-.121569,.763833,.187056,.138326,.00392157,.847035,.254558,.189407,.129412,.905663,.345937,.258215,.254902,.941431,.447111,.346277,.380392,.962608,.546927,.457571,.505882,.987833,.637276,.569944,.631373,.994202,.732176,.687958,.756863,.993304,.826268,.800567,.882353,.994413,.917205,.906393,1,1,1,.999979]},{ColorSpace:"Lab",Name:"RED_TEMPERATURE",RGBPoints:[-1,0,0,0,-.87451,.090196,0,0,-.74902,.180392,0,0,-.623529,.270588,0,0,-.498039,.360784,0,0,-.372549,.45098,0,0,-.247059,.545098,0,0,-.121569,.635294,0,0,.00392157,.72549,.058824,0,.129412,.815686,.176471,0,.254902,.905882,.294118,0,.380392,1,.411765,0,.505882,1,.533333,.027451,.631373,1,.65098,.27451,.756863,1,.768627,.521569,.882353,1,.886275,.768627,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_orange_BW",RGBPoints:[-1,0,0,253806e-10,-.87451,.135871,.0593824,0,-.74902,.224328,.0907216,0,-.623529,.318083,.119647,0,-.498039,.414443,.150246,0,-.372549,.511077,.184884,0,-.247059,.605501,.226033,0,-.121569,.695274,.275491,0,.00392157,.777826,.334445,0,.129412,.851498,.402441,0,.254902,.915899,.47759,602975e-9,.380392,.971984,.557882,.0361443,.505882,1,.641287,.135967,.631373,1,.725198,.27997,.756863,1,.808205,.438135,.882353,1,.89306,.587036,1,1,.977928,.721599]},{ColorSpace:"Lab",Name:"heated_object",RGBPoints:[-1,0,0,0,-.87451,.34902,.0862745,0,-.74902,.45098,.172549,0,-.623529,.52549,.231373,0,-.498039,.580392,.278431,0,-.372549,.623529,.313725,0,-.247059,.670588,.352941,0,-.121569,.717647,.392157,0,.00392157,.772549,.439216,0,.129412,.839216,.494118,0,.254902,.901961,.541176,0,.380392,.968627,.6,0,.505882,1,.658824,0,.631373,1,.721569,0,.756863,1,.827451,.298039,.882353,1,.976471,.72549,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_gold_BW",RGBPoints:[-1,0,0,190933e-10,-.87451,.128363,.0636265,0,-.74902,.193795,.111057,0,-.623529,.25976,.15987,0,-.498039,.328546,.210589,0,-.372549,.399726,.26332,0,-.247059,.472969,.318261,0,-.121569,.546245,.375827,0,.00392157,.61745,.436719,0,.129412,.685545,.501113,0,.254902,.749578,.568799,0,.380392,.80962,.6394,0,.505882,.865572,.712699,.10257,.631373,.917709,.787569,.233665,.756863,.966914,.863138,.369608,.882353,1,.939405,.496104,1,.999225,1,.612275]},{ColorSpace:"Lab",Name:"erdc_brown_BW",RGBPoints:[-1,3.3216e-7,0,483629e-11,-.87451,.14693,.0518172,0,-.74902,.225806,.0814996,0,-.623529,.301681,.111452,0,-.498039,.370487,.150664,0,-.372549,.43108,.199477,0,-.247059,.4849,.255107,0,-.121569,.536798,.313486,0,.00392157,.59286,.371167,0,.129412,.653119,.428135,0,.254902,.714589,.485917,.0379541,.380392,.774667,.54565,.116634,.505882,.831222,.608047,.183895,.631373,.880305,.674199,.260298,.756863,.922314,.742472,.367086,.882353,.959408,.811222,.497258,1,.993548,.875183,.622093]},{ColorSpace:"Lab",Name:"copper_Matlab",RGBPoints:[-1,0,0,0,-.87451,.0784314,.0501961,.0313725,-.74902,.156863,.100392,.0627451,-.623529,.235294,.150588,.0941176,-.498039,.313725,.200784,.12549,-.372549,.392157,.25098,.156863,-.247059,.470588,.301176,.188235,-.121569,.54902,.351373,.219608,.00392157,.627451,.401569,.25098,.129412,.705882,.451765,.282353,.254902,.784314,.501961,.313725,.380392,.862745,.552157,.345098,.505882,.941176,.602353,.376471,.631373,1,.652549,.407843,.756863,1,.702745,.439216,.882353,1,.752941,.470588,1,1,.8,.5]},{ColorSpace:"Lab",Name:"pink_Matlab",RGBPoints:[-1,0,0,0,-.87451,.312416,.204524,.204524,-.74902,.441822,.289241,.289241,-.623529,.54112,.354246,.354246,-.498039,.624831,.409048,.409048,-.372549,.698582,.45733,.45733,-.247059,.764404,.502282,.500979,-.121569,.791292,.591516,.54112,.00392157,.817297,.66895,.578481,.129412,.842499,.738308,.613572,.254902,.866968,.801687,.646762,.380392,.890766,.86041,.678329,.505882,.913944,.913944,.711254,.631373,.936549,.936549,.79459,.756863,.958621,.958621,.869979,.882353,.980196,.980196,.939336,1,1,1,1]},{ColorSpace:"Lab",Name:"bone_Matlab",RGBPoints:[-1,0,0,0,-.87451,.054902,.054902,.075817,-.74902,.109804,.109804,.151634,-.623529,.164706,.164706,.227451,-.498039,.219608,.219608,.303268,-.372549,.27451,.27451,.379085,-.247059,.329412,.329902,.454412,-.121569,.384314,.405719,.509314,.00392157,.439216,.481536,.564216,.129412,.494118,.557353,.619118,.254902,.54902,.63317,.67402,.380392,.603922,.708987,.728922,.505882,.660294,.783824,.783824,.631373,.746569,.838725,.838725,.756863,.832843,.893627,.893627,.882353,.919118,.948529,.948529,1,1,1,1]},{ColorSpace:"Lab",Name:"gray_Matlab",RGBPoints:[-1,0,0,0,-.87451,.0627451,.0627451,.0627451,-.74902,.12549,.12549,.12549,-.623529,.188235,.188235,.188235,-.498039,.25098,.25098,.25098,-.372549,.313725,.313725,.313725,-.247059,.376471,.376471,.376471,-.121569,.439216,.439216,.439216,.00392157,.501961,.501961,.501961,.129412,.564706,.564706,.564706,.254902,.627451,.627451,.627451,.380392,.690196,.690196,.690196,.505882,.752941,.752941,.752941,.631373,.815686,.815686,.815686,.756863,.878431,.878431,.878431,.882353,.941176,.941176,.941176,1,1,1,1]},{ColorSpace:"Lab",Name:"Purples",RGBPoints:[-1,.247059,0,.490196,-.87451,.288397,.07677,.525629,-.74902,.32975,.153587,.561092,-.623529,.373057,.236263,.600461,-.498039,.416363,.319,.639923,-.372549,.459669,.405613,.685198,-.247059,.503345,.491534,.730058,-.121569,.562399,.54862,.757616,.00392157,.621453,.606075,.785544,.129412,.680508,.674971,.824914,.254902,.739562,.743406,.863899,.380392,.798616,.800492,.893426,.505882,.85684,.856655,.922491,.631373,.898178,.894056,.942176,.756863,.938654,.930919,.961646,.882353,.964245,.958478,.977393,1,.988235,.984314,.992157]},{ColorSpace:"Lab",Name:"Blues",RGBPoints:[-1,.031373,.188235,.419608,-.87451,.031373,.253195,.516063,-.74902,.031757,.318139,.612149,-.623529,.080969,.38113,.661361,-.498039,.130427,.444152,.710327,-.372549,.195386,.509112,.743791,-.247059,.260715,.573841,.777209,-.121569,.341423,.628958,.808704,.00392157,.422745,.684075,.839892,.129412,.523137,.739193,.861546,.254902,.622684,.793464,.883429,.380392,.701423,.826928,.910988,.505882,.778685,.8603,.937993,.631373,.825928,.891795,.953741,.756863,.87328,.923291,.969489,.882353,.922491,.954787,.985236,1,.968627,.984314,1]},{ColorSpace:"Lab",Name:"Greens",RGBPoints:[-1,0,.266667,.105882,-.87451,0,.347374,.139346,-.74902,538e-6,.427912,.172933,-.623529,.069435,.486967,.222145,-.498039,.138178,.546082,.271326,-.372549,.197232,.609073,.31857,-.247059,.257255,.671742,.365859,-.121569,.357647,.720953,.415071,.00392157,.45767,.769919,.465021,.129412,.546251,.811257,.537855,.254902,.634295,.852211,.610688,.380392,.709097,.883706,.683522,.505882,.78316,.914833,.755894,.631373,.842215,.938454,.818885,.756863,.899977,.961538,.880692,.882353,.935409,.975317,.92203,1,.968627,.988235,.960784]},{ColorSpace:"Lab",Name:"PuBu",RGBPoints:[-1,.301961,0,.294118,-.87451,.404321,.029527,.390573,-.74902,.50599,.059592,.486782,-.623529,.519769,.158016,.551742,-.498039,.533456,.256194,.616301,-.372549,.54133,.33887,.655671,-.247059,.54902,.421592,.695087,-.121569,.54902,.506236,.736424,.00392157,.550127,.590573,.777701,.129412,.585559,.665375,.81707,.254902,.622145,.739023,.855825,.380392,.687105,.784298,.879446,.505882,.752065,.829758,.903253,.631373,.817024,.87897,.930811,.756863,.880907,.927213,.957832,.882353,.926182,.958708,.975548,1,.968627,.988235,.992157]},{ColorSpace:"Lab",Name:"BuPu",RGBPoints:[-1,.007843,.219608,.345098,-.87451,.01178,.286536,.449427,-.74902,.015702,.35328,.553479,-.623529,.01767,.396586,.622376,-.498039,.021115,.4402,.690688,-.372549,.11757,.503191,.722184,-.247059,.214625,.565859,.753633,-.121569,.336671,.615071,.78316,.00392157,.457978,.663975,.812503,.129412,.556401,.703345,.836125,.254902,.65421,.742714,.859669,.380392,.736886,.782084,.881323,.505882,.81827,.821638,.903068,.631373,.873387,.864944,.92669,.756863,.927536,.907605,.949988,.882353,.964937,.9391,.967705,1,1,.968627,.984314]},{ColorSpace:"Lab",Name:"BuGn",RGBPoints:[-1,.031373,.25098,.505882,-.87451,.031373,.329719,.590527,-.74902,.031911,.408397,.674787,-.623529,.100807,.479262,.710219,-.498039,.169704,.550219,.745744,-.372549,.238601,.62699,.787082,-.247059,.307958,.703114,.826759,-.121569,.39654,.752326,.797232,.00392157,.485121,.801046,.767705,.129412,.573702,.83451,.738178,.254902,.661592,.867743,.711034,.380392,.732457,.895302,.74253,.505882,.801845,.922307,.774579,.631373,.841215,.938055,.817885,.756863,.880907,.95391,.861084,.882353,.926182,.971626,.902422,1,.968627,.988235,.941176]},{ColorSpace:"Lab",Name:"GnBu",RGBPoints:[-1,0,.266667,.105882,-.87451,0,.347374,.139346,-.74902,538e-6,.427912,.172933,-.623529,.069435,.486967,.222145,-.498039,.138178,.546175,.272095,-.372549,.197232,.615071,.368551,-.247059,.256609,.683276,.464867,-.121569,.329443,.722645,.555417,.00392157,.403137,.762138,.645413,.129412,.503529,.805444,.718247,.254902,.603922,.848597,.790465,.380392,.704314,.887966,.847551,.505882,.802307,.926321,.903714,.631373,.851519,.944037,.941115,.756863,.899977,.961538,.976901,.882353,.935409,.975317,.984775,1,.968627,.988235,.992157]},{ColorSpace:"Lab",Name:"GnBuPu",RGBPoints:[-1,.003922,.27451,.211765,-.87451,.003922,.349312,.280661,-.74902,.003937,.423852,.349773,-.623529,.005905,.46519,.446228,-.498039,.009443,.506344,.542837,-.372549,.111803,.535871,.649135,-.247059,.214025,.565859,.753633,-.121569,.310481,.615071,.78316,.00392157,.407797,.663975,.812503,.129412,.531811,.703345,.836125,.254902,.65421,.742714,.859669,.380392,.736886,.782084,.881323,.505882,.81827,.821176,.902884,.631373,.873387,.854641,.922568,.756863,.927536,.888535,.942361,.882353,.964937,.929873,.964014,1,1,.968627,.984314]},{ColorSpace:"Lab",Name:"BuGnYl",RGBPoints:[-1,.031373,.113725,.345098,-.87451,.088458,.159,.463206,-.74902,.145052,.204567,.5807,-.623529,.139146,.287243,.620069,-.498039,.13318,.370196,.659562,-.372549,.123337,.470588,.706805,-.247059,.115386,.570335,.753126,-.121569,.186251,.643168,.761,.00392157,.258716,.71514,.768074,.129412,.380761,.760415,.750358,.254902,.503576,.806075,.732795,.380392,.645306,.861192,.719016,.505882,.783899,.91511,.705606,.631373,.858701,.944637,.6997,.756863,.931349,.973303,.698424,.882353,.966782,.987082,.777163,1,1,1,.85098]},{ColorSpace:"Lab",Name:"PuRd",RGBPoints:[-1,.286275,0,.415686,-.87451,.38273,.001968,.441276,-.74902,.479231,.003922,.466774,-.623529,.581592,.003922,.480554,-.498039,.683799,.00549,.494887,-.372549,.776317,.105882,.544098,-.247059,.867866,.206321,.592618,-.121569,.919047,.308681,.612303,.00392157,.968812,.411226,.632603,.129412,.974717,.519493,.671972,.254902,.980546,.626451,.71065,.380392,.984483,.701253,.732303,.505882,.988328,.77504,.755617,.631373,.990296,.828189,.812703,.756863,.992372,.880907,.869035,.882353,.996309,.926182,.912341,1,1,.968627,.952941]},{ColorSpace:"Lab",Name:"RdPu",RGBPoints:[-1,.403922,0,.121569,-.87451,.500377,0,.192434,-.74902,.596909,277e-6,.263037,-.623529,.703206,.035709,.300438,-.498039,.808612,.071296,.338854,-.372549,.857824,.116571,.441215,-.247059,.905513,.163552,.54293,-.121569,.889765,.281661,.617732,.00392157,.873156,.39897,.691611,.129412,.82985,.491488,.736886,.254902,.789081,.583237,.781853,.380392,.810734,.656071,.819254,.505882,.833126,.729181,.85684,.631373,.870527,.80792,.898178,.756863,.907605,.884398,.938331,.882353,.9391,.921799,.958016,1,.968627,.956863,.976471]},{ColorSpace:"Lab",Name:"Oranges",RGBPoints:[-1,.498039,.152941,.015686,-.87451,.57481,.182468,.013718,-.74902,.651765,.212042,.011734,-.623529,.752157,.247474,.007797,-.498039,.851719,.283368,.004475,-.372549,.898962,.348328,.039908,-.247059,.945652,.413426,.076401,-.121569,.969273,.484291,.157109,.00392157,.992157,.554971,.238185,.129412,.992157,.619931,.330704,.254902,.992157,.684967,.423837,.380392,.992157,.751895,.532103,.505882,.992249,.817716,.639354,.631373,.994218,.861023,.725967,.756863,.996186,.903576,.810965,.882353,.998155,.933103,.868051,1,1,.960784,.921569]},{ColorSpace:"Lab",Name:"Reds",RGBPoints:[-1,.403922,0,.05098,-.87451,.525967,.029527,.066728,-.74902,.647643,.058962,.082476,-.623529,.722445,.076678,.098224,-.498039,.797186,.095194,.114187,-.372549,.868051,.164091,.143714,-.247059,.937809,.233541,.173933,-.121569,.96143,.326059,.232987,.00392157,.984375,.418147,.292657,.129412,.986344,.496886,.371396,.254902,.988235,.575702,.450673,.380392,.988235,.656409,.543191,.505882,.98842,.736747,.635894,.631373,.992357,.809581,.732349,.756863,.996186,.880692,.826759,.882353,.998155,.92203,.885813,1,1,.960784,.941176]},{ColorSpace:"Lab",Name:"RdOr",RGBPoints:[-1,.498039,0,0,-.87451,.6004,0,0,-.74902,.702514,738e-6,477e-6,-.623529,.773379,.095225,.061499,-.498039,.843875,.189865,.12283,-.372549,.891119,.294195,.203537,-.247059,.937855,.397924,.283137,-.121569,.963445,.476663,.316601,.00392157,.988297,.555771,.351665,.129412,.990265,.646321,.436309,.254902,.992157,.735256,.519646,.380392,.992157,.784468,.570827,.505882,.992249,.833218,.623483,.631373,.994218,.872587,.706159,.756863,.996186,.911419,.788189,.882353,.998155,.940946,.859054,1,1,.968627,.92549]},{ColorSpace:"Lab",Name:"BrOrYl",RGBPoints:[-1,.4,.145098,.023529,-.87451,.500392,.174625,.019592,-.74902,.600784,.204291,.015656,-.623529,.701176,.251534,.011719,-.498039,.800984,.299146,.008397,-.372549,.863975,.370012,.043829,-.247059,.926321,.441107,.0794,-.121569,.961753,.521815,.120738,.00392157,.996078,.602645,.163122,.129412,.996078,.68729,.237924,.254902,.996078,.771011,.314879,.380392,.996078,.832034,.444798,.505882,.996171,.892042,.572595,.631373,.998139,.931411,.65724,.756863,1,.969489,.741669,.882353,1,.985236,.822376,1,1,1,.898039]},{ColorSpace:"Lab",Name:"RdOrYl",RGBPoints:[-1,.501961,0,.14902,-.87451,.622038,0,.14902,-.74902,.741761,4e-4,.148866,-.623529,.816563,.05158,.129181,-.498039,.890965,.10356,.110235,-.372549,.940177,.205921,.137793,-.247059,.988281,.308789,.165536,-.121569,.99025,.432803,.200969,.00392157,.992218,.555217,.236278,.129412,.994187,.628051,.267774,.254902,.996078,.701038,.301269,.380392,.996078,.777809,.383945,.505882,.996171,.852826,.466621,.631373,.998139,.892195,.549296,.756863,1,.931349,.632188,.882353,1,.966782,.7188,1,1,1,.8]},{ColorSpace:"Lab",Name:"CIELab_blue2red",RGBPoints:[-1,0,.6,.74902,1,.76863,.46667,.34118]},{ColorSpace:"Lab",Name:"blue2yellow",RGBPoints:[-1,0,0,1,0,.5,.5,.5,1,1,1,0]},{ColorSpace:"Lab",Name:"erdc_blue2gold",RGBPoints:[-1,.175119,.0438468,1,-.874016,.22383,.159771,.94557,-.748031,.27254,.233611,.891216,-.622047,.321251,.296526,.836857,-.496063,.369962,.354296,.782359,-.370079,.418672,.409139,.72754,-.244094,.467383,.462152,.672148,-.11811,.51609,.51396,.615825,.00787402,.572863,.55452,.559172,.133858,.630269,.593822,.517729,.259843,.689588,.624668,.47446,.385827,.745394,.656113,.428638,.511811,.798624,.688104,.379105,.637795,.849926,.720593,.323834,.76378,.899765,.753543,.258657,.889764,.948487,.78692,.171778,1,.990413,.816451,.00729848]},{ColorSpace:"Lab",Name:"erdc_blue2yellow",RGBPoints:[-1,.0830122,0,.495617,-.87451,.141973,.0551288,.57363,-.74902,.193048,.110258,.604561,-.623529,.234231,.165386,.57643,-.498039,.275413,.220515,.548299,-.372549,.316596,.275644,.520169,-.247059,.357778,.330773,.492038,-.121569,.398961,.385901,.463908,.00392157,.449929,.438487,.426815,.129412,.511572,.488299,.379944,.254902,.581222,.53603,.325741,.380392,.650871,.583761,.271538,.505882,.720521,.631493,.217335,.631373,.79017,.679224,.163132,.756863,.85982,.726955,.108929,.882353,.910254,.774159,.14112,1,.927513,.81759,.306289]},{ColorSpace:"Lab",Name:"erdc_cyan2orange",RGBPoints:[-1,.0471513,.213874,.414329,-.87451,.0674702,.256648,.439027,-.74902,.0959957,.299331,.462089,-.623529,.132428,.341872,.483212,-.498039,.188743,.38277,.500597,-.372549,.268511,.420229,.512179,-.247059,.352945,.455602,.519101,-.121569,.43893,.489368,.521538,.00392157,.522445,.522495,.522436,.129412,.600089,.555682,.53205,.254902,.67988,.587981,.539163,.380392,.761011,.619586,.544439,.505882,.84278,.650741,.548567,.631373,.910713,.687347,.557822,.756863,.952232,.734972,.577775,.882353,.975642,.789858,.604868,1,.990752,.843643,.632857]},{ColorSpace:"Lab",Name:"erdc_purple2green",RGBPoints:[-1,.235006,.0483128,.530899,-.87451,.302968,.108419,.552391,-.74902,.360241,.166059,.569502,-.623529,.406746,.226782,.579373,-.498039,.444073,.28964,.582094,-.372549,.473648,.353774,.577947,-.247059,.497636,.418154,.567911,-.121569,.519086,.481741,.553968,.00392157,.542884,.542914,.542875,.129412,.566303,.603989,.527499,.254902,.595218,.662965,.516857,.380392,.628641,.720701,.510673,.505882,.665373,.777849,.508165,.631373,.704182,.834921,.508303,.756863,.743846,.892328,.50999,.882353,.783158,.950422,.512181,1,.818617,1,.513888]},{ColorSpace:"Lab",Name:"erdc_purple2green_dark",RGBPoints:[-1,.107656,0,.428682,-.87451,.1924,0,.449799,-.74902,.255118,.0648939,.466726,-.623529,.304256,.133066,.476703,-.498039,.343202,.19716,.479793,-.372549,.373876,.260353,.476241,-.247059,.398497,.322872,.466953,-.121569,.420016,.384252,.453785,.00392157,.44319,.443216,.443186,.129412,.465553,.502139,.428233,.254902,.492959,.559151,.417591,.380392,.524654,.615092,.411016,.505882,.55959,.670583,.40779,.631373,.596614,.726102,.406948,.756863,.634544,.782032,.407439,.882353,.672183,.838703,.408237,1,.706131,.892759,.408452]},{ColorSpace:"Lab",Name:"coolwarm",RGBPoints:[-1,.229806,.298718,.753683,-.875,.303869,.406535,.844959,-.75,.383013,.509419,.917388,-.625,.466667,.604563,.968155,-.5,.552953,.688929,.995376,-.375,.639176,.7596,.998151,-.25,.722193,.813953,.976575,-.125,.798692,.849786,.931689,0,.865395,.86541,.865396,.125,.924128,.827385,.774508,.25,.958853,.769768,.678008,.375,.969954,.694267,.579375,.5,.958003,.602842,.481776,.625,.923945,.497309,.38797,.75,.869187,.378313,.300267,.875,.795632,.241284,.220526,1,.705673,.0155562,.150233]},{ColorSpace:"Lab",Name:"BuRd",RGBPoints:[-1,.019608,.188235,.380392,-.87451,.088504,.321107,.564937,-.74902,.163399,.444983,.697501,-.623529,.247059,.555709,.754095,-.498039,.420684,.676432,.818685,-.372549,.606459,.789773,.880277,-.247059,.761476,.868512,.924567,-.121569,.878047,.925721,.951942,.00392157,.969089,.966474,.964937,.129412,.983852,.897578,.846828,.254902,.982468,.800692,.706113,.380392,.960323,.66782,.536332,.505882,.894579,.503806,.399769,.631373,.81707,.33218,.281046,.756863,.728489,.155017,.197386,.882353,.576932,.055363,.14925,1,.403922,0,.121569]},{ColorSpace:"Lab",Name:"Spectral_lowBlue",RGBPoints:[-1,.368627,.309804,.635294,-.87451,.260361,.450058,.70173,-.74902,.248058,.591311,.717186,-.623529,.376009,.734025,.658132,-.498039,.537947,.814764,.64506,-.372549,.702345,.879585,.636678,-.247059,.84752,.938639,.607151,-.121569,.940408,.976163,.656055,.00392157,.999923,.997616,.745021,.129412,.997463,.921338,.61707,.254902,.995002,.824606,.499885,.380392,.992541,.701576,.39654,.505882,.973472,.547405,.318108,.631373,.937793,.398539,.270127,.756863,.861515,.282891,.299654,.882353,.746482,.144637,.288812,1,.619608,.003922,.258824]},{ColorSpace:"Lab",Name:"GnRP",RGBPoints:[-1,0,.266667,.105882,-.87451,.066436,.394617,.174779,-.74902,.168858,.524567,.25767,-.623529,.323875,.657439,.361015,-.498039,.504883,.772318,.506344,-.372549,.678431,.870127,.654902,-.247059,.803922,.921799,.780392,-.121569,.897116,.951942,.882814,.00392157,.967397,.965936,.967474,.129412,.928028,.879815,.930565,.254902,.866052,.780777,.882891,.380392,.77501,.665129,.821376,.505882,.675663,.537024,.737024,.631373,.57847,.396155,.645982,.756863,.492349,.223914,.547559,.882353,.375548,.096886,.423299,1,.25098,0,.294118]},{ColorSpace:"Lab",Name:"GYPi",RGBPoints:[-1,.152941,.392157,.098039,-.87451,.246444,.505344,.117724,-.74902,.351942,.614533,.161399,-.623529,.474971,.717878,.240138,-.498039,.611995,.811226,.392849,-.372549,.746328,.893118,.565321,-.247059,.859516,.94233,.747405,-.121569,.928105,.96386,.875663,.00392157,.969089,.966859,.968012,.129412,.983852,.910265,.948328,.254902,.979239,.833218,.914648,.380392,.949712,.729873,.862976,.505882,.905652,.58293,.763552,.631373,.85521,.410073,.652211,.756863,.793695,.183699,.531642,.882353,.683737,.063899,.420761,1,.556863,.003922,.321569]},{ColorSpace:"Lab",Name:"GnYlRd",RGBPoints:[-1,0,.407843,.215686,-.87451,.063975,.525952,.277201,-.74902,.177932,.633064,.332718,-.623529,.364937,.724106,.379469,-.498039,.527951,.797155,.40223,-.372549,.678431,.862822,.433449,-.247059,.803922,.916955,.514648,-.121569,.909419,.961861,.625067,.00392157,.999923,.997616,.745021,.129412,.997463,.921338,.61707,.254902,.995002,.824606,.499885,.380392,.992541,.701576,.39654,.505882,.973472,.547405,.318108,.631373,.939023,.389927,.245521,.756863,.867666,.239831,.176624,.882353,.762399,.110727,.151326,1,.647059,0,.14902]},{ColorSpace:"Lab",Name:"GBBr",RGBPoints:[-1,0,.235294,.188235,-.87451,.002461,.338639,.301423,-.74902,.055902,.448981,.417609,-.623529,.183852,.56955,.538178,-.498039,.357785,.700115,.660746,-.372549,.540177,.819531,.77624,-.247059,.714879,.890888,.864821,-.121569,.851134,.934564,.922645,.00392157,.960861,.959785,.95694,.129412,.963322,.927797,.83391,.254902,.939946,.868897,.68935,.380392,.883353,.775394,.517109,.505882,.808074,.625836,.324106,.631373,.717647,.476355,.15494,.756863,.592157,.358247,.06882,.882353,.458593,.26436,.031142,1,.329412,.188235,.019608]},{ColorSpace:"Lab",Name:"PuOr",RGBPoints:[-1,.498039,.231373,.031373,-.87451,.62599,.30273,.026451,-.74902,.746943,.387082,.037524,-.623529,.85767,.490427,.071972,-.498039,.936409,.617762,.236371,-.372549,.992695,.743099,.43291,-.247059,.995156,.841523,.63714,-.121569,.985313,.913802,.813687,.00392157,.966244,.966398,.967705,.129412,.889965,.89504,.938178,.254902,.806151,.804306,.894656,.380392,.712649,.688658,.833141,.505882,.594233,.554325,.744637,.631373,.474894,.404229,.652364,.756863,.366628,.217224,.563783,.882353,.266436,.089965,.434833,1,.176471,0,.294118]},{ColorSpace:"Lab",Name:"PRGn",RGBPoints:[-1,.25098,0,.294118,-.87451,.383852,.103345,.431911,-.74902,.497732,.234679,.55371,-.623529,.583852,.40692,.652134,-.498039,.681968,.545175,.742561,-.372549,.7807,.672357,.825221,-.247059,.871742,.788005,.886736,-.121569,.930488,.885198,.932872,.00392157,.966321,.968089,.965859,.129412,.892503,.950865,.877278,.254902,.796078,.91857,.772549,.380392,.670588,.866897,.647059,.505882,.493195,.765398,.496655,.631373,.314187,.649135,.354556,.756863,.15917,.516263,.251211,.882353,.062284,.386621,.170473,1,0,.266667,.105882]},{ColorSpace:"Lab",Name:"PiYG",RGBPoints:[-1,.556863,.003922,.321569,-.87451,.692195,.067897,.427374,-.74902,.797539,.197847,.539177,-.623529,.859054,.424221,.659746,-.498039,.908574,.592618,.770319,-.372549,.951557,.736332,.866205,-.247059,.981084,.839677,.917878,-.121569,.98293,.913802,.949558,.00392157,.96732,.968474,.965629,.129412,.92549,.963552,.869666,.254902,.852441,.939254,.736025,.380392,.739254,.890042,.553941,.505882,.60323,.805536,.382238,.631373,.467282,.711419,.235217,.756863,.344252,.608074,.156478,.882353,.2406,.49827,.116494,1,.152941,.392157,.098039]},{ColorSpace:"Lab",Name:"OrPu",RGBPoints:[-1,.176471,0,.294118,-.87451,.272434,.095963,.444214,-.74902,.373395,.228912,.56932,-.623529,.481661,.415917,.657901,-.498039,.601922,.562937,.750481,-.372549,.718493,.695886,.836986,-.247059,.811995,.811534,.898501,-.121569,.894733,.8995,.940023,.00392157,.969166,.966859,.963629,.129412,.98639,.910265,.803691,.254902,.995002,.835371,.624375,.380392,.992541,.736947,.420146,.505882,.931949,.609458,.224221,.631373,.85075,.483968,.069819,.756863,.740023,.380623,.035371,.882353,.617993,.29827,.026759,1,.498039,.231373,.031373]},{ColorSpace:"Lab",Name:"BrBG",RGBPoints:[-1,.329412,.188235,.019608,-.87451,.467205,.269435,.031911,-.74902,.6,.365629,.074202,-.623529,.72549,.483737,.160323,-.498039,.812995,.635832,.336409,-.372549,.88689,.781238,.527874,-.247059,.943483,.87474,.700115,-.121569,.963168,.929796,.841599,.00392157,.957247,.959938,.959554,.129412,.84406,.932872,.920185,.254902,.70396,.886428,.859285,.380392,.529258,.815071,.770704,.505882,.346251,.691811,.653057,.631373,.175855,.562015,.530642,.756863,.047905,.441446,.410073,.882353,.002307,.33218,.294348,1,0,.235294,.188235]},{ColorSpace:"Lab",Name:"GyRd",RGBPoints:[-1,.101961,.101961,.101961,-.87451,.227451,.227451,.227451,-.74902,.359939,.359939,.359939,-.623529,.502653,.502653,.502653,-.498039,.631373,.631373,.631373,-.372549,.749865,.749865,.749865,-.247059,.843368,.843368,.843368,-.121569,.926105,.926105,.926105,.00392157,.999846,.997232,.995694,.129412,.994925,.908651,.857901,.254902,.982468,.800692,.706113,.380392,.960323,.66782,.536332,.505882,.894579,.503806,.399769,.631373,.81707,.33218,.281046,.756863,.728489,.155017,.197386,.882353,.576932,.055363,.14925,1,.403922,0,.121569]},{ColorSpace:"Lab",Name:"erdc_divHi_purpleGreen",RGBPoints:[-1,.297553,0,.489074,-.87451,.40259,.151146,.567754,-.74902,.516038,.284843,.658231,-.623529,.629783,.423646,.750938,-.498039,.735198,.563697,.835956,-.372549,.82408,.695541,.903582,-.247059,.889091,.807454,.944862,-.121569,.92334,.886917,.951839,.00392157,.921045,.921084,.921003,.129412,.877324,.907455,.845381,.254902,.797649,.849713,.734695,.380392,.691646,.75964,.600532,.505882,.568981,.649159,.453807,.631373,.438945,.529756,.304259,.756863,.30973,.412001,.158303,.882353,.187078,.305111,.00251458,1,.101655,.220836,0]},{ColorSpace:"Lab",Name:"erdc_divHi_purpleGreen_dim",RGBPoints:[-1,.404088,.131038,.592767,-.87451,.486469,.230957,.651243,-.74902,.575165,.339335,.717723,-.623529,.662741,.454332,.784263,-.498039,.742071,.570213,.842918,-.372549,.806935,.678992,.886227,-.247059,.852219,.771315,.90763,-.121569,.873345,.837327,.901572,.00392157,.866783,.86682,.866745,.129412,.82839,.858225,.796812,.254902,.762578,.814287,.700202,.380392,.676429,.744229,.585735,.505882,.577033,.65732,.461526,.631373,.47128,.562476,.33476,.756863,.365461,.467957,.21076,.882353,.264758,.381138,.0878313,1,.182591,.312249,0]},{ColorSpace:"Lab",Name:"erdc_divLow_icePeach",RGBPoints:[-1,.480048,.817441,.998056,-.87451,.425898,.726921,.883187,-.74902,.366682,.629445,.761936,-.623529,.308756,.531002,.640217,-.498039,.258021,.43705,.523433,-.372549,.219244,.352381,.416348,-.247059,.195127,.281032,.322979,-.121569,.186286,.22627,.246525,.00392157,.192352,.19236,.192364,.129412,.255927,.214469,.191756,.254902,.340459,.254426,.206666,.380392,.444655,.309315,.234029,.505882,.565353,.376004,.270969,.631373,.697917,.450748,.314293,.756863,.836657,.529064,.360227,.882353,.972695,.614884,.413123,1,1,.705904,.472699]},{ColorSpace:"Lab",Name:"erdc_divLow_purpleGreen",RGBPoints:[-1,.956034,.666487,.952663,-.87451,.874457,.572698,.936352,-.74902,.753465,.488253,.909063,-.623529,.63309,.413507,.763833,-.498039,.514491,.345878,.620015,-.372549,.405008,.288141,.484376,-.247059,.311388,.241986,.363556,-.121569,.238722,.209044,.263449,.00392157,.192352,.192366,.192362,.129412,.200379,.233201,.168618,.254902,.230151,.291737,.165227,.380392,.279481,.366076,.178607,.505882,.344927,.453267,.205703,.631373,.421554,.549449,.242643,.756863,.503334,.649999,.284377,.882353,.583497,.749672,.324969,1,.650705,.837228,.356264]},{ColorSpace:"Lab",Name:"Haze_green",RGBPoints:[-1,1,.835294,.886275,-.87451,.937255,.756863,.870443,-.74902,.875817,.666376,.857807,-.623529,.778359,.583007,.808134,-.498039,.676253,.494118,.745098,-.372549,.561365,.390123,.682353,-.247059,.438344,.262745,.621496,-.121569,.321133,.141031,.558751,.00392157,.203922,.0217865,.495861,.129412,.265505,.129412,.433261,.254902,.311692,.255338,.37008,.380392,.356282,.377342,.310821,.505882,.39971,.488889,.258243,.631373,.442556,.604357,.205519,.756863,.48671,.71968,.152941,.882353,.529847,.830356,.100944,1,.572549,.933333,.054902]},{ColorSpace:"Lab",Name:"Haze_lime",RGBPoints:[-1,.704034,.784196,1,-.87451,.633111,.691418,.956078,-.74902,.564021,.600606,.912157,-.623529,.496827,.51189,.868235,-.498039,.43157,.425416,.824314,-.372549,.368248,.341347,.780392,-.247059,.306767,.259855,.736471,-.121569,.246862,.181069,.692549,.00392157,.191619,.109542,.648627,.129412,.257404,.194031,.604706,.254902,.321794,.278775,.560784,.380392,.387909,.364617,.516863,.505882,.456569,.451881,.472941,.631373,.527424,.540773,.42902,.756863,.599759,.631427,.385098,.882353,.673065,.723898,.341176,1,.742751,.812252,.3]},{ColorSpace:"RGB",Name:"Haze",RGBPoints:[-1,1,.835294,.996078,-.00392157,.023529,.141176,.498039,.00392157,.015686,.137255,.494118,1,.984314,.764706,0]},{ColorSpace:"Lab",Name:"Haze_cyan",RGBPoints:[-1,.956863,1,.835294,-.87451,.933188,.921714,.760784,-.74902,.870588,.803486,.671605,-.623529,.807843,.684096,.583297,-.498039,.745098,.569208,.494118,-.372549,.682353,.437763,.390123,-.247059,.621496,.288163,.262745,-.121569,.558751,.144517,.141031,.00392157,.495861,.0217865,.0413943,.129412,.433261,.137255,.129412,.254902,.37008,.263181,.255338,.380392,.306318,.381845,.372694,.505882,.243137,.503994,.494263,.631373,.180392,.629484,.619753,.756863,.117647,.754975,.747131,.882353,.054902,.876398,.866812,1,0,.988235,.976471]},{ColorSpace:"Lab",Name:"nic_Edge",RGBPoints:[-1,.191208,.191208,.191208,-.87451,.239484,.00545035,.614821,-.74902,.220593,.0617459,.863547,-.623529,.17509,.278988,.97794,-.498039,.143526,.576069,.998553,-.372549,.166456,.871883,.96594,-.247059,.376202,.993555,.981833,-.121569,.681996,.991297,.999239,.00392157,.954172,.952734,.94374,.129412,.999735,.99301,.662896,.254902,.979399,.991466,.357973,.380392,.968771,.854967,.162659,.505882,.999245,.556697,.144323,.631373,.973959,.26223,.177946,.756863,.852358,.0526707,.222974,.882353,.593889,.00912724,.238855,1,.191208,.191208,.191208]},{ColorSpace:"Lab",Name:"erdc_iceFire_H",RGBPoints:[-1,4.05432e-7,0,590122e-11,-.87451,0,.120401,.302675,-.74902,0,.216583,.524574,-.623529,.0552475,.345025,.6595,-.498039,.128047,.492588,.720288,-.372549,.188955,.641309,.792092,-.247059,.327673,.784935,.873434,-.121569,.60824,.892164,.935547,.00392157,.881371,.912178,.818099,.129412,.951407,.835621,.449279,.254902,.904481,.690489,0,.380392,.85407,.510864,0,.505882,.777093,.33018,88199e-8,.631373,.672862,.139087,.00269398,.756863,.508815,0,0,.882353,.299417,366289e-9,547829e-9,1,.0157519,.00332021,4.55569e-8]},{ColorSpace:"Lab",Name:"erdc_iceFire_L",RGBPoints:[-1,.870485,.913768,.832905,-.87451,.586919,.887865,.934003,-.74902,.31583,.776442,.867858,-.623529,.18302,.632034,.787722,-.498039,.117909,.484134,.713825,-.372549,.0507239,.335979,.654741,-.247059,0,.209874,.511832,-.121569,0,.114689,.28935,.00392157,.0157519,.00332021,4.55569e-8,.129412,.312914,0,0,.254902,.520865,0,0,.380392,.680105,.15255,.0025996,.505882,.785109,.339479,797922e-9,.631373,.857354,.522494,0,.756863,.910974,.699774,0,.882353,.951921,.842817,.478545,1,.881371,.912178,.818099]},{ColorSpace:"RGB",Name:"hsv",RGBPoints:[-1,1,0,0,-.666666,1,0,1,-.333333,0,0,1,0,0,1,1,.33333,0,1,0,.66666,1,1,0,1,1,0,0]},{ColorSpace:"Lab",Name:"hue_L60",RGBPoints:[-1,.964784,.400592,.349549,-.87451,.964915,.372498,.53785,-.74902,.892353,.401039,.759569,-.623529,.79263,.446956,.903017,-.498039,.682208,.49954,.966673,-.372549,.56392,.553082,.968836,-.247059,.442031,.606396,.901601,-.121569,.305499,.65701,.765784,.00392157,.197251,.687914,.620914,.129412,.193882,.701887,.472654,.254902,.249866,.706123,.320005,.380392,.35132,.697417,.202919,.505882,.498097,.669467,.125232,.631373,.637477,.626239,.107431,.756863,.762115,.56872,.155812,.882353,.889434,.481116,.240445,1,.964784,.400592,.349549]},{IndexedColors:[0,0,0,.8941176470588236,.1019607843137255,.1098039215686274,.2156862745098039,.4941176470588236,.7215686274509804,.3019607843137255,.6862745098039216,.2901960784313726,.596078431372549,.3058823529411765,.6392156862745098,1,.4980392156862745,0,.6509803921568628,.3372549019607843,.1568627450980392],Name:"Spectrum",NanColor:[.6509803921568628,.3372549019607843,.1568627450980392]},{IndexedColors:[.4745098039215686,.09019607843137255,.09019607843137255,.7098039215686275,.00392156862745098,.00392156862745098,.9372549019607843,.2784313725490196,.09803921568627451,.9764705882352941,.5137254901960784,.1411764705882353,1,.7058823529411765,0,1,.8980392156862745,.02352941176470588],Name:"Warm",NanColor:[1,.8980392156862745,.02352941176470588]},{IndexedColors:[.4588235294117647,.6941176470588235,.00392156862745098,.3450980392156863,.5019607843137255,.1607843137254902,.3137254901960784,.8431372549019608,.7490196078431373,.1098039215686274,.5843137254901961,.803921568627451,.2313725490196079,.407843137254902,.6705882352941176,.6039215686274509,.407843137254902,1,.3725490196078431,.2,.5019607843137255],Name:"Cool",NanColor:[.3725490196078431,.2,.5019607843137255]},{IndexedColors:[.2313725490196079,.407843137254902,.6705882352941176,.1098039215686274,.5843137254901961,.803921568627451,.3058823529411765,.8509803921568627,.9176470588235294,.4509803921568628,.6039215686274509,.8352941176470589,.2588235294117647,.2392156862745098,.6627450980392157,.3137254901960784,.3294117647058823,.5294117647058824,.06274509803921569,.1647058823529412,.3215686274509804],Name:"Blues",NanColor:[.06274509803921569,.1647058823529412,.3215686274509804]},{IndexedColors:[.1098039215686274,.5843137254901961,.803921568627451,.2313725490196079,.407843137254902,.6705882352941176,.4,.2431372549019608,.7176470588235294,.6352941176470588,.3294117647058823,.8117647058823529,.8705882352941177,.3803921568627451,.807843137254902,.8627450980392157,.3803921568627451,.5843137254901961,.2392156862745098,.06274509803921569,.3215686274509804],Name:"Wild Flower",NanColor:[.2392156862745098,.06274509803921569,.3215686274509804]},{IndexedColors:[.396078431372549,.4862745098039216,.2156862745098039,.4588235294117647,.6941176470588235,.00392156862745098,.6980392156862745,.7294117647058823,.1882352941176471,1,.8980392156862745,.02352941176470588,1,.7058823529411765,0,.9764705882352941,.5137254901960784,.1411764705882353],Name:"Citrus",NanColor:[.9764705882352941,.5137254901960784,.1411764705882353]},{IndexedColors:[.4980392156862745,.2313725490196079,.03137254901960784,.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333,.1764705882352941,0,.2941176470588235],Name:"Brewer Diverging Purple-Orange (11)",NanColor:[.1764705882352941,0,.2941176470588235]},{IndexedColors:[.4980392156862745,.2313725490196079,.03137254901960784,.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333,.1764705882352941,0,.2941176470588235],Name:"Brewer Diverging Purple-Orange (10)",NanColor:[.1764705882352941,0,.2941176470588235]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (9)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (8)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.9450980392156862,.6392156862745098,.2509803921568627,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6,.5568627450980392,.7647058823529411,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (7)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.9450980392156862,.6392156862745098,.2509803921568627,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6,.5568627450980392,.7647058823529411,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (6)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.9019607843137255,.3803921568627451,.00392156862745098,.9921568627450981,.7215686274509804,.3882352941176471,.9686274509803922,.9686274509803922,.9686274509803922,.6980392156862745,.6705882352941176,.8235294117647058,.3686274509803922,.2352941176470588,.6],Name:"Brewer Diverging Purple-Orange (5)",NanColor:[.3686274509803922,.2352941176470588,.6]},{IndexedColors:[.9019607843137255,.3803921568627451,.00392156862745098,.9921568627450981,.7215686274509804,.3882352941176471,.6980392156862745,.6705882352941176,.8235294117647058,.3686274509803922,.2352941176470588,.6],Name:"Brewer Diverging Purple-Orange (4)",NanColor:[.3686274509803922,.2352941176470588,.6]},{IndexedColors:[.9450980392156862,.6392156862745098,.2509803921568627,.9686274509803922,.9686274509803922,.9686274509803922,.6,.5568627450980392,.7647058823529411],Name:"Brewer Diverging Purple-Orange (3)",NanColor:[.6,.5568627450980392,.7647058823529411]},{IndexedColors:[.6196078431372549,.00392156862745098,.2588235294117647,.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353,.3686274509803922,.3098039215686275,.6352941176470588],Name:"Brewer Diverging Spectral (11)",NanColor:[.3686274509803922,.3098039215686275,.6352941176470588]},{IndexedColors:[.6196078431372549,.00392156862745098,.2588235294117647,.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353,.3686274509803922,.3098039215686275,.6352941176470588],Name:"Brewer Diverging Spectral (10)",NanColor:[.3686274509803922,.3098039215686275,.6352941176470588]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (9)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (8)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9882352941176471,.5529411764705883,.3490196078431372,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6,.8352941176470589,.5803921568627451,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (7)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9882352941176471,.5529411764705883,.3490196078431372,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6,.8352941176470589,.5803921568627451,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (6)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8431372549019608,.09803921568627451,.1098039215686274,.9921568627450981,.6823529411764706,.3803921568627451,1,1,.7490196078431373,.6705882352941176,.8666666666666667,.6431372549019608,.1686274509803922,.5137254901960784,.7294117647058823],Name:"Brewer Diverging Spectral (5)",NanColor:[.1686274509803922,.5137254901960784,.7294117647058823]},{IndexedColors:[.8431372549019608,.09803921568627451,.1098039215686274,.9921568627450981,.6823529411764706,.3803921568627451,.6705882352941176,.8666666666666667,.6431372549019608,.1686274509803922,.5137254901960784,.7294117647058823],Name:"Brewer Diverging Spectral (4)",NanColor:[.1686274509803922,.5137254901960784,.7294117647058823]},{IndexedColors:[.9882352941176471,.5529411764705883,.3490196078431372,1,1,.7490196078431373,.6,.8352941176470589,.5803921568627451],Name:"Brewer Diverging Spectral (3)",NanColor:[.6,.8352941176470589,.5803921568627451]},{IndexedColors:[.3294117647058823,.1882352941176471,.0196078431372549,.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922,0,.2352941176470588,.1882352941176471],Name:"Brewer Diverging Brown-Blue-Green (11)",NanColor:[0,.2352941176470588,.1882352941176471]},{IndexedColors:[.3294117647058823,.1882352941176471,.0196078431372549,.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922,0,.2352941176470588,.1882352941176471],Name:"Brewer Diverging Brown-Blue-Green (10)",NanColor:[0,.2352941176470588,.1882352941176471]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (9)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (8)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.8470588235294118,.7019607843137254,.396078431372549,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.3529411764705883,.7058823529411765,.6745098039215687,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (7)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.8470588235294118,.7019607843137254,.396078431372549,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.3529411764705883,.7058823529411765,.6745098039215687,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (6)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.6509803921568628,.3803921568627451,.1019607843137255,.8745098039215686,.7607843137254902,.4901960784313725,.9607843137254902,.9607843137254902,.9607843137254902,.5019607843137255,.803921568627451,.7568627450980392,.00392156862745098,.5215686274509804,.4431372549019608],Name:"Brewer Diverging Brown-Blue-Green (5)",NanColor:[.00392156862745098,.5215686274509804,.4431372549019608]},{IndexedColors:[.6509803921568628,.3803921568627451,.1019607843137255,.8745098039215686,.7607843137254902,.4901960784313725,.5019607843137255,.803921568627451,.7568627450980392,.00392156862745098,.5215686274509804,.4431372549019608],Name:"Brewer Diverging Brown-Blue-Green (4)",NanColor:[.00392156862745098,.5215686274509804,.4431372549019608]},{IndexedColors:[.8470588235294118,.7019607843137254,.396078431372549,.9607843137254902,.9607843137254902,.9607843137254902,.3529411764705883,.7058823529411765,.6745098039215687],Name:"Brewer Diverging Brown-Blue-Green (3)",NanColor:[.3529411764705883,.7058823529411765,.6745098039215687]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8980392156862745,.9607843137254902,.9764705882352941,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.4274509803921568,.1725490196078431,0,.2666666666666667,.1058823529411765],Name:"Brewer Sequential Blue-Green (9)",NanColor:[0,.2666666666666667,.1058823529411765]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8980392156862745,.9607843137254902,.9764705882352941,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.3450980392156863,.1411764705882353],Name:"Brewer Sequential Blue-Green (8)",NanColor:[0,.3450980392156863,.1411764705882353]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.8,.9254901960784314,.9019607843137255,.8,.9254901960784314,.9019607843137255,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.3450980392156863,.1411764705882353],Name:"Brewer Sequential Blue-Green (7)",NanColor:[0,.3450980392156863,.1411764705882353]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.1725490196078431,.6352941176470588,.3725490196078431,0,.4274509803921568,.1725490196078431],Name:"Brewer Sequential Blue-Green (6)",NanColor:[0,.4274509803921568,.1725490196078431]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.6980392156862745,.8862745098039215,.8862745098039215,.4,.7607843137254902,.6431372549019608,.1725490196078431,.6352941176470588,.3725490196078431,0,.4274509803921568,.1725490196078431],Name:"Brewer Sequential Blue-Green (5)",NanColor:[0,.4274509803921568,.1725490196078431]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.6980392156862745,.8862745098039215,.8862745098039215,.4,.7607843137254902,.6431372549019608,.1372549019607843,.5450980392156862,.2705882352941176],Name:"Brewer Sequential Blue-Green (4)",NanColor:[.1372549019607843,.5450980392156862,.2705882352941176]},{IndexedColors:[.8980392156862745,.9607843137254902,.9764705882352941,.6,.8470588235294118,.788235294117647,.1725490196078431,.6352941176470588,.3725490196078431],Name:"Brewer Sequential Blue-Green (3)",NanColor:[.1725490196078431,.6352941176470588,.3725490196078431]},{IndexedColors:[1,1,.8980392156862745,1,.9686274509803922,.7372549019607844,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.6,.203921568627451,.01568627450980392,.4,.1450980392156863,.02352941176470588],Name:"Brewer Sequential Yellow-Orange-Brown (9)",NanColor:[.4,.1450980392156863,.02352941176470588]},{IndexedColors:[1,1,.8980392156862745,1,.9686274509803922,.7372549019607844,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.5490196078431373,.1764705882352941,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (8)",NanColor:[.5490196078431373,.1764705882352941,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.5490196078431373,.1764705882352941,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (7)",NanColor:[.5490196078431373,.1764705882352941,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.8509803921568627,.3725490196078431,.05490196078431372,.6,.203921568627451,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (6)",NanColor:[.6,.203921568627451,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8509803921568627,.5568627450980392,.996078431372549,.6,.1607843137254902,.8509803921568627,.3725490196078431,.05490196078431372,.6,.203921568627451,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (5)",NanColor:[.6,.203921568627451,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8509803921568627,.5568627450980392,.996078431372549,.6,.1607843137254902,.8,.2980392156862745,.00784313725490196],Name:"Brewer Sequential Yellow-Orange-Brown (4)",NanColor:[.8,.2980392156862745,.00784313725490196]},{IndexedColors:[1,.9686274509803922,.7372549019607844,.996078431372549,.7686274509803922,.3098039215686275,.8509803921568627,.3725490196078431,.05490196078431372],Name:"Brewer Sequential Yellow-Orange-Brown (3)",NanColor:[.8509803921568627,.3725490196078431,.05490196078431372]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8784313725490196,.9254901960784314,.9568627450980393,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.5058823529411764,.05882352941176471,.4862745098039216,.3019607843137255,0,.2941176470588235],Name:"Brewer Sequential Blue-Purple (9)",NanColor:[.3019607843137255,0,.2941176470588235]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8784313725490196,.9254901960784314,.9568627450980393,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.4313725490196079,.00392156862745098,.4196078431372549],Name:"Brewer Sequential Blue-Purple (8)",NanColor:[.4313725490196079,.00392156862745098,.4196078431372549]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.4313725490196079,.00392156862745098,.4196078431372549],Name:"Brewer Sequential Blue-Purple (7)",NanColor:[.4313725490196079,.00392156862745098,.4196078431372549]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.3372549019607843,.6549019607843137,.5058823529411764,.05882352941176471,.4862745098039216],Name:"Brewer Sequential Blue-Purple (6)",NanColor:[.5058823529411764,.05882352941176471,.4862745098039216]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7019607843137254,.803921568627451,.8901960784313725,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.3372549019607843,.6549019607843137,.5058823529411764,.05882352941176471,.4862745098039216],Name:"Brewer Sequential Blue-Purple (5)",NanColor:[.5058823529411764,.05882352941176471,.4862745098039216]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7019607843137254,.803921568627451,.8901960784313725,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.2549019607843137,.615686274509804],Name:"Brewer Sequential Blue-Purple (4)",NanColor:[.5333333333333333,.2549019607843137,.615686274509804]},{IndexedColors:[.8784313725490196,.9254901960784314,.9568627450980393,.6196078431372549,.7372549019607844,.8549019607843137,.5333333333333333,.3372549019607843,.6549019607843137],Name:"Brewer Sequential Blue-Purple (3)",NanColor:[.5333333333333333,.3372549019607843,.6549019607843137]},{IndexedColors:[.4980392156862745,.788235294117647,.4980392156862745,.7450980392156863,.6823529411764706,.8313725490196079,.9921568627450981,.7529411764705882,.5254901960784314,1,1,.6,.2196078431372549,.4235294117647059,.6901960784313725,.9411764705882353,.00784313725490196,.4980392156862745,.7490196078431373,.3568627450980392,.09019607843137255,.4,.4,.4],Name:"Brewer Qualitative Accent",NanColor:[.4,.4,.4]},{IndexedColors:[.1058823529411765,.6196078431372549,.4666666666666667,.8509803921568627,.3725490196078431,.00784313725490196,.4588235294117647,.4392156862745098,.7019607843137254,.9058823529411765,.1607843137254902,.5411764705882353,.4,.6509803921568628,.1176470588235294,.9019607843137255,.6705882352941176,.00784313725490196,.6509803921568628,.4627450980392157,.1137254901960784,.4,.4,.4],Name:"Brewer Qualitative Dark2",NanColor:[.4,.4,.4]},{IndexedColors:[.4,.7607843137254902,.6470588235294118,.9882352941176471,.5529411764705883,.3843137254901961,.5529411764705883,.6274509803921569,.796078431372549,.9058823529411765,.5411764705882353,.7647058823529411,.6509803921568628,.8470588235294118,.3294117647058823,1,.8509803921568627,.1843137254901961,.8980392156862745,.7686274509803922,.5803921568627451,.7019607843137254,.7019607843137254,.7019607843137254],Name:"Brewer Qualitative Set2",NanColor:[.7019607843137254,.7019607843137254,.7019607843137254]},{IndexedColors:[.7019607843137254,.8862745098039215,.803921568627451,.9921568627450981,.803921568627451,.6745098039215687,.796078431372549,.8352941176470589,.9098039215686274,.9568627450980393,.792156862745098,.8941176470588236,.9019607843137255,.9607843137254902,.788235294117647,1,.9490196078431372,.6823529411764706,.9450980392156862,.8862745098039215,.8,.8,.8,.8],Name:"Brewer Qualitative Pastel2",NanColor:[.8,.8,.8]},{IndexedColors:[.984313725490196,.7058823529411765,.6823529411764706,.7019607843137254,.803921568627451,.8901960784313725,.8,.9215686274509803,.7725490196078432,.8705882352941177,.796078431372549,.8941176470588236,.996078431372549,.8509803921568627,.6509803921568628,1,1,.8,.8980392156862745,.8470588235294118,.7411764705882353,.9921568627450981,.8549019607843137,.9254901960784314,.9490196078431372,.9490196078431372,.9490196078431372],Name:"Brewer Qualitative Pastel1",NanColor:[.9490196078431372,.9490196078431372,.9490196078431372]},{IndexedColors:[.8941176470588236,.1019607843137255,.1098039215686274,.2156862745098039,.4941176470588236,.7215686274509804,.3019607843137255,.6862745098039216,.2901960784313726,.596078431372549,.3058823529411765,.6392156862745098,1,.4980392156862745,0,1,1,.2,.6509803921568628,.3372549019607843,.1568627450980392,.9686274509803922,.5058823529411764,.7490196078431373,.6,.6,.6],Name:"Brewer Qualitative Set1",NanColor:[.6,.6,.6]},{IndexedColors:[.6509803921568628,.807843137254902,.8901960784313725,.1215686274509804,.4705882352941176,.7058823529411765,.6980392156862745,.8745098039215686,.5411764705882353,.2,.6274509803921569,.1725490196078431,.984313725490196,.6039215686274509,.6,.8901960784313725,.1019607843137255,.1098039215686274,.9921568627450981,.7490196078431373,.4352941176470588,1,.4980392156862745,0,.792156862745098,.6980392156862745,.8392156862745098,.4156862745098039,.2392156862745098,.6039215686274509,1,1,.6],Name:"Brewer Qualitative Paired",NanColor:[1,1,.6]},{IndexedColors:[.5529411764705883,.8274509803921568,.7803921568627451,1,1,.7019607843137254,.7450980392156863,.7294117647058823,.8549019607843137,.984313725490196,.5019607843137255,.4470588235294118,.5019607843137255,.6941176470588235,.8274509803921568,.9921568627450981,.7058823529411765,.3843137254901961,.7019607843137254,.8705882352941177,.4117647058823529,.9882352941176471,.803921568627451,.8980392156862745,.8509803921568627,.8509803921568627,.8509803921568627,.7372549019607844,.5019607843137255,.7411764705882353,.8,.9215686274509803,.7725490196078432,1,.9294117647058824,.4352941176470588],Name:"Brewer Qualitative Set3",NanColor:[1,.9294117647058824,.4352941176470588]},{IndexedColors:[1,0,0,1,.862745,0,0,.695201,0],Name:"Traffic Lights",NanColor:[.803922,0,.803922]},{IndexedColors:[.908659,.604013,.581857,1,.862745,0,0,.695201,0],Name:"Traffic Lights For Deuteranopes",NanColor:[.803922,0,.803922]},{IndexedColors:[.4196078431372549,0,.07058823529411765,.9019607843137255,.9411764705882353,.0196078431372549,.01568627450980392,.6196078431372549,.00784313725490196],Name:"Traffic Lights For Deuteranopes 2",NanColor:[.803922,0,.803922]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Muted Blue-Green",NanColor:[.25,0,0],RGBPoints:[0,.109804,.27451,.301961,.02,.129412,.309804,.341176,.05,.14902,.341176,.380392,.1,.188235,.403922,.458824,.15,.227451,.447059,.521569,.2,.290196,.494118,.588235,.25,.368627,.552941,.670588,.3,.458824,.619608,.74902,.35,.588235,.713725,.85098,.4,.72549,.815686,.941176,.45,.831373,.882353,.980392,.475,.909804,.933333,1,.5,.980392,.984314,1,.5,.996078,1,.94902,.5,1,1,.980392,.5,.980392,.984314,1,.525,.972549,.988235,.890196,.55,.917647,.960784,.835294,.6,.835294,.921569,.772549,.65,.768627,.901961,.737255,.7,.670588,.831373,.654902,.75,.576471,.760784,.584314,.8,.498039,.678431,.521569,.85,.392157,.560784,.427451,.9,.294118,.45098,.333333,.95,.211765,.34902,.254902,1,.152941,.278431,.196078]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Green-Blue Asymmetric Divergent (62Blbc)",NanColor:[.25,0,0],RGBPoints:[0,.121569,.2,.145098,.05,.196078,.301961,.223529,.1,.258824,.4,.278431,.2,.341176,.54902,.341176,.25,.419608,.619608,.376471,.3,.545098,.701961,.392157,.35,.643137,.780392,.403922,.4,.729412,.819608,.45098,.45,.811765,.870588,.521569,.5,.898039,.909804,.564706,.55,.941176,.92549,.686275,.6,.960784,.94902,.776471,.64,1,1,1,.65,.890196,.988235,.972549,.7,.721569,.894118,.901961,.75,.631373,.823529,.839216,.8,.517647,.662745,.701961,.85,.384314,.494118,.54902,.9,.298039,.360784,.45098,.95,.223529,.25098,.34902,.99,.156863,.172549,.25098,1,.137255,.137255,.188235]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Asymmtrical Earth Tones (6_21b)",NanColor:[.25,0,0],RGBPoints:[0,.141176,.14902,.2,.05,.215686,.258824,.321569,.1,.243137,.368627,.380392,.15,.27451,.439216,.4,.2,.32549,.501961,.384314,.25,.403922,.6,.419608,.3,.486275,.701961,.454902,.35,.556863,.74902,.494118,.4,.670588,.8,.545098,.5,.854902,.901961,.631373,.55,.92549,.941176,.694118,.6,.960784,.94902,.776471,.65,.988235,.968627,.909804,.7,.839216,.815686,.772549,.75,.701961,.662745,.615686,.8,.6,.529412,.478431,.85,.501961,.403922,.360784,.9,.439216,.313725,.290196,1,.301961,.164706,.176471]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Yellow 15",NanColor:[.25,0,0],RGBPoints:[0,1,1,.988235,.002,1,1,.988235,.05,.984314,.988235,.843137,.1,.988235,.988235,.741176,.15,.980392,.968627,.654902,.2,.980392,.945098,.576471,.25,.968627,.905882,.486275,.3,.968627,.862745,.388235,.35,.960784,.803922,.286275,.4,.94902,.741176,.219608,.45,.941176,.678431,.14902,.5,.929412,.607843,.094118,.55,.921569,.545098,.054902,.6,.909804,.486275,.035294,.65,.890196,.411765,.019608,.7,.8,.305882,0,.75,.760784,.239216,0,.8,.678431,.180392,.011765,.85,.6,.121569,.023529,.9,.501961,.054902,.031373,.95,.4,.039216,.058824,1,.301961,.047059,.090196]},{ColorSpace:"Diverging",Name:"Magma (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.001462,466e-6,.013866,.003922,.002258,.001295,.018331,.007843,.003279,.002305,.023708,.011765,.004512,.00349,.029965,.015686,.00595,.004843,.03713,.019608,.007588,.006356,.044973,.023529,.009426,.008022,.052844,.027451,.011465,.009828,.06075,.031373,.013708,.011771,.068667,.035294,.016156,.01384,.076603,.039216,.018815,.016026,.084584,.043137,.021692,.01832,.09261,.047059,.024792,.020715,.100676,.05098,.028123,.023201,.108787,.054902,.031696,.025765,.116965,.058824,.03552,.028397,.125209,.062745,.039608,.03109,.133515,.066667,.04383,.03383,.141886,.070588,.048062,.036607,.150327,.07451,.05232,.039407,.158841,.078431,.056615,.04216,.167446,.082353,.060949,.044794,.176129,.086275,.06533,.047318,.184892,.090196,.069764,.049726,.193735,.094118,.074257,.052017,.20266,.098039,.078815,.054184,.211667,.101961,.083446,.056225,.220755,.105882,.088155,.058133,.229922,.109804,.092949,.059904,.239164,.113725,.097833,.061531,.248477,.117647,.102815,.06301,.257854,.121569,.107899,.064335,.267289,.12549,.113094,.065492,.276784,.129412,.118405,.066479,.286321,.133333,.123833,.067295,.295879,.137255,.12938,.067935,.305443,.141176,.135053,.068391,.315,.145098,.140858,.068654,.324538,.14902,.146785,.068738,.334011,.152941,.152839,.068637,.343404,.156863,.159018,.068354,.352688,.160784,.165308,.067911,.361816,.164706,.171713,.067305,.370771,.168627,.178212,.066576,.379497,.172549,.184801,.065732,.387973,.176471,.19146,.064818,.396152,.180392,.198177,.063862,.404009,.184314,.204935,.062907,.411514,.188235,.211718,.061992,.418647,.192157,.218512,.061158,.425392,.196078,.225302,.060445,.431742,.2,.232077,.059889,.437695,.203922,.238826,.059517,.443256,.207843,.245543,.059352,.448436,.211765,.25222,.059415,.453248,.215686,.258857,.059706,.45771,.219608,.265447,.060237,.46184,.223529,.271994,.060994,.46566,.227451,.278493,.061978,.46919,.231373,.284951,.063168,.472451,.235294,.291366,.064553,.475462,.239216,.29774,.066117,.478243,.243137,.304081,.067835,.480812,.247059,.310382,.069702,.483186,.25098,.316654,.07169,.48538,.254902,.322899,.073782,.487408,.258824,.329114,.075972,.489287,.262745,.335308,.078236,.491024,.266667,.341482,.080564,.492631,.270588,.347636,.082946,.494121,.27451,.353773,.085373,.495501,.278431,.359898,.087831,.496778,.282353,.366012,.090314,.49796,.286275,.372116,.092816,.499053,.290196,.378211,.095332,.500067,.294118,.384299,.097855,.501002,.298039,.390384,.100379,.501864,.301961,.396467,.102902,.502658,.305882,.402548,.10542,.503386,.309804,.408629,.10793,.504052,.313725,.414709,.110431,.504662,.317647,.420791,.11292,.505215,.321569,.426877,.115395,.505714,.32549,.432967,.117855,.50616,.329412,.439062,.120298,.506555,.333333,.445163,.122724,.506901,.337255,.451271,.125132,.507198,.341176,.457386,.127522,.507448,.345098,.463508,.129893,.507652,.34902,.46964,.132245,.507809,.352941,.47578,.134577,.507921,.356863,.481929,.136891,.507989,.360784,.488088,.139186,.508011,.364706,.494258,.141462,.507988,.368627,.500438,.143719,.50792,.372549,.506629,.145958,.507806,.376471,.512831,.148179,.507648,.380392,.519045,.150383,.507443,.384314,.52527,.152569,.507192,.388235,.531507,.154739,.506895,.392157,.537755,.156894,.506551,.396078,.544015,.159033,.506159,.4,.550287,.161158,.505719,.403922,.556571,.163269,.50523,.407843,.562866,.165368,.504692,.411765,.569172,.167454,.504105,.415686,.57549,.16953,.503466,.419608,.581819,.171596,.502777,.423529,.588158,.173652,.502035,.427451,.594508,.175701,.501241,.431373,.600868,.177743,.500394,.435294,.607238,.179779,.499492,.439216,.613617,.181811,.498536,.443137,.620005,.18384,.497524,.447059,.626401,.185867,.496456,.45098,.632805,.187893,.495332,.454902,.639216,.189921,.49415,.458824,.645633,.191952,.49291,.462745,.652056,.193986,.491611,.466667,.658483,.196027,.490253,.470588,.664915,.198075,.488836,.47451,.671349,.200133,.487358,.478431,.677786,.202203,.485819,.482353,.684224,.204286,.484219,.486275,.690661,.206384,.482558,.490196,.697098,.208501,.480835,.494118,.703532,.210638,.479049,.498039,.709962,.212797,.477201,.501961,.716387,.214982,.47529,.505882,.722805,.217194,.473316,.509804,.729216,.219437,.471279,.513725,.735616,.221713,.46918,.517647,.742004,.224025,.467018,.521569,.748378,.226377,.464794,.52549,.754737,.228772,.462509,.529412,.761077,.231214,.460162,.533333,.767398,.233705,.457755,.537255,.773695,.236249,.455289,.541176,.779968,.238851,.452765,.545098,.786212,.241514,.450184,.54902,.792427,.244242,.447543,.552941,.798608,.24704,.444848,.556863,.804752,.249911,.442102,.560784,.810855,.252861,.439305,.564706,.816914,.255895,.436461,.568627,.822926,.259016,.433573,.572549,.828886,.262229,.430644,.576471,.834791,.26554,.427671,.580392,.840636,.268953,.424666,.584314,.846416,.272473,.421631,.588235,.852126,.276106,.418573,.592157,.857763,.279857,.415496,.596078,.86332,.283729,.412403,.6,.868793,.287728,.409303,.603922,.874176,.291859,.406205,.607843,.879464,.296125,.403118,.611765,.884651,.30053,.400047,.615686,.889731,.305079,.397002,.619608,.8947,.309773,.393995,.623529,.899552,.314616,.391037,.627451,.904281,.31961,.388137,.631373,.908884,.324755,.385308,.635294,.913354,.330052,.382563,.639216,.917689,.3355,.379915,.643137,.921884,.341098,.377376,.647059,.925937,.346844,.374959,.65098,.929845,.352734,.372677,.654902,.933606,.358764,.370541,.658824,.937221,.364929,.368567,.662745,.940687,.371224,.366762,.666667,.944006,.377643,.365136,.670588,.94718,.384178,.363701,.67451,.95021,.39082,.362468,.678431,.953099,.397563,.361438,.682353,.955849,.4044,.360619,.686275,.958464,.411324,.360014,.690196,.960949,.418323,.35963,.694118,.96331,.42539,.359469,.698039,.965549,.432519,.359529,.701961,.967671,.439703,.35981,.705882,.96968,.446936,.360311,.709804,.971582,.45421,.36103,.713725,.973381,.46152,.361965,.717647,.975082,.468861,.363111,.721569,.97669,.476226,.364466,.72549,.97821,.483612,.366025,.729412,.979645,.491014,.367783,.733333,.981,.498428,.369734,.737255,.982279,.505851,.371874,.741176,.983485,.51328,.374198,.745098,.984622,.520713,.376698,.74902,.985693,.528148,.379371,.752941,.9867,.535582,.38221,.756863,.987646,.543015,.38521,.760784,.988533,.550446,.388365,.764706,.989363,.557873,.391671,.768627,.990138,.565296,.395122,.772549,.990871,.572706,.398714,.776471,.991558,.580107,.402441,.780392,.992196,.587502,.406299,.784314,.992785,.594891,.410283,.788235,.993326,.602275,.41439,.792157,.993834,.609644,.418613,.796078,.994309,.616999,.42295,.8,.994738,.62435,.427397,.803922,.995122,.631696,.431951,.807843,.99548,.639027,.436607,.811765,.99581,.646344,.441361,.815686,.996096,.653659,.446213,.819608,.996341,.660969,.45116,.823529,.99658,.668256,.456192,.827451,.996775,.675541,.461314,.831373,.996925,.682828,.466526,.835294,.997077,.690088,.471811,.839216,.997186,.697349,.477182,.843137,.997254,.704611,.482635,.847059,.997325,.711848,.488154,.85098,.997351,.719089,.493755,.854902,.997351,.726324,.499428,.858824,.997341,.733545,.505167,.862745,.997285,.740772,.510983,.866667,.997228,.747981,.516859,.870588,.997138,.75519,.522806,.87451,.997019,.762398,.528821,.878431,.996898,.769591,.534892,.882353,.996727,.776795,.541039,.886275,.996571,.783977,.547233,.890196,.996369,.791167,.553499,.894118,.996162,.798348,.55982,.898039,.995932,.805527,.566202,.901961,.99568,.812706,.572645,.905882,.995424,.819875,.57914,.909804,.995131,.827052,.585701,.913725,.994851,.834213,.592307,.917647,.994524,.841387,.598983,.921569,.994222,.84854,.605696,.92549,.993866,.855711,.612482,.929412,.993545,.862859,.619299,.933333,.99317,.870024,.626189,.937255,.992831,.877168,.633109,.941176,.99244,.88433,.640099,.945098,.992089,.89147,.647116,.94902,.991688,.898627,.654202,.952941,.991332,.905763,.661309,.956863,.99093,.912915,.668481,.960784,.99057,.920049,.675675,.964706,.990175,.927196,.682926,.968627,.989815,.934329,.690198,.972549,.989434,.94147,.697519,.976471,.989077,.948604,.704863,.980392,.988717,.955742,.712242,.984314,.988367,.962878,.719649,.988235,.988033,.970012,.727077,.992157,.987691,.977154,.734536,.996078,.987387,.984288,.742002,1,.987053,.991438,.749504]},{ColorSpace:"Diverging",Name:"Inferno (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.001462,466e-6,.013866,.003922,.002267,.00127,.01857,.007843,.003299,.002249,.024239,.011765,.004547,.003392,.030909,.015686,.006006,.004692,.038558,.019608,.007676,.006136,.046836,.023529,.009561,.007713,.055143,.027451,.011663,.009417,.06346,.031373,.013995,.011225,.071862,.035294,.016561,.013136,.080282,.039216,.019373,.015133,.088767,.043137,.022447,.017199,.097327,.047059,.025793,.019331,.10593,.05098,.029432,.021503,.114621,.054902,.033385,.023702,.123397,.058824,.037668,.025921,.132232,.062745,.042253,.028139,.141141,.066667,.046915,.030324,.150164,.070588,.051644,.032474,.159254,.07451,.056449,.034569,.168414,.078431,.06134,.03659,.177642,.082353,.066331,.038504,.186962,.086275,.071429,.040294,.196354,.090196,.076637,.041905,.205799,.094118,.081962,.043328,.215289,.098039,.087411,.044556,.224813,.101961,.09299,.045583,.234358,.105882,.098702,.046402,.243904,.109804,.104551,.047008,.25343,.113725,.110536,.047399,.262912,.117647,.116656,.047574,.272321,.121569,.122908,.047536,.281624,.12549,.129285,.047293,.290788,.129412,.135778,.046856,.299776,.133333,.142378,.046242,.308553,.137255,.149073,.045468,.317085,.141176,.15585,.044559,.325338,.145098,.162689,.043554,.333277,.14902,.169575,.042489,.340874,.152941,.176493,.041402,.348111,.156863,.183429,.040329,.354971,.160784,.190367,.039309,.361447,.164706,.197297,.0384,.367535,.168627,.204209,.037632,.373238,.172549,.211095,.03703,.378563,.176471,.217949,.036615,.383522,.180392,.224763,.036405,.388129,.184314,.231538,.036405,.3924,.188235,.238273,.036621,.396353,.192157,.244967,.037055,.400007,.196078,.25162,.037705,.403378,.2,.258234,.038571,.406485,.203922,.26481,.039647,.409345,.207843,.271347,.040922,.411976,.211765,.27785,.042353,.414392,.215686,.284321,.043933,.416608,.219608,.290763,.045644,.418637,.223529,.297178,.04747,.420491,.227451,.303568,.049396,.422182,.231373,.309935,.051407,.423721,.235294,.316282,.05349,.425116,.239216,.32261,.055634,.426377,.243137,.328921,.057827,.427511,.247059,.335217,.06006,.428524,.25098,.3415,.062325,.429425,.254902,.347771,.064616,.430217,.258824,.354032,.066925,.430906,.262745,.360284,.069247,.431497,.266667,.366529,.071579,.431994,.270588,.372768,.073915,.4324,.27451,.379001,.076253,.432719,.278431,.385228,.078591,.432955,.282353,.391453,.080927,.433109,.286275,.397674,.083257,.433183,.290196,.403894,.08558,.433179,.294118,.410113,.087896,.433098,.298039,.416331,.090203,.432943,.301961,.422549,.092501,.432714,.305882,.428768,.09479,.432412,.309804,.434987,.097069,.432039,.313725,.441207,.099338,.431594,.317647,.447428,.101597,.43108,.321569,.453651,.103848,.430498,.32549,.459875,.106089,.429846,.329412,.4661,.108322,.429125,.333333,.472328,.110547,.428334,.337255,.478558,.112764,.427475,.341176,.484789,.114974,.426548,.345098,.491022,.117179,.425552,.34902,.497257,.119379,.424488,.352941,.503493,.121575,.423356,.356863,.50973,.123769,.422156,.360784,.515967,.12596,.420887,.364706,.522206,.12815,.419549,.368627,.528444,.130341,.418142,.372549,.534683,.132534,.416667,.376471,.54092,.134729,.415123,.380392,.547157,.136929,.413511,.384314,.553392,.139134,.411829,.388235,.559624,.141346,.410078,.392157,.565854,.143567,.408258,.396078,.572081,.145797,.406369,.4,.578304,.148039,.404411,.403922,.584521,.150294,.402385,.407843,.590734,.152563,.40029,.411765,.59694,.154848,.398125,.415686,.603139,.157151,.395891,.419608,.60933,.159474,.393589,.423529,.615513,.161817,.391219,.427451,.621685,.164184,.388781,.431373,.627847,.166575,.386276,.435294,.633998,.168992,.383704,.439216,.640135,.171438,.381065,.443137,.64626,.173914,.378359,.447059,.652369,.176421,.375586,.45098,.658463,.178962,.372748,.454902,.66454,.181539,.369846,.458824,.670599,.184153,.366879,.462745,.676638,.186807,.363849,.466667,.682656,.189501,.360757,.470588,.688653,.192239,.357603,.47451,.694627,.195021,.354388,.478431,.700576,.197851,.351113,.482353,.7065,.200728,.347777,.486275,.712396,.203656,.344383,.490196,.718264,.206636,.340931,.494118,.724103,.20967,.337424,.498039,.729909,.212759,.333861,.501961,.735683,.215906,.330245,.505882,.741423,.219112,.326576,.509804,.747127,.222378,.322856,.513725,.752794,.225706,.319085,.517647,.758422,.229097,.315266,.521569,.76401,.232554,.311399,.52549,.769556,.236077,.307485,.529412,.775059,.239667,.303526,.533333,.780517,.243327,.299523,.537255,.785929,.247056,.295477,.541176,.791293,.250856,.29139,.545098,.796607,.254728,.287264,.54902,.801871,.258674,.283099,.552941,.807082,.262692,.278898,.556863,.812239,.266786,.274661,.560784,.817341,.270954,.27039,.564706,.822386,.275197,.266085,.568627,.827372,.279517,.26175,.572549,.832299,.283913,.257383,.576471,.837165,.288385,.252988,.580392,.841969,.292933,.248564,.584314,.846709,.297559,.244113,.588235,.851384,.30226,.239636,.592157,.855992,.307038,.235133,.596078,.860533,.311892,.230606,.6,.865006,.316822,.226055,.603922,.869409,.321827,.221482,.607843,.873741,.326906,.216886,.611765,.878001,.33206,.212268,.615686,.882188,.337287,.207628,.619608,.886302,.342586,.202968,.623529,.890341,.347957,.198286,.627451,.894305,.353399,.193584,.631373,.898192,.358911,.18886,.635294,.902003,.364492,.184116,.639216,.905735,.37014,.17935,.643137,.90939,.375856,.174563,.647059,.912966,.381636,.169755,.65098,.916462,.387481,.164924,.654902,.919879,.393389,.16007,.658824,.923215,.399359,.155193,.662745,.92647,.405389,.150292,.666667,.929644,.411479,.145367,.670588,.932737,.417627,.140417,.67451,.935747,.423831,.13544,.678431,.938675,.430091,.130438,.682353,.941521,.436405,.125409,.686275,.944285,.442772,.120354,.690196,.946965,.449191,.115272,.694118,.949562,.45566,.110164,.698039,.952075,.462178,.105031,.701961,.954506,.468744,.099874,.705882,.956852,.475356,.094695,.709804,.959114,.482014,.089499,.713725,.961293,.488716,.084289,.717647,.963387,.495462,.079073,.721569,.965397,.502249,.073859,.72549,.967322,.509078,.068659,.729412,.969163,.515946,.063488,.733333,.970919,.522853,.058367,.737255,.97259,.529798,.053324,.741176,.974176,.53678,.048392,.745098,.975677,.543798,.043618,.74902,.977092,.55085,.03905,.752941,.978422,.557937,.034931,.756863,.979666,.565057,.031409,.760784,.980824,.572209,.028508,.764706,.981895,.579392,.02625,.768627,.982881,.586606,.024661,.772549,.983779,.593849,.02377,.776471,.984591,.601122,.023606,.780392,.985315,.608422,.024202,.784314,.985952,.61575,.025592,.788235,.986502,.623105,.027814,.792157,.986964,.630485,.030908,.796078,.987337,.63789,.034916,.8,.987622,.64532,.039886,.803922,.987819,.652773,.045581,.807843,.987926,.66025,.05175,.811765,.987945,.667748,.058329,.815686,.987874,.675267,.065257,.819608,.987714,.682807,.072489,.823529,.987464,.690366,.07999,.827451,.987124,.697944,.087731,.831373,.986694,.70554,.095694,.835294,.986175,.713153,.103863,.839216,.985566,.720782,.112229,.843137,.984865,.728427,.120785,.847059,.984075,.736087,.129527,.85098,.983196,.743758,.138453,.854902,.982228,.751442,.147565,.858824,.981173,.759135,.156863,.862745,.980032,.766837,.166353,.866667,.978806,.774545,.176037,.870588,.977497,.782258,.185923,.87451,.976108,.789974,.196018,.878431,.974638,.797692,.206332,.882353,.973088,.805409,.216877,.886275,.971468,.813122,.227658,.890196,.969783,.820825,.238686,.894118,.968041,.828515,.249972,.898039,.966243,.836191,.261534,.901961,.964394,.843848,.273391,.905882,.962517,.851476,.285546,.909804,.960626,.859069,.29801,.913725,.95872,.866624,.31082,.917647,.956834,.874129,.323974,.921569,.954997,.881569,.337475,.92549,.953215,.888942,.351369,.929412,.951546,.896226,.365627,.933333,.950018,.903409,.380271,.937255,.948683,.910473,.395289,.941176,.947594,.917399,.410665,.945098,.946809,.924168,.426373,.94902,.946392,.930761,.442367,.952941,.946403,.937159,.458592,.956863,.946903,.943348,.47497,.960784,.947937,.949318,.491426,.964706,.949545,.955063,.50786,.968627,.95174,.960587,.524203,.972549,.954529,.965896,.540361,.976471,.957896,.971003,.556275,.980392,.961812,.975924,.571925,.984314,.966249,.980678,.587206,.988235,.971162,.985282,.602154,.992157,.976511,.989753,.61676,.996078,.982257,.994109,.631017,1,.988362,.998364,.644924]},{ColorSpace:"Diverging",Name:"Plasma (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.050383,.029803,.527975,.003922,.063536,.028426,.533124,.007843,.075353,.027206,.538007,.011765,.086222,.026125,.542658,.015686,.096379,.025165,.547103,.019608,.10598,.024309,.551368,.023529,.115124,.023556,.555468,.027451,.123903,.022878,.559423,.031373,.132381,.022258,.56325,.035294,.140603,.021687,.566959,.039216,.148607,.021154,.570562,.043137,.156421,.020651,.574065,.047059,.16407,.020171,.577478,.05098,.171574,.019706,.580806,.054902,.17895,.019252,.584054,.058824,.186213,.018803,.587228,.062745,.193374,.018354,.59033,.066667,.200445,.017902,.593364,.070588,.207435,.017442,.596333,.07451,.21435,.016973,.599239,.078431,.221197,.016497,.602083,.082353,.227983,.016007,.604867,.086275,.234715,.015502,.607592,.090196,.241396,.014979,.610259,.094118,.248032,.014439,.612868,.098039,.254627,.013882,.615419,.101961,.261183,.013308,.617911,.105882,.267703,.012716,.620346,.109804,.274191,.012109,.622722,.113725,.280648,.011488,.625038,.117647,.287076,.010855,.627295,.121569,.293478,.010213,.62949,.12549,.299855,.009561,.631624,.129412,.30621,.008902,.633694,.133333,.312543,.008239,.6357,.137255,.318856,.007576,.63764,.141176,.32515,.006915,.639512,.145098,.331426,.006261,.641316,.14902,.337683,.005618,.643049,.152941,.343925,.004991,.64471,.156863,.35015,.004382,.646298,.160784,.356359,.003798,.64781,.164706,.362553,.003243,.649245,.168627,.368733,.002724,.650601,.172549,.374897,.002245,.651876,.176471,.381047,.001814,.653068,.180392,.387183,.001434,.654177,.184314,.393304,.001114,.655199,.188235,.399411,859e-6,.656133,.192157,.405503,678e-6,.656977,.196078,.41158,577e-6,.65773,.2,.417642,564e-6,.65839,.203922,.423689,646e-6,.658956,.207843,.429719,831e-6,.659425,.211765,.435734,.001127,.659797,.215686,.441732,.00154,.660069,.219608,.447714,.00208,.66024,.223529,.453677,.002755,.66031,.227451,.459623,.003574,.660277,.231373,.46555,.004545,.660139,.235294,.471457,.005678,.659897,.239216,.477344,.00698,.659549,.243137,.48321,.00846,.659095,.247059,.489055,.010127,.658534,.25098,.494877,.01199,.657865,.254902,.500678,.014055,.657088,.258824,.506454,.016333,.656202,.262745,.512206,.018833,.655209,.266667,.517933,.021563,.654109,.270588,.523633,.024532,.652901,.27451,.529306,.027747,.651586,.278431,.534952,.031217,.650165,.282353,.54057,.03495,.64864,.286275,.546157,.038954,.64701,.290196,.551715,.043136,.645277,.294118,.557243,.047331,.643443,.298039,.562738,.051545,.641509,.301961,.568201,.055778,.639477,.305882,.573632,.060028,.637349,.309804,.579029,.064296,.635126,.313725,.584391,.068579,.632812,.317647,.589719,.072878,.630408,.321569,.595011,.07719,.627917,.32549,.600266,.081516,.625342,.329412,.605485,.085854,.622686,.333333,.610667,.090204,.619951,.337255,.615812,.094564,.61714,.341176,.620919,.098934,.614257,.345098,.625987,.103312,.611305,.34902,.631017,.107699,.608287,.352941,.636008,.112092,.605205,.356863,.640959,.116492,.602065,.360784,.645872,.120898,.598867,.364706,.650746,.125309,.595617,.368627,.65558,.129725,.592317,.372549,.660374,.134144,.588971,.376471,.665129,.138566,.585582,.380392,.669845,.142992,.582154,.384314,.674522,.147419,.578688,.388235,.67916,.151848,.575189,.392157,.683758,.156278,.57166,.396078,.688318,.160709,.568103,.4,.69284,.165141,.564522,.403922,.697324,.169573,.560919,.407843,.701769,.174005,.557296,.411765,.706178,.178437,.553657,.415686,.710549,.182868,.550004,.419608,.714883,.187299,.546338,.423529,.719181,.191729,.542663,.427451,.723444,.196158,.538981,.431373,.72767,.200586,.535293,.435294,.731862,.205013,.531601,.439216,.736019,.209439,.527908,.443137,.740143,.213864,.524216,.447059,.744232,.218288,.520524,.45098,.748289,.222711,.516834,.454902,.752312,.227133,.513149,.458824,.756304,.231555,.509468,.462745,.760264,.235976,.505794,.466667,.764193,.240396,.502126,.470588,.76809,.244817,.498465,.47451,.771958,.249237,.494813,.478431,.775796,.253658,.491171,.482353,.779604,.258078,.487539,.486275,.783383,.2625,.483918,.490196,.787133,.266922,.480307,.494118,.790855,.271345,.476706,.498039,.794549,.27577,.473117,.501961,.798216,.280197,.469538,.505882,.801855,.284626,.465971,.509804,.805467,.289057,.462415,.513725,.809052,.293491,.45887,.517647,.812612,.297928,.455338,.521569,.816144,.302368,.451816,.52549,.819651,.306812,.448306,.529412,.823132,.311261,.444806,.533333,.826588,.315714,.441316,.537255,.830018,.320172,.437836,.541176,.833422,.324635,.434366,.545098,.836801,.329105,.430905,.54902,.840155,.33358,.427455,.552941,.843484,.338062,.424013,.556863,.846788,.342551,.420579,.560784,.850066,.347048,.417153,.564706,.853319,.351553,.413734,.568627,.856547,.356066,.410322,.572549,.85975,.360588,.406917,.576471,.862927,.365119,.403519,.580392,.866078,.36966,.400126,.584314,.869203,.374212,.396738,.588235,.872303,.378774,.393355,.592157,.875376,.383347,.389976,.596078,.878423,.387932,.3866,.6,.881443,.392529,.383229,.603922,.884436,.397139,.37986,.607843,.887402,.401762,.376494,.611765,.89034,.406398,.37313,.615686,.89325,.411048,.369768,.619608,.896131,.415712,.366407,.623529,.898984,.420392,.363047,.627451,.901807,.425087,.359688,.631373,.904601,.429797,.356329,.635294,.907365,.434524,.35297,.639216,.910098,.439268,.34961,.643137,.9128,.444029,.346251,.647059,.915471,.448807,.34289,.65098,.918109,.453603,.339529,.654902,.920714,.458417,.336166,.658824,.923287,.463251,.332801,.662745,.925825,.468103,.329435,.666667,.928329,.472975,.326067,.670588,.930798,.477867,.322697,.67451,.933232,.48278,.319325,.678431,.93563,.487712,.315952,.682353,.93799,.492667,.312575,.686275,.940313,.497642,.309197,.690196,.942598,.502639,.305816,.694118,.944844,.507658,.302433,.698039,.947051,.512699,.299049,.701961,.949217,.517763,.295662,.705882,.951344,.52285,.292275,.709804,.953428,.52796,.288883,.713725,.95547,.533093,.28549,.717647,.957469,.53825,.282096,.721569,.959424,.543431,.278701,.72549,.961336,.548636,.275305,.729412,.963203,.553865,.271909,.733333,.965024,.559118,.268513,.737255,.966798,.564396,.265118,.741176,.968526,.5697,.261721,.745098,.970205,.575028,.258325,.74902,.971835,.580382,.254931,.752941,.973416,.585761,.25154,.756863,.974947,.591165,.248151,.760784,.976428,.596595,.244767,.764706,.977856,.602051,.241387,.768627,.979233,.607532,.238013,.772549,.980556,.613039,.234646,.776471,.981826,.618572,.231287,.780392,.983041,.624131,.227937,.784314,.984199,.629718,.224595,.788235,.985301,.63533,.221265,.792157,.986345,.640969,.217948,.796078,.987332,.646633,.214648,.8,.98826,.652325,.211364,.803922,.989128,.658043,.2081,.807843,.989935,.663787,.204859,.811765,.990681,.669558,.201642,.815686,.991365,.675355,.198453,.819608,.991985,.681179,.195295,.823529,.992541,.68703,.19217,.827451,.993032,.692907,.189084,.831373,.993456,.69881,.186041,.835294,.993814,.704741,.183043,.839216,.994103,.710698,.180097,.843137,.994324,.716681,.177208,.847059,.994474,.722691,.174381,.85098,.994553,.728728,.171622,.854902,.994561,.734791,.168938,.858824,.994495,.74088,.166335,.862745,.994355,.746995,.163821,.866667,.994141,.753137,.161404,.870588,.993851,.759304,.159092,.87451,.993482,.765499,.156891,.878431,.993033,.77172,.154808,.882353,.992505,.777967,.152855,.886275,.991897,.784239,.151042,.890196,.991209,.790537,.149377,.894118,.990439,.796859,.14787,.898039,.989587,.803205,.146529,.901961,.988648,.809579,.145357,.905882,.987621,.815978,.144363,.909804,.986509,.822401,.143557,.913725,.985314,.828846,.142945,.917647,.984031,.835315,.142528,.921569,.982653,.841812,.142303,.92549,.98119,.848329,.142279,.929412,.979644,.854866,.142453,.933333,.977995,.861432,.142808,.937255,.976265,.868016,.143351,.941176,.974443,.874622,.144061,.945098,.97253,.88125,.144923,.94902,.970533,.887896,.145919,.952941,.968443,.894564,.147014,.956863,.966271,.901249,.14818,.960784,.964021,.90795,.14937,.964706,.961681,.914672,.15052,.968627,.959276,.921407,.151566,.972549,.956808,.928152,.152409,.976471,.954287,.934908,.152921,.980392,.951726,.941671,.152925,.984314,.949151,.948435,.152178,.988235,.946602,.95519,.150328,.992157,.944152,.961916,.146861,.996078,.941896,.96859,.140956,1,.940015,.975158,.131326]},{ColorSpace:"Diverging",Name:"Viridis (matplotlib)",NanColor:[1,0,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Eric Firing",RGBPoints:[0,.267004,.004874,.329415,.003922,.26851,.009605,.335427,.007843,.269944,.014625,.341379,.011765,.271305,.019942,.347269,.015686,.272594,.025563,.353093,.019608,.273809,.031497,.358853,.023529,.274952,.037752,.364543,.027451,.276022,.044167,.370164,.031373,.277018,.050344,.375715,.035294,.277941,.056324,.381191,.039216,.278791,.062145,.386592,.043137,.279566,.067836,.391917,.047059,.280267,.073417,.397163,.05098,.280894,.078907,.402329,.054902,.281446,.08432,.407414,.058824,.281924,.089666,.412415,.062745,.282327,.094955,.417331,.066667,.282656,.100196,.42216,.070588,.28291,.105393,.426902,.07451,.283091,.110553,.431554,.078431,.283197,.11568,.436115,.082353,.283229,.120777,.440584,.086275,.283187,.125848,.44496,.090196,.283072,.130895,.449241,.094118,.282884,.13592,.453427,.098039,.282623,.140926,.457517,.101961,.28229,.145912,.46151,.105882,.281887,.150881,.465405,.109804,.281412,.155834,.469201,.113725,.280868,.160771,.472899,.117647,.280255,.165693,.476498,.121569,.279574,.170599,.479997,.12549,.278826,.17549,.483397,.129412,.278012,.180367,.486697,.133333,.277134,.185228,.489898,.137255,.276194,.190074,.493001,.141176,.275191,.194905,.496005,.145098,.274128,.199721,.498911,.14902,.273006,.20452,.501721,.152941,.271828,.209303,.504434,.156863,.270595,.214069,.507052,.160784,.269308,.218818,.509577,.164706,.267968,.223549,.512008,.168627,.26658,.228262,.514349,.172549,.265145,.232956,.516599,.176471,.263663,.237631,.518762,.180392,.262138,.242286,.520837,.184314,.260571,.246922,.522828,.188235,.258965,.251537,.524736,.192157,.257322,.25613,.526563,.196078,.255645,.260703,.528312,.2,.253935,.265254,.529983,.203922,.252194,.269783,.531579,.207843,.250425,.27429,.533103,.211765,.248629,.278775,.534556,.215686,.246811,.283237,.535941,.219608,.244972,.287675,.53726,.223529,.243113,.292092,.538516,.227451,.241237,.296485,.539709,.231373,.239346,.300855,.540844,.235294,.237441,.305202,.541921,.239216,.235526,.309527,.542944,.243137,.233603,.313828,.543914,.247059,.231674,.318106,.544834,.25098,.229739,.322361,.545706,.254902,.227802,.326594,.546532,.258824,.225863,.330805,.547314,.262745,.223925,.334994,.548053,.266667,.221989,.339161,.548752,.270588,.220057,.343307,.549413,.27451,.21813,.347432,.550038,.278431,.21621,.351535,.550627,.282353,.214298,.355619,.551184,.286275,.212395,.359683,.55171,.290196,.210503,.363727,.552206,.294118,.208623,.367752,.552675,.298039,.206756,.371758,.553117,.301961,.204903,.375746,.553533,.305882,.203063,.379716,.553925,.309804,.201239,.38367,.554294,.313725,.19943,.387607,.554642,.317647,.197636,.391528,.554969,.321569,.19586,.395433,.555276,.32549,.1941,.399323,.555565,.329412,.192357,.403199,.555836,.333333,.190631,.407061,.556089,.337255,.188923,.41091,.556326,.341176,.187231,.414746,.556547,.345098,.185556,.41857,.556753,.34902,.183898,.422383,.556944,.352941,.182256,.426184,.55712,.356863,.180629,.429975,.557282,.360784,.179019,.433756,.55743,.364706,.177423,.437527,.557565,.368627,.175841,.44129,.557685,.372549,.174274,.445044,.557792,.376471,.172719,.448791,.557885,.380392,.171176,.45253,.557965,.384314,.169646,.456262,.55803,.388235,.168126,.459988,.558082,.392157,.166617,.463708,.558119,.396078,.165117,.467423,.558141,.4,.163625,.471133,.558148,.403922,.162142,.474838,.55814,.407843,.160665,.47854,.558115,.411765,.159194,.482237,.558073,.415686,.157729,.485932,.558013,.419608,.15627,.489624,.557936,.423529,.154815,.493313,.55784,.427451,.153364,.497,.557724,.431373,.151918,.500685,.557587,.435294,.150476,.504369,.55743,.439216,.149039,.508051,.55725,.443137,.147607,.511733,.557049,.447059,.14618,.515413,.556823,.45098,.144759,.519093,.556572,.454902,.143343,.522773,.556295,.458824,.141935,.526453,.555991,.462745,.140536,.530132,.555659,.466667,.139147,.533812,.555298,.470588,.13777,.537492,.554906,.47451,.136408,.541173,.554483,.478431,.135066,.544853,.554029,.482353,.133743,.548535,.553541,.486275,.132444,.552216,.553018,.490196,.131172,.555899,.552459,.494118,.129933,.559582,.551864,.498039,.128729,.563265,.551229,.501961,.127568,.566949,.550556,.505882,.126453,.570633,.549841,.509804,.125394,.574318,.549086,.513725,.124395,.578002,.548287,.517647,.123463,.581687,.547445,.521569,.122606,.585371,.546557,.52549,.121831,.589055,.545623,.529412,.121148,.592739,.544641,.533333,.120565,.596422,.543611,.537255,.120092,.600104,.54253,.541176,.119738,.603785,.5414,.545098,.119512,.607464,.540218,.54902,.119423,.611141,.538982,.552941,.119483,.614817,.537692,.556863,.119699,.61849,.536347,.560784,.120081,.622161,.534946,.564706,.120638,.625828,.533488,.568627,.12138,.629492,.531973,.572549,.122312,.633153,.530398,.576471,.123444,.636809,.528763,.580392,.12478,.640461,.527068,.584314,.126326,.644107,.525311,.588235,.128087,.647749,.523491,.592157,.130067,.651384,.521608,.596078,.132268,.655014,.519661,.6,.134692,.658636,.517649,.603922,.137339,.662252,.515571,.607843,.14021,.665859,.513427,.611765,.143303,.669459,.511215,.615686,.146616,.67305,.508936,.619608,.150148,.676631,.506589,.623529,.153894,.680203,.504172,.627451,.157851,.683765,.501686,.631373,.162016,.687316,.499129,.635294,.166383,.690856,.496502,.639216,.170948,.694384,.493803,.643137,.175707,.6979,.491033,.647059,.180653,.701402,.488189,.65098,.185783,.704891,.485273,.654902,.19109,.708366,.482284,.658824,.196571,.711827,.479221,.662745,.202219,.715272,.476084,.666667,.20803,.718701,.472873,.670588,.214,.722114,.469588,.67451,.220124,.725509,.466226,.678431,.226397,.728888,.462789,.682353,.232815,.732247,.459277,.686275,.239374,.735588,.455688,.690196,.24607,.73891,.452024,.694118,.252899,.742211,.448284,.698039,.259857,.745492,.444467,.701961,.266941,.748751,.440573,.705882,.274149,.751988,.436601,.709804,.281477,.755203,.432552,.713725,.288921,.758394,.428426,.717647,.296479,.761561,.424223,.721569,.304148,.764704,.419943,.72549,.311925,.767822,.415586,.729412,.319809,.770914,.411152,.733333,.327796,.77398,.40664,.737255,.335885,.777018,.402049,.741176,.344074,.780029,.397381,.745098,.35236,.783011,.392636,.74902,.360741,.785964,.387814,.752941,.369214,.788888,.382914,.756863,.377779,.791781,.377939,.760784,.386433,.794644,.372886,.764706,.395174,.797475,.367757,.768627,.404001,.800275,.362552,.772549,.412913,.803041,.357269,.776471,.421908,.805774,.35191,.780392,.430983,.808473,.346476,.784314,.440137,.811138,.340967,.788235,.449368,.813768,.335384,.792157,.458674,.816363,.329727,.796078,.468053,.818921,.323998,.8,.477504,.821444,.318195,.803922,.487026,.823929,.312321,.807843,.496615,.826376,.306377,.811765,.506271,.828786,.300362,.815686,.515992,.831158,.294279,.819608,.525776,.833491,.288127,.823529,.535621,.835785,.281908,.827451,.545524,.838039,.275626,.831373,.555484,.840254,.269281,.835294,.565498,.84243,.262877,.839216,.575563,.844566,.256415,.843137,.585678,.846661,.249897,.847059,.595839,.848717,.243329,.85098,.606045,.850733,.236712,.854902,.616293,.852709,.230052,.858824,.626579,.854645,.223353,.862745,.636902,.856542,.21662,.866667,.647257,.8584,.209861,.870588,.657642,.860219,.203082,.87451,.668054,.861999,.196293,.878431,.678489,.863742,.189503,.882353,.688944,.865448,.182725,.886275,.699415,.867117,.175971,.890196,.709898,.868751,.169257,.894118,.720391,.87035,.162603,.898039,.730889,.871916,.156029,.901961,.741388,.873449,.149561,.905882,.751884,.874951,.143228,.909804,.762373,.876424,.137064,.913725,.772852,.877868,.131109,.917647,.783315,.879285,.125405,.921569,.79376,.880678,.120005,.92549,.804182,.882046,.114965,.929412,.814576,.883393,.110347,.933333,.82494,.88472,.106217,.937255,.83527,.886029,.102646,.941176,.845561,.887322,.099702,.945098,.85581,.888601,.097452,.94902,.866013,.889868,.095953,.952941,.876168,.891125,.09525,.956863,.886271,.892374,.095374,.960784,.89632,.893616,.096335,.964706,.906311,.894855,.098125,.968627,.916242,.896091,.100717,.972549,.926106,.89733,.104071,.976471,.935904,.89857,.108131,.980392,.945636,.899815,.112838,.984314,.9553,.901065,.118128,.988235,.964894,.902323,.123941,.992157,.974417,.90359,.130215,.996078,.983868,.904867,.136897,1,.993248,.906157,.143936]},{ShowIndexedColorActiveValues:1,IndexedColors:[.07,.5,.7,1,1,1,.85,1,1,.8,.5,1,.76,1,0,1,.71,.71,.5,.5,.5,.05,.05,1,1,.05,.05,.7,1,1,.7,.89,.96,.67,.36,.95,.54,1,0,.75,.65,.65,.5,.6,.6,1,.5,0,1,1,.19,.12,.94,.12,.5,.82,.89,.56,.25,.83,.24,1,0,.9,.9,.9,.75,.76,.78,.65,.65,.67,.54,.6,.78,.61,.48,.78,.5,.48,.78,.44,.48,.78,.36,.48,.76,1,.48,.38,.49,.5,.69,.76,.56,.56,.4,.56,.56,.74,.5,.89,1,.63,0,.65,.16,.16,.36,.72,.82,.44,.18,.69,0,1,0,.58,1,1,.58,.88,.88,.45,.76,.79,.33,.71,.71,.23,.62,.62,.14,.56,.56,.04,.49,.55,0,.41,.52,.88,.88,1,1,.85,.56,.65,.46,.45,.4,.5,.5,.62,.39,.71,.83,.48,0,.58,0,.58,.26,.62,.69,.34,.09,.56,0,.79,0,.44,.83,1,1,1,.78,.85,1,.78,.78,1,.78,.64,1,.78,.56,1,.78,.38,1,.78,.27,1,.78,.19,1,.78,.12,1,.78,0,1,.61,0,.9,.46,0,.83,.32,0,.75,.22,0,.67,.14,.3,.76,1,.3,.65,1,.13,.58,.84,.15,.49,.67,.15,.4,.59,.09,.33,.53,.96,.93,.82,.8,.82,.12,.71,.71,.76,.65,.33,.3,.34,.35,.38,.62,.31,.71,.67,.36,0,.46,.31,.27,.26,.51,.59,.26,0,.4,0,.49,0,.44,.67,.98,0,.73,1,0,.63,1,0,.56,1,0,.5,1,0,.42,1,.33,.36,.95,.47,.36,.89,.54,.31,.89,.63,.21,.83,.7,.12,.83,.7,.12,.73,.7,.05,.65,.74,.05,.53,.78,0,.4,.8,0,.35,.82,0,.31,.85,0,.27,.88,0,.22,.9,0,.18,.91,0,.15,.92,0,.14,.93,0,.13,.94,0,.12,.95,0,.11,.96,0,.1,.97,0,.09,.98,0,.08,.99,0,.07,1,0,.06],Annotations:[0,"Xx",1,"H",2,"He",3,"Li",4,"Be",5,"B",6,"C",7,"N",8,"O",9,"F",10,"Ne",11,"Na",12,"Mg",13,"Al",14,"Si",15,"P",16,"S",17,"Cl",18,"Ar",19,"K",20,"Ca",21,"Sc",22,"Ti",23,"V",24,"Cr",25,"Mn",26,"Fe",27,"Co",28,"Ni",29,"Cu",30,"Zn",31,"Ga",32,"Ge",33,"As",34,"Se",35,"Br",36,"Kr",37,"Rb",38,"Sr",39,"Y",40,"Zr",41,"Nb",42,"Mo",43,"Tc",44,"Ru",45,"Rh",46,"Pd",47,"Ag",48,"Cd",49,"In",50,"Sn",51,"Sb",52,"Te",53,"I",54,"Xe",55,"Cs",56,"Ba",57,"La",58,"Ce",59,"Pr",60,"Nd",61,"Pm",62,"Sm",63,"Eu",64,"Gd",65,"Tb",66,"Dy",67,"Ho",68,"Er",69,"Tm",70,"Yb",71,"Lu",72,"Hf",73,"Ta",74,"W",75,"Re",76,"Os",77,"Ir",78,"Pt",79,"Au",80,"Hg",81,"Tl",82,"Pb",83,"Bi",84,"Po",85,"At",86,"Rn",87,"Fr",88,"Ra",89,"Ac",90,"Th",91,"Pa",92,"U",93,"Np",94,"Pu",95,"Am",96,"Cm",97,"Bk",98,"Cf",99,"Es",100,"Fm",101,"Md",102,"No",103,"Lr",104,"Rf",105,"Db",106,"Sg",107,"Bh",108,"Hs",109,"Mt",110,"Ds",111,"Rg",112,"Cn",113,"Uut",114,"Uuq",115,"Uup",116,"Uuh",117,"Uus",118,"Uuo"],Name:"BlueObeliskElements"}]},function(e,t,n){"use strict";var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments[3];return new Promise(function(o,i){var s=n._messageId++;n._messages.set(s,[o,i,a]),n._worker.postMessage([s,t,e],r||[])})}},{key:"postMessage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2];return new Promise(function(a,o){var i=t._messageId++;t._messages.set(i,[a,o,r]),t._worker.postMessage([i,e],n||[])})}},{key:"emit",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(l&&u){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;M(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){(function(e){var r;!function(e,a,o){function i(e){var t=this,n=function(){var e=4022871197;return function(t){t=String(t);for(var n=0;n>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)}}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=n(" "),t.s1=n(" "),t.s2=n(" "),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var n=new i(e),r=t&&t.state,a=n.next;return a.int32=function(){return 4294967296*n.next()|0},a.double=function(){return a()+1.1102230246251565e-16*(2097152*a()|0)},a.quick=a,r&&("object"==typeof r&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=l:n(2)&&n(4)?void 0===(r=function(){return l}.call(t,n,t,a))||(a.exports=r):this.alea=l}(0,e,n(2))}).call(this,n(3)(e))},function(e,t,n){(function(e){var r;!function(e,a,o){function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function s(e,t){var n=new function(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=s:n(2)&&n(4)?void 0===(r=function(){return s}.call(t,n,t,a))||(a.exports=r):this.xor128=s}(0,e,n(2))}).call(this,n(3)(e))},function(e,t,n){(function(e){var r;!function(e,a,o){function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function s(e,t){var n=new function(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r>>4),t.next()}(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=s:n(2)&&n(4)?void 0===(r=function(){return s}.call(t,n,t,a))||(a.exports=r):this.xorwow=s}(0,e,n(2))}).call(this,n(3)(e))},function(e,t,n){(function(e){var r;!function(e,a,o){function i(e,t){return t.x=e.x.slice(),t.i=e.i,t}function s(e,t){null==e&&(e=+new Date);var n=new function(e){var t=this;t.next=function(){var e,n,r=t.x,a=t.i;return e=r[a],n=(e^=e>>>7)^e<<24,n^=(e=r[a+1&7])^e>>>10,n^=(e=r[a+3&7])^e>>>3,n^=(e=r[a+4&7])^e<<7,e=r[a+7&7],n^=(e^=e<<13)^e<<9,r[a]=n,t.i=a+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n0;--n)e.next()}(t,e)}(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&(r.x&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=s:n(2)&&n(4)?void 0===(r=function(){return s}.call(t,n,t,a))||(a.exports=r):this.xorshift7=s}(0,e,n(2))}).call(this,n(3)(e))},function(e,t,n){(function(e){var r;!function(e,a,o){function i(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function s(e,t){null==e&&(e=+new Date);var n=new function(e){var t=this;t.next=function(){var e,n,r=t.w,a=t.X,o=t.i;return t.w=r=r+1640531527|0,n=a[o+34&127],e=a[o=o+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=a[o]=n^e,t.i=o,n+(r^r>>>16)|0},function(e,t){var n,r,a,o,i,s=[],l=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,l=Math.max(l,t.length)),a=0,o=-32;o>>15,r^=r<<4,r^=r>>>13,o>=0&&(i=i+1640531527|0,a=0==(n=s[127&o]^=r+i)?a+1:0);for(a>=128&&(s[127&(t&&t.length||0)]=-1),a=127,o=512;o>0;--o)r=s[a+34&127],n=s[a=a+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[a]=r^n;e.w=i,e.X=s,e.i=a}(t,e)}(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&(r.X&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=s:n(2)&&n(4)?void 0===(r=function(){return s}.call(t,n,t,a))||(a.exports=r):this.xor4096=s}(0,e,n(2))}).call(this,n(3)(e))},function(e,t,n){(function(e){var r;!function(e,a,o){function i(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function s(e,t){var n=new function(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,a=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^a,t.a=a-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=s:n(2)&&n(4)?void 0===(r=function(){return s}.call(t,n,t,a))||(a.exports=r):this.tychei=s}(0,e,n(2))}).call(this,n(3)(e))},function(e,t,n){var r;!function(a,o,i){var s,l=256,u=6,c="random",d=i.pow(l,u),f=i.pow(2,52),p=2*f,g=l-1;function m(e,t,n){var r=[],m=h(function e(t,n){var r,a=[],o=typeof t;if(n&&"object"==o)for(r in t)try{a.push(e(t[r],n-1))}catch(e){}return a.length?a:"string"==o?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(o)]:null==e?function(){try{var e;return s&&(e=s.randomBytes)?e=e(l):(e=new Uint8Array(l),(a.crypto||a.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=a.navigator,n=t&&t.plugins;return[+new Date,a,n,a.screen,y(o)]}}():e,3),r),b=new function(e){var t,n=e.length,r=this,a=0,o=r.i=r.j=0,i=r.S=[];n||(e=[n++]);for(;a=p;)e/=2,t/=2,n>>>=1;return(e+n)/t};return T.int32=function(){return 0|b.g(4)},T.quick=function(){return b.g(4)/4294967296},T.double=T,h(y(b.S),o),(t.pass||n||function(e,t,n,r){return r&&(r.S&&v(r,b),e.state=function(){return v(b,{})}),n?(i[c]=e,t):e})(T,m,"global"in t?t.global:this==i,t.state)}function v(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function h(e,t){for(var n,r=e+"",a=0;a1?t-1:0),r=1;r0?(n[0]=2*(s*i+d*r+l*o-u*a)/f,n[1]=2*(l*i+d*a+u*r-s*o)/f,n[2]=2*(u*i+d*o+s*a-l*r)/f):(n[0]=2*(s*i+d*r+l*o-u*a),n[1]=2*(l*i+d*a+u*r-s*o),n[2]=2*(u*i+d*o+s*a-l*r)),ye(e,t,n),e}function Te(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Ce(e,t){var n=t[0],r=t[1],a=t[2],o=t[4],i=t[5],s=t[6],l=t[8],u=t[9],c=t[10];return e[0]=Math.hypot(n,r,a),e[1]=Math.hypot(o,i,s),e[2]=Math.hypot(l,u,c),e}function Se(e,t){var n=new c(3);Ce(n,t);var r=1/n[0],a=1/n[1],o=1/n[2],i=t[0]*r,s=t[1]*a,l=t[2]*o,u=t[4]*r,d=t[5]*a,f=t[6]*o,p=t[8]*r,g=t[9]*a,m=t[10]*o,v=i+d+m,h=0;return v>0?(h=2*Math.sqrt(v+1),e[3]=.25*h,e[0]=(f-g)/h,e[1]=(p-l)/h,e[2]=(s-u)/h):i>d&&i>m?(h=2*Math.sqrt(1+i-d-m),e[3]=(f-g)/h,e[0]=.25*h,e[1]=(s+u)/h,e[2]=(p+l)/h):d>m?(h=2*Math.sqrt(1+d-i-m),e[3]=(p-l)/h,e[0]=(s+u)/h,e[1]=.25*h,e[2]=(f+g)/h):(h=2*Math.sqrt(1+m-i-d),e[3]=(s-u)/h,e[0]=(p+l)/h,e[1]=(f+g)/h,e[2]=.25*h),e}function Pe(e,t,n,r){var a=t[0],o=t[1],i=t[2],s=t[3],l=a+a,u=o+o,c=i+i,d=a*l,f=a*u,p=a*c,g=o*u,m=o*c,v=i*c,h=s*l,y=s*u,b=s*c,T=r[0],C=r[1],S=r[2];return e[0]=(1-(g+v))*T,e[1]=(f+b)*T,e[2]=(p-y)*T,e[3]=0,e[4]=(f-b)*C,e[5]=(1-(d+v))*C,e[6]=(m+h)*C,e[7]=0,e[8]=(p+y)*S,e[9]=(m-h)*S,e[10]=(1-(d+g))*S,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function we(e,t,n,r,a){var o=t[0],i=t[1],s=t[2],l=t[3],u=o+o,c=i+i,d=s+s,f=o*u,p=o*c,g=o*d,m=i*c,v=i*d,h=s*d,y=l*u,b=l*c,T=l*d,C=r[0],S=r[1],P=r[2],w=a[0],x=a[1],O=a[2],M=(1-(m+h))*C,A=(p+T)*C,I=(g-b)*C,R=(p-T)*S,E=(1-(f+h))*S,D=(v+y)*S,V=(g+b)*P,L=(v-y)*P,N=(1-(f+m))*P;return e[0]=M,e[1]=A,e[2]=I,e[3]=0,e[4]=R,e[5]=E,e[6]=D,e[7]=0,e[8]=V,e[9]=L,e[10]=N,e[11]=0,e[12]=n[0]+w-(M*w+R*x+V*O),e[13]=n[1]+x-(A*w+E*x+L*O),e[14]=n[2]+O-(I*w+D*x+N*O),e[15]=1,e}function xe(e,t){var n=t[0],r=t[1],a=t[2],o=t[3],i=n+n,s=r+r,l=a+a,u=n*i,c=r*i,d=r*s,f=a*i,p=a*s,g=a*l,m=o*i,v=o*s,h=o*l;return e[0]=1-d-g,e[1]=c+h,e[2]=f-v,e[3]=0,e[4]=c-h,e[5]=1-u-g,e[6]=p+m,e[7]=0,e[8]=f+v,e[9]=p-m,e[10]=1-u-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Oe(e,t,n,r,a,o,i){var s=1/(n-t),l=1/(a-r),u=1/(o-i);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(a+r)*l,e[10]=(i+o)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*o*2*u,e[15]=0,e}function Me(e,t,n,r,a){var o,i=1/Math.tan(t/2);return e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=a&&a!==1/0?(o=1/(r-a),e[10]=(a+r)*o,e[14]=2*a*r*o):(e[10]=-1,e[14]=-2*r),e}function Ae(e,t,n,r){var a=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(i+s),u=2/(a+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(i-s)*l*.5,e[9]=(a-o)*u*.5,e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e}function Ie(e,t,n,r,a,o,i){var s=1/(t-n),l=1/(r-a),u=1/(o-i);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+n)*s,e[13]=(a+r)*l,e[14]=(i+o)*u,e[15]=1,e}function Re(e,t,n,r){var a,o,i,s,l,c,d,f,p,g,m=t[0],v=t[1],h=t[2],y=r[0],b=r[1],T=r[2],C=n[0],S=n[1],P=n[2];return Math.abs(m-C)0&&(c*=p=1/Math.sqrt(p),d*=p,f*=p);var g=l*f-u*d,m=u*c-s*f,v=s*d-l*c;return(p=g*g+m*m+v*v)>0&&(g*=p=1/Math.sqrt(p),m*=p,v*=p),e[0]=g,e[1]=m,e[2]=v,e[3]=0,e[4]=d*v-f*m,e[5]=f*g-c*v,e[6]=c*m-d*g,e[7]=0,e[8]=c,e[9]=d,e[10]=f,e[11]=0,e[12]=a,e[13]=o,e[14]=i,e[15]=1,e}function De(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function Ve(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Le(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function Ne(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function Be(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}function ke(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e[9]=t[9]+n[9]*r,e[10]=t[10]+n[10]*r,e[11]=t[11]+n[11]*r,e[12]=t[12]+n[12]*r,e[13]=t[13]+n[13]*r,e[14]=t[14]+n[14]*r,e[15]=t[15]+n[15]*r,e}function Fe(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function Ge(e,t){var n=e[0],r=e[1],a=e[2],o=e[3],i=e[4],s=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],m=e[12],v=e[13],h=e[14],y=e[15],b=t[0],T=t[1],C=t[2],S=t[3],P=t[4],w=t[5],x=t[6],O=t[7],M=t[8],A=t[9],I=t[10],R=t[11],E=t[12],D=t[13],V=t[14],L=t[15];return Math.abs(n-b)<=u*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(r-T)<=u*Math.max(1,Math.abs(r),Math.abs(T))&&Math.abs(a-C)<=u*Math.max(1,Math.abs(a),Math.abs(C))&&Math.abs(o-S)<=u*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(i-P)<=u*Math.max(1,Math.abs(i),Math.abs(P))&&Math.abs(s-w)<=u*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(l-x)<=u*Math.max(1,Math.abs(l),Math.abs(x))&&Math.abs(c-O)<=u*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(d-M)<=u*Math.max(1,Math.abs(d),Math.abs(M))&&Math.abs(f-A)<=u*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(p-I)<=u*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(g-R)<=u*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(m-E)<=u*Math.max(1,Math.abs(m),Math.abs(E))&&Math.abs(v-D)<=u*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(h-V)<=u*Math.max(1,Math.abs(h),Math.abs(V))&&Math.abs(y-L)<=u*Math.max(1,Math.abs(y),Math.abs(L))}var _e=oe,Ue=Ne;function je(){var e=new c(3);return c!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function We(e){var t=new c(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ze(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function He(e,t,n){var r=new c(3);return r[0]=e,r[1]=t,r[2]=n,r}function Ke(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Xe(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function qe(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function Ye(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function Ze(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function Qe(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function $e(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function Je(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function et(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function tt(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function nt(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}function rt(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function at(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e}function ot(e,t){var n=t[0]-e[0],r=t[1]-e[1],a=t[2]-e[2];return Math.hypot(n,r,a)}function it(e,t){var n=t[0]-e[0],r=t[1]-e[1],a=t[2]-e[2];return n*n+r*r+a*a}function st(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r}function lt(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function ut(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function ct(e,t){var n=t[0],r=t[1],a=t[2],o=n*n+r*r+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function dt(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ft(e,t,n){var r=t[0],a=t[1],o=t[2],i=n[0],s=n[1],l=n[2];return e[0]=a*l-o*s,e[1]=o*i-r*l,e[2]=r*s-a*i,e}function pt(e,t,n,r){var a=t[0],o=t[1],i=t[2];return e[0]=a+r*(n[0]-a),e[1]=o+r*(n[1]-o),e[2]=i+r*(n[2]-i),e}function gt(e,t,n,r,a,o){var i=o*o,s=i*(2*o-3)+1,l=i*(o-2)+o,u=i*(o-1),c=i*(3-2*o);return e[0]=t[0]*s+n[0]*l+r[0]*u+a[0]*c,e[1]=t[1]*s+n[1]*l+r[1]*u+a[1]*c,e[2]=t[2]*s+n[2]*l+r[2]*u+a[2]*c,e}function mt(e,t,n,r,a,o){var i=1-o,s=i*i,l=o*o,u=s*i,c=3*o*s,d=3*l*i,f=l*o;return e[0]=t[0]*u+n[0]*c+r[0]*d+a[0]*f,e[1]=t[1]*u+n[1]*c+r[1]*d+a[1]*f,e[2]=t[2]*u+n[2]*c+r[2]*d+a[2]*f,e}function vt(e,t){t=t||1;var n=2*d()*Math.PI,r=2*d()-1,a=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(n)*a,e[1]=Math.sin(n)*a,e[2]=r*t,e}function ht(e,t,n){var r=t[0],a=t[1],o=t[2],i=n[3]*r+n[7]*a+n[11]*o+n[15];return i=i||1,e[0]=(n[0]*r+n[4]*a+n[8]*o+n[12])/i,e[1]=(n[1]*r+n[5]*a+n[9]*o+n[13])/i,e[2]=(n[2]*r+n[6]*a+n[10]*o+n[14])/i,e}function yt(e,t,n){var r=t[0],a=t[1],o=t[2];return e[0]=r*n[0]+a*n[3]+o*n[6],e[1]=r*n[1]+a*n[4]+o*n[7],e[2]=r*n[2]+a*n[5]+o*n[8],e}function bt(e,t,n){var r=n[0],a=n[1],o=n[2],i=n[3],s=t[0],l=t[1],u=t[2],c=a*u-o*l,d=o*s-r*u,f=r*l-a*s,p=a*f-o*d,g=o*c-r*f,m=r*d-a*c,v=2*i;return c*=v,d*=v,f*=v,p*=2,g*=2,m*=2,e[0]=s+c+p,e[1]=l+d+g,e[2]=u+f+m,e}function Tt(e,t,n,r){var a=[],o=[];return a[0]=t[0]-n[0],a[1]=t[1]-n[1],a[2]=t[2]-n[2],o[0]=a[0],o[1]=a[1]*Math.cos(r)-a[2]*Math.sin(r),o[2]=a[1]*Math.sin(r)+a[2]*Math.cos(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function Ct(e,t,n,r){var a=[],o=[];return a[0]=t[0]-n[0],a[1]=t[1]-n[1],a[2]=t[2]-n[2],o[0]=a[2]*Math.sin(r)+a[0]*Math.cos(r),o[1]=a[1],o[2]=a[2]*Math.cos(r)-a[0]*Math.sin(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function St(e,t,n,r){var a=[],o=[];return a[0]=t[0]-n[0],a[1]=t[1]-n[1],a[2]=t[2]-n[2],o[0]=a[0]*Math.cos(r)-a[1]*Math.sin(r),o[1]=a[0]*Math.sin(r)+a[1]*Math.cos(r),o[2]=a[2],e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function Pt(e,t){var n=e[0],r=e[1],a=e[2],o=t[0],i=t[1],s=t[2],l=Math.sqrt(n*n+r*r+a*a)*Math.sqrt(o*o+i*i+s*s),u=l&&dt(e,t)/l;return Math.acos(Math.min(Math.max(u,-1),1))}function wt(e){return e[0]=0,e[1]=0,e[2]=0,e}function xt(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function Ot(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Mt(e,t){var n=e[0],r=e[1],a=e[2],o=t[0],i=t[1],s=t[2];return Math.abs(n-o)<=u*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-i)<=u*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(a-s)<=u*Math.max(1,Math.abs(a),Math.abs(s))}var At=Ye,It=Ze,Rt=Qe,Et=ot,Dt=it,Vt=ze,Lt=st,Nt=function(){var e=je();return function(t,n,r,a,o,i){var s,l;for(n||(n=3),r||(r=0),l=a?Math.min(a*n+r,t.length):t.length,s=r;s0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=r*i,e[2]=a*i,e[3]=o*i,e}function on(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function sn(e,t,n,r){var a=n[0]*r[1]-n[1]*r[0],o=n[0]*r[2]-n[2]*r[0],i=n[0]*r[3]-n[3]*r[0],s=n[1]*r[2]-n[2]*r[1],l=n[1]*r[3]-n[3]*r[1],u=n[2]*r[3]-n[3]*r[2],c=t[0],d=t[1],f=t[2],p=t[3];return e[0]=d*u-f*l+p*s,e[1]=-c*u+f*i-p*o,e[2]=c*l-d*i+p*a,e[3]=-c*s+d*o-f*a,e}function ln(e,t,n,r){var a=t[0],o=t[1],i=t[2],s=t[3];return e[0]=a+r*(n[0]-a),e[1]=o+r*(n[1]-o),e[2]=i+r*(n[2]-i),e[3]=s+r*(n[3]-s),e}function un(e,t){var n,r,a,o,i,s;t=t||1;do{i=(n=2*d()-1)*n+(r=2*d()-1)*r}while(i>=1);do{s=(a=2*d()-1)*a+(o=2*d()-1)*o}while(s>=1);var l=Math.sqrt((1-i)/s);return e[0]=t*n,e[1]=t*r,e[2]=t*a*l,e[3]=t*o*l,e}function cn(e,t,n){var r=t[0],a=t[1],o=t[2],i=t[3];return e[0]=n[0]*r+n[4]*a+n[8]*o+n[12]*i,e[1]=n[1]*r+n[5]*a+n[9]*o+n[13]*i,e[2]=n[2]*r+n[6]*a+n[10]*o+n[14]*i,e[3]=n[3]*r+n[7]*a+n[11]*o+n[15]*i,e}function dn(e,t,n){var r=t[0],a=t[1],o=t[2],i=n[0],s=n[1],l=n[2],u=n[3],c=u*r+s*o-l*a,d=u*a+l*r-i*o,f=u*o+i*a-s*r,p=-i*r-s*a-l*o;return e[0]=c*u+p*-i+d*-l-f*-s,e[1]=d*u+p*-s+f*-i-c*-l,e[2]=f*u+p*-l+c*-s-d*-i,e[3]=t[3],e}function fn(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function pn(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function gn(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function mn(e,t){var n=e[0],r=e[1],a=e[2],o=e[3],i=t[0],s=t[1],l=t[2],c=t[3];return Math.abs(n-i)<=u*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-s)<=u*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(a-l)<=u*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(o-c)<=u*Math.max(1,Math.abs(o),Math.abs(c))}var vn=jt,hn=Wt,yn=zt,bn=$t,Tn=Jt,Cn=en,Sn=tn,Pn=function(){var e=Bt();return function(t,n,r,a,o,i){var s,l;for(n||(n=4),r||(r=0),l=a?Math.min(a*n+r,t.length):t.length,s=r;su?(e[0]=t[0]/r,e[1]=t[1]/r,e[2]=t[2]/r):(e[0]=1,e[1]=0,e[2]=0),n}function An(e,t){var n=Qn(e,t);return Math.acos(2*n*n-1)}function In(e,t,n){var r=t[0],a=t[1],o=t[2],i=t[3],s=n[0],l=n[1],u=n[2],c=n[3];return e[0]=r*c+i*s+a*u-o*l,e[1]=a*c+i*l+o*s-r*u,e[2]=o*c+i*u+r*l-a*s,e[3]=i*c-r*s-a*l-o*u,e}function Rn(e,t,n){n*=.5;var r=t[0],a=t[1],o=t[2],i=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+i*s,e[1]=a*l+o*s,e[2]=o*l-a*s,e[3]=i*l-r*s,e}function En(e,t,n){n*=.5;var r=t[0],a=t[1],o=t[2],i=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l-o*s,e[1]=a*l+i*s,e[2]=o*l+r*s,e[3]=i*l-a*s,e}function Dn(e,t,n){n*=.5;var r=t[0],a=t[1],o=t[2],i=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+a*s,e[1]=a*l-r*s,e[2]=o*l+i*s,e[3]=i*l-o*s,e}function Vn(e,t){var n=t[0],r=t[1],a=t[2];return e[0]=n,e[1]=r,e[2]=a,e[3]=Math.sqrt(Math.abs(1-n*n-r*r-a*a)),e}function Ln(e,t){var n=t[0],r=t[1],a=t[2],o=t[3],i=Math.sqrt(n*n+r*r+a*a),s=Math.exp(o),l=i>0?s*Math.sin(i)/i:0;return e[0]=n*l,e[1]=r*l,e[2]=a*l,e[3]=s*Math.cos(i),e}function Nn(e,t){var n=t[0],r=t[1],a=t[2],o=t[3],i=Math.sqrt(n*n+r*r+a*a),s=i>0?Math.atan2(i,o)/i:0;return e[0]=n*s,e[1]=r*s,e[2]=a*s,e[3]=.5*Math.log(n*n+r*r+a*a+o*o),e}function Bn(e,t,n){return Nn(e,t),Zn(e,e,n),Ln(e,e),e}function kn(e,t,n,r){var a,o,i,s,l,c=t[0],d=t[1],f=t[2],p=t[3],g=n[0],m=n[1],v=n[2],h=n[3];return(o=c*g+d*m+f*v+p*h)<0&&(o=-o,g=-g,m=-m,v=-v,h=-h),1-o>u?(a=Math.acos(o),i=Math.sin(a),s=Math.sin((1-r)*a)/i,l=Math.sin(r*a)/i):(s=1-r,l=r),e[0]=s*c+l*g,e[1]=s*d+l*m,e[2]=s*f+l*v,e[3]=s*p+l*h,e}function Fn(e){var t=d(),n=d(),r=d(),a=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=a*Math.sin(2*Math.PI*n),e[1]=a*Math.cos(2*Math.PI*n),e[2]=o*Math.sin(2*Math.PI*r),e[3]=o*Math.cos(2*Math.PI*r),e}function Gn(e,t){var n=t[0],r=t[1],a=t[2],o=t[3],i=n*n+r*r+a*a+o*o,s=i?1/i:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-a*s,e[3]=o*s,e}function _n(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function Un(e,t){var n,r=t[0]+t[4]+t[8];if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var a=0;t[4]>t[0]&&(a=1),t[8]>t[3*a+a]&&(a=2);var o=(a+1)%3,i=(a+2)%3;n=Math.sqrt(t[3*a+a]-t[3*o+o]-t[3*i+i]+1),e[a]=.5*n,n=.5/n,e[3]=(t[3*o+i]-t[3*i+o])*n,e[o]=(t[3*o+a]+t[3*a+o])*n,e[i]=(t[3*i+a]+t[3*a+i])*n}return e}function jn(e,t,n,r){var a=.5*Math.PI/180;t*=a,n*=a,r*=a;var o=Math.sin(t),i=Math.cos(t),s=Math.sin(n),l=Math.cos(n),u=Math.sin(r),c=Math.cos(r);return e[0]=o*l*c-i*s*u,e[1]=i*s*c+o*l*u,e[2]=i*l*u-o*s*c,e[3]=i*l*c+o*s*u,e}function Wn(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var zn=kt,Hn=Ft,Kn=Gt,Xn=_t,qn=Ut,Yn=In,Zn=Zt,Qn=on,$n=ln,Jn=en,er=Jn,tr=tn,nr=tr,rr=an,ar=gn,or=mn,ir=function(){var e=je(),t=He(1,0,0),n=He(0,1,0);return function(r,a,o){var i=dt(a,o);return i<-.999999?(ft(e,t,a),Vt(e)<1e-6&&ft(e,n,a),ct(e,e),On(r,e,Math.PI),r):i>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(ft(e,a,o),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+i,rr(r,r))}}(),sr=function(){var e=wn(),t=wn();return function(n,r,a,o,i,s){return kn(e,r,i,s),kn(t,a,o,s),kn(n,e,t,2*s*(1-s)),n}}(),lr=function(){var e=v();return function(t,n,r,a){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=a[0],e[4]=a[1],e[7]=a[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],rr(t,Un(t,e))}}(),ur=n(0),cr=ur.a.vtkErrorMacro;var dr={parent:null,renderable:null,myFactory:null,children:[],visited:!1};function fr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dr,n),ur.a.obj(e,t),ur.a.event(e,t,"event"),t._renderableChildMap=new Map,ur.a.get(e,t,["visited"]),ur.a.setGet(e,t,["parent","renderable","myFactory"]),ur.a.getArray(e,t,["children"]),function(e,t){t.classHierarchy.push("vtkViewNode"),e.build=function(e){},e.render=function(e){},e.traverse=function(n){var r=n.getTraverseOperation(),a=e[r];if(a)a(n);else{e.apply(n,!0);for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gr,n),ur.a.obj(e,t),function(e,t){t.overrides||(t.overrides={}),t.classHierarchy.push("vtkViewNodeFactory"),e.createNode=function(n){if(n.isDeleted())return null;for(var r=0,a=n.getClassName(r++),o=!1,i=Object.keys(t.overrides);a&&!o;)-1!==i.indexOf(a)?o=!0:a=n.getClassName(r++);if(!o)return null;var s=t.overrides[a]();return s.setMyFactory(e),s},e.registerOverride=function(e,n){t.overrides[e]=n}}(e,t)}var vr={newInstance:ur.a.newInstance(mr,"vtkViewNodeFactory"),extend:mr},hr=Object.create(null);function yr(e,t){hr[e]=t}var br={};function Tr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,br,n),t.overrides=hr,vr.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkOpenGLViewNodeFactory")}(0,t)}var Cr={newInstance:ur.a.newInstance(Tr,"vtkOpenGLViewNodeFactory"),extend:Tr};var Sr={context:null,lastRenderer:null,keyMatrixTime:null,keyMatrices:null};function Pr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Sr,n),pr.extend(e,t,n),t.keyMatrixTime={},ur.g(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(9),vcpc:new Float64Array(16),wcvc:new Float64Array(16),wcpc:new Float64Array(16)},ur.i(e,t,["context","keyMatrixTime"]),function(e,t){t.classHierarchy.push("vtkOpenGLCamera"),e.buildPass=function(n){n&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext())},e.opaquePass=function(e){if(e){var n=t.openGLRenderer.getTiledSizeAndOrigin();t.context.viewport(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize),t.context.scissor(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize)}},e.translucentPass=e.opaquePass,e.opaqueZBufferPass=e.opaquePass,e.volumePass=e.opaquePass,e.getKeyMatrices=function(n){if(n!==t.lastRenderer||t.openGLRenderWindow.getMTime()>t.keyMatrixTime.getMTime()||e.getMTime()>t.keyMatrixTime.getMTime()||n.getMTime()>t.keyMatrixTime.getMTime()||t.renderable.getMTime()>t.keyMatrixTime.getMTime()){o.copy(t.keyMatrices.wcvc,t.renderable.getViewMatrix()),a.fromMat4(t.keyMatrices.normalMatrix,t.keyMatrices.wcvc),a.invert(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),o.transpose(t.keyMatrices.wcvc,t.keyMatrices.wcvc);var r=t.openGLRenderer.getAspectRatio();o.copy(t.keyMatrices.vcpc,t.renderable.getProjectionMatrix(r,-1,1)),o.transpose(t.keyMatrices.vcpc,t.keyMatrices.vcpc),o.multiply(t.keyMatrices.wcpc,t.keyMatrices.vcpc,t.keyMatrices.wcvc),t.keyMatrixTime.modified(),t.lastRenderer=n}return t.keyMatrices}}(e,t)}var wr=ur.d(Pr);yr("vtkCamera",wr);var xr=n(8),Or=n.n(xr);function Mr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ar(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ar(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:3,t=[];t.length1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=1/0,a=-1/0,o=t,i=e.length;o1&&void 0!==arguments[1]?arguments[1]:3;switch(t){case 1:return Math.abs(e);case 2:return Math.sqrt(e[0]*e[0]+e[1]*e[1]);case 3:return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);default:for(var n=0,r=0;r2&&void 0!==arguments[2]?arguments[2]:1e-6;if(e.length!==t.length)return!1;return e.every(function(e,r){return Math.abs(e-t[r])<=n})}var ma=ga;function va(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!"".concat(e).includes("e"))return+"".concat(Math.round("".concat(e,"e+").concat(t)),"e-").concat(t);var n="".concat(e).split("e"),r="";return+n[1]+t>0&&(r="+"),+"".concat(Math.round("".concat(+n[0],"e").concat(r).concat(+n[1]+t)),"e-").concat(t)}function ha(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t[0]=va(e[0],n),t[1]=va(e[1],n),t[2]=va(e[2],n),t}function ya(e,t,n,r){var a,o,i,s,l,u,c,d,f,p,g,m,v,h,y,b,T=Br(t),C=Br(t),S=function(e,t,n,r,a){h=e[t][n],v=e[r][a],e[t][n]=h-m*(v+h*p),e[r][a]=v+m*(h-v*p)};for(l=0;l3&&Math.abs(n[l])+h===Math.abs(n[l])&&Math.abs(n[s])+h===Math.abs(n[s]))e[l][s]=0;else if(Math.abs(e[l][s])>c){for(v=n[s]-n[l],Math.abs(v)+h===Math.abs(v)?f=e[l][s]/v:(d=.5*v/e[l][s],f=1/(Math.abs(d)+Math.sqrt(1+d*d)),d<0&&(f=-f)),y=1/Math.sqrt(1+f*f),p=(m=f*y)/(1+y),v=f*e[l][s],C[l]-=v,C[s]+=v,n[l]-=v,n[s]+=v,e[l][s]=0,o=0;o<=l-1;o++)S(e,o,l,o,s);for(o=l+1;o<=s-1;o++)S(e,l,o,o,s);for(o=s+1;o=Dr)return Rr("vtkMath::Jacobi: Error extracting eigenfunctions"),0;for(o=0;o=b&&(b=n[i=a]);if(i!==o)for(n[i]=n[o],n[o]=b,a=0;a>1)+(1&t);for(o=0;o=0&&u++;if(u(r=l>s?l:s)?u:r,a[i]=1,0!==r&&(a[i]/=r)}var c=Math.abs(t[0][0])*a[0],d=Math.abs(t[1][0])*a[1],f=Math.abs(t[2][0])*a[2];o[0]=0,d>=(r=c)&&(r=d,o[0]=1),f>=r&&(o[0]=2),0!==o[0]&&(Nr(t[o[0]],t[0]),a[o[0]]=a[0]);var p=Math.abs(t[1][1])*a[1],g=Math.abs(t[2][1])*a[2];o[1]=1,g>=(r=p)&&(o[1]=2,Nr(t[2],t[1])),o[2]=2;var m=0;if(fa(t)<0){m=1;for(var v=0;v<3;v++)t[0][v]=-t[0][v],t[1][v]=-t[1][v],t[2][v]=-t[2][v]}var h=Br(4);if(ba(t,h),pa(h,t),m)for(var y=0;y<3;y++)t[0][y]=-t[0][y],t[1][y]=-t[1][y],t[2][y]=-t[2][y];1!==o[1]&&Nr(t[o[1]],t[1]),0!==o[0]&&Nr(t[o[0]],t[0])}function Ca(e,t,n){var r,a,o,i,s,l,u=[Br(3),Br(3),Br(3)],c=Br(3),d=Br(3);for(r=0;r<3;r++)u[r][0]=e[r][0],u[r][1]=e[r][1],u[r][2]=e[r][2],c[r]=u[r],d[r]=n[r];if(ya(c,3,t,d),t[0]!==t[1]||t[0]!==t[2]){for(ca(n,n),r=0;r<3;r++)if(t[(r+1)%3]===t[(r+2)%3]){for(l=Math.abs(n[r][0]),i=0,a=1;a<3;a++)l<(s=Math.abs(n[r][a]))&&(l=s,i=a);return i!==r&&(s=t[i],t[i]=t[r],t[r]=s,Nr(n[r],n[i])),n[i][i]<0&&(n[i][0]=-n[i][0],n[i][1]=-n[i][1],n[i][2]=-n[i][2]),o=(i+2)%3,n[a=(i+1)%3][0]=0,n[a][1]=0,n[a][2]=0,n[a][a]=1,ta(n[i],n[a],n[o]),ra(n[o]),ta(n[o],n[i],n[a]),void ca(n,n)}for(l=Math.abs(n[0][0]),i=0,r=1;r<3;r++)l<(s=Math.abs(n[r][0]))&&(l=s,i=r);for(0!==i&&(s=t[i],t[i]=t[0],t[0]=s,Nr(n[i],n[0])),Math.abs(n[1][1])i&&(i=u);if(0===i)return Rr("Unable to factor linear system"),0;d[r]=1/i}for(a=0;a=i&&(i=l,c=r)}if(a!==c){for(o=0;o=0)for(o=i;o<=a-1;o++)l-=e[a][o]*n[o];else 0!==l&&(i=a);n[a]=l}for(a=r-1;a>=0;a--){for(l=n[a],o=a+1;o3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=r||Br(n),i=a||Br(n);if(0===Sa(e,o,n))return 0;for(var s=0;sl?l=i:il?l=s:s0?(l-u)/l:0)>0?(n=o===l?1/6*(i-s)/(l-u):i===l?1/3+1/6*(s-o)/(l-u):2/3+1/6*(o-i)/(l-u))<0&&(n+=1):n=0,t[0]=n,t[1]=r,t[2]=c}function Aa(e,t){var n,r,a,o=Mr(e,3),i=o[0],s=o[1],l=o[2];i>1/6&&i<=1/3?(r=1,n=(1/3-i)/(1/6),a=0):i>1/3&&i<=.5?(r=1,a=(i-1/3)/(1/6),n=0):i>.5&&i<=2/3?(a=1,r=(2/3-i)/(1/6),n=0):i>2/3&&i<=5/6?(a=1,n=(i-2/3)/(1/6),r=0):i>5/6&&i<=1?(n=1,a=(1-i)/(1/6),r=0):(n=1,r=i/(1/6),a=0),n=s*n+(1-s),r=s*r+(1-s),a=s*a+(1-s),n*=l,r*=l,a*=l,t[0]=n,t[1]=r,t[2]=a}function Ia(e,t){var n=Mr(e,3),r=(n[0]+16)/116,a=n[1]/500+r,o=r-n[2]/200;r=Math.pow(r,3)>.008856?Math.pow(r,3):(r-16/116)/7.787,a=Math.pow(a,3)>.008856?Math.pow(a,3):(a-16/116)/7.787,o=Math.pow(o,3)>.008856?Math.pow(o,3):(o-16/116)/7.787;t[0]=.9505*a,t[1]=1*r,t[2]=1.089*o}function Ra(e,t){var n=Mr(e,3),r=n[0]/.9505,a=n[1]/1,o=n[2]/1.089;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,t[0]=116*a-16,t[1]=500*(r-a),t[2]=200*(a-o)}function Ea(e,t){var n=Mr(e,3),r=n[0],a=n[1],o=n[2],i=3.2406*r+-1.5372*a+-.4986*o,s=-.9689*r+1.8758*a+.0415*o,l=.0557*r+-.204*a+1.057*o;i>.0031308?i=1.055*Math.pow(i,1/2.4)-.055:i*=12.92,s>.0031308?s=1.055*Math.pow(s,1/2.4)-.055:s*=12.92,l>.0031308?l=1.055*Math.pow(l,1/2.4)-.055:l*=12.92;var u=i;u1&&(i/=u,s/=u,l/=u),i<0&&(i=0),s<0&&(s=0),l<0&&(l=0),t[0]=i,t[1]=s,t[2]=l}function Da(e,t){var n=Mr(e,3),r=n[0],a=n[1],o=n[2];r>.04045?r=Math.pow((r+.055)/1.055,2.4):r/=12.92,a>.04045?a=Math.pow((a+.055)/1.055,2.4):a/=12.92,o>.04045?o=Math.pow((o+.055)/1.055,2.4):o/=12.92,t[0]=.4124*r+.3576*a+.1805*o,t[1]=.2126*r+.7152*a+.0722*o,t[2]=.0193*r+.1192*a+.9505*o}function Va(e,t){var n=[0,0,0];Da(e,n),Ra(n,t)}function La(e,t){var n=[0,0,0];Ia(e,n),Ea(n,t)}function Na(e){e[0]=1,e[1]=-1,e[2]=1,e[3]=-1,e[4]=1,e[5]=-1}function Ba(e){return!(e[1]-e[0]<0)}function ka(e,t,n){n[0]=Math.min(e[0],t[0]),n[1]=Math.max(e[0],t[0]),n[2]=Math.min(e[1],t[1]),n[3]=Math.max(e[1],t[1]),n[4]=Math.min(e[2],t[2]),n[5]=Math.max(e[2],t[2])}function Fa(e,t,n){return en?n:e}function Ga(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return r[0]=Fa(e[0],t[0],n[0]),r[1]=Fa(e[1],t[1],n[1]),r[2]=Fa(e[2],t[2],n[2]),r}var _a=Lr("GetScalarTypeFittingRange"),Ua=Lr("GetAdjustedScalarRange");var ja=function(e){return!Number.isFinite(e)},Wa=Number.isFinite,za=Number.isNaN,Ha=za;function Ka(){return[].concat([Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE])}function Xa(e){var t=Math.floor(255*e);return t>15?t.toString(16):"0".concat(t.toString(16))}function qa(e){return Math.round(255*e)}var Ya={Pi:function(){return Math.PI},radiansFromDegrees:kr,degreesFromRadians:Fr,round:Gr,floor:_r,ceil:Ur,ceilLog2:Hr,min:jr,max:Wr,arrayMin:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=1/0,a=t,o=e.length;a1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=-1/0,a=t,o=e.length;a=0;--a)if(n[a]0&&void 0!==arguments[0]?arguments[0]:0;return e+((arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)-e)*Math.random()},gaussian:Yr,add:Zr,subtract:Qr,multiplyScalar:$r,multiplyScalar2D:Jr,multiplyAccumulate:function(e,t,n,r){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r},multiplyAccumulate2D:function(e,t,n,r){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r},dot:ea,outer:function(e,t,n){for(var r=0;r<3;r++)for(var a=0;a<3;a++)n[r][a]=e[r]*t[a]},cross:ta,norm:na,normalize:ra,perpendiculars:function(e,t,n,r){var a,o,i,s=e[0]*e[0],l=e[1]*e[1],u=e[2]*e[2],c=Math.sqrt(s+l+u);s>l&&s>u?(a=0,o=1,i=2):l>u?(a=1,o=2,i=0):(a=2,o=0,i=1);var d=e[a]/c,f=e[o]/c,p=e[i]/c,g=Math.sqrt(d*d+p*p);if(0!==r){var m=Math.sin(r),v=Math.cos(r);t&&(t[a]=(p*v-d*f*m)/g,t[o]=m*g,t[i]=(-d*v-f*p*m)/g),n&&(n[a]=(-p*m-d*f*v)/g,n[o]=v*g,n[i]=(d*m-f*p*v)/g)}else t&&(t[a]=p/g,t[o]=0,t[i]=-d/g),n&&(n[a]=-d*f/g,n[o]=g,n[i]=-f*p/g)},projectVector:function(e,t,n){var r=ea(t,t);if(0===r)return n[0]=0,n[1]=0,n[2]=0,!1;for(var a=ea(e,t)/r,o=0;o<3;o++)n[o]=t[o];return $r(n,a),!0},projectVector2D:function(e,t,n){var r=aa(t,t);if(0===r)return n[0]=0,n[1]=0,!1;for(var a=aa(e,t)/r,o=0;o<2;o++)n[o]=t[o];return Jr(n,a),!0},distance2BetweenPoints:oa,angleBetweenVectors:ia,gaussianAmplitude:function(e,t,n){var r=Math.abs(e-n);return 1/Math.sqrt(2*Math.PI*t)*Math.exp(-Math.pow(r,2)/(2*t))},gaussianWeight:function(e,t,n){var r=Math.abs(e-n);return Math.exp(-Math.pow(r,2)/(2*t))},dot2D:aa,outer2D:function(e,t,n){for(var r=0;r<2;r++)for(var a=0;a<2;a++)n[r][a]=e[r]*t[a]},norm2D:sa,normalize2D:function(e){var t=sa(e);return 0!==t&&(e[0]/=t,e[1]/=t),t},determinant2x2:la,LUFactor3x3:function(e,t){for(var n,r,a,o=[0,0,0],i=0;i<3;i++)a=Math.abs(e[i][0]),(r=Math.abs(e[i][1]))>a&&(a=r),(r=Math.abs(e[i][2]))>a&&(a=r),o[i]=1/a;a=o[0]*Math.abs(e[0][0]),n=0,(r=o[1]*Math.abs(e[1][0]))>=a&&(a=r,n=1),(r=o[2]*Math.abs(e[2][0]))>=a&&(n=2),0!==n&&(Nr(e[n],e[0]),o[n]=o[0]),t[0]=n,e[1][0]/=e[0][0],e[2][0]/=e[0][0],e[1][1]-=e[1][0]*e[0][1],e[2][1]-=e[2][0]*e[0][1],a=o[1]*Math.abs(e[1][1]),n=1,(r=o[2]*Math.abs(e[2][1]))>=a&&(n=2,Nr(e[2],e[1]),o[2]=o[1]),t[1]=n,e[2][1]/=e[1][1],e[1][2]-=e[1][0]*e[0][2],e[2][2]-=e[2][0]*e[0][2]+e[2][1]*e[1][2],t[2]=2},LUSolve3x3:function(e,t,n){var r=n[t[0]];n[t[0]]=n[0],n[0]=r,r=n[t[1]],n[t[1]]=n[1],n[1]=r-e[1][0]*n[0],r=n[t[2]],n[t[2]]=n[2],n[2]=r-e[2][0]*n[0]-e[2][1]*n[1],n[2]/=e[2][2],n[1]=(n[1]-e[1][2]*n[2])/e[1][1],n[0]=(n[0]-e[0][1]*n[1]-e[0][2]*n[2])/e[0][0]},linearSolve3x3:function(e,t,n){var r=e[0][0],a=e[0][1],o=e[0][2],i=e[1][0],s=e[1][1],l=e[1][2],u=e[2][0],c=e[2][1],d=e[2][2],f=+la(s,c,l,d),p=-la(i,u,l,d),g=+la(i,u,s,c),m=-la(a,c,o,d),v=+la(r,u,o,d),h=-la(r,u,a,c),y=+la(a,s,o,l),b=-la(r,i,o,l),T=+la(r,i,a,s),C=r*f+a*p+o*g,S=f*t[0]+m*t[1]+y*t[2],P=p*t[0]+v*t[1]+b*t[2],w=g*t[0]+h*t[1]+T*t[2];n[0]=S/C,n[1]=P/C,n[2]=w/C},multiply3x3_vect3:function(e,t,n){var r=e[0][0]*t[0]+e[0][1]*t[1]+e[0][2]*t[2],a=e[1][0]*t[0]+e[1][1]*t[1]+e[1][2]*t[2],o=e[2][0]*t[0]+e[2][1]*t[1]+e[2][2]*t[2];n[0]=r,n[1]=a,n[2]=o},multiply3x3_mat3:ua,multiplyMatrix:function(e,t,n,r,a,o,i){r!==a&&Ir("Number of columns of A must match number of rows of B.");for(var s=0;sWr&&(r=Math.abs(e[a][o]));for(var i=0;i6&&void 0!==arguments[6])||arguments[6];if(eVr&&(f=0,d[u]=0);if(f&&1===a)return Rr("Detected homogeneous system (Y=0), calling SolveHomogeneousLeastSquares()"),Oa(e,t,n,o);if(f)g=1;else for(u=0;u1&&void 0!==arguments[1]?arguments[1]:[0,.5,1];switch(e.length){case 3:return t[0]=17*parseInt(e[0],16)/255,t[1]=17*parseInt(e[1],16)/255,t[2]=17*parseInt(e[2],16)/255,t;case 4:return t[0]=17*parseInt(e[1],16)/255,t[1]=17*parseInt(e[2],16)/255,t[2]=17*parseInt(e[3],16)/255,t;case 6:return t[0]=parseInt(e.substr(0,2),16)/255,t[1]=parseInt(e.substr(2,2),16)/255,t[2]=parseInt(e.substr(4,2),16)/255,t;case 7:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t;case 9:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t[3]=parseInt(e.substr(7,2),16)/255,t;default:return t}},rgb2hsv:Ma,hsv2rgb:Aa,lab2xyz:Ia,xyz2lab:Ra,xyz2rgb:Ea,rgb2xyz:Da,rgb2lab:Va,lab2rgb:La,uninitializeBounds:Na,areBoundsInitialized:Ba,computeBoundsFromPoints:ka,clampValue:Fa,clampVector:Ga,clampAndNormalizeValue:function(e,t){var n=0;return t[0]!==t[1]&&(n=((n=et[1]?t[1]:e)-t[0])/(t[1]-t[0])),n},getScalarTypeFittingRange:_a,getAdjustedScalarRange:Ua,extentIsWithinOtherExtent:function(e,t){if(!e||!t)return 0;for(var n=0;n<6;n+=2)if(e[n]t[n+1]||e[n+1]t[n+1])return 0;return 1},boundsIsWithinOtherBounds:function(e,t,n){if(!e||!t)return 0;for(var r=0;r<6;r+=2)if(e[r]+n[r/2]t[r+1]||e[r+1]+n[r/2]t[r+1])return 0;return 1},pointIsWithinBounds:function(e,t,n){if(!e||!t||!n)return 0;for(var r=0;r<3;r++)if(e[r]+n[r]t[2*r+1])return 0;return 1},solve3PointCircle:function(e,t,n,r){for(var a=Br(3),o=Br(3),i=Br(3),s=Br(3),l=Br(3),u=Br(3),c=0;c<3;++c)a[c]=e[c]-t[c],o[c]=t[c]-n[c],i[c]=n[c]-e[c],s[c]=-a[c],l[c]=-o[c],u[c]=-i[c];var d=na(s),f=na(l),p=na(i),g=Br(3);ta(a,o,g);for(var m=na(g),v=d*f*p/(2*m),h=2*m*m,y=f*f*ea(a,u)/h,b=p*p*ea(s,o)/h,T=d*d*ea(i,l)/h,C=0;C<3;++C)r[C]=y*e[C]+b*t[C]+T*n[C];return v},inf:1/0,negInf:-1/0,isInf:ja,isNan:za,isNaN:za,isFinite:Wa,createUninitializedBounds:Ka,getMajorAxisIndex:function(e){for(var t=-1,n=-1,r=0;rt&&(n=r,t=a)}return n},floatToHex2:Xa,floatRGB2HexCode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";return"".concat(t).concat(e.map(Xa).join(""))},float2CssRGBA:function(e){return 3===e.length?"rgb(".concat(e.map(qa).join(", "),")"):"rgba(".concat(qa(e[0]||0),", ").concat(qa(e[1]||0),", ").concat(qa(e[2]||0),", ").concat(e[3]||0,")")}},Za=ur.k;var Qa={context:null,openGLRenderWindow:null,selector:null};function $a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qa,n),pr.extend(e,t,n),ur.b(e,t,["shaderCache"]),ur.i(e,t,["selector"]),function(e,t){t.classHierarchy.push("vtkOpenGLRenderer"),e.buildPass=function(n){if(n){if(!t.renderable)return;t.renderable.isActiveCameraCreated()||t.renderable.resetCamera(),e.updateLights(),e.prepareNodes(),e.addMissingNode(t.renderable.getActiveCamera()),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes()}},e.updateLights=function(){for(var e=0,n=t.renderable.getLightsByReference(),r=0;r0&&e++;return e||(Za("No lights are on, creating one."),t.renderable.createLight()),e},e.opaqueZBufferPass=function(n){if(n){var r=0,a=t.context;t.renderable.getTransparent()||(t.context.clearColor(1,0,0,1),r|=a.COLOR_BUFFER_BIT),t.renderable.getPreserveDepthBuffer()||(a.clearDepth(1),r|=a.DEPTH_BUFFER_BIT,a.depthMask(!0));var o=e.getTiledSizeAndOrigin();a.enable(a.SCISSOR_TEST),a.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),a.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),a.colorMask(!0,!0,!0,!0),a.clear(r),a.enable(a.DEPTH_TEST)}},e.cameraPass=function(t){t&&e.clear()},e.getAspectRatio=function(){var e=t.parent.getSizeByReference(),n=t.renderable.getViewportByReference();return e[0]*(n[2]-n[0])/((n[3]-n[1])*e[1])},e.getTiledSizeAndOrigin=function(){var e=t.renderable.getViewportByReference(),n=[0,0,1,1],r=Fa(e[0]-n[0],0,1),a=Fa(e[1]-n[1],0,1),o=t.parent.normalizedDisplayToDisplay(r,a),i=Math.round(o[0]),s=Math.round(o[1]),l=Fa(e[2]-n[0],0,1),u=Fa(e[3]-n[1],0,1);l>n[2]-n[0]&&(l=n[2]-n[0]),u>n[3]-n[1]&&(u=n[3]-n[1]);var c=t.parent.normalizedDisplayToDisplay(l,u),d=Math.round(c[0])-i,f=Math.round(c[1])-s;return d<0&&(d=0),f<0&&(f=0),{usize:d,vsize:f,lowerLeftU:i,lowerLeftV:s}},e.clear=function(){var n=0,r=t.context;if(!t.renderable.getTransparent()){var a=t.renderable.getBackgroundByReference();t.context.clearColor(a[0],a[1],a[2],a[3]),n|=r.COLOR_BUFFER_BIT}t.renderable.getPreserveDepthBuffer()||(r.clearDepth(1),n|=r.DEPTH_BUFFER_BIT,r.depthMask(!0)),r.colorMask(!0,!0,!0,!0);var o=e.getTiledSizeAndOrigin();r.enable(r.SCISSOR_TEST),r.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),r.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),r.clear(n),r.enable(r.DEPTH_TEST)},e.releaseGraphicsResources=function(){null!==t.selector&&t.selector.releaseGraphicsResources()},e.setOpenGLRenderWindow=function(n){t.openGLRenderWindow!==n&&(e.releaseGraphicsResources(),t.openGLRenderWindow=n,t.context=null,n&&(t.context=t.openGLRenderWindow.getContext()))}}(e,t)}var Ja=ur.d($a,"vtkOpenGLRenderer");yr("vtkRenderer",Ja);var eo={NONE:-1,I:0,J:1,K:2,X:3,Y:4,Z:5},to={VOID:"",CHAR:"Int8Array",SIGNED_CHAR:"Int8Array",UNSIGNED_CHAR:"Uint8Array",SHORT:"Int16Array",UNSIGNED_SHORT:"Uint16Array",INT:"Int32Array",UNSIGNED_INT:"Uint32Array",FLOAT:"Float32Array",DOUBLE:"Float64Array"},no={DefaultDataType:to.FLOAT,DataTypeByteSize:{Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},VtkDataTypes:to};function ro(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ao(e){for(var t=1;ta&&(e=a),t1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=so(),a=e.length,o=0;if(t<0&&n>1){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=e||[];n.length<=t;)n.push(null);return n}function co(e){return Object.prototype.toString.call(e).slice(8,-1)}var fo={computeRange:lo,createRangeHelper:so,getDataType:co,getMaxNorm:function(e){for(var t=e.getNumberOfComponents(),n=0,r=0;rn&&(n=a)}return n}};var po={name:"",numberOfComponents:1,size:0,dataType:no.DefaultDataType,rangeTuple:[0,0]};function go(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,po,n),!t.empty&&!t.values&&!t.size)throw new TypeError("Cannot create vtkDataArray object without: size > 0, values");t.values?Array.isArray(t.values)&&(t.values=ur.f(t.dataType,t.values)):t.values=ur.e(t.dataType,t.size),t.values&&(t.size=t.values.length,t.dataType=co(t.values)),ur.g(e,t),ur.h(e,t,["name","numberOfComponents"]),function(e,t){function n(){t.ranges=null,e.modified()}t.classHierarchy.push("vtkDataArray"),e.getElementComponentSize=function(){return t.values.BYTES_PER_ELEMENT},e.getComponent=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.values[e*t.numberOfComponents+n]},e.setComponent=function(e,r,a){a!==t.values[e*t.numberOfComponents+r]&&(t.values[e*t.numberOfComponents+r]=a,n())},e.getData=function(){return t.values},e.getRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,n=e<0?t.numberOfComponents:e,r=null;return t.ranges||(t.ranges=uo(t.ranges,t.numberOfComponents)),(r=t.ranges[n])?(t.rangeTuple[0]=r.min,t.rangeTuple[1]=r.max,t.rangeTuple):(r=lo(t.values,e,t.numberOfComponents),t.ranges[n]=r,t.rangeTuple[0]=r.min,t.rangeTuple[1]=r.max,t.rangeTuple)},e.setRange=function(e,n){t.ranges||(t.ranges=uo(t.ranges,t.numberOfComponents));var r={min:e.min,max:e.max};return t.ranges[n]=r,t.rangeTuple[0]=r.min,t.rangeTuple[1]=r.max,t.rangeTuple},e.setTuple=function(e,n){for(var r=e*t.numberOfComponents,a=0;a1&&void 0!==arguments[1]?arguments[1]:io,r=t.numberOfComponents||1;n.length!==r&&(n.length=r);var a=e*r;if(1===r)n[0]=t.values[a];else if(2===r)n[0]=t.values[a],n[1]=t.values[a+1];else if(3===r)n[0]=t.values[a],n[1]=t.values[a+1],n[2]=t.values[a+2];else if(4===r)n[0]=t.values[a],n[1]=t.values[a+1],n[2]=t.values[a+2],n[3]=t.values[a+3];else for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:1)*t.numberOfComponents},e.getNumberOfComponents=function(){return t.numberOfComponents},e.getNumberOfValues=function(){return t.values.length},e.getNumberOfTuples=function(){return t.values.length/t.numberOfComponents},e.getDataType=function(){return t.dataType},e.newClone=function(){return mo({empty:!0,name:t.name,dataType:t.dataType,numberOfComponents:t.numberOfComponents})},e.getName=function(){return t.name||(e.modified(),t.name="vtkDataArray".concat(e.getMTime())),t.name},e.setData=function(e,r){t.values=e,t.size=e.length,t.dataType=co(e),r&&(t.numberOfComponents=r),t.size%t.numberOfComponents!=0&&(t.numberOfComponents=1),n()},e.getState=function(){var n=ao(ao({},t),{},{vtkClass:e.getClassName()});n.values=Array.from(n.values),delete n.buffer,Object.keys(n).forEach(function(e){n[e]||delete n[e]});var r={};return Object.keys(n).sort().forEach(function(e){r[e]=n[e]}),r.mtime&&delete r.mtime,r}}(e,t)}var mo=ur.d(go,"vtkDataArray"),vo=ao(ao({newInstance:mo,extend:go},fo),no),ho={ARRAY_BUFFER:0,ELEMENT_ARRAY_BUFFER:1,TEXTURE_BUFFER:2},yo={ObjectType:ho};function bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function To(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Po,n),ur.a.obj(e,t),ur.a.get(e,t,["openGLRenderWindow"]),function(e,t){function n(e){switch(e){case So.ELEMENT_ARRAY_BUFFER:return t.context.ELEMENT_ARRAY_BUFFER;case So.TEXTURE_BUFFER:if("TEXTURE_BUFFER"in t.context)return t.context.TEXTURE_BUFFER;default:case So.ARRAY_BUFFER:return t.context.ARRAY_BUFFER}}t.classHierarchy.push("vtkOpenGLBufferObject");var r=null,a=null,o=!0,i="";e.getType=function(){return r},e.setType=function(e){r=e},e.getHandle=function(){return a},e.isReady=function(){return!1===o},e.generateBuffer=function(e){var o=n(e);return null===a&&(a=t.context.createBuffer(),r=e),n(r)===o},e.upload=function(s,l){return e.generateBuffer(l)?(t.context.bindBuffer(n(r),a),t.context.bufferData(n(r),s,t.context.STATIC_DRAW),o=!1,!0):(i="Trying to upload array buffer to incompatible buffer.",!1)},e.bind=function(){return!!a&&(t.context.bindBuffer(n(r),a),!0)},e.release=function(){return!!a&&(t.context.bindBuffer(n(r),null),!0)},e.releaseGraphicsResources=function(){null!==a&&(t.context.bindBuffer(n(r),null),t.context.deleteBuffer(a),a=null)},e.setOpenGLRenderWindow=function(n){t.openGLRenderWindow!==n&&(e.releaseGraphicsResources(),t.openGLRenderWindow=n,t.context=null,n&&(t.context=t.openGLRenderWindow.getContext()))},e.getError=function(){return i}}(e,t)}var xo=To(To({newInstance:ur.a.newInstance(wo),extend:wo},{}),yo),Oo={FLAT:0,GOURAUD:1,PHONG:2},Mo={POINTS:0,WIREFRAME:1,SURFACE:2},Ao={Shading:Oo,Representation:Mo,Interpolation:Oo},Io=ur.a.vtkErrorMacro;function Ro(e,t){t.classHierarchy.push("vtkOpenGLCellArrayBufferObject"),e.setType(ho.ARRAY_BUFFER),e.createVBO=function(n,r,a,o){if(!n.getData()||!n.getData().length)return t.elementCount=0,0;t.blockSize=3,t.vertexOffset=0,t.normalOffset=0,t.tCoordOffset=0,t.tCoordComponents=0,t.colorComponents=0,t.colorOffset=0,t.customData=[];var i=o.points.getData(),s=null,l=null,u=null,c=o.colors?o.colors.getNumberOfComponents():0,d=o.tcoords?o.tcoords.getNumberOfComponents():0;o.normals&&(t.normalOffset=4*t.blockSize,t.blockSize+=3,s=o.normals.getData()),o.customAttributes&&o.customAttributes.forEach(function(e){e&&(t.customData.push({data:e.getData(),offset:4*t.blockSize,components:e.getNumberOfComponents(),name:e.getName()}),t.blockSize+=e.getNumberOfComponents())}),o.tcoords&&(t.tCoordOffset=4*t.blockSize,t.tCoordComponents=d,t.blockSize+=d,l=o.tcoords.getData()),o.colors?(t.colorComponents=o.colors.getNumberOfComponents(),t.colorOffset=0,u=o.colors.getData(),t.colorBO||(t.colorBO=xo.newInstance()),t.colorBO.setOpenGLRenderWindow(t.openGLRenderWindow)):t.colorBO=null,t.stride=4*t.blockSize;var f,p=0,g=0,m=0,v=0,h=0,y=0,b={anythingToPoints:function(e,t,n){for(var r=0;r2)for(var r=0;r2){for(var r=0;r1?2*(e-1):0},polysToWireframe:function(e,t){return e>2?2*e:0},stripsToWireframe:function(e,t){return e>2?4*e-6:0},polysToSurface:function(e,t){return e>2?3*(e-2):0},stripsToSurface:function(e,t,n){return e>2?3*(e-2):0}},C=null,S=null;a===Mo.POINTS||"verts"===r?(C=b.anythingToPoints,S=T.anythingToPoints):a===Mo.WIREFRAME||"lines"===r?(C=b["".concat(r,"ToWireframe")],S=T["".concat(r,"ToWireframe")]):(C=b["".concat(r,"ToSurface")],S=T["".concat(r,"ToSurface")]);for(var P=n.getData(),w=P.length,x=0,O=0;O0&&(Math.abs(D)/E>1e6||Math.abs(Math.log10(E))>3||0===E&&D>1e6)){for(var k=new Float64Array(3),F=new Float64Array(3),G=0;G<3;++G){var _=o.points.getRange(G),U=_[1]-_[0];k[G]=.5*(_[1]+_[0]),F[G]=U>0?1/U:1}e.setCoordShiftAndScale(k,F)}else!0===t.coordShiftAndScaleEnabled&&e.setCoordShiftAndScale(null,null);f=function(e){if(p=3*e,t.coordShiftAndScaleEnabled?(A[I++]=(i[p++]-t.coordShift[0])*t.coordScale[0],A[I++]=(i[p++]-t.coordShift[1])*t.coordScale[1],A[I++]=(i[p++]-t.coordShift[2])*t.coordScale[2]):(A[I++]=i[p++],A[I++]=i[p++],A[I++]=i[p++]),null!==s&&(g=o.haveCellNormals?3*(y+o.cellOffset):3*e,A[I++]=s[g++],A[I++]=s[g++],A[I++]=s[g++]),t.customData.forEach(function(t){h=e*t.components;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Eo,n),xo.extend(e,t,n),ur.a.setGet(e,t,["colorBO","elementCount","stride","colorBOStride","vertexOffset","normalOffset","tCoordOffset","tCoordComponents","colorOffset","colorComponents","customData"]),ur.a.get(e,t,["coordShift","coordScale","coordShiftAndScaleEnabled","inverseShiftAndScaleMatrix"]),Ro(e,t)}var Vo={newInstance:ur.a.newInstance(Do),extend:Do},Lo=ur.a.vtkErrorMacro;var No={shaderType:"Unknown",source:"",error:"",handle:0,dirty:!1,context:null};function Bo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,No,n),ur.a.obj(e,t),ur.a.setGet(e,t,["shaderType","source","error","handle","context"]),function(e,t){t.classHierarchy.push("vtkShader"),e.compile=function(){var e=t.context.VERTEX_SHADER;if(!t.source||!t.source.length||"Unknown"===t.shaderType)return!1;switch(0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0),t.shaderType){case"Fragment":e=t.context.FRAGMENT_SHADER;break;case"Vertex":default:e=t.context.VERTEX_SHADER}if(t.handle=t.context.createShader(e),t.context.shaderSource(t.handle,t.source),t.context.compileShader(t.handle),!t.context.getShaderParameter(t.handle,t.context.COMPILE_STATUS)){var n=t.context.getShaderInfoLog(t.handle);return Lo("Error compiling shader '".concat(t.source,"': ").concat(n)),t.context.deleteShader(t.handle),t.handle=0,!1}return!0},e.cleanup=function(){"Unknown"!==t.shaderType&&0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0,t.dirty=!0)}}(e,t)}var ko={newInstance:ur.a.newInstance(Bo,"vtkShader"),extend:Bo},Fo=ur.a.vtkErrorMacro;var Go={vertexShaderHandle:0,fragmentShaderHandle:0,geometryShaderHandle:0,vertexShader:null,fragmentShader:null,geometryShader:null,linked:!1,bound:!1,compiled:!1,error:"",handle:0,numberOfOutputs:0,attributesLocs:null,uniformLocs:null,md5Hash:0,context:null,lastCameraMTime:null};function _o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Go,n),t.attributesLocs={},t.uniformLocs={},t.vertexShader=ko.newInstance(),t.vertexShader.setShaderType("Vertex"),t.fragmentShader=ko.newInstance(),t.fragmentShader.setShaderType("Fragment"),t.geometryShader=ko.newInstance(),t.geometryShader.setShaderType("Geometry"),ur.a.obj(e,t),ur.a.get(e,t,["lastCameraMTime"]),ur.a.setGet(e,t,["error","handle","compiled","bound","md5Hash","vertexShader","fragmentShader","geometryShader","linked"]),function(e,t){t.classHierarchy.push("vtkShaderProgram"),e.compileShader=function(){return t.vertexShader.compile()?t.fragmentShader.compile()?e.attachShader(t.vertexShader)&&e.attachShader(t.fragmentShader)?e.link()?(e.setCompiled(!0),1):(Fo("Links failed: ".concat(t.error)),0):(Fo(t.error),0):(Fo(t.fragmentShader.getSource().split("\n").map(function(e,t){return"".concat(t,": ").concat(e)}).join("\n")),Fo(t.fragmentShader.getError()),0):(Fo(t.vertexShader.getSource().split("\n").map(function(e,t){return"".concat(t,": ").concat(e)}).join("\n")),Fo(t.vertexShader.getError()),0)},e.cleanup=function(){"Unknown"!==t.shaderType&&0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0)},e.bind=function(){return!(!t.linked&&!e.link()||(t.context.useProgram(t.handle),e.setBound(!0),0))},e.isBound=function(){return!!t.bound},e.release=function(){t.context.useProgram(null),e.setBound(!1)},e.setContext=function(e){t.vertexShader.setContext(e),t.fragmentShader.setContext(e),t.geometryShader.setContext(e)},e.link=function(){if(t.inked)return!0;if(0===t.handle)return t.error="Program has not been initialized, and/or does not have shaders.",!1;if(t.uniformLocs={},t.context.linkProgram(t.handle),!t.context.getProgramParameter(t.handle,t.context.LINK_STATUS)){var n=t.context.getProgramInfoLog(t.handle);return Fo("Error linking shader ".concat(n)),t.handle=0,!1}return e.setLinked(!0),t.attributeLocs={},!0},e.setUniformMatrix=function(n,r){var a=e.findUniform(n);if(-1===a)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;var o=new Float32Array(r);return t.context.uniformMatrix4fv(a,!1,o),!0},e.setUniformMatrix3x3=function(n,r){var a=e.findUniform(n);if(-1===a)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;var o=new Float32Array(r);return t.context.uniformMatrix3fv(a,!1,o),!0},e.setUniformf=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1f(a,r),!0)},e.setUniformfv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1fv(a,r),!0)},e.setUniformi=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1i(a,r),!0)},e.setUniformiv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1iv(a,r),!0)},e.setUniform2f=function(n,r,a){var o=e.findUniform(n);if(-1===o)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2f(o,r,a),!0},e.setUniform2fv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform2fv(a,r),!0)},e.setUniform2i=function(n,r,a){var o=e.findUniform(n);if(-1===o)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2i(o,r,a),!0},e.setUniform2iv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform2iv(a,r),!0)},e.setUniform3f=function(n,r,a,o){var i=e.findUniform(n);if(-1===i)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(void 0===o)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(i,r,a,o),!0},e.setUniform3fArray=function(n,r){var a=e.findUniform(n);if(-1===a)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(!Array.isArray(r)||3!==r.length)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(a,r[0],r[1],r[2]),!0},e.setUniform3fv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform3fv(a,r),!0)},e.setUniform3i=function(n){var r=e.findUniform(n);if(-1===r)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;for(var a=arguments.length,o=new Array(a>1?a-1:0),i=1;i1?a-1:0),i=1;i1?a-1:0),i=1;i3&&void 0!==arguments[3])||arguments[3],a=Array.isArray(n)?n.join("\n"):n,o=!1;-1!==e.search(t)&&(o=!0);var i="";r&&(i="g");var s=new RegExp(t,i);return{replace:o,result:e.replace(s,a)}}};var jo={forceEmulation:!1,handleVAO:0,handleProgram:0,supported:!0,buffers:null,context:null,openGLRenderWindow:null};function Wo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,jo,n),t.buffers=[],ur.a.obj(e,t),ur.a.get(e,t,["supported"]),ur.a.setGet(e,t,["forceEmulation"]),function(e,t){t.classHierarchy.push("vtkOpenGLVertexArrayObject"),e.exposedMethod=function(){},e.initialize=function(){t.instancingExtension=null,t.openGLRenderWindow.getWebgl2()||(t.instancingExtension=t.context.getExtension("ANGLE_instanced_arrays")),!t.forceEmulation&&t.openGLRenderWindow&&t.openGLRenderWindow.getWebgl2()?(t.extension=null,t.supported=!0,t.handleVAO=t.context.createVertexArray()):(t.extension=t.context.getExtension("OES_vertex_array_object"),!t.forceEmulation&&t.extension?(t.supported=!0,t.handleVAO=t.extension.createVertexArrayOES()):t.supported=!1)},e.isReady=function(){return 0!==t.handleVAO||!1===t.supported},e.bind=function(){if(e.isReady()||e.initialize(),e.isReady()&&t.supported)t.extension?t.extension.bindVertexArrayOES(t.handleVAO):t.context.bindVertexArray(t.handleVAO);else if(e.isReady())for(var n=t.context,r=0;r0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,1):n.vertexAttribDivisor(i.index+l,1))}},e.release=function(){if(e.isReady()&&t.supported)t.extension?t.extension.bindVertexArrayOES(null):t.context.bindVertexArray(null);else if(e.isReady())for(var n=t.context,r=0;r0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,0):n.vertexAttribDivisor(i.index+l,0)),n.disableVertexAttribArray(i.index+l)}},e.shaderProgramChanged=function(){e.release(),t.handleVAO&&(t.extension?t.extension.deleteVertexArrayOES(t.handleVAO):t.context.deleteVertexArray(t.handleVAO)),t.handleVAO=0,t.handleProgram=0},e.releaseGraphicsResources=function(){e.shaderProgramChanged(),t.handleVAO&&(t.extension?t.extension.deleteVertexArrayOES(t.handleVAO):t.context.deleteVertexArray(t.handleVAO)),t.handleVAO=0,t.supported=!0,t.handleProgram=0},e.addAttributeArray=function(t,n,r,a,o,i,s,l){return e.addAttributeArrayWithDivisor(t,n,r,a,o,i,s,l,0,!1)},e.addAttributeArrayWithDivisor=function(n,r,a,o,i,s,l,u,c,d){if(!n)return!1;if(!n.isBound()||0===r.getHandle()||r.getType()!==ho.ARRAY_BUFFER)return!1;if(0===t.handleProgram&&(t.handleProgram=n.getHandle()),e.isReady()||e.initialize(),!e.isReady()||t.handleProgram!==n.getHandle())return!1;var f=t.context,p={};if(p.name=a,p.index=f.getAttribLocation(t.handleProgram,a),p.offset=o,p.stride=i,p.type=s,p.size=l,p.normalize=u,p.isMatrix=d,p.divisor=c,-1===p.Index)return!1;if(r.bind(),f.enableVertexAttribArray(p.index),f.vertexAttribPointer(p.index,p.size,p.type,p.normalize,p.stride,p.offset),c>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(p.index,1):f.vertexAttribDivisor(p.index,1)),p.buffer=r.getHandle(),!t.supported){for(var g=!1,m=0;m0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(p+g,1):f.vertexAttribDivisor(p+g,1));return!0},e.removeAttributeArray=function(n){if(!e.isReady()||0===t.handleProgram)return!1;if(!t.supported)for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ho,n),ur.a.obj(e,t),t.shaderSourceTime={},ur.a.obj(t.shaderSourceTime),t.attributeUpdateTime={},ur.a.obj(t.attributeUpdateTime),ur.a.setGet(e,t,["program","shaderSourceTime","VAO","attributeUpdateTime","CABO","primitiveType"]),t.program=Uo.newInstance(),t.VAO=zo.newInstance(),t.CABO=Vo.newInstance(),function(e,t){t.classHierarchy.push("vtkOpenGLHelper"),e.setOpenGLRenderWindow=function(e){t.program.setContext(e.getContext()),t.VAO.setOpenGLRenderWindow(e),t.CABO.setOpenGLRenderWindow(e)},e.releaseGraphicsResources=function(e){t.VAO.releaseGraphicsResources(),t.CABO.releaseGraphicsResources(),t.CABO.setElementCount(0)}}(e,t)}var Xo={newInstance:ur.a.newInstance(Ko),extend:Ko},qo={CLAMP_TO_EDGE:0,REPEAT:1,MIRRORED_REPEAT:2},Yo={NEAREST:0,LINEAR:1,NEAREST_MIPMAP_NEAREST:2,NEAREST_MIPMAP_LINEAR:3,LINEAR_MIPMAP_NEAREST:4,LINEAR_MIPMAP_LINEAR:5},Zo={Wrap:qo,Filter:Yo};function Qo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jo=Zo.Wrap,ei=Zo.Filter,ti=vo.VtkDataTypes,ni=ur.k,ri=ur.l,ai=ur.m;var oi={openGLRenderWindow:null,context:null,handle:0,sendParametersTime:null,textureBuildTime:null,numberOfDimensions:0,target:0,format:0,openGLDataType:0,components:0,width:0,height:0,depth:0,autoParameters:!0,wrapS:Jo.CLAMP_TO_EDGE,wrapT:Jo.CLAMP_TO_EDGE,wrapR:Jo.CLAMP_TO_EDGE,minificationFilter:ei.NEAREST,magnificationFilter:ei.NEAREST,minLOD:-1e3,maxLOD:1e3,baseLevel:0,maxLevel:1e3,generateMipmap:!1};function ii(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oi,n),pr.extend(e,t,n),t.sendParametersTime={},ur.g(t.sendParametersTime,{mtime:0}),t.textureBuildTime={},ur.g(t.textureBuildTime,{mtime:0}),ur.h(e,t,["format","openGLDataType"]),ur.i(e,t,["keyMatrixTime","minificationFilter","magnificationFilter","wrapS","wrapT","wrapR","generateMipmap"]),ur.b(e,t,["width","height","volumeInfo","components","handle","target"]),function(e,t){var n=this;function r(e,n){var r=[];if(e!==ti.FLOAT&&t.openGLDataType===t.context.FLOAT)for(var a=t.width*t.height*t.components,o=0;o=a&&(h=a-1);var y=m-v,b=1-y;v=v*r*o,h=h*r*o;for(var T=0;T=r&&(w=r-1);var x=S-P;P*=o,w*=o;for(var O=0;Oa[l]&&(a[l]=n[i]),i++;for(var u=[],c=[],d=0;d0&&void 0!==arguments[0]?arguments[0]:null;if(n?t.openGLRenderWindow=n:(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent()),t.context=t.openGLRenderWindow.getContext(),t.renderable.getInterpolate()?(t.generateMipmap?e.setMinificationFilter(ei.LINEAR_MIPMAP_LINEAR):e.setMinificationFilter(ei.LINEAR),e.setMagnificationFilter(ei.LINEAR)):(e.setMinificationFilter(ei.NEAREST),e.setMagnificationFilter(ei.NEAREST)),t.renderable.getRepeat()&&(e.setWrapR(Jo.REPEAT),e.setWrapS(Jo.REPEAT),e.setWrapT(Jo.REPEAT)),t.renderable.getInputData()&&t.renderable.setImage(null),!t.handle||t.renderable.getMTime()>t.textureBuildTime.getMTime()){null!==t.renderable.getImage()&&(t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(ei.LINEAR_MIPMAP_LINEAR)),t.renderable.getImage()&&t.renderable.getImageLoaded()&&(e.create2DFromImage(t.renderable.getImage()),e.activate(),e.sendParameters(),t.textureBuildTime.modified()));var r=t.renderable.getInputData(0);if(r&&r.getPointData().getScalars()){for(var a=r.getExtent(),o=r.getPointData().getScalars(),i=[],s=0;st.sendParametersTime.getMTime()&&e.sendParameters()},e.isBound=function(){var e=!1;if(t.context&&t.handle){var n=0;switch(t.target){case t.context.TEXTURE_2D:n=t.context.TEXTURE_BINDING_2D;break;default:ai("impossible case")}e=t.context.getIntegerv(n)===t.handle}return e},e.sendParameters=function(){t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_S,e.getOpenGLWrapMode(t.wrapS)),t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_T,e.getOpenGLWrapMode(t.wrapT)),t.openGLRenderWindow.getWebgl2()&&t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_R,e.getOpenGLWrapMode(t.wrapR)),t.context.texParameteri(t.target,t.context.TEXTURE_MIN_FILTER,e.getOpenGLFilterMode(t.minificationFilter)),t.context.texParameteri(t.target,t.context.TEXTURE_MAG_FILTER,e.getOpenGLFilterMode(t.magnificationFilter)),t.openGLRenderWindow.getWebgl2()&&(t.context.texParameteri(t.target,t.context.TEXTURE_BASE_LEVEL,t.baseLevel),t.context.texParameteri(t.target,t.context.TEXTURE_MAX_LEVEL,t.maxLevel)),t.sendParametersTime.modified()},e.getInternalFormat=function(n,r){return t.internalFormat||(t.internalFormat=e.getDefaultInternalFormat(n,r)),t.internalFormat||ni("Unable to find suitable internal format for T=".concat(n," NC= ").concat(r)),t.internalFormat},e.getDefaultInternalFormat=function(e,r){var a=0;return(a=t.openGLRenderWindow.getDefaultTextureInternalFormat(e,r,!1))?a:((a=n.openGLRenderWindow.getDefaultTextureInternalFormat(e,r,!0))||(ni("Unsupported internal texture type!"),ni("Unable to find suitable internal format for T=".concat(e," NC= ").concat(r))),a)},e.setInternalFormat=function(n){n!==t.internalFormat&&(t.internalFormat=n,e.modified())},e.getFormat=function(n,r){return t.format=e.getDefaultFormat(n,r),t.format},e.getDefaultFormat=function(e,n){if(t.openGLRenderWindow.getWebgl2())switch(n){case 1:return t.context.RED;case 2:return t.context.RG;case 3:return t.context.RGB;case 4:return t.context.RGBA;default:return t.context.RGB}else switch(n){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:return t.context.RGB;case 4:return t.context.RGBA;default:return t.context.RGB}},e.resetFormatAndType=function(){t.format=0,t.internalFormat=0,t.openGLDataType=0},e.getDefaultDataType=function(e){if(t.openGLRenderWindow.getWebgl2())switch(e){case ti.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case ti.FLOAT:case ti.VOID:default:return t.context.FLOAT}switch(e){case ti.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case ti.FLOAT:case ti.VOID:default:return t.context.getExtension("OES_texture_float")&&t.context.getExtension("OES_texture_float_linear")?t.context.FLOAT:t.context.UNSIGNED_BYTE}},e.getOpenGLDataType=function(n){return t.openGLDataType=e.getDefaultDataType(n),t.openGLDataType},e.getShiftAndScale=function(){var e=0,n=1;switch(t.openGLDataType){case t.context.BYTE:e=(n=127.5)-128;break;case t.context.UNSIGNED_BYTE:n=255,e=0;break;case t.context.SHORT:e=(n=32767.5)-32768;break;case t.context.UNSIGNED_SHORT:n=65536,e=0;break;case t.context.INT:e=(n=2147483647.5)-2147483648;break;case t.context.UNSIGNED_INT:n=4294967295,e=0;break;case t.context.FLOAT:}return{shift:e,scale:n}},e.getOpenGLFilterMode=function(e){switch(e){case ei.NEAREST:return t.context.NEAREST;case ei.LINEAR:return t.context.LINEAR;case ei.NEAREST_MIPMAP_NEAREST:return t.context.NEAREST_MIPMAP_NEAREST;case ei.NEAREST_MIPMAP_LINEAR:return t.context.NEAREST_MIPMAP_LINEAR;case ei.LINEAR_MIPMAP_NEAREST:return t.context.LINEAR_MIPMAP_NEAREST;case ei.LINEAR_MIPMAP_LINEAR:return t.context.LINEAR_MIPMAP_LINEAR;default:return t.context.NEAREST}},e.getOpenGLWrapMode=function(e){switch(e){case Jo.CLAMP_TO_EDGE:return t.context.CLAMP_TO_EDGE;case Jo.REPEAT:return t.context.REPEAT;case Jo.MIRRORED_REPEAT:return t.context.MIRRORED_REPEAT;default:return t.context.CLAMP_TO_EDGE}},e.create2DFromRaw=function(n,o,i,s,l){if(e.getOpenGLDataType(s),e.getInternalFormat(s,i),e.getFormat(s,i),!t.internalFormat||!t.format||!t.openGLDataType)return ri("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=i,t.width=n,t.height=o,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();var u=a(r(s,[l]));return t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,u[0]),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0},e.createCubeFromRaw=function(n,o,i,s,l){if(e.getOpenGLDataType(s),e.getInternalFormat(s,i),e.getFormat(s,i),!t.internalFormat||!t.format||!t.openGLDataType)return ri("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_CUBE_MAP,t.components=i,t.width=n,t.height=o,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),t.maxLevel=l.length/6-1,e.createTexture(),e.bind();for(var u=a(r(s,l)),c=[],d=t.width,f=t.height,p=0;p=1&&T>=1;){var C=null;y<=t.maxLevel&&(C=c[6*y+h]),t.context.texImage2D(t.context.TEXTURE_CUBE_MAP_POSITIVE_X+h,y,t.internalFormat,b,T,0,t.format,t.openGLDataType,C),y++,b/=2,T/=2}return e.deactivate(),!0},e.createDepthFromRaw=function(n,r,a,o){return e.getOpenGLDataType(a),t.format=t.context.DEPTH_COMPONENT,t.openGLRenderWindow.getWebgl2()?a===ti.FLOAT?t.internalFormat=t.context.DEPTH_COMPONENT32F:t.internalFormat=t.context.DEPTH_COMPONENT16:t.internalFormat=t.context.DEPTH_COMPONENT,t.internalFormat&&t.format&&t.openGLDataType?(t.target=t.context.TEXTURE_2D,t.components=1,t.width=n,t.height=r,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,o),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0):(ri("Failed to determine texture parameters."),!1)},e.create2DFromImage=function(n){if(e.getOpenGLDataType(ti.UNSIGNED_CHAR),e.getInternalFormat(ti.UNSIGNED_CHAR,4),e.getFormat(ti.UNSIGNED_CHAR,4),!t.internalFormat||!t.format||!t.openGLDataType)return ri("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=4,t.width=n.width,t.height=n.height,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1);var r=!qr(n.width)||!qr(n.height),a=document.createElement("canvas");a.width=r?Xr(n.width):n.width,a.height=r?Xr(n.height):n.height;var o=a.getContext("2d");o.translate(0,a.height),o.scale(1,-1),o.drawImage(n,0,0,n.width,n.height,0,0,a.width,a.height),navigator.userAgent.indexOf("Chrome/69")>=0&&o.getImageData(0,0,1,1);var i=a;return t.context.texImage2D(t.target,0,t.internalFormat,t.format,t.openGLDataType,i),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0},e.create3DFromRaw=function(n,r,a,o,i,s){return e.getOpenGLDataType(i),e.getInternalFormat(i,o),e.getFormat(i,o),t.internalFormat&&t.format&&t.openGLDataType?(t.target=t.context.TEXTURE_3D,t.components=o,t.width=n,t.height=r,t.depth=a,t.numberOfDimensions=3,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.texImage3D(t.target,0,t.internalFormat,t.width,t.height,t.depth,0,t.format,t.openGLDataType,s),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0):(ri("Failed to determine texture parameters."),!1)},e.create3DFilterableFromRaw=function(n,r,a,i,s,l){for(var u=n*r*a,c=[],d=[],f=0;f4096&&(w===ti.FLOAT||i>=3)&&(O=4096);var M=1,A=1;u>O*O&&(A=M=Math.ceil(Math.sqrt(u/(O*O))));var I=Math.sqrt(u)/M;I=Xr(I);var R,E=Math.floor(I*M/n),D=Math.ceil(a/E),V=Xr(r*D/A);t.width=I,t.height=V,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.volumeInfo.xreps=E,t.volumeInfo.yreps=D,t.volumeInfo.xstride=M,t.volumeInfo.ystride=A,t.volumeInfo.offset=S.offset,t.volumeInfo.scale=S.scale;var L=I*V*i;R=w===ti.FLOAT?new Float32Array(L):new Uint8Array(L);for(var N=0,B=Math.floor(n/M),k=Math.floor(r/A),F=0;F2&&void 0!==arguments[2]&&arguments[2],e.replaceShaderCoincidentOffset=function(n,r,a){var o=e.getCoincidentParameters(r,a);if(o&&(0!==o.factor||0!==o.offset)){var i=n.Fragment;i=Uo.substitute(i,"//VTK::Coincident::Dec",["uniform float cfactor;","uniform float coffset;"]).result,t.context.getExtension("EXT_frag_depth")&&(0!==o.factor?(i=Uo.substitute(i,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,i=Uo.substitute(i,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):i=Uo.substitute(i,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + 0.000016*coffset;").result),t.openGLRenderWindow.getWebgl2()&&(0!==o.factor?(i=Uo.substitute(i,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,i=Uo.substitute(i,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):i=Uo.substitute(i,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + 0.000016*coffset;").result),n.Fragment=i}}}},mi=ur.l,vi=eo;function hi(e,t,n){if(t.apply(e)){var r=e.getIndependentComponents();return"".concat(e.getMTime(),"-").concat(r,"-").concat(n)}return"0"}var yi={VBOBuildTime:0,VBOBuildString:null,openGLTexture:null,tris:null,imagemat:null,colorTexture:null,pwfTexture:null,lastHaveSeenDepthRequest:!1,haveSeenDepthRequest:!1,lastTextureComponents:0};function bi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yi,n),pr.extend(e,t,n),gi.implementReplaceShaderCoincidentOffset(e,t,n),t.tris=Xo.newInstance(),t.openGLTexture=li.newInstance(),t.colorTexture=li.newInstance(),t.pwfTexture=li.newInstance(),t.imagemat=o.identity(new Float64Array(16)),ur.i(e,t,[]),t.VBOBuildTime={},ur.g(t.VBOBuildTime),function(e,t){t.classHierarchy.push("vtkOpenGLImageMapper"),e.buildPass=function(n){if(n){t.openGLImageSlice=e.getFirstAncestorOfType("vtkOpenGLImageSlice"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext(),t.tris.setOpenGLRenderWindow(t.openGLRenderWindow),t.openGLTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.colorTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.pwfTexture.setOpenGLRenderWindow(t.openGLRenderWindow);var r=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(r.getActiveCamera()),t.renderable.getSliceAtFocalPoint()&&t.renderable.setSliceFromCamera(r.getActiveCamera())}},e.translucentPass=function(t){t&&e.render()},e.opaqueZBufferPass=function(n){n&&(t.haveSeenDepthRequest=!0,t.renderDepth=!0,e.render(),t.renderDepth=!1)},e.opaquePass=function(t){t&&e.render()},e.getCoincidentParameters=function(e,n){return t.renderable.getResolveCoincidentTopology()?t.renderable.getCoincidentTopologyPolygonOffsetParameters():null},e.render=function(){var n=t.openGLImageSlice.getRenderable(),r=t.openGLRenderer.getRenderable();e.renderPiece(r,n)},e.buildShaders=function(t,n,r){e.getShaderTemplate(t,n,r),e.replaceShaderValues(t,n,r)},e.getShaderTemplate=function(e,t,n){e.Vertex=di.a,e.Fragment=pi.a,e.Geometry=""},e.replaceShaderValues=function(n,r,a){var o=n.Vertex,i=n.Fragment;o=Uo.substitute(o,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,o=Uo.substitute(o,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result,o=Uo.substitute(o,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result,o=Uo.substitute(o,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result;var s=t.openGLTexture.getComponents(),l=a.getProperty().getIndependentComponents(),u=["varying vec2 tcoordVCVSOutput;","uniform float cshift0;","uniform float cscale0;","uniform float pwfshift0;","uniform float pwfscale0;","uniform sampler2D texture1;","uniform sampler2D colorTexture1;","uniform sampler2D pwfTexture1;","uniform float opacity;"];if(l){for(var c=1;cn.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(n.getProgram().isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexMC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||mi("Error setting vertexMC in shader VAO.")),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),t.context.FLOAT,n.getCABO().getTCoordComponents(),t.context.FALSE)||mi("Error setting tcoordMC in shader VAO.")),n.getAttributeUpdateTime().modified());var o=t.openGLTexture.getTextureUnit();n.getProgram().setUniformi("texture1",o);var i=t.openGLTexture.getComponents(),s=a.getProperty().getIndependentComponents();if(s)for(var l=0;l1?1:0;var U=o.getData(),j=null;if(E===vi.I){j=new U.constructor(B[2]*B[1]*l);for(var W=0,z=0;z2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ci,n),pr.extend(e,t,n),t.keyMatrixTime={},ur.g(t.keyMatrixTime,{mtime:0}),t.keyMatrices={mcwc:o.identity(new Float64Array(16))},ur.i(e,t,["context"]),function(e,t){t.classHierarchy.push("vtkOpenGLImageSlice"),e.buildPass=function(n){if(t.renderable&&t.renderable.getVisibility()&&n){if(!t.renderable)return;t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaqueZBufferPass=function(t){e.traverseOpaquePass(t)},e.traverseOpaquePass=function(n){t.renderable&&t.renderable.getVisibility()&&t.renderable.getIsOpaque()&&(!t.openGLRenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children.forEach(function(e){e.traverse(n)}),e.apply(n,!1))},e.traverseTranslucentPass=function(n){!t.renderable||!t.renderable.getVisibility()||t.renderable.getIsOpaque()||t.openGLRenderer.getSelector()&&!t.renderable.getPickable()||(e.apply(n,!0),t.children.forEach(function(e){e.traverse(n)}),e.apply(n,!1))},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?n.incrementOpaqueActorCount():n.incrementTranslucentActorCount()}},e.opaqueZBufferPass=function(t,n){return e.opaquePass(t,n)},e.opaquePass=function(n,r){n&&(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!0))},e.translucentPass=function(n,r){n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!1)):t.context.depthMask(!0)},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(o.copy(t.keyMatrices.mcwc,t.renderable.getMatrix()),o.transpose(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.keyMatrixTime.modified()),t.keyMatrices}}(e,t)}var Pi=ur.d(Si,"vtkOpenGLImageSlice");yr("vtkImageSlice",Pi);var wi={};function xi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,wi,n),pr.extend(e,t,n),t.keyMatrixTime={},ur.g(t.keyMatrixTime,{mtime:0}),t.normalMatrix=new Float64Array(9),t.MCWCMatrix=new Float64Array(16),ur.i(e,t,["context"]),function(e,t){t.classHierarchy.push("vtkOpenGLVolume"),e.buildPass=function(n){t.renderable&&t.renderable.getVisibility()&&n&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;n.incrementVolumeCount()}},e.traverseVolumePass=function(n){t.renderable&&t.renderable.getVisibility()&&(!t.openGLRenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children[0].traverse(n),e.apply(n,!1))},e.volumePass=function(n){t.renderable&&t.renderable.getVisibility()&&(n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!1)):t.context.depthMask(!0))},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),o.copy(t.MCWCMatrix,t.renderable.getMatrix()),o.transpose(t.MCWCMatrix,t.MCWCMatrix),t.renderable.getIsIdentity()?a.identity(t.normalMatrix):(a.fromMat4(t.normalMatrix,t.MCWCMatrix),a.invert(t.normalMatrix,t.normalMatrix)),t.keyMatrixTime.modified()),{mcwc:t.MCWCMatrix,normalMatrix:t.normalMatrix}}}(e,t)}var Oi=ur.d(xi,"vtkOpenGLVolume");yr("vtkVolume",Oi);var Mi={openGLRenderWindow:null,glFramebuffer:null,colorTexture:null,depthTexture:null,previousDrawBinding:0,previousReadBinding:0,previousDrawBuffer:0,previousReadBuffer:0,previousActiveFramebuffer:null};function Ai(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mi,n),ur.g(e,t),ur.i(e,t,["colorTexture"]),function(e,t){t.classHierarchy.push("vtkFramebuffer"),e.getBothMode=function(){return t.context.FRAMEBUFFER},e.saveCurrentBindingsAndBuffers=function(t){var n=void 0!==t?t:e.getBothMode();e.saveCurrentBindings(n),e.saveCurrentBuffers(n)},e.saveCurrentBindings=function(e){var n=t.context;t.previousDrawBinding=n.getParameter(t.context.FRAMEBUFFER_BINDING),t.previousActiveFramebuffer=t.openGLRenderWindow.getActiveFramebuffer()},e.saveCurrentBuffers=function(e){},e.restorePreviousBindingsAndBuffers=function(t){var n=void 0!==t?t:e.getBothMode();e.restorePreviousBindings(n),e.restorePreviousBuffers(n)},e.restorePreviousBindings=function(e){var n=t.context;n.bindFramebuffer(n.FRAMEBUFFER,t.previousDrawBinding),t.openGLRenderWindow.setActiveFramebuffer(t.previousActiveFramebuffer)},e.restorePreviousBuffers=function(e){},e.bind=function(){t.context.bindFramebuffer(t.context.FRAMEBUFFER,t.glFramebuffer),t.colorTexture&&t.colorTexture.bind(),t.openGLRenderWindow.setActiveFramebuffer(e)},e.create=function(e,n){t.glFramebuffer=t.context.createFramebuffer(),t.glFramebuffer.width=e,t.glFramebuffer.height=n},e.setColorBuffer=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=t.context,a=r.COLOR_ATTACHMENT0;if(n>0){if(!t.openGLRenderWindow.getWebgl2())return void ur.l("Using multiple framebuffer attachments requires WebGL 2");a+=n}t.colorTexture=e,r.framebufferTexture2D(r.FRAMEBUFFER,a,r.TEXTURE_2D,e.getHandle(),0)},e.removeColorBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=t.context,r=n.COLOR_ATTACHMENT0;if(e>0){if(!t.openGLRenderWindow.getWebgl2())return void ur.l("Using multiple framebuffer attachments requires WebGL 2");r+=e}n.framebufferTexture2D(n.FRAMEBUFFER,r,n.TEXTURE_2D,null,0)},e.setDepthBuffer=function(e){if(t.openGLRenderWindow.getWebgl2()){var n=t.context;n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,e.getHandle(),0)}else ur.l("Attaching depth buffer textures to fbo requires WebGL 2")},e.removeDepthBuffer=function(){if(t.openGLRenderWindow.getWebgl2()){var e=t.context;e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,null,0)}else ur.l("Attaching depth buffer textures to framebuffers requires WebGL 2")},e.getGLFramebuffer=function(){return t.glFramebuffer},e.setOpenGLRenderWindow=function(n){t.openGLRenderWindow!==n&&(e.releaseGraphicsResources(),t.openGLRenderWindow=n,t.context=null,n&&(t.context=t.openGLRenderWindow.getContext()))},e.releaseGraphicsResources=function(){t.glFramebuffer&&t.context.deleteFramebuffer(t.glFramebuffer),t.colorTexture&&t.colorTexture.releaseGraphicsResources()},e.getSize=function(){var e=[0,0];return null!==t.glFramebuffer&&(e[0]=t.glFramebuffer.width,e[1]=t.glFramebuffer.height),e},e.populateFramebuffer=function(){e.bind();var n=t.context,r=li.newInstance();r.setOpenGLRenderWindow(t.openGLRenderWindow),r.setMinificationFilter(Yo.LINEAR),r.setMagnificationFilter(Yo.LINEAR),r.create2DFromRaw(t.glFramebuffer.width,t.glFramebuffer.height,4,to.UNSIGNED_CHAR,null),e.setColorBuffer(r),t.depthTexture=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,t.depthTexture),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t.glFramebuffer.width,t.glFramebuffer.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t.depthTexture)}}(e,t)}var Ii={newInstance:ur.d(Ai,"vtkFramebuffer"),extend:Ai},Ri={NEAREST:0,LINEAR:1,FAST_LINEAR:2},Ei={FRACTIONAL:0,PROPORTIONAL:1},Di={InterpolationType:Ri,OpacityMode:Ei},Vi={COMPOSITE_BLEND:0,MAXIMUM_INTENSITY_BLEND:1,MINIMUM_INTENSITY_BLEND:2,AVERAGE_INTENSITY_BLEND:3},Li={BlendMode:Vi},Ni=n(9),Bi=n.n(Ni),ki=n(10),Fi=n.n(ki);function Gi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ui=ur.m,ji=ur.l;function Wi(e,t){if(e.length!==t.length)return!1;for(var n=0;n0&&(o=Uo.substitute(o,"//VTK::vtkProportionalComponents",u.join("\n")).result)}var d=t.currentInput.getExtent(),f=t.currentInput.getSpacing(),p=new Float64Array(3);i.set(p,(d[1]-d[0])*f[0],(d[3]-d[2])*f[1],(d[5]-d[4])*f[2]);var g=i.length(p)/t.renderable.getSampleDistance();o=Uo.substitute(o,"//VTK::MaximumSamplesValue","".concat(Math.ceil(g))).result,o=Uo.substitute(o,"//VTK::LightComplexity","#define vtkLightComplexity ".concat(t.lastLightComplexity)).result,t.gopacity=a.getProperty().getUseGradientOpacity(0);for(var m=1;l&&!t.gopacity&&m0&&(a=Uo.substitute(a,"//VTK::Light::Dec",["uniform vec3 lightColor".concat(o,";"),"uniform vec3 lightDirectionVC".concat(o,"; // normalized"),"uniform vec3 lightHalfAngleVC".concat(o,"; // normalized"),"//VTK::Light::Dec"],!1).result,a=Uo.substitute(a,"//VTK::Light::Impl",[" float df = abs(dot(normal.rgb, -lightDirectionVC".concat(o,"));")," diffuse += ((df".concat("",") * lightColor").concat(o,");")," float sf = pow( abs(dot(lightHalfAngleVC".concat(o,",normal.rgb)), vSpecularPower);")," specular += ((sf".concat("",") * lightColor").concat(o,");")," //VTK::Light::Impl"],!1).result,o++)})}e.Fragment=a},e.replaceShaderClippingPlane=function(e,n,r){var a=e.Fragment;if(t.renderable.getClippingPlanes().length>0){var o=t.renderable.getClippingPlanes().length;a=Uo.substitute(a,"//VTK::ClipPlane::Dec",["uniform vec3 vClipPlaneNormals[6];","uniform float vClipPlaneDistances[6];","//VTK::ClipPlane::Dec"],!1).result,a=Uo.substitute(a,"//VTK::ClipPlane::Impl",["for(int i = 0; i < ".concat(o,"; i++) {")," float rayDirRatio = dot(rayDir, vClipPlaneNormals[i]);"," float equationResult = dot(vertexVCVSOutput, vClipPlaneNormals[i]) + vClipPlaneDistances[i];"," if (rayDirRatio == 0.0)"," {"," if (equationResult < 0.0) dists.x = dists.y;"," continue;"," }"," float result = -1.0 * equationResult / rayDirRatio;"," if (rayDirRatio < 0.0) dists.y = min(dists.y, result);"," else dists.x = max(dists.x, result);","}","//VTK::ClipPlane::Impl"],!1).result}e.Fragment=a},e.getNeedToRebuildShaders=function(n,r,a){var o=0;a.getProperty().getShade()&&t.renderable.getBlendMode()===Vi.COMPOSITE_BLEND&&(o=0,t.numberOfLights=0,r.getLights().forEach(function(e){e.getSwitch()>0&&(t.numberOfLights++,0===o&&(o=1)),1===o&&(t.numberOfLights>1||1!==e.getIntensity()||!e.lightTypeIsHeadLight())&&(o=2),o<3&&e.getPositional()&&(o=3)}));var s=!1;t.lastLightComplexity!==o&&(t.lastLightComplexity=o,s=!0);var l=t.scalarTexture.getComponents(),u=a.getProperty().getIndependentComponents(),c=!1,d=[];if(u){for(var f=0;f0&&(c=!0)}var p=t.currentInput.getExtent(),g=t.currentInput.getSpacing(),m=new Float64Array(3);i.set(m,(p[1]-p[0])*g[0],(p[3]-p[2])*g[1],(p[5]-p[4])*g[2]);var v=i.length(m)/t.renderable.getSampleDistance(),h={interpolationType:a.getProperty().getInterpolationType(),useLabelOutline:a.getProperty().getUseLabelOutline(),numComp:l,usesProportionalComponents:c,iComps:u,maxSamples:v,useGradientOpacity:a.getProperty().getUseGradientOpacity(0),blendMode:t.renderable.getBlendMode(),averageIPScalarMode:t.renderable.getAverageIPScalarRange(),proportionalComponents:d};return t.previousState&&t.previousState.interpolationType===h.interpolationType&&t.previousState.useLabelOutline===h.useLabelOutline&&t.previousState.numComp===h.numComp&&t.previousState.usesProportionalComponents===h.usesProportionalComponents&&t.previousState.iComps===h.iComps&&t.previousState.maxSamples===h.maxSamples&&t.previousState.useGradientOpacity===h.useGradientOpacity&&t.previousState.blendMode===h.blendMode&&Wi(t.previousState.averageIPScalarMode,h.averageIPScalarMode)&&Wi(t.previousState.proportionalComponents,h.proportionalComponents)?!!(0===n.getProgram()||s||t.lastHaveSeenDepthRequest!==t.haveSeenDepthRequest||!!t.lastZBufferTexture!=!!t.zBufferTexture||n.getShaderSourceTime().getMTime()n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(o.isAttributeUsed("vertexDC")&&(n.getVAO().addAttributeArray(o,n.getCABO(),"vertexDC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||ji("Error setting vertexDC in shader VAO.")),n.getAttributeUpdateTime().modified()),o.setUniformi("texture1",t.scalarTexture.getTextureUnit()),o.setUniformf("sampleDistance",t.renderable.getSampleDistance()),null!==t.zBufferTexture){o.setUniformi("zBufferTexture",t.zBufferTexture.getTextureUnit());var i=e.getRenderTargetSize();o.setUniformf("vpWidth",i[0]),o.setUniformf("vpHeight",i[1])}},e.setCameraShaderParameters=function(n,r,s){var l=t.openGLCamera.getKeyMatrices(r),u=t.openGLVolume.getKeyMatrices();o.multiply(t.modelToView,l.wcvc,u.mcwc);var c=n.getProgram(),d=t.openGLCamera.getRenderable(),f=d.getClippingRange();c.setUniformf("camThick",f[1]-f[0]),c.setUniformf("camNear",f[0]),c.setUniformf("camFar",f[1]);for(var p=t.currentInput.getBounds(),g=t.currentInput.getDimensions(),m=new Float64Array(3),v=new Float64Array(3),h=1,y=-1,b=1,T=-1,C=0;C<8;++C){if(i.set(m,p[C%2],p[2+Math.floor(C/2)%2],p[4+Math.floor(C/4)]),i.transformMat4(m,m,t.modelToView),!d.getParallelProjection()){i.normalize(v,m);var S=-f[0]/m[2];i.scale(m,v,S)}i.transformMat4(m,m,l.vcpc),h=Math.min(m[0],h),y=Math.max(m[0],y),b=Math.min(m[1],b),T=Math.max(m[1],T)}c.setUniformf("dcxmin",h),c.setUniformf("dcxmax",y),c.setUniformf("dcymin",b),c.setUniformf("dcymax",T),c.isUniformUsed("cameraParallel")&&c.setUniformi("cameraParallel",d.getParallelProjection());var P=t.currentInput.getExtent(),w=t.currentInput.getSpacing(),x=new Float64Array(3);i.set(x,(P[1]-P[0]+1)*w[0],(P[3]-P[2]+1)*w[1],(P[5]-P[4]+1)*w[2]),c.setUniform3f("vSpacing",w[0],w[1],w[2]),i.set(m,P[0],P[2],P[4]),t.currentInput.indexToWorldVec3(m,m),i.transformMat4(m,m,t.modelToView),c.setUniform3f("vOriginVC",m[0],m[1],m[2]);var O=t.currentInput.getIndexToWorld();o.multiply(t.idxToView,t.modelToView,O),a.multiply(t.idxNormalMatrix,l.normalMatrix,u.normalMatrix),a.multiply(t.idxNormalMatrix,t.idxNormalMatrix,t.currentInput.getDirection());var M=i.length(x)/t.renderable.getSampleDistance();M>t.renderable.getMaximumSamplesPerRay()&&Ui("The number of steps required ".concat(Math.ceil(M)," is larger than the\n specified maximum number of steps ").concat(t.renderable.getMaximumSamplesPerRay(),".\n Please either change the\n volumeMapper sampleDistance or its maximum number of samples."));var A=new Float64Array(3);if(i.set(A,1,1,1),i.divide(A,A,x),c.setUniform3f("vVCToIJK",A[0],A[1],A[2]),c.setUniform3i("volumeDimensions",g[0],g[1],g[2]),!t.openGLRenderWindow.getWebgl2()){var I=t.scalarTexture.getVolumeInfo();c.setUniformf("texWidth",t.scalarTexture.getWidth()),c.setUniformf("texHeight",t.scalarTexture.getHeight()),c.setUniformi("xreps",I.xreps),c.setUniformi("xstride",I.xstride),c.setUniformi("ystride",I.ystride)}for(var R=new Float64Array(3),E=new Float64Array(3),D=0;D<6;++D){switch(D){default:case 0:i.set(R,1,0,0),i.set(E,P[1],P[3],P[5]);break;case 1:i.set(R,-1,0,0),i.set(E,P[0],P[2],P[4]);break;case 2:i.set(R,0,1,0),i.set(E,P[1],P[3],P[5]);break;case 3:i.set(R,0,-1,0),i.set(E,P[0],P[2],P[4]);break;case 4:i.set(R,0,0,1),i.set(E,P[1],P[3],P[5]);break;case 5:i.set(R,0,0,-1),i.set(E,P[0],P[2],P[4])}i.transformMat3(R,R,t.idxNormalMatrix),i.transformMat4(E,E,t.idxToView);var V=-1*i.dot(E,R);if(c.setUniform3f("vPlaneNormal".concat(D),R[0],R[1],R[2]),c.setUniformf("vPlaneDistance".concat(D),V),s.getProperty().getUseLabelOutline()){var L=t.currentInput.getWorldToIndex();c.setUniformMatrix("vWCtoIDX",L),o.invert(t.projectionToWorld,l.wcpc),c.setUniformMatrix("PCWCMatrix",t.projectionToWorld);var N=e.getRenderTargetSize();c.setUniformf("vpWidth",N[0]),c.setUniformf("vpHeight",N[1])}}switch(o.invert(t.projectionToView,l.vcpc),c.setUniformMatrix("PCVCMatrix",t.projectionToView),t.lastLightComplexity){default:case 0:break;case 1:case 2:case 3:var B=0,k=[];r.getLights().forEach(function(e){if(e.getSwitch()>0){var t=e.getColor(),n=e.getIntensity();k[0]=t[0]*n,k[1]=t[1]*n,k[2]=t[2]*n,c.setUniform3fArray("lightColor".concat(B),k);var r=e.getDirection();i.set(R,r[0],r[1],r[2]),i.transformMat3(R,R,l.normalMatrix),c.setUniform3f("lightDirectionVC".concat(B),R[0],R[1],R[2]);var a=[-.5*R[0],-.5*R[1],-.5*(R[2]-1)];c.setUniform3fArray("lightHalfAngleVC".concat(B),a),B++}})}},e.setPropertyShaderParameters=function(e,n,r){var a=e.getProgram();a.setUniformi("ctexture",t.colorTexture.getTextureUnit()),a.setUniformi("otexture",t.opacityTexture.getTextureUnit()),a.setUniformi("jtexture",t.jitterTexture.getTextureUnit());var o=t.scalarTexture.getVolumeInfo(),i=r.getProperty(),s=t.scalarTexture.getComponents(),l=r.getProperty().getIndependentComponents();if(l&&s>=2)for(var u=0;u0&&(a.setUniformf("vAmbient",i.getAmbient()),a.setUniformf("vDiffuse",i.getDiffuse()),a.setUniformf("vSpecular",i.getSpecular()),a.setUniformf("vSpecularPower",i.getSpecularPower()))},e.getClippingPlaneShaderParameters=function(e,n,r){if(t.renderable.getClippingPlanes().length>0){for(var a=t.openGLCamera.getKeyMatrices(n),o=[],s=[],l=t.renderable.getClippingPlanes(),u=l.length,c=0;c1.43){var e=t.framebuffer.getSize();return[t.fvp[0]*e[0],t.fvp[1]*e[1]]}return t.openGLRenderWindow.getFramebufferSize()},e.renderPieceStart=function(n,r){if(t.renderable.getAutoAdjustSampleDistances()){var a=n.getVTKWindow().getInteractor(),o=a.getLastFrameTime();if(t.avgFrameTime=.97*t.avgFrameTime+.03*o,t.avgWindowArea=.97*t.avgWindowArea+.03/(t.lastXYF*t.lastXYF),n.getVTKWindow().getInteractor().isAnimating()){var i=Math.sqrt(t.avgFrameTime*a.getDesiredUpdateRate()/t.avgWindowArea);i>10&&(i=10),t.targetXYF=i}else t.targetXYF=Math.sqrt(t.avgFrameTime*a.getStillUpdateRate()/t.avgWindowArea);t.targetXYF<1.53&&t.targetXYF>1.33&&(t.targetXYF=t.lastXYF),Math.abs(1-t.targetXYF/t.lastXYF)<.1&&(t.targetXYF=t.lastXYF),t.lastXYF=t.targetXYF}else t.lastXYF=t.renderable.getImageSampleDistance();t.lastXYF<=1.43&&(t.lastXYF=1);var s=t.lastXYF,l=t.openGLRenderWindow.getFramebufferSize();if(s>1.43){if(t.framebuffer.saveCurrentBindingsAndBuffers(),null===t.framebuffer.getGLFramebuffer())t.framebuffer.create(Math.floor(.7*l[0]),Math.floor(.7*l[1])),t.framebuffer.populateFramebuffer();else{var u=t.framebuffer.getSize();u[0]===Math.floor(.7*l[0])&&u[1]===Math.floor(.7*l[1])||(t.framebuffer.create(Math.floor(.7*l[0]),Math.floor(.7*l[1])),t.framebuffer.populateFramebuffer())}t.framebuffer.bind();var c=t.context;c.clearColor(0,0,0,0),c.colorMask(!0,!0,!0,!0),c.clear(c.COLOR_BUFFER_BIT),c.viewport(0,0,l[0]/s,l[1]/s),t.fvp=[Math.floor(l[0]/s)/Math.floor(.7*l[0]),Math.floor(l[1]/s)/Math.floor(.7*l[1])]}t.context.disable(t.context.DEPTH_TEST),e.updateBufferObjects(n,r),r.getProperty().getInterpolationType()===Ri.NEAREST?(t.scalarTexture.setMinificationFilter(Yo.NEAREST),t.scalarTexture.setMagnificationFilter(Yo.NEAREST)):(t.scalarTexture.setMinificationFilter(Yo.LINEAR),t.scalarTexture.setMagnificationFilter(Yo.LINEAR)),t.lastBoundBO=null,null!==t.zBufferTexture&&t.zBufferTexture.activate()},e.renderPieceDraw=function(n,r){var a=t.context;t.scalarTexture.activate(),t.opacityTexture.activate(),t.colorTexture.activate(),t.jitterTexture.activate(),e.updateShaders(t.tris,n,r),a.drawArrays(a.TRIANGLES,0,t.tris.getCABO().getElementCount()),t.tris.getVAO().release(),t.scalarTexture.deactivate(),t.colorTexture.deactivate(),t.opacityTexture.deactivate(),t.jitterTexture.deactivate()},e.renderPieceFinish=function(e,n){if(null!==t.zBufferTexture&&t.zBufferTexture.deactivate(),t.lastXYF>1.43){if(t.framebuffer.restorePreviousBindingsAndBuffers(),null===t.copyShader){t.copyShader=t.openGLRenderWindow.getShaderCache().readyShaderProgramArray(["//VTK::System::Dec","attribute vec4 vertexDC;","uniform vec2 tfactor;","varying vec2 tcoord;","void main() { tcoord = vec2(vertexDC.x*0.5 + 0.5, vertexDC.y*0.5 + 0.5) * tfactor; gl_Position = vertexDC; }"].join("\n"),["//VTK::System::Dec","//VTK::Output::Dec","uniform sampler2D texture1;","varying vec2 tcoord;","void main() { gl_FragData[0] = texture2D(texture1,tcoord); }"].join("\n"),"");var r=t.copyShader;t.copyVAO=zo.newInstance(),t.copyVAO.setOpenGLRenderWindow(t.openGLRenderWindow),t.tris.getCABO().bind(),t.copyVAO.addAttributeArray(r,t.tris.getCABO(),"vertexDC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||ji("Error setting vertexDC in copy shader VAO.")}else t.openGLRenderWindow.getShaderCache().readyShaderProgram(t.copyShader);var a=t.openGLRenderWindow.getFramebufferSize();t.context.viewport(0,0,a[0],a[1]);var o=t.framebuffer.getColorTexture();o.activate(),t.copyShader.setUniformi("texture",o.getTextureUnit()),t.copyShader.setUniform2f("tfactor",t.fvp[0],t.fvp[1]);var i=t.context;i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA),t.context.drawArrays(t.context.TRIANGLES,0,t.tris.getCABO().getElementCount()),o.deactivate(),i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA)}},e.renderPiece=function(n,r){e.invokeEvent({type:"StartEvent"}),t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent({type:"EndEvent"}),t.currentInput?(e.renderPieceStart(n,r),e.renderPieceDraw(n,r),e.renderPieceFinish(n,r)):ji("No input!")},e.computeBounds=function(n,r){e.getInput()?t.bounds=e.getInput().getBounds():Na(t.Bounds)},e.updateBufferObjects=function(t,n){e.getNeedToRebuildBufferObjects(t,n)&&e.buildBufferObjects(t,n)},e.getNeedToRebuildBufferObjects=function(n,r){return t.VBOBuildTime.getMTime()1?1:-1,A[3*I+2]=-1;var R=new Uint16Array(8);R[0]=3,R[1]=0,R[2]=1,R[3]=3,R[4]=3,R[5]=0,R[6]=3,R[7]=2;var E=vo.newInstance({numberOfComponents:3,values:A});E.setName("points");var D=vo.newInstance({numberOfComponents:1,values:R});t.tris.getCABO().createVBO(D,"polys",Mo.SURFACE,{points:E,cellOffset:0})}t.VBOBuildTime.modified()}}}}var Hi={context:null,VBOBuildTime:null,scalarTexture:null,scalarTextureString:null,opacityTexture:null,opacityTextureString:null,colorTexture:null,colorTextureString:null,jitterTexture:null,tris:null,framebuffer:null,copyShader:null,copyVAO:null,lastXYF:1,targetXYF:1,zBufferTexture:null,lastZBufferTexture:null,lastLightComplexity:0,fullViewportTime:1,idxToView:null,idxNormalMatrix:null,modelToView:null,projectionToView:null,avgWindowArea:0,avgFrameTime:0};function Ki(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hi,n),pr.extend(e,t,n),t.VBOBuildTime={},ur.g(t.VBOBuildTime,{mtime:0}),t.tris=Xo.newInstance(),t.scalarTexture=li.newInstance(),t.opacityTexture=li.newInstance(),t.colorTexture=li.newInstance(),t.jitterTexture=li.newInstance(),t.jitterTexture.setWrapS(qo.REPEAT),t.jitterTexture.setWrapT(qo.REPEAT),t.framebuffer=Ii.newInstance(),t.idxToView=o.identity(new Float64Array(16)),t.idxNormalMatrix=a.identity(new Float64Array(9)),t.modelToView=o.identity(new Float64Array(16)),t.projectionToView=o.identity(new Float64Array(16)),t.projectionToWorld=o.identity(new Float64Array(16)),ur.i(e,t,["context"]),zi(e,t)}var Xi=ur.d(Ki,"vtkOpenGLVolumeMapper");yr("vtkVolumeMapper",Xi);var qi=ur.k;var Yi={};function Zi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yi,n),pr.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkOpenGLPixelSpaceCallbackMapper"),e.opaquePass=function(n,r){t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent();var a=t.openGLRenderer.getAspectRatio(),o=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,i=t.openGLRenderer.getTiledSizeAndOrigin(),s=null;if(t.renderable.getUseZValues()){var l=r.getZBufferTexture(),u=Math.floor(l.getWidth()),c=Math.floor(l.getHeight()),d=t.openGLRenderWindow.getContext();l.bind();var f=r.getFramebuffer();f?f.saveCurrentBindingsAndBuffers():qi("No framebuffer to save/restore");var p=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,p),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,l.getHandle(),0),d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE&&(s=new Uint8Array(u*c*4),d.viewport(0,0,u,c),d.readPixels(0,0,u,c,d.RGBA,d.UNSIGNED_BYTE,s)),f&&f.restorePreviousBindingsAndBuffers(),d.deleteFramebuffer(p)}t.renderable.invokeCallback(t.renderable.getInputData(),o,a,i,s)},e.queryPass=function(e,n){e&&t.renderable.getUseZValues()&&n.requestDepth()}}(e,t)}var Qi=ur.d(Zi,"vtkOpenGLPixelSpaceCallbackMapper");yr("vtkPixelSpaceCallbackMapper",Qi);var $i=Object.create(null);function Ji(e,t){$i[e]=t}var es={};function ts(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,es,n),t.overrides=$i,vr.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkWebGPUViewNodeFactory")}(0,t)}ur.a.newInstance(ts,"vtkWebGPUViewNodeFactory");var ns={keyMatrixTime:null,keyMatrices:null};function rs(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ns,n),pr.extend(e,t,n),t.keyMatrixTime={},ur.a.obj(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(16),vcpc:new Float64Array(16),pcsc:new Float64Array(16),wcvc:new Float64Array(16),scpc:new Float64Array(16),scvc:new Float64Array(16)},ur.a.setGet(e,t,["keyMatrixTime"]),function(e,t){t.classHierarchy.push("vtkWebGPUCamera"),e.getKeyMatrices=function(n){var r=n.getRenderable(),a=n.getParent();if(Math.max(a.getMTime(),e.getMTime(),r.getMTime(),t.renderable.getMTime(),n.getStabilizedTime().getMTime())>t.keyMatrixTime.getMTime()){var i=t.renderable.getViewMatrix();o.copy(t.keyMatrices.normalMatrix,i),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,o.invert(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),o.transpose(t.keyMatrices.wcvc,i);var s=n.getStabilizedCenterByReference();o.translate(t.keyMatrices.scvc,t.keyMatrices.wcvc,s);var l=n.getAspectRatio(),u=t.renderable.getProjectionMatrix(l,-1,1);o.transpose(t.keyMatrices.vcpc,u),t.keyMatrices.vcpc[2]=.5*u[8]+.5*u[12],t.keyMatrices.vcpc[6]=.5*u[9]+.5*u[13],t.keyMatrices.vcpc[10]=.5*u[10]+.5*u[14],t.keyMatrices.vcpc[14]=.5*u[11]+.5*u[15],o.multiply(t.keyMatrices.scpc,t.keyMatrices.vcpc,t.keyMatrices.scvc),o.invert(t.keyMatrices.pcsc,t.keyMatrices.scpc),t.keyMatrixTime.modified()}return t.keyMatrices}}(e,t)}var as=ur.a.newInstance(rs);Ji("vtkCamera",as);var os={device:null,handle:null,name:null};function is(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,os,n),ur.a.obj(e,t),t.bindables=[],t.bindGroupTime={},ur.a.obj(t.bindGroupTime,{mtime:0}),ur.a.get(e,t,["bindGroupTime","handle","sizeInBytes","usage"]),ur.a.setGet(e,t,["name","device","arrayInformation","sourceTime"]),function(e,t){t.classHierarchy.push("vtkWebGPUBindGroup"),e.addBindable=function(n){for(var r=0;rr?o:r}if(r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ls,n),ur.a.obj(e,t),ur.a.get(e,t,["lastCameraMTime"]),ur.a.setGet(e,t,["device","handle"]),function(e,t){t.classHierarchy.push("vtkWebGPUShaderModule"),e.initialize=function(e,n){t.device=e,t.handle=t.device.getHandle().createShaderModule({code:n.getCode()})}}(e,t)}var cs={newInstance:ur.a.newInstance(us,"vtkWebGPUShaderModule"),extend:us};var ds={shaderModules:null,device:null,window:null};function fs(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ds,n),t._shaderModules=new Map,ur.a.obj(e,t),ur.a.setGet(e,t,["device","window"]),function(e,t){t.classHierarchy.push("vtkWebGPUShaderCache"),e.getShaderModule=function(e){for(var n=e.getType(),r=e.getHash(),a=t._shaderModules.keys(),o=0;o3&&void 0!==arguments[3])||arguments[3],a=Array.isArray(n)?n.join("\n"):n,o=!1;-1!==e.search(t)&&(o=!0);var i="";r&&(i="g");var s=new RegExp(t,i);return{replace:o,result:e.replace(s,a)}}};var gs={handle:null,layouts:null,renderEncoder:null,shaderDescriptions:null,vertexState:null,topology:null};function ms(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gs,n),ur.g(e,t),t.layouts=[],t.shaderDescriptions=[],ur.b(e,t,["handle"]),ur.i(e,t,["device","renderEncoder","topology","vertexState"]),function(e,t){t.classHierarchy.push("vtkWebGPUPipeline"),e.getShaderDescriptions=function(){return t.shaderDescriptions},e.initialize=function(e){var n=t.renderEncoder.getPipelineSettings();n.primitive.topology=t.topology,n.vertex=t.vertexState;for(var r=[],a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hs,n),t.outputNames=[],t.outputTypes=[],t.builtinOutputNames=[],t.builtinOutputTypes=[],t.builtinInputNames=[],t.builtinInputTypes=[],ur.a.obj(e,t),ur.a.setGet(e,t,["type","hash","code"]),ur.a.getArray(e,t,["outputTypes","outputNames"]),function(e,t){t.classHierarchy.push("vtkWebGPUShaderDescription"),e.hasOutput=function(e){return t.outputNames.includes(e)},e.addOutput=function(e,n){t.outputTypes.push(e),t.outputNames.push(n)},e.addBuiltinOutput=function(e,n){t.builtinOutputTypes.push(e),t.builtinOutputNames.push(n)},e.addBuiltinInput=function(e,n){t.builtinInputTypes.push(e),t.builtinInputNames.push(n)},e.replaceShaderCode=function(e,n){var r=[],a=[];if(n&&r.push(n.getShaderCode()),e||t.builtinInputNames.length){var o=[];if(o.push("struct ".concat(t.type,"Input\n{")),e)for(var i=e.getOutputNamesByReference(),s=e.getOutputTypesByReference(),l=0;l1&&(o.push("};"),a=o,r[r.length-1]+=",",r.push("input: ".concat(t.type,"Input")))}if(r.length&&(t.code=ps.substitute(t.code,"//VTK::IOStructs::Input",r).result),t.outputNames.length+t.builtinOutputNames.length){for(var c=["struct ".concat(t.type,"Output\n{")],d=0;d ".concat(t.type,"Output")]).result}t.code=ps.substitute(t.code,"//VTK::IOStructs::Dec",a).result}}(e,t)}var bs={newInstance:ur.a.newInstance(ys,"vtkWebGPUShaderDescription"),extend:ys};var Ts={getByteStrideFromBufferFormat:function(e){if(!e||e.length<5)return 0;var t=1;"x"===e[e.length-2]&&(t=e[e.length-1]);var n=1===t?e.length-1:e.length-3,r=Number(e[n]);return Number.isNaN(r)?(Object(ur.l)("unknown format ".concat(e)),0):t*(5-r/2)},getNativeTypeFromBufferFormat:function(e){if(!e||e.length<5)return 0;var t;if("f"===e[0])t="Float";else if("s"===e[0])t="Int";else{if("u"!==e[0])return void Object(ur.l)("unknown format ".concat(e));t="Uint"}var n=e.split("x")[0],r=Number(n[n.length-1]);if(!Number.isNaN(r))return t+=8*(5-r/2),t+="Array";Object(ur.l)("unknown format ".concat(e))},getShaderTypeFromBufferFormat:function(e){var t;if("f"===e[0]||"n"===e[1])t="f32";else if("s"===e[0]&&"i"===e[1])t="i32";else{if("u"!==e[0]||"i"!==e[1])return void Object(ur.l)("unknown format ".concat(e));t="u32"}var n=1;return"x"===e[e.length-2]&&(n=Number(e[e.length-1])),4===n?"vec4<".concat(t,">"):3===n?"vec3<".concat(t,">"):2===n?"vec2<".concat(t,">"):t},getByteStrideFromShaderFormat:function(e){if(!e)return 0;var t=1;return"vec"===e.substring(0,3)?t=e[3]:"mat"===e.substring(0,3)&&(t=e[3]*e[5]),4*t},getNativeTypeFromShaderFormat:function(e){if(e)return e.includes("f32")?"Float32Array":e.includes("i32")?"Int32Array":e.includes("u32")?"Uint32Array":void Object(ur.l)("unknown format ".concat(e))}};function Cs(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ss,n),ur.g(e,t),t.bindingDescriptions=[],t.attributeDescriptions=[],t.inputs=[],ur.i(e,t,["created","device","handle"]),function(e,t){t.classHierarchy.push("vtkWebGPUVertexInput"),e.addBuffer=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertex",a=n;Array.isArray(a)||(a=[a]);for(var o=0;ot.names[0]?1:0})},e.removeBufferIfPresent=function(e){for(var n=0;n0&&(e+=",\n"),e="".concat(e," [[location(").concat(n,")]] ").concat(t.inputs[r].names[a]," : ").concat(i),n++}return e},e.getVertexInputInformation=function(){var e={};if(t.inputs.length){for(var n=[],r=0,a=0;a = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",Os="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n // var computedColor:vec4 = vec4(1.0,0.5,0.5,1.0);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";var Ms={bindGroup:null,device:null,fragmentShaderTemplate:null,numberOfInstances:1,numberOfVertices:0,pipelineHash:null,shaderReplacements:null,SSBO:null,textureViews:null,topology:"triangle-list",UBO:null,vertexShaderTemplate:null,WebGPURenderer:null};function As(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ms,n),ur.a.obj(e,t),t.textureViews=[],t.vertexInput=ws.newInstance(),t.bindGroup=ss.newInstance(),t.bindGroup.setName("mapperBG"),t.fragmentShaderTemplate=t.fragmentShaderTemplate||Os,t.vertexShaderTemplate=t.vertexShaderTemplate||xs,t.shaderReplacements=new Map,ur.a.get(e,t,["vertexInput"]),ur.a.setGet(e,t,["device","fragmentShaderTemplate","interpolate","numberOfInstances","numberOfVertices","pipelineHash","shaderReplacements","SSBO","textureViews","topology","UBO","vertexShaderTemplate","WebGPURenderer"]),function(e,t){t.classHierarchy.push("vtkWebGPUMapperHelper"),e.generateShaderDescriptions=function(n,r,a){var o=bs.newInstance({type:"vertex",hash:n,code:t.vertexShaderTemplate}),i=bs.newInstance({type:"fragment",hash:n,code:t.fragmentShaderTemplate}),s=r.getShaderDescriptions();s.push(o),s.push(i);for(var l=t.vertexShaderTemplate+t.fragmentShaderTemplate,u=new RegExp("//VTK::[^:]*::","g"),c=l.match(u).filter(function(e,t,n){return n.indexOf(e)===t}).map(function(e){return"replaceShader".concat(e.substring(7,e.length-2))}),d=0;d","[[builtin(position)]] Position");var a=r.getCode();a=ps.substitute(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*vertexBC;"]).result,r.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderTCoord=function(e,t,n){t.getShaderDescription("vertex").addOutput("vec2","tcoordVS")},t.shaderReplacements.set("replaceShaderTCoord",e.replaceShaderTCoord),e.addTextureView=function(e){t.textureViews.includes(e)||t.textureViews.push(e)},e.renderForPipeline=function(e){var n=e.getBoundPipeline();e.activateBindGroup(t.bindGroup),n.bindVertexInput(e,t.vertexInput),e.draw(t.numberOfVertices,t.numberOfInstances,0,0)},e.registerToDraw=function(){t.pipeline&&t.WebGPURenderer.registerPipelineCallback(t.pipeline,e.renderForPipeline)},e.render=function(n,r){e.build(n,r),n.setPipeline(t.pipeline),t.WebGPURenderer&&t.WebGPURenderer.bindUBO(n),e.renderForPipeline(n)},e.build=function(n,r){t.renderEncoder=n,t.pipeline=r.getPipeline(t.pipelineHash),t.UBO&&t.bindGroup.addBindable(t.UBO),t.SSBO&&t.bindGroup.addBindable(t.SSBO);for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Rs,n),Is.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkWebGPUFullScreenQuad"),e.replaceShaderPosition=function(e,t,n){var r=t.getShaderDescription("vertex");r.addBuiltinOutput("vec4","[[builtin(position)]] Position");var a=r.getCode();a=ps.substitute(a,"//VTK::Position::Impl",["output.tcoordVS = vec2(vertexBC.x * 0.5 + 0.5, 1.0 - vertexBC.y * 0.5 - 0.5);","output.Position = vec4(vertexBC, 1.0);"]).result,r.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition);var n=e.build;e.build=function(e,r){var a=r.getBufferManager().getFullScreenQuadBuffer();t.vertexInput.addBuffer(a,["vertexBC"]),t.numberOfVertices=6,n(e,r)}}(e,t)}var Ds={newInstance:ur.a.newInstance(Es,"vtkWebGPUFullScreenQuad"),extend:Es},Vs={BufferUsage:{Verts:0,Lines:1,Triangles:2,Strips:3,LinesFromStrips:4,LinesFromTriangles:5,Points:6,UniformArray:7,PointArray:8,NormalsFromPoints:9,Texture:10,RawVertex:11,Storage:12},PrimitiveTypes:{Start:0,Points:0,Lines:1,Triangles:2,TriangleStrips:3,TriangleEdges:4,TriangleStripEdges:5,End:6}};function Ls(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ns(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Bs=["getMappedRange","mapAsync","unmap"];function ks(e,t){t.classHierarchy.push("vtkWebGPUBuffer"),e.create=function(e,n){t.handle=t.device.getHandle().createBuffer({size:e,usage:n}),t.sizeInBytes=e,t.usage=n},e.write=function(e){!function(e,t,n,r){var a=r.byteLength,o=e.createBuffer({size:a,usage:GPUBufferUsage.COPY_SRC,mappedAtCreation:!0}),i=o.getMappedRange(0,a);new Uint8Array(i).set(new Uint8Array(r)),o.unmap();var s=e.createCommandEncoder();s.copyBufferToBuffer(o,0,t,n,a);var l=s.finish();e.queue.submit([l]),o.destroy()}(t.device.getHandle(),t.handle,0,e.buffer)},e.createAndWrite=function(e,n){t.handle=t.device.getHandle().createBuffer({size:e.byteLength,usage:n,mappedAtCreation:!0}),t.sizeInBytes=e.byteLength,t.usage=n,new Uint8Array(t.handle.getMappedRange()).set(new Uint8Array(e.buffer)),t.handle.unmap()};for(var n=function(n){e[Bs[n]]=function(){var e;return(e=t.handle)[Bs[n]].apply(e,arguments)}},r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fs,n),ur.a.obj(e,t),ur.a.get(e,t,["handle","sizeInBytes","usage"]),ur.a.setGet(e,t,["strideInBytes","device","arrayInformation","sourceTime"]),ks(e,t)}var _s=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ks,n),ur.a.obj(e,t),ur.a.setGet(e,t,["lighting","interpolation","ambient","diffuse","specular","specularPower","opacity","edgeVisibility","lineWidth","pointSize","backfaceCulling","frontfaceCulling","representation"]),ur.a.setGetArray(e,t,["ambientColor","specularColor","diffuseColor","edgeColor"],3),function(e,t){t.classHierarchy.push("vtkProperty"),e.setColor=function(n,r,a){Array.isArray(n)?t.color[0]===n[0]&&t.color[1]===n[1]&&t.color[2]===n[2]||(t.color[0]=n[0],t.color[1]=n[1],t.color[2]=n[2],e.modified()):t.color[0]===n&&t.color[1]===r&&t.color[2]===a||(t.color[0]=n,t.color[1]=r,t.color[2]=a,e.modified()),e.setDiffuseColor(t.color),e.setAmbientColor(t.color),e.setSpecularColor(t.color)},e.computeCompositeColor=Hs("ComputeCompositeColor"),e.getColor=function(){var e=0;t.ambient+t.diffuse+t.specular>0&&(e=1/(t.ambient+t.diffuse+t.specular));for(var n=0;n<3;n++)t.color[n]=e*(t.ambient*t.ambientColor[n]+t.diffuse*t.diffuseColor[n]+t.specular*t.specularColor[n]);return[].concat(t.color)},e.addShaderVariable=Hs("AddShaderVariable"),e.setInterpolationToFlat=function(){return e.setInterpolation(zs.FLAT)},e.setInterpolationToGouraud=function(){return e.setInterpolation(zs.GOURAUD)},e.setInterpolationToPhong=function(){return e.setInterpolation(zs.PHONG)},e.getInterpolationAsString=function(){return ur.a.enumToString(zs,t.interpolation)},e.setRepresentationToWireframe=function(){return e.setRepresentation(Ws.WIREFRAME)},e.setRepresentationToSurface=function(){return e.setRepresentation(Ws.SURFACE)},e.setRepresentationToPoints=function(){return e.setRepresentation(Ws.POINTS)},e.getRepresentationAsString=function(){return ur.a.enumToString(Ws,t.representation)}}(e,t)}var qs=function(e){for(var t=1;t1?2*(e-1):0},polysToWireframe:function(e,t){return e>2?2*e:0},stripsToWireframe:function(e,t){return e>2?4*e-6:0},polysToSurface:function(e,t){return e>2?3*(e-2):0},stripsToSurface:function(e,t,n){return numPoints>2?3*(e-2):0}};function al(e){switch(e){case Js.Points:return"points";case Js.Lines:return"lines";case Js.Triangles:return"polys";case Js.TriangleStrips:return"strips";default:return""}}function ol(e,t,n){var r=null;r=t===el.POINTS||"points"===n?rl.anythingToPoints:t===el.WIREFRAME||"lines"===n?rl["".concat(n,"ToWireframe")]:rl["".concat(n,"ToSurface")];for(var a=e.getData(),o=a.length,i=0,s=0;s2)for(var a=0;a2){for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ll,n),ur.g(e,t),t.buffers=new WeakMap,ur.i(e,t,["device"]),sl(e,t)}var cl=Zs(Zs({newInstance:ur.d(ul),extend:ul},{}),Vs);function dl(e){return function(e){if(Array.isArray(e))return fl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return fl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ml,n),ur.a.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"uniform"}},t.sendTime={},ur.a.obj(t.sendTime,{mtime:0}),t.bindGroupTime={},ur.a.obj(t.bindGroupTime,{mtime:0}),t.sendDirty=!0,t.sortDirty=!0,ur.a.get(e,t,["binding","bindGroupTime"]),ur.a.setGet(e,t,["bindGroupLayoutEntry","device","name","sizeInBytes"]),function(e,t){t.classHierarchy.push("vtkWebGPUUniformBuffer"),e.addEntry=function(e,n){t._bufferEntryNames.has(e)?gl("entry named ".concat(e," already exists")):(t.sortDirty=!0,t._bufferEntryNames.set(e,t.bufferEntries.length),t.bufferEntries.push({name:e,type:n,sizeInBytes:Ts.getByteStrideFromShaderFormat(n),offset:-1,nativeType:Ts.getNativeTypeFromShaderFormat(n),packed:!1}))},e.sortBufferEntries=function(){if(t.sortDirty){for(var e=0,n=[],r=0;r4&&(C.packed=!0,C.offset=e,n.push(C),e+=C.sizeInBytes)}for(var S=0;S ").concat(t.name,": ").concat(t.name,"Struct;")),a.join("\n")}}(e,t)}var hl={newInstance:ur.a.newInstance(vl,"vtkWebGPUUniformBuffer"),extend:vl},yl=ur.k,bl="\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n var computedColor: vec4 = mapperUBO.BackgroundColor;\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";var Tl={bindGroup:null,selector:null,renderEncoder:null,recenterThreshold:20,suppressClear:!1,stabilizedCenter:[0,0,0]};function Cl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tl,n),pr.extend(e,t,n),t.UBO=hl.newInstance(),t.UBO.setName("rendererUBO"),t.UBO.addEntry("WCVCMatrix","mat4x4"),t.UBO.addEntry("SCPCMatrix","mat4x4"),t.UBO.addEntry("PCSCMatrix","mat4x4"),t.UBO.addEntry("SCVCMatrix","mat4x4"),t.UBO.addEntry("VCPCMatrix","mat4x4"),t.UBO.addEntry("WCVCNormals","mat4x4"),t.UBO.addEntry("cameraParallel","u32"),t.bindGroup=ss.newInstance(),t.bindGroup.setName("rendererBG"),t.bindGroup.addBindable(t.UBO),t.tmpMat4=o.identity(new Float64Array(16)),t.stabilizedTime={},ur.g(t.stabilizedTime,{mtime:0}),ur.b(e,t,["bindGroup","stabilizedTime"]),ur.c(e,t,["stabilizedCenter"]),ur.i(e,t,["renderEncoder","selector","suppressClear","UBO"]),function(e,t){t.classHierarchy.push("vtkWebGPURenderer"),e.buildPass=function(n){if(n){if(!t.renderable)return;t.renderable.isActiveCameraCreated()||t.renderable.resetCamera(),e.updateLights(),e.prepareNodes(),e.addMissingNode(t.renderable.getActiveCamera()),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes(),e.updateStabilizedMatrix()}},e.updateStabilizedMatrix=function(){var e=t.renderable.getActiveCamera(),n=e.getClippingRange(),r=e.getPositionByReference(),a=e.getDirectionOfProjectionByReference(),o=[],s=[];i.scale(s,a,.5*(n[0]+n[1])),i.add(o,r,s),i.sub(s,o,t.stabilizedCenter),i.len(s)/(n[1]-n[0])>t.recenterThreshold&&(t.stabilizedCenter=o,t.stabilizedTime.modified())},e.updateLights=function(){for(var e=0,n=t.renderable.getLightsByReference(),r=0;r0&&e++;return e||(yl("No lights are on, creating one."),t.renderable.createLight()),e},e.registerPipelineCallback=function(e,n){for(var r=0;ra||e.getMTime()>a||n.getMTime()>a||t.renderable.getMTime()>a){var o=r.getKeyMatrices(e);t.UBO.setArray("WCVCMatrix",o.wcvc),t.UBO.setArray("SCPCMatrix",o.scpc),t.UBO.setArray("PCSCMatrix",o.pcsc),t.UBO.setArray("SCVCMatrix",o.scvc),t.UBO.setArray("VCPCMatrix",o.vcpc),t.UBO.setArray("WCVCNormals",o.normalMatrix),t.UBO.setValue("cameraParallel",n.getParallelProjection());var i=t.parent.getDevice();t.UBO.sendIfNeeded(i)}},e.scissorAndViewport=function(t){var n=e.getYInvertedTiledSizeAndOrigin();t.getHandle().setViewport(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize,0,1),t.getHandle().setScissorRect(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize)},e.bindUBO=function(e){e.activateBindGroup(t.bindGroup)},e.opaquePass=function(n){if(n)t.pipelineCallbacks=[],t.renderEncoder.begin(t.parent.getCommandEncoder()),e.updateUBO();else{e.scissorAndViewport(t.renderEncoder),e.clear();for(var r=0;r"),t.clearFSQ.setUBO(n)}var r=t.renderable.getBackgroundByReference();t.clearFSQ.getUBO().setArray("BackgroundColor",r),t.clearFSQ.getUBO().sendIfNeeded(e),t.clearFSQ.render(t.renderEncoder,e)}},e.translucentPass=function(n){if(n)t.pipelineCallbacks=[],t.renderEncoder.begin(t.parent.getCommandEncoder());else{e.scissorAndViewport(t.renderEncoder);for(var r=0;rn[2]-n[0]&&(l=n[2]-n[0]),u>n[3]-n[1]&&(u=n[3]-n[1]);var c=t.parent.normalizedDisplayToDisplay(l,u),d=Math.round(c[0])-i,f=Math.round(c[1])-s;return d<0&&(d=0),f<0&&(f=0),{usize:d,vsize:f,lowerLeftU:i,lowerLeftV:s}},e.getPropFromID=function(e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Pl,n),pr.extend(e,t,n),t.keyMatricesTime={},ur.a.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={bcwc:new Float64Array(16),bcsc:new Float64Array(16)},ur.a.get(e,t,["propID","keyMatricesTime"]),function(e,t){t.classHierarchy.push("vtkWebGPUVolume"),e.buildPass=function(n){t.renderable&&t.renderable.getVisibility()&&n&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.queryPass=function(n,r){if(n){if(!t.renderable||!t.renderable.getVisibility())return;var a=t.renderable.getMapper().getBounds();if(!a||6!==a.length||a[0]>a[1])return;r.addVolume(e)}},e.getBoundingCubePoints=function(e,n){for(var r=t.renderable.getMapper().getBounds(),a=t.renderable.getMatrix(),o=0,i=4;i<6;i++)for(var s=r[i],l=2;l<4;l++)for(var u=r[l],c=0;c<2;c++){var d=r[c],f=n+3*o;e[f++]=a[0]*d+a[1]*u+a[2]*s+a[3],e[f++]=a[4]*d+a[5]*u+a[6]*s+a[7],e[f++]=a[8]*d+a[9]*u+a[10]*s+a[11],o++}},e.traverseVolumePass=function(n){t.renderable&&t.renderable.getVisibility()&&(!t.WebGPURenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children[0].traverse(n),e.apply(n,!1))},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime().getMTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var n=t.renderable.getMatrix(),r=e.getStabilizedCenterByReference();o.transpose(t.keyMatrices.bcwc,n),o.translate(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-r[0],-r[1],-r[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}(e,t)}var xl=ur.a.newInstance(wl,"vtkWebGPUVolume");Ji("vtkVolume",xl);var Ol={};function Ml(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ol,n),pr.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkWebGPUPixelSpaceCallbackMapper"),e.opaquePass=function(n,r){t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent();var a=t.WebGPURenderer.getAspectRatio(),o=t.WebGPURenderer?t.WebGPURenderer.getRenderable().getActiveCamera():null,i=t.WebGPURenderer.getTiledSizeAndOrigin();t.renderable.getUseZValues(),t.renderable.invokeCallback(t.renderable.getInputData(),o,a,i,null)}}(e,t)}var Al=ur.a.newInstance(Ml,"vtkWebGPUPixelSpaceCallbackMapper");Ji("vtkPixelSpaceCallbackMapper",Al);var Il={context:null,keyMatrixTime:null,keyMatrices:null,activeTextures:null};function Rl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Il,n),pr.extend(e,t,n),t.keyMatrixTime={},ur.g(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:a.identity(new Float64Array(9)),mcwc:o.identity(new Float64Array(16))},ur.i(e,t,["context"]),ur.b(e,t,["activeTextures"]),function(e,t){t.classHierarchy.push("vtkOpenGLActor"),e.buildPass=function(n){if(n){t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t.openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNodes(t.renderable.getTextures()),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes(),t.ogltextures=null,t.activeTextures=null;for(var r=0;rt.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),o.copy(t.keyMatrices.mcwc,t.renderable.getMatrix()),o.transpose(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.renderable.getIsIdentity()?a.identity(t.keyMatrices.normalMatrix):(a.fromMat4(t.keyMatrices.normalMatrix,t.keyMatrices.mcwc),a.invert(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),a.transpose(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),t.keyMatrixTime.modified()),t.keyMatrices}}(e,t)}var El=ur.d(Rl);yr("vtkActor",El);var Dl={context:null,activeTextures:[]};function Vl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Dl,n),pr.extend(e,t,n),ur.i(e,t,["context"]),ur.b(e,t,["activeTextures"]),function(e,t){t.classHierarchy.push("vtkOpenGLActor2D"),e.buildPass=function(n){if(n){if(!t.renderable)return;t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),e.prepareNodes(),e.addMissingNodes(t.renderable.getTextures()),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaquePass=function(n){t.renderable&&t.renderable.getVisibility()&&t.renderable.getIsOpaque()&&(!t.openGLRenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children.forEach(function(e){e.isA("vtkOpenGLTexture")||e.traverse(n)}),e.apply(n,!1))},e.traverseTranslucentPass=function(n){!t.renderable||!t.renderable.getVisibility()||t.renderable.getIsOpaque()||t.openGLRenderer.getSelector()&&!t.renderable.getPickable()||(e.apply(n,!0),t.children.forEach(function(e){e.isA("vtkOpenGLTexture")||e.traverse(n)}),e.apply(n,!1))},e.activateTextures=function(){t.activeTextures=[],t.children.forEach(function(e){e.isA("vtkOpenGLTexture")&&(e.render(),e.getHandle()&&t.activeTextures.push(e))})},e.opaquePass=function(n,r){n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!0),e.activateTextures()):t.activeTextures.forEach(function(e){e.deactivate()})},e.translucentPass=function(n,r){n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!1),e.activateTextures()):(t.activeTextures.forEach(function(e){e.deactivate()}),t.context.depthMask(!0))}}(e,t)}var Ll=ur.d(Vl);yr("vtkActor2D",Ll);var Nl={clippingPlanes:[]};var Bl={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Nl,n),ur.a.obj(e,t),ur.a.algo(e,t,1,0),t.clippingPlanes||(t.clippingPlanes=[]),function(e,t){e.update=function(){e.getInputData()},e.addClippingPlane=function(e){"vtkPlane"===e.getClassName()&&t.clippingPlanes.push(e)},e.getNumberOfClippingPlanes=function(){return t.clippingPlanes.length},e.removeAllClippingPlanes=function(){t.clippingPlanes.length=0},e.removeClippingPlane=function(e){e<0||e>=6||t.clippingPlanes.splice(e,1)},e.getClippingPlanes=function(){return t.clippingPlanes},e.setClippingPlanes=function(t){if(t)if(Array.isArray(t))for(var n=t.length,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kl,n),Bl.extend(e,t,n),t.bounds||Na(t.bounds),t.center||(t.center=[0,0,0]),function(e,t){e.getBounds=function(){return 0},e.getBounds=function(n){e.getBounds();for(var r=0;r<6;r++)n[r]=t.bounds[r]},e.getCenter=function(){e.getBounds();for(var n=0;n<3;n++)t.center[n]=(t.bounds[2*n+1]+t.bounds[2*n])/2;return t.center.slice()},e.getLength=function(){var n=0,r=0;e.getBounds();for(var a=0;a<3;a++)r+=(n=t.bounds[2*a+1]-t.bounds[2*a])*n;return Math.sqrt(r)},e.getClippingPlaneInDataCoords=function(e,n,r){var a=t.clippingPlanes,o=e;if(a){var i=a.length;if(n>=0&&n=0&&a.t<=1,a)}function Yl(e,t,n,r){var a={intersection:!1,l0:[],l1:[],error:null},o=[];ta(t,r,o);var i,s=o.map(function(e){return Math.abs(e)});if(s[0]+s[1]+s[2]s[1]&&s[0]>s[2]?"x":s[1]>s[2]?"y":"z";var u=[],c=-ea(t,e),d=-ea(r,n);switch(i){case"x":u[0]=0,u[1]=(d*t[2]-c*r[2])/o[0],u[2]=(c*r[1]-d*t[1])/o[0];break;case"y":u[0]=(c*r[2]-d*t[2])/o[1],u[1]=0,u[2]=(d*t[0]-c*r[0])/o[1];break;case"z":u[0]=(d*t[1]-c*r[1])/o[2],u[1]=(c*r[0]-d*t[0])/o[2],u[2]=0}return a.l0=u,Zr(u,o,a.l1),a.intersection=!0,a}var Zl={evaluate:function(e,t,n){return e[0]*(n[0]-t[0])+e[1]*(n[1]-t[1])+e[2]*(n[2]-t[2])},distanceToPlane:zl,projectPoint:Hl,projectVector:Kl,generalizedProjectPoint:Xl,intersectWithLine:ql,intersectWithPlane:Yl,DISJOINT:Wl,COINCIDE:jl};var Ql={normal:[0,0,1],origin:[0,0,0]};function $l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ql,n),ur.a.obj(e,t),ur.a.setGetArray(e,t,["normal","origin"],3),function(e,t){t.classHierarchy.push("vtkPlane"),e.distanceToPlane=function(e){return zl(e,t.origin,t.normal)},e.projectPoint=function(e,n){Hl(e,t.origin,t.normal,n)},e.projectVector=function(e,n){return Kl(e,t.normal,n)},e.push=function(e){if(0!==e)for(var n=0;n<3;n++)t.origin[n]+=e*t.normal[n]},e.generalizedProjectPoint=function(e,n){Xl(e,t.origin,t.normal,n)},e.evaluateFunction=function(e,n,r){return Array.isArray(e)?t.normal[0]*(e[0]-t.origin[0])+t.normal[1]*(e[1]-t.origin[1])+t.normal[2]*(e[2]-t.origin[2]):t.normal[0]*(e-t.origin[0])+t.normal[1]*(n-t.origin[1])+t.normal[2]*(r-t.origin[2])},e.evaluateGradient=function(e){return[t.normal[0],t.normal[1],t.normal[2]]},e.intersectWithLine=function(e,n){return ql(e,n,t.origin,t.normal)},e.intersectWithPlane=function(e,n){return Yl(e,n,t.origin,t.normal)}}(e,t)}var Jl=function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n(arguments.length<=1?void 0:arguments[1])?r:arguments.length<=1?void 0:arguments[1],e[2]=a<(arguments.length<=2?void 0:arguments[2])?a:arguments.length<=2?void 0:arguments[2],e[3]=o>(arguments.length<=2?void 0:arguments[2])?o:arguments.length<=2?void 0:arguments[2],e[4]=i<(arguments.length<=3?void 0:arguments[3])?i:arguments.length<=3?void 0:arguments[3],e[5]=s>(arguments.length<=3?void 0:arguments[3])?s:arguments.length<=3?void 0:arguments[3]}function pu(e,t,n,r,a,o,i){var s=au(e,6),l=s[0],u=s[1],c=s[2],d=s[3],f=s[4],p=s[5];void 0===i?(e[0]=Math.min(t[0],l),e[1]=Math.max(t[1],u),e[2]=Math.min(t[2],c),e[3]=Math.max(t[3],d),e[4]=Math.min(t[4],f),e[5]=Math.max(t[5],p)):(e[0]=Math.min(t,l),e[1]=Math.max(n,u),e[2]=Math.min(r,c),e[3]=Math.max(a,d),e[4]=Math.min(o,f),e[5]=Math.max(i,p))}function gu(e,t,n,r){var a=au(e,6),o=a[0],i=a[1],s=a[2],l=a[3],u=a[4],c=a[5];return e[0]=t,e[1]=t>i?t:i,e[2]=n,e[3]=n>l?n:l,e[4]=r,e[5]=r>c?r:c,o!==t||s!==n||u!==r}function mu(e,t,n,r){var a=au(e,6),o=a[0],i=a[1],s=a[2],l=a[3],u=a[4],c=a[5];return e[0]=t=0?(e[0]*=t,e[1]*=t):(e[0]=t*e[1],e[1]=t*e[0]),n>=0?(e[2]*=n,e[3]*=n):(e[2]=n*e[3],e[3]=n*e[2]),r>=0?(e[4]*=r,e[5]*=r):(e[4]=r*e[5],e[5]=r*e[4]),!0)}function yu(e){return[.5*(e[0]+e[1]),.5*(e[2]+e[3]),.5*(e[4]+e[5])]}function bu(e,t){return e[2*t+1]-e[2*t]}function Tu(e){return[bu(e,0),bu(e,1),bu(e,2)]}function Cu(e){return e.slice(0,2)}function Su(e){return e.slice(2,4)}function Pu(e){return e.slice(4,6)}function wu(e){var t=Tu(e);return t[0]>t[1]?t[0]>t[2]?t[0]:t[2]:t[1]>t[2]?t[1]:t[2]}function xu(e){if(uu(e)){var t=Tu(e);return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}return null}function Ou(e){return[e[0],e[2],e[4]]}function Mu(e){return[e[1],e[3],e[5]]}function Au(e,t){return e<=0&&t>=0||e>=0&&t<=0}function Iu(e,t){for(var n=0,r=0;r<2;r++)for(var a=2;a<4;a++)for(var o=4;o<6;o++)t[n]=[e[r],e[a],e[o]],n++}function Ru(e,t,n){t[0]=e[0],t[1]=e[2],t[2]=e[4],n[0]=e[1],n[1]=e[3],n[2]=e[5]}function Eu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=yu(e);return t[0]=e[1]-n[0],t[1]=e[3]-n[1],t[2]=e[5]-n[2],t}function Du(e,t,n,r){for(var a=[].concat(su),o=e.getData(),i=0;ie[2*c+1]?(i[c]=0,u[c]=e[2*c+1],o=!1):i[c]=2;if(o)return r[0]=t[0],r[1]=t[1],r[2]=t[2],a[0]=0,1;for(var d=0;d<3;d++)2!==i[d]&&0!==n[d]?l[d]=(u[d]-t[d])/n[d]:l[d]=-1;for(var f=0;f<3;f++)l[s]1||l[s]<0)return 0;a[0]=l[s];for(var p=0;p<3;p++)if(s!==p){if(r[p]=t[p]+l[s]*n[p],r[p]e[2*p+1])return 0}else r[p]=u[p];return 1}function Lu(e,t,n){for(var r=[],a=0,o=1,i=1,s=4;s<=5;++s){r[2]=e[s];for(var l=2;l<=3;++l){r[1]=e[l];for(var u=0;u<=1;++u)if(r[0]=e[u],a=Jl.evaluate(n,t,r),i&&(o=a>=0?1:-1,i=0),0===a||o>0&&a<0||o<0&&a>0)return 1}}return 0}function Nu(e,t){if(!uu(e)||!uu(t))return!1;for(var n,r=[0,0,0,0,0,0],a=0;a<3;a++)if(n=!1,t[2*a]>=e[2*a]&&t[2*a]<=e[2*a+1]?(n=!0,r[2*a]=t[2*a]):e[2*a]>=t[2*a]&&e[2*a]<=t[2*a+1]&&(n=!0,r[2*a]=e[2*a]),t[2*a+1]>=e[2*a]&&t[2*a+1]<=e[2*a+1]?(n=!0,r[2*a+1]=t[2*a+1]):e[2*a+1]>=t[2*a]&&e[2*a+1]<=t[2*a+1]&&(n=!0,r[2*a+1]=e[2*a+1]),!n)return!1;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],!0}function Bu(e,t){if(!uu(e)||!uu(t))return!1;for(var n=0;n<3;n++)if(!(t[2*n]>=e[2*n]&&t[2*n]<=e[2*n+1]||e[2*n]>=t[2*n]&&e[2*n]<=t[2*n+1]||t[2*n+1]>=e[2*n]&&t[2*n+1]<=e[2*n+1]||e[2*n+1]>=t[2*n]&&e[2*n+1]<=t[2*n+1]))return!1;return!0}function ku(e,t,n,r){return!(te[1])&&(!(ne[3])&&!(re[5]))}function Fu(e,t,n){for(var r=[[0,1,2,3,4,5,6,7],[0,1,4,5,2,3,6,7],[0,2,4,6,1,3,5,7]],a=[0,0,0,0,0,0,0,0],o=0,i=0;i<2;i++)for(var s=2;s<4;s++)for(var l=4;l<6;l++){var u=[e[i],e[s],e[l]];a[o++]=Jl.evaluate(n,t,u)}for(var c=2;c--&&!(Au(a[r[c][0]],a[r[c][4]])&&Au(a[r[c][1]],a[r[c][5]])&&Au(a[r[c][2]],a[r[c][6]])&&Au(a[r[c][3]],a[r[c][7]])););if(c<0)return!1;for(var d=Math.sign(n[c]),f=Math.abs((e[2*c+1]-e[2*c])*n[c]),p=d>0?1:0,g=0;g<4;g++)if(0!==f){var m=Math.abs(a[r[c][g]])/f;d>0&&mp&&(p=m)}var v=(1-p)*e[2*c]+p*e[2*c+1];return d>0?e[2*c]=v:e[2*c+1]=v,!0}var Gu=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bounds=t,this.bounds||(this.bounds=new Float64Array(6),cu(this.bounds,su))}return function(e,t,n){t&&nu(e.prototype,t),n&&nu(e,n)}(e,[{key:"getBounds",value:function(){return this.bounds}},{key:"equals",value:function(e){return lu(this.bounds,e)}},{key:"isValid",value:function(){return uu(this.bounds)}},{key:"setBounds",value:function(e){return cu(this.bounds,e)}},{key:"reset",value:function(){return du(this.bounds)}},{key:"addPoint",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ju,n),ur.a.obj(e,t),function(e,t){t.classHierarchy.push("vtkFieldData");var n=e.getState;t.arrays&&(t.arrays=t.arrays.map(function(e){return{data:Object(Uu.a)(e.data)}})),e.initialize=function(){e.initializeFields(),e.copyAllOn(),e.clearFieldFlags()},e.initializeFields=function(){t.arrays=[],t.copyFieldFlags={},e.modified()},e.copyStructure=function(n){e.initializeFields(),t.copyFieldFlags=n.getCopyFieldFlags().map(function(e){return e}),t.arrays=n.arrays().map(function(e){return{array:e}})},e.getNumberOfArrays=function(){return t.arrays.length},e.getNumberOfActiveArrays=function(){return t.arrays.length},e.addArray=function(e){return t.arrays=[].concat(t.arrays,{data:e}),t.arrays.length-1},e.removeAllArrays=function(){t.arrays=[]},e.removeArray=function(e){t.arrays=t.arrays.filter(function(t){return e!==t.data.getName()})},e.removeArrayByIndex=function(e){t.arrays=t.arrays.filter(function(t,n){return n!==e})},e.getArrays=function(){return t.arrays.map(function(e){return e.data})},e.getArray=function(t){return"number"==typeof t?e.getArrayByIndex(t):e.getArrayByName(t)},e.getArrayByName=function(e){return t.arrays.reduce(function(t,n,r){return n.data.getName()===e?n.data:t},null)},e.getArrayWithIndex=function(e){return t.arrays.reduce(function(t,n,r){return n.data&&n.data.getName()===e?{array:n.data,index:r}:t},{array:null,index:-1})},e.getArrayByIndex=function(e){return e>=0&&e=0},e.getArrayName=function(e){var n=t.arrays[e];return n?n.data.getName():""},e.getCopyFieldFlags=function(){return t.copyFieldFlags},e.getFlag=function(e){return t.copyFieldFlags[e]},e.passData=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;n.getArrays().forEach(function(n){var o=e.getFlag(n.getName());if(!1!==o&&(!t.doCopyAllOff||!0===o)&&n){var i=e.getArrayByName(n.getName());if(i){if(n.getNumberOfComponents()===i.getNumberOfComponents())if(r>-1&&r-1?a:r;i.setTuple(s,n.getTuple(r))}else for(var l=0;ln.getNumberOfTuples())e.addArray(n);else{var u=n.getNumberOfComponents(),c=n.getNumberOfValues(),d=a>-1?a:r;ce?t.data.getMTime():e},t.mtime)},e.getNumberOfComponents=function(){return t.arrays.reduce(function(e,t){return e+t.data.getNumberOfComponents()},0)},e.getNumberOfTuples=function(){return t.arrays.length>0?t.arrays[0].getNumberOfTuples():0},e.getState=function(){var e=n();return e.arrays=t.arrays.map(function(e){return{data:e.data.getState()}}),e}}(e,t)}var zu={newInstance:ur.a.newInstance(Wu,"vtkFieldData"),extend:Wu},Hu={AttributeCopyOperations:{COPYTUPLE:0,INTERPOLATE:1,PASSDATA:2,ALLCOPY:3},AttributeLimitTypes:{MAX:0,EXACT:1,NOLIMIT:2},AttributeTypes:{SCALARS:0,VECTORS:1,NORMALS:2,TCOORDS:3,TENSORS:4,GLOBALIDS:5,PEDIGREEIDS:6,EDGEFLAG:7,NUM_ATTRIBUTES:8},CellGhostTypes:{DUPLICATECELL:1,HIGHCONNECTIVITYCELL:2,LOWCONNECTIVITYCELL:4,REFINEDCELL:8,EXTERIORCELL:16,HIDDENCELL:32},DesiredOutputPrecision:{DEFAULT:0,SINGLE:1,DOUBLE:2},PointGhostTypes:{DUPLICATEPOINT:1,HIDDENPOINT:2},ghostArrayName:"vtkGhostType"};function Ku(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qu=Hu.AttributeTypes,Yu=Hu.AttributeCopyOperations,Zu=ur.a.vtkWarningMacro;var Qu={activeScalars:-1,activeVectors:-1,activeTensors:-1,activeNormals:-1,activeTCoords:-1,activeGlobalIds:-1,activePedigreeIds:-1};function $u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qu,n),zu.extend(e,t,n),ur.a.setGet(e,t,["activeScalars","activeNormals","activeTCoords","activeVectors","activeTensors","activeGlobalIds","activePedigreeIds"]),t.arrays||(t.arrays={}),function(e,t){var n=["Scalars","Vectors","Normals","TCoords","Tensors","GlobalIds","PedigreeIds"];function r(e){var t=n.find(function(t){return qu[t.toUpperCase()]===e||"number"!=typeof e&&t.toLowerCase()===e.toLowerCase()});return void 0===t&&(t=null),t}t.classHierarchy.push("vtkDataSetAttributes"),e.checkNumberOfComponents=function(e){return!0},e.setAttribute=function(n,a){var o=r(a);if(n&&"PEDIGREEIDS"===o.toUpperCase()&&!n.isA("vtkDataArray"))return Zu("Cannot set attribute ".concat(o,". The attribute must be a vtkDataArray.")),-1;if(n&&!e.checkNumberOfComponents(n,o))return Zu("Cannot set attribute ".concat(o,". Incorrect number of components.")),-1;var i=t["active".concat(o)];if(i>=0&&i=0&&n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oc,n),ur.a.obj(e,t),ur.a.setGet(e,t,ac),function(e,t){t.classHierarchy.push("vtkDataSet"),ac.forEach(function(e){t[e]?t[e]=Object(Uu.a)(t[e]):t[e]=Ju.newInstance()});var n=e.shallowCopy;e.shallowCopy=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n(e,r),ac.forEach(function(n){t[n]=Ju.newInstance(),t[n].shallowCopy(e.getReferenceByName(n))})}}(e,t)}var sc=function(e){for(var t=1;te[1]||e[2]>e[3]||e[4]>e[5]?fc.EMPTY:3===t?fc.XYZ_GRID:2===t?e[0]===e[1]?fc.YZ_PLANE:e[2]===e[3]?fc.XZ_PLANE:fc.XY_PLANE:1===t?e[0]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hc,n),sc.extend(e,t,n),t.direction?Array.isArray(t.direction)&&(t.direction=new Float64Array(t.direction.slice(0,9))):t.direction=a.identity(new Float64Array(9)),t.indexToWorld=new Float64Array(16),t.worldToIndex=new Float64Array(16),ur.a.get(e,t,["direction","indexToWorld","worldToIndex"]),ur.a.setGetArray(e,t,["origin","spacing"],3),ur.a.getArray(e,t,["extent"],6),function(e,t){t.classHierarchy.push("vtkImageData"),e.setExtent=function(){if(t.deleted)return vc("instance deleted - cannot call any method"),!1;for(var n=arguments.length,r=new Array(n),a=0;a1&&(n*=t[r]-1)}return n},e.getNumberOfPoints=function(){var t=e.getDimensions();return t[0]*t[1]*t[2]},e.getPoint=function(n){var r=e.getDimensions();if(0===r[0]||0===r[1]||0===r[2])return vc("Requesting a point from an empty image."),null;var a=new Float64Array(3);switch(t.dataDescription){case lc.EMPTY:return null;case lc.SINGLE_POINT:break;case lc.X_LINE:a[0]=n;break;case lc.Y_LINE:a[1]=n;break;case lc.Z_LINE:a[2]=n;break;case lc.XY_PLANE:a[0]=n%r[0],a[1]=n/r[0];break;case lc.YZ_PLANE:a[1]=n%r[1],a[2]=n/r[1];break;case lc.XZ_PLANE:a[0]=n%r[0],a[2]=n/r[0];break;case lc.XYZ_GRID:a[0]=n%r[0],a[1]=n/r[0]%r[1],a[2]=n/(r[0]*r[1]);break;default:vc("Invalid dataDescription")}var o=[0,0,0];return e.indexToWorld(a,o),o},e.getBounds=function(){return e.extentToBounds(t.extent)},e.extentToBounds=function(t){var n=[t[0],t[2],t[4],t[1],t[2],t[4],t[0],t[3],t[4],t[1],t[3],t[4],t[0],t[2],t[5],t[1],t[2],t[5],t[0],t[3],t[5],t[1],t[3],t[5]],r=new Float64Array([n[0],n[1],n[2]]),a=new Float64Array(3);e.indexToWorld(r,a);for(var o=[a[0],a[0],a[1],a[1],a[2],a[2]],s=3;s<24;s+=3)i.set(r,n[s],n[s+1],n[s+2]),e.indexToWorld(r,a),a[0]o[1]&&(o[1]=a[0]),a[1]>o[3]&&(o[3]=a[1]),a[2]>o[5]&&(o[5]=a[2]);return o},e.computeTransforms=function(){o.fromTranslation(t.indexToWorld,t.origin),t.indexToWorld[0]=t.direction[0],t.indexToWorld[1]=t.direction[1],t.indexToWorld[2]=t.direction[2],t.indexToWorld[4]=t.direction[3],t.indexToWorld[5]=t.direction[4],t.indexToWorld[6]=t.direction[5],t.indexToWorld[8]=t.direction[6],t.indexToWorld[9]=t.direction[7],t.indexToWorld[10]=t.direction[8],o.scale(t.indexToWorld,t.indexToWorld,t.spacing),o.invert(t.worldToIndex,t.indexToWorld)},e.setDirection=function(){if(t.deleted)return vc("instance deleted - cannot call any method"),!1;for(var n=arguments.length,r=new Array(n),a=0;a1&&void 0!==arguments[1]?arguments[1]:[];return i.transformMat4(n,e,t.indexToWorld),n},e.indexToWorldVec3=e.indexToWorld,e.worldToIndex=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return i.transformMat4(n,e,t.worldToIndex),n},e.worldToIndexVec3=e.worldToIndex,e.indexToWorldBounds=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[0,0,0],a=[0,0,0];_u.computeCornerPoints(e,r,a);var o=[0,0,0],s=[0,0,0];return i.transformMat4(o,r,t.indexToWorld),i.transformMat4(s,a,t.indexToWorld),ka(o,s,n),n},e.worldToIndexBounds=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[0,0,0],a=[0,0,0];_u.computeCornerPoints(e,r,a);var o=[0,0,0],s=[0,0,0];return i.transformMat4(o,r,t.worldToIndex),i.transformMat4(s,a,t.worldToIndex),ka(o,s,n),n},e.onModified(e.computeTransforms),e.computeTransforms(),e.getCenter=function(){for(var t=e.getBounds(),n=[],r=0;r<3;r++)n[r]=(t[2*r+1]+t[2*r])/2;return n},e.computeHistogram=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=[0,0,0,0,0,0];e.worldToIndexBounds(t,r);var a=[0,0,0],o=[0,0,0];_u.computeCornerPoints(r,a,o),ha(a,a),ha(o,o);var i=e.getDimensions();Ga(a,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],a),Ga(o,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],o);for(var s=i[0],l=i[0]*i[1],u=e.getPointData().getScalars().getData(),c=-1/0,d=1/0,f=0,p=0,g=0,m=a[2];m<=o[2];m++)for(var v=a[1];v<=o[1];v++)for(var h=a[0]+v*s+m*l,y=a[0];y<=o[0];y++){if(!n||n([y,v,m],r)){var b=u[h];b>c&&(c=b),b0?p/g:0,C=f-T*T;return{minimum:d,maximum:c,average:T,variance:C,sigma:Math.sqrt(C)}},e.computeIncrements=function(e){for(var t=[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=0;r<3;++r)t[r]=n,n*=e[2*r+1]-e[2*r]+1;return t},e.computeOffsetIndex=function(t){var n=gc(t,3),r=n[0],a=n[1],o=n[2],i=e.getExtent(),s=e.getPointData().getScalars().getNumberOfComponents(),l=e.computeIncrements(i,s);return Math.floor((Math.round(r)-i[0])*l[0]+(Math.round(a)-i[2])*l[1]+(Math.round(o)-i[4])*l[2])},e.getOffsetIndexFromWorld=function(t){for(var n=e.getExtent(),r=e.worldToIndex(t),a=0;a<3;++a)if(r[a]n[2*a+1])return vc("GetScalarPointer: Pixel ".concat(r," is not in memory. Current extent = ").concat(n)),NaN;return e.computeOffsetIndex(r)},e.getScalarValueFromWorld=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.getPointData().getScalars().getNumberOfComponents();if(n<0||n>=r)return vc("GetScalarPointer: Scalar Component ".concat(n," is not within bounds. Current Scalar numberOfComponents: ").concat(r)),NaN;var a=e.getOffsetIndexFromWorld(t);return Number.isNaN(a)?a:e.getPointData().getScalars().getComponent(a,n)}}(e,t)}var bc={newInstance:ur.a.newInstance(yc,"vtkImageData"),extend:yc},Tc={LUMINANCE:1,LUMINANCE_ALPHA:2,RGB:3,RGBA:4},Cc={VectorMode:{MAGNITUDE:0,COMPONENT:1,RGBCOLORS:2},ScalarMappingTarget:Tc},Sc={DEFAULT:0,USE_POINT_DATA:1,USE_CELL_DATA:2,USE_POINT_FIELD_DATA:3,USE_CELL_FIELD_DATA:4,USE_FIELD_DATA:5},Pc={ColorMode:{DEFAULT:0,MAP_SCALARS:1,DIRECT_SCALARS:2},GetArray:{BY_ID:0,BY_NAME:1},ScalarMode:Sc};function wc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Oc=Cc.ScalarMappingTarget,Mc=Cc.VectorMode,Ac=vo.VtkDataTypes,Ic=Pc.ColorMode,Rc=ur.a.vtkErrorMacro;function Ec(e){return e}function Dc(e){return Math.floor(255*e+.5)}var Vc={alpha:1,vectorComponent:0,vectorSize:-1,vectorMode:Mc.COMPONENT,mappingRange:null,annotationArray:null,annotatedValueMap:null,indexedLookup:!1};function Lc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Vc,n),ur.a.obj(e,t),t.mappingRange=[0,255],t.annotationArray=[],t.annotatedValueMap=[],ur.a.setGet(e,t,["vectorSize","vectorComponent","vectorMode","alpha","indexedLookup"]),ur.a.setArray(e,t,["mappingRange"],2),ur.a.getArray(e,t,["mappingRange"]),function(e,t){t.classHierarchy.push("vtkScalarsToColors"),e.setVectorModeToMagnitude=function(){return e.setVectorMode(Mc.MAGNITUDE)},e.setVectorModeToComponent=function(){return e.setVectorMode(Mc.COMPONENT)},e.setVectorModeToRGBColors=function(){return e.setVectorMode(Mc.RGBCOLORS)},e.build=function(){},e.isOpaque=function(){return!0},e.setAnnotations=function(n,r){if(!(n&&!r||!n&&r))if(n&&r&&n.length!==r.length)Rc("Values and annotations do not have the same number of tuples so ignoring");else{if(t.annotationArray=[],r&&n)for(var a=r.length,o=0;o=0?t.annotationArray[a].annotation!==r&&(t.annotationArray[a].annotation=r,o=!0):(t.annotationArray.push({value:n,annotation:r}),a=t.annotationArray.length-1,o=!0),o&&(e.updateAnnotatedValueMap(),e.modified()),a},e.getNumberOfAnnotatedValues=function(){return t.annotationArray.length},e.getAnnotatedValue=function(e){return e<0||e>=t.annotationArray.length?null:t.annotationArray[e].value},e.getAnnotation=function(e){return void 0===t.annotationArray[e]?null:t.annotationArray[e].annotation},e.getAnnotatedValueIndex=function(n){return t.annotationArray.length?e.checkForAnnotatedValue(n):-1},e.removeAnnotation=function(n){var r=e.checkForAnnotatedValue(n),a=r>=0;return a&&(t.annotationArray.splice(r,1),e.updateAnnotatedValueMap(),e.modified()),a},e.resetAnnotations=function(){t.annotationArray=[],t.annotatedValueMap=[],e.modified()},e.getAnnotationColor=function(n,r){if(t.indexedLookup){var a=e.getAnnotatedValueIndex(n);e.getIndexedColor(a,r)}else e.getColor(parseFloat(n),r),r[3]=1},e.checkForAnnotatedValue=function(t){return e.getAnnotatedValueIndexInternal(t)},e.getAnnotatedValueIndexInternal=function(e){if(void 0!==t.annotatedValueMap[e]){var n=t.annotationArray.length;return t.annotatedValueMap[e]%n}return-1},e.getIndexedColor=function(e,t){t[0]=0,t[1]=0,t[2]=0,t[3]=0},e.updateAnnotatedValueMap=function(){t.annotatedValueMap=[];for(var e=t.annotationArray.length,n=0;n1?e.mapVectorsThroughTable(t,o,Oc.RGBA,-1,-1):(l<0&&(l=0),l>=a&&(l=a-1),e.mapScalarsThroughTable(t,o,Oc.RGBA,l))}return o},e.mapVectorsToMagnitude=function(e,t,n){for(var r=e.getNumberOfTuples(),a=e.getNumberOfComponents(),o=t.getData(),i=e.getData(),s=0;s=u&&(l=u-1)):(-1===s&&(s=e.getVectorSize()),s<=0?(l=0,s=u):(l<0&&(l=0),l>=u&&(l=u-1),l+s>u&&(s=u-l)),i!==Mc.MAGNITUDE||1!==u&&1!==s||(i=Mc.COMPONENT));var c=0;switch(l>0&&(c=l),i){case Mc.COMPONENT:e.mapScalarsThroughTable(t,n,r,c);break;default:case Mc.MAGNITUDE:var d=vo.newInstance({numberOfComponents:1,values:new Float32Array(t.getNumberOfTuples())});e.mapVectorsToMagnitude(t,d,s),e.mapScalarsThroughTable(d,n,r,0);break;case Mc.RGBCOLORS:}},e.luminanceToRGBA=function(e,t,n,r){for(var a=r(n),o=t.getData(),i=e.getData(),s=o.length,l=0,u=0;u=1&&n.getDataType()===Ac.UNSIGNED_CHAR)return n;var i=vo.newInstance({numberOfComponents:4,empty:!0,size:4*a,dataType:Ac.UNSIGNED_CHAR});if(a<=0)return i;o=(o=o>0?o:0)<1?o:1;var s=Ec;switch(n.getDataType()!==Ac.FLOAT&&n.getDataType()!==Ac.DOUBLE||(s=Dc),r){case 1:e.luminanceToRGBA(i,n,o,s);break;case 2:e.luminanceAlphaToRGBA(i,n,s);break;case 3:e.rGBToRGBA(i,n,o,s);break;case 4:e.rGBAToRGBA(i,n,o,s);break;default:return Rc("Cannot convert colors"),null}return i},e.usingLogScale=function(){return!1},e.getNumberOfAvailableColors=function(){return 16777216},e.setRange=function(t,n){return e.setMappingRange(t,n)},e.getRange=function(t,n){return e.getMappingRange()}}(e,t)}var Nc=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_c,n),Nc.extend(e,t,n),t.table||(t.table=[]),t.buildTime={},ur.a.obj(t.buildTime),t.opaqueFlagBuildTime={},ur.a.obj(t.opaqueFlagBuildTime,{mtime:0}),t.insertTime={},ur.a.obj(t.insertTime,{mtime:0}),ur.a.get(e,t,["buildTime"]),ur.a.setGet(e,t,["numberOfColors","useAboveRangeColor","useBelowRangeColor"]),ur.a.setArray(e,t,["alphaRange","hueRange","saturationRange","valueRange"],2),ur.a.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),ur.a.getArray(e,t,["hueRange","saturationRange","valueRange","alphaRange","nanColor","belowRangeColor","aboveRangeColor"]),function(e,t){t.classHierarchy.push("vtkLookupTable"),e.isOpaque=function(){if(t.opaqueFlagBuildTime.getMTime()t.range[1]?t.maxIndex+Fc+1.5:(n=(e+t.shift)*t.scale)e[0]&&(t.scale=(t.maxIndex+1)/(e[1]-e[0]))},e.mapScalarsThroughTable=function(n,r,a,o){var i=e.linearLookup;t.indexedLookup&&(i=e.indexedLookupFunction);var s=e.getMappingRange(),l={maxIndex:e.getNumberOfColors()-1,range:s,shift:0,scale:0};e.lookupShiftAndScale(s,l);var u=e.getAlpha(),c=n.getNumberOfTuples(),d=n.getNumberOfComponents(),f=r.getData(),p=n.getData();if(u>=1){if(a===Tc.RGBA)for(var g=0;gt.buildTime.getMTime()&&t.insertTime.getMTime()<=t.buildTime.getMTime())&&e.forceBuild()},t.table.length>0&&t.insertTime.modified()}(e,t)}var jc={newInstance:ur.a.newInstance(Uc,"vtkLookupTable"),extend:Uc},Wc=1,zc=0,Hc=["VTK_RESOLVE_OFF","VTK_RESOLVE_POLYGON_OFFSET"];function Kc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;zc=e}var Xc={getResolveCoincidentTopologyAsString:function(){return Hc[zc]},getResolveCoincidentTopologyPolygonOffsetFaces:function(){return Wc},getResolveCoincidentTopology:function(){return zc},setResolveCoincidentTopology:Kc,setResolveCoincidentTopologyPolygonOffsetFaces:function(e){Wc=e},setResolveCoincidentTopologyToDefault:function(){Kc(0)},setResolveCoincidentTopologyToOff:function(){Kc(0)},setResolveCoincidentTopologyToPolygonOffset:function(){Kc(1)}};function qc(e,t,n){n.forEach(function(n){e["get".concat(n.method)]=function(){return t[n.key]},e["set".concat(n.method)]=function(e,r){t[n.key]={factor:e,offset:r}}})}var Yc=["Polygon","Line","Point"],Zc={};qc(Zc,{Polygon:{factor:2,offset:0},Line:{factor:1,offset:-1},Point:{factor:0,offset:-2}},Yc.map(function(e){return{key:e,method:"ResolveCoincidentTopology".concat(e,"OffsetParameters")}}));var Qc={implementCoincidentTopologyMethods:function(e,t){void 0===t.resolveCoincidentTopology&&(t.resolveCoincidentTopology=!1),ur.a.setGet(e,t,["resolveCoincidentTopology"]),t.topologyOffset={Polygon:{factor:0,offset:0},Line:{factor:0,offset:0},Point:{factor:0,offset:0}},Object.keys(Xc).forEach(function(t){e[t]=Xc[t]}),Object.keys(Zc).forEach(function(t){e[t]=Zc[t]}),qc(e,t.topologyOffset,Yc.map(function(e){return{key:e,method:"RelativeCoincidentTopology".concat(e,"OffsetParameters")}})),e.getCoincidentTopologyPolygonOffsetParameters=function(){var t=Zc.getResolveCoincidentTopologyPolygonOffsetParameters(),n=e.getRelativeCoincidentTopologyPolygonOffsetParameters();return{factor:t.factor+n.factor,offset:t.offset+n.offset}},e.getCoincidentTopologyLineOffsetParameters=function(){var t=Zc.getResolveCoincidentTopologyLineOffsetParameters(),n=e.getRelativeCoincidentTopologyLineOffsetParameters();return{factor:t.factor+n.factor,offset:t.offset+n.offset}},e.getCoincidentTopologyPointOffsetParameter=function(){var t=Zc.getResolveCoincidentTopologyPointOffsetParameters(),n=e.getRelativeCoincidentTopologyPointOffsetParameters();return{factor:t.factor+n.factor,offset:t.offset+n.offset}}},staticOffsetAPI:Zc,otherStaticMethods:Xc,CATEGORIES:Yc};function $c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jc(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ud,n),Fl.extend(e,t,n),ur.a.get(e,t,["colorCoordinates","colorMapColors","colorTextureMap"]),ur.a.setGet(e,t,["colorByArrayName","arrayAccessMode","colorMode","fieldDataTupleId","interpolateScalarsBeforeMapping","lookupTable","renderTime","scalarMode","scalarVisibility","static","useLookupTableScalarRange","viewSpecificProperties","customShaderAttributes"]),ur.a.setGetArray(e,t,["scalarRange"],2),t.viewSpecificProperties||(t.viewSpecificProperties={}),Qc.implementCoincidentTopologyMethods(e,t),function(e,t){t.classHierarchy.push("vtkMapper"),e.getBounds=function(){var n=e.getInputData();return n?(t.static||e.update(),t.bounds=n.getBounds()):t.bounds=Ka(),t.bounds},e.setForceCompileOnly=function(e){t.forceCompileOnly=e},e.createDefaultLookupTable=function(){t.lookupTable=jc.newInstance()},e.getColorModeAsString=function(){return ur.a.enumToString(rd,t.colorMode)},e.setColorModeToDefault=function(){return e.setColorMode(0)},e.setColorModeToMapScalars=function(){return e.setColorMode(1)},e.setColorModeToDirectScalars=function(){return e.setColorMode(2)},e.getScalarModeAsString=function(){return ur.a.enumToString(ad,t.scalarMode)},e.setScalarModeToDefault=function(){return e.setScalarMode(0)},e.setScalarModeToUsePointData=function(){return e.setScalarMode(1)},e.setScalarModeToUseCellData=function(){return e.setScalarMode(2)},e.setScalarModeToUsePointFieldData=function(){return e.setScalarMode(3)},e.setScalarModeToUseCellFieldData=function(){return e.setScalarMode(4)},e.setScalarModeToUseFieldData=function(){return e.setScalarMode(5)},e.getAbstractScalars=function(e,n,r,a,o){if(!e||!t.scalarVisibility)return{scalars:null,cellFLag:!1};var i=null,s=!1;if(n===ad.DEFAULT)(i=e.getPointData().getScalars())||(i=e.getCellData().getScalars(),s=!0);else if(n===ad.USE_POINT_DATA)i=e.getPointData().getScalars();else if(n===ad.USE_CELL_DATA)i=e.getCellData().getScalars(),s=!0;else if(n===ad.USE_POINT_FIELD_DATA){var l=e.getPointData();i=r===od.BY_ID?l.getArrayByIndex(a):l.getArrayByName(o)}else if(n===ad.USE_CELL_FIELD_DATA){var u=e.getCellData();s=!0,i=r===od.BY_ID?u.getArrayByIndex(a):u.getArrayByName(o)}else if(n===ad.USE_FIELD_DATA){var c=e.getFieldData();i=r===od.BY_ID?c.getArrayByIndex(a):c.getArrayByName(o)}return{scalars:i,cellFlag:s}},e.mapScalars=function(n,r){var a=e.getAbstractScalars(n,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;if(!a)return t.colorCoordinates=null,t.colorTextureMap=null,void(t.colorMapColors=null);var o="".concat(e.getMTime()).concat(a.getMTime()).concat(r);if(t.colorBuildString!==o){if(t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]),e.canUseTextureMapForColoring(n))e.mapScalarsToTexture(a,r);else{t.colorCoordinates=null,t.colorTextureMap=null;var i=e.getLookupTable();i&&(i.build(),t.colorMapColors=i.mapScalars(a,t.colorMode,-1))}t.colorBuildString="".concat(e.getMTime()).concat(a.getMTime()).concat(r)}},e.scalarToTextureCoordinate=function(e,t,n){var r=.5,a=1;return Ha(e)||(a=.49,(r=(e-t)*n)>1e3?r=1e3:r<-1e3&&(r=-1e3)),{texCoordS:r,texCoordT:a}},e.createColorTextureCoordinates=function(t,n,r,a,o,i,s,l,u){var c=(i[1]-i[0])/l,d=[];d[0]=i[0]-c,d[1]=i[1]+c;var f=1/(d[1]-d[0]),p=n.getData(),g=t.getData(),m=0,v=0;if(o<0||o>=a)for(var h=0;ht.colorTextureMap.getMTime()||t.lookupTable.getMTime()>t.colorTextureMap.getMTime()||t.lookupTable.getAlpha()!==r){t.lookupTable.setAlpha(r),t.colorTextureMap=null,t.lookupTable.build();var s=t.lookupTable.getNumberOfAvailableColors();s>4094&&(s=4094),s+=2;for(var l=(a[1]-a[0])/(s-1-2),u=new Float64Array(2*s),c=0;ct.colorCoordinates.getMTime()||e.getInputData(0).getMTime()>t.colorCoordinates.getMTime()||t.lookupTable.getMTime()>t.colorCoordinates.getMTime()){t.colorCoordinates=null;var p=n.getNumberOfComponents(),g=n.getNumberOfTuples();t.colorCoordinates=vo.newInstance({numberOfComponents:2,values:new Float32Array(2*g)});var m=t.lookupTable.getVectorComponent();t.lookupTable.getVectorMode()===id.MAGNITUDE&&n.getNumberOfComponents()>1&&(m=-1),e.createColorTextureCoordinates(n,t.colorCoordinates,g,p,m,a,t.lookupTable.getRange(),t.colorTextureMap.getPointData().getScalars().getNumberOfTuples()/2-2,o)}},e.getIsOpaque=function(){var t=e.getLookupTable();return!t||(t.build(),t.isOpaque())},e.canUseTextureMapForColoring=function(n){if(!t.interpolateScalarsBeforeMapping)return!1;if(t.lookupTable&&t.lookupTable.getIndexedLookup())return!1;var r=e.getAbstractScalars(n,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName),a=r.scalars;return!(!a||r.cellFlag||t.colorMode===rd.DEFAULT&&a.getDataType()===sd.UNSIGNED_CHAR||t.colorMode===rd.DIRECT_SCALARS)},e.clearColorArrays=function(){t.colorMapColors=null,t.colorCoordinates=null,t.colorTextureMap=null},e.getLookupTable=function(){return t.lookupTable||e.createDefaultLookupTable(),t.lookupTable},e.getMTime=function(){var e=t.mtime;if(null!==t.lookupTable){var n=t.lookupTable.getMTime();e=n>e?n:e}return e},e.getPrimitiveCount=function(){var t=e.getInputData();return{points:t.getPoints().getNumberOfValues()/3,verts:t.getVerts().getNumberOfValues()-t.getVerts().getNumberOfCells(),lines:t.getLines().getNumberOfValues()-2*t.getLines().getNumberOfCells(),triangles:t.getPolys().getNumberOfValues()-3*t.getLines().getNumberOfCells()}},e.acquireInvertibleLookupTable=ld("AcquireInvertibleLookupTable"),e.valueToColor=ld("ValueToColor"),e.colorToValue=ld("ColorToValue"),e.useInvertibleColorFor=ld("UseInvertibleColorFor"),e.clearInvertibleColor=ld("ClearInvertibleColor")}(e,t)}var dd=Jc(Jc(Jc({newInstance:ur.a.newInstance(cd,"vtkMapper"),extend:cd},td),nd),Pc);function fd(e){return function(e){if(Array.isArray(e))return pd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return pd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pd(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Pd,n),pr.extend(e,t,n),gi.implementReplaceShaderCoincidentOffset(e,t,n),t.primitives=[],t.primTypes=gd,t.tmpMat3=a.identity(new Float64Array(9)),t.tmpMat4=o.identity(new Float64Array(16));for(var r=gd.Start;r= cos(radians(lightConeAngle".concat(d,")))")," {"," attenuation = attenuation * pow(coneDot, lightExponent".concat(d,");")," }"," else"," {"," attenuation = 0.0;"," }"," }"," }"," df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));"," diffuseL += ((df".concat("",") * lightColor").concat(d,");")," if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)"," {"," float sf = attenuation*pow( max(0.0, dot(lightHalfAngleVC".concat(d,",normalVCVSOutput)), specularPower);")," specularL += ((sf".concat("",") * lightColor").concat(d,");")," }"]);s=s.concat([" diffuseL = diffuseL * diffuseColor;"," specularL = specularL * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"]),a=Uo.substitute(a,"//VTK::Light::Impl",s,!1).result;break;default:Td("bad light complexity")}e.Fragment=a},e.replaceShaderNormal=function(n,r,a){if(t.lastBoundBO.getReferenceByName("lastLightComplexity")>0){var o=n.Vertex,i=n.Geometry,s=n.Fragment;t.lastBoundBO.getCABO().getNormalOffset()?(o=Uo.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=Uo.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * normalMC;"]).result,i=Uo.substitute(i,"//VTK::Normal::Dec",["in vec3 normalVCVSOutput[];","out vec3 normalVCGSOutput;"]).result,i=Uo.substitute(i,"//VTK::Normal::Impl",["normalVCGSOutput = normalVCVSOutput[i];"]).result,s=Uo.substitute(s,"//VTK::Normal::Dec",["varying vec3 normalVCVSOutput;"]).result,s=Uo.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalVCVSOutput);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):t.haveCellNormals?(s=Uo.substitute(s,"//VTK::Normal::Dec",["uniform mat3 normalMatrix;","uniform samplerBuffer textureN;"]).result,s=Uo.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalMatrix *"," texelFetchBuffer(textureN, gl_PrimitiveID + PrimitiveIDOffset).xyz);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):e.getOpenGLMode(a.getProperty().getRepresentation(),t.lastBoundBO.getPrimitiveType())===t.context.LINES?(s=Uo.substitute(s,"//VTK::UniformFlow::Impl",[" vec3 fdx = vec3(dFdx(vertexVC.x),dFdx(vertexVC.y),dFdx(vertexVC.z));"," vec3 fdy = vec3(dFdy(vertexVC.x),dFdy(vertexVC.y),dFdy(vertexVC.z));"," //VTK::UniformFlow::Impl"]).result,s=Uo.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput;"," fdx = normalize(fdx);"," fdy = normalize(fdy);"," if (abs(fdx.x) > 0.0)"," { normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }"," else { normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}"]).result):(s=Uo.substitute(s,"//VTK::Normal::Dec",["uniform int cameraParallel;"]).result,s=Uo.substitute(s,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,s=Uo.substitute(s,"//VTK::Normal::Impl",[" fdx = normalize(fdx);"," fdy = normalize(fdy);"," vec3 normalVCVSOutput = normalize(cross(fdx,fdy));"," if (cameraParallel == 1 && normalVCVSOutput.z < 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"," if (cameraParallel == 0 && dot(normalVCVSOutput,vertexVC.xyz) > 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"]).result),n.Vertex=o,n.Geometry=i,n.Fragment=s}},e.replaceShaderPositionVC=function(e,n,r){var a=e.Vertex,o=e.Geometry,i=e.Fragment;r.getProperty().getRepresentation()!==md.POINTS&&t.lastBoundBO.getPrimitiveType()!==gd.Points||(a=Uo.substitute(a,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," gl_PointSize = ".concat(r.getProperty().getPointSize(),".0;")],!1).result),t.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(a=Uo.substitute(a,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,a=Uo.substitute(a,"//VTK::PositionVC::Impl",["vertexVCVSOutput = MCVCMatrix * vertexMC;"," gl_Position = MCPCMatrix * vertexMC;"]).result,a=Uo.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result,o=Uo.substitute(o,"//VTK::PositionVC::Dec",["in vec4 vertexVCVSOutput[];","out vec4 vertexVCGSOutput;"]).result,o=Uo.substitute(o,"//VTK::PositionVC::Impl",["vertexVCGSOutput = vertexVCVSOutput[i];"]).result,i=Uo.substitute(i,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,i=Uo.substitute(i,"//VTK::PositionVC::Impl",["vec4 vertexVC = vertexVCVSOutput;"]).result):(a=Uo.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,a=Uo.substitute(a,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result),e.Vertex=a,e.Geometry=o,e.Fragment=i},e.replaceShaderTCoord=function(e,n,r){if(t.lastBoundBO.getCABO().getTCoordOffset()){var a=e.Vertex,o=e.Geometry,i=e.Fragment;if(t.drawingEdges)return;a=Uo.substitute(a,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result;var s=t.openGLActor.getActiveTextures(),l=2,u=2;if(s&&s.length>0&&(l=s[0].getComponents(),s[0].getTarget()===t.context.TEXTURE_CUBE_MAP&&(u=3)),t.renderable.getColorTextureMap()&&(l=t.renderable.getColorTextureMap().getPointData().getScalars().getNumberOfComponents(),u=2),2===u){if(a=Uo.substitute(a,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result,o=Uo.substitute(o,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput[];","out vec2 tcoordVCGSOutput;"]).result,o=Uo.substitute(o,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=Uo.substitute(i,"//VTK::TCoord::Dec",["varying vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,s&&s.length>=1)switch(l){case 1:i=Uo.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,1.0);"]).result;break;case 2:i=Uo.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);"]).result;break;default:i=Uo.substitute(i,"//VTK::TCoord::Impl","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*texture2D(texture1, tcoordVCVSOutput.st);").result}}else switch(a=Uo.substitute(a,"//VTK::TCoord::Dec","attribute vec3 tcoordMC; varying vec3 tcoordVCVSOutput;").result,o=Uo.substitute(o,"//VTK::TCoord::Dec",["in vec3 tcoordVCVSOutput[];","out vec3 tcoordVCGSOutput;"]).result,o=Uo.substitute(o,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=Uo.substitute(i,"//VTK::TCoord::Dec",["varying vec3 tcoordVCVSOutput;","uniform samplerCube texture1;"]).result,l){case 1:i=Uo.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,1.0);"]).result;break;case 2:i=Uo.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);"]).result;break;default:i=Uo.substitute(i,"//VTK::TCoord::Impl","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*textureCube(texture1, tcoordVCVSOutput);").result}e.Vertex=a,e.Geometry=o,e.Fragment=i}},e.replaceShaderClip=function(e,n,r){var a=e.Vertex,o=e.Fragment;if(t.renderable.getNumberOfClippingPlanes()){var i=t.renderable.getNumberOfClippingPlanes();i>6&&(ur.l("OpenGL has a limit of 6 clipping planes"),i=6),a=Uo.substitute(a,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[6];","varying float clipDistancesVSOutput[6];"]).result,a=Uo.substitute(a,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,o=Uo.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[6];"]).result,o=Uo.substitute(o,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}e.Vertex=a,e.Fragment=o},e.getCoincidentParameters=function(e,n){var r=null,a=n.getProperty();if(t.renderable.getResolveCoincidentTopology()||a.getEdgeVisibility()&&a.getRepresentation()===md.SURFACE){var o=t.lastBoundBO.getPrimitiveType();o===gd.Points||a.getRepresentation()===md.POINTS?r=t.renderable.getCoincidentTopologyPointOffsetParameter():o===gd.Lines||a.getRepresentation()===md.WIREFRAME?r=t.renderable.getCoincidentTopologyLineOffsetParameters():o!==gd.Tris&&o!==gd.TriStrips||(r=t.renderable.getCoincidentTopologyPolygonOffsetParameters()),o!==gd.TrisEdges&&o!==gd.TriStripsEdges||((r=t.renderable.getCoincidentTopologyPolygonOffsetParameters()).factor/=2,r.offset/=2)}return r},e.replaceShaderPicking=function(e,t,n){var r=e.Fragment;r=Uo.substitute(r,"//VTK::Picking::Dec",["uniform vec3 mapperIndex;","uniform int picking;"]).result,r=Uo.substitute(r,"//VTK::Picking::Impl"," gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];").result,e.Fragment=r},e.replaceShaderValues=function(n,r,a){if(e.replaceShaderColor(n,r,a),e.replaceShaderNormal(n,r,a),e.replaceShaderLight(n,r,a),e.replaceShaderTCoord(n,r,a),e.replaceShaderPicking(n,r,a),e.replaceShaderClip(n,r,a),e.replaceShaderCoincidentOffset(n,r,a),e.replaceShaderPositionVC(n,r,a),t.haveSeenDepthRequest){var o=n.Fragment;o=Uo.substitute(o,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,o=Uo.substitute(o,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float iz = floor(gl_FragCoord.z*65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result,n.Fragment=o}},e.getNeedToRebuildShaders=function(n,r,a){var o=0,i=0,s=n.getPrimitiveType(),l=t.currentInput,u=!1,c=l.getPointData().getNormals(),d=l.getCellData().getNormals(),f=a.getProperty().getInterpolation()===vd.FLAT,p=a.getProperty().getRepresentation(),g=e.getOpenGLMode(p,s);if(g===t.context.TRIANGLES?u=!0:d&&!c?u=!0:!f&&c?u=!0:f||g!==t.context.LINES||(u=!0),a.getProperty().getLighting()&&u){o=0;for(var m=r.getLightsByReference(),v=0;v0&&(i++,0===o&&(o=1)),1===o&&(i>1||1!==h.getIntensity()||!h.lightTypeIsHeadLight())&&(o=2),o<3&&h.getPositional()&&(o=3)}}var y=!1,b=t.lastBoundBO.getReferenceByName("lastLightComplexity"),T=t.lastBoundBO.getReferenceByName("lastLightCount");return b===o&&T===i||(t.lastBoundBO.set({lastLightComplexity:o},!0),t.lastBoundBO.set({lastLightCount:i},!0),y=!0),!!(t.lastHaveSeenDepthRequest!==t.haveSeenDepthRequest||0===n.getProgram()||n.getShaderSourceTime().getMTime()n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())){var o=t.lastBoundBO.getReferenceByName("lastLightComplexity");n.getProgram().isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexMC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),t.context.FLOAT,3,!1)||Td("Error setting vertexMC in shader VAO.")),n.getProgram().isAttributeUsed("normalMC")&&n.getCABO().getNormalOffset()&&o>0?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"normalMC",n.getCABO().getNormalOffset(),n.getCABO().getStride(),t.context.FLOAT,3,!1)||Td("Error setting normalMC in shader VAO."):n.getVAO().removeAttributeArray("normalMC"),t.renderable.getCustomShaderAttributes().forEach(function(e,r){n.getProgram().isAttributeUsed("".concat(e,"MC"))&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"".concat(e,"MC"),n.getCABO().getCustomData()[r].offset,n.getCABO().getStride(),t.context.FLOAT,n.getCABO().getCustomData()[r].components,!1)||Td("Error setting ".concat(e,"MC in shader VAO.")))}),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),t.context.FLOAT,n.getCABO().getTCoordComponents(),!1)||Td("Error setting tcoordMC in shader VAO."):n.getVAO().removeAttributeArray("tcoordMC"),n.getProgram().isAttributeUsed("scalarColor")&&n.getCABO().getColorComponents()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO().getColorBO(),"scalarColor",n.getCABO().getColorOffset(),n.getCABO().getColorBOStride(),t.context.UNSIGNED_BYTE,4,!0)||Td("Error setting scalarColor in shader VAO."):n.getVAO().removeAttributeArray("scalarColor"),n.getAttributeUpdateTime().modified()}if(t.renderable.getNumberOfClippingPlanes()){var i=t.renderable.getNumberOfClippingPlanes();i>6&&(ur.l("OpenGL has a limit of 6 clipping planes"),i=6);for(var s=[],l=0;l0){var f=d.getColorByReference(),p=d.getIntensity();t.lightColor[0]=f[0]*p,t.lightColor[1]=f[1]*p,t.lightColor[2]=f[2]*p;var g=d.getDirection(),m=n.getActiveCamera().getViewMatrix(),v=fd(g);d.lightTypeIsSceneLight()&&(v[0]=m[0]*g[0]+m[1]*g[1]+m[2]*g[2],v[1]=m[4]*g[0]+m[5]*g[1]+m[6]*g[2],v[2]=m[8]*g[0]+m[9]*g[1]+m[10]*g[2],ra(v)),t.lightDirection[0]=v[0],t.lightDirection[1]=v[1],t.lightDirection[2]=v[2],t.lightHalfAngle[0]=-t.lightDirection[0],t.lightHalfAngle[1]=-t.lightDirection[1],t.lightHalfAngle[2]=1-t.lightDirection[2],ra(t.lightDirection),s.setUniform3fArray("lightColor".concat(l),t.lightColor),s.setUniform3fArray("lightDirectionVC".concat(l),t.lightDirection),s.setUniform3fArray("lightHalfAngleVC".concat(l),t.lightHalfAngle),l++}}if(!(a<3)){var h=n.getActiveCamera().getViewMatrix();o.transpose(h,h),l=0;for(var y=0;y0){var T=b.getTransformedPosition(),C=new Float64Array(3);i.transformMat4(C,T,h),s.setUniform3fArray("lightAttenuation".concat(l),b.getAttenuationValuesByReference()),s.setUniformi("lightPositional".concat(l),b.getPositional()),s.setUniformf("lightExponent".concat(l),b.getExponent()),s.setUniformf("lightConeAngle".concat(l),b.getConeAngle()),s.setUniform3fArray("lightPositionVC".concat(l),[C[0],C[1],C[2]]),l++}}}}},e.setCameraShaderParameters=function(e,r,i){var s=e.getProgram(),l=t.openGLCamera.getKeyMatrices(r),u=r.getActiveCamera(),c=t.openGLCamera.getKeyMatrixTime().getMTime(),d=s.getLastCameraMTime(),f=e.getCABO().getCoordShiftAndScaleEnabled()?e.getCABO().getInverseShiftAndScaleMatrix():null,p=i.getIsIdentity(),g=p?{mcwc:null,normalMatrix:null}:t.openGLActor.getKeyMatrices();s.setUniformMatrix("MCPCMatrix",n([l.wcpc,g.mcwc,f],o,t.tmpMat4)),s.isUniformUsed("MCVCMatrix")&&s.setUniformMatrix("MCVCMatrix",n([l.wcvc,g.mcwc,f],o,t.tmpMat4)),s.isUniformUsed("normalMatrix")&&s.setUniformMatrix3x3("normalMatrix",n([l.normalMatrix,g.normalMatrix],a,t.tmpMat3)),d!==c&&(s.isUniformUsed("cameraParallel")&&s.setUniformi("cameraParallel",u.getParallelProjection()),s.setLastCameraMTime(c)),p||s.setLastCameraMTime(0)},e.setPropertyShaderParameters=function(e,n,r){var a=e.getProgram(),o=r.getProperty(),i=o.getOpacity(),s=t.drawingEdges?o.getEdgeColorByReference():o.getAmbientColorByReference(),l=t.drawingEdges?o.getEdgeColorByReference():o.getDiffuseColorByReference(),u=t.drawingEdges?1:o.getAmbient(),c=t.drawingEdges?0:o.getDiffuse(),d=t.drawingEdges?0:o.getSpecular(),f=o.getSpecularPower();a.setUniformf("opacityUniform",i),a.setUniform3fArray("ambientColorUniform",s),a.setUniform3fArray("diffuseColorUniform",l),a.setUniformf("ambient",u),a.setUniformf("diffuse",c);var p=t.lastBoundBO.getReferenceByName("lastLightComplexity");if(!(p<1)){var g=o.getSpecularColorByReference();if(a.setUniform3fArray("specularColorUniform",g),a.setUniformf("specularPowerUniform",f),a.isUniformUsed("ambientIntensityBF")){if(i=(o=r.getBackfaceProperty()).getOpacity(),s=o.getAmbientColor(),u=o.getAmbient(),l=o.getDiffuseColor(),c=o.getDiffuse(),g=o.getSpecularColor(),d=o.getSpecular(),a.setUniformf("ambientIntensityBF",u),a.setUniformf("diffuseIntensityBF",c),a.setUniformf("opacityUniformBF",i),a.setUniform3fArray("ambientColorUniformBF",s),a.setUniform3fArray("diffuseColorUniformBF",l),p<1)return;a.setUniformf("specularIntensityBF",d),a.setUniform3fArray("specularColorUniformBF",g),a.setUniformf("specularPowerUniformBF",f)}}},e.renderPieceStart=function(n,r){t.primitiveIDOffset=0,t.openGLRenderer.getSelector()&&(t.openGLRenderer.getSelector().getCurrentPass(),t.openGLRenderer.getSelector().renderProp(r)),e.updateBufferObjects(n,r),t.renderable.getColorTextureMap()&&t.internalColorTexture.activate(),t.lastBoundBO=null},e.renderPieceDraw=function(n,r){var a=r.getProperty().getRepresentation(),o=t.context,i=r.getProperty().getEdgeVisibility()&&a===md.SURFACE;o.lineWidth(r.getProperty().getLineWidth());for(var s=gd.Start;s2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ad,n),pr.extend(e,t,n),t.openGLTexture=li.newInstance(),t.tris=Xo.newInstance(),t.keyMatrixTime={},ur.g(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:a.identity(new Float64Array(9)),mcwc:o.identity(new Float64Array(16))},ur.i(e,t,["context"]),ur.b(e,t,["activeTextures"]),function(e,t){t.classHierarchy.push("vtkOpenGLSkybox"),e.buildPass=function(n){if(n){t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext(),t.tris.setOpenGLRenderWindow(t.openGLRenderWindow),t.openGLTexture.setOpenGLRenderWindow(t.openGLRenderWindow);var r=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(r.getActiveCamera())}},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;n.incrementOpaqueActorCount()}},e.opaquePass=function(n,r){if(n&&!t.openGLRenderer.getSelector()){e.updateBufferObjects(),t.openGLRenderWindow.enableDepthMask(),t.openGLRenderWindow.getShaderCache().readyShaderProgram(t.tris.getProgram()),t.openGLTexture.render(t.openGLRenderWindow);var a=t.openGLTexture.getTextureUnit();t.tris.getProgram().setUniformi("sbtexture",a);var i=t.openGLRenderer.getRenderable(),s=t.openGLCamera.getKeyMatrices(i),l=new Float64Array(16);if(o.invert(l,s.wcpc),t.tris.getProgram().setUniformMatrix("IMCPCMatrix",l),"box"===t.lastFormat){var u=i.getActiveCamera().getPosition();t.tris.getProgram().setUniform3f("camPos",u[0],u[1],u[2])}t.tris.getVAO().bind(),t.context.drawArrays(t.context.TRIANGLES,0,t.tris.getCABO().getElementCount()),t.tris.getVAO().release(),t.openGLTexture.deactivate()}},e.updateBufferObjects=function(){if(!t.tris.getCABO().getElementCount()){for(var e=new Float32Array(12),n=0;n<4;n++)e[3*n]=n%2*2-1,e[3*n+1]=n>1?1:-1,e[3*n+2]=1;var r=vo.newInstance({numberOfComponents:3,values:e});r.setName("points");var a=new Uint16Array(8);a[0]=3,a[1]=0,a[2]=1,a[3]=3,a[4]=3,a[5]=0,a[6]=3,a[7]=2;var o=vo.newInstance({numberOfComponents:1,values:a});t.tris.getCABO().createVBO(o,"polys",Mo.SURFACE,{points:r,cellOffset:0})}t.renderable.getFormat()!==t.lastFormat&&(t.lastFormat=t.renderable.getFormat(),"box"===t.lastFormat&&t.tris.setProgram(t.openGLRenderWindow.getShaderCache().readyShaderProgramArray("//VTK::System::Dec\n attribute vec3 vertexMC;\n uniform mat4 IMCPCMatrix;\n varying vec3 TexCoords;\n void main () {\n gl_Position = vec4(vertexMC.xyz, 1.0);\n vec4 wpos = IMCPCMatrix * gl_Position;\n TexCoords = wpos.xyz/wpos.w;\n }","//VTK::System::Dec\n //VTK::Output::Dec\n varying vec3 TexCoords;\n uniform samplerCube sbtexture;\n uniform vec3 camPos;\n void main () {\n // skybox looks from inside out\n // which means we have to adjust\n // our tcoords. Otherwise text would\n // be flipped\n vec3 tc = normalize(TexCoords - camPos);\n if (abs(tc.z) < max(abs(tc.x),abs(tc.y)))\n {\n tc = vec3(1.0, 1.0, -1.0) * tc;\n }\n else\n {\n tc = vec3(-1.0, 1.0, 1.0) * tc;\n }\n gl_FragData[0] = textureCube(sbtexture, tc);\n }","")),"background"===t.lastFormat&&t.tris.setProgram(t.openGLRenderWindow.getShaderCache().readyShaderProgramArray("//VTK::System::Dec\n attribute vec3 vertexMC;\n uniform mat4 IMCPCMatrix;\n varying vec2 TexCoords;\n void main () {\n gl_Position = vec4(vertexMC.xyz, 1.0);\n vec4 wpos = IMCPCMatrix * gl_Position;\n TexCoords = vec2(vertexMC.x, vertexMC.y)*0.5 + 0.5;\n }","//VTK::System::Dec\n //VTK::Output::Dec\n varying vec2 TexCoords;\n uniform sampler2D sbtexture;\n void main () {\n gl_FragData[0] = texture2D(sbtexture, TexCoords);\n }","")),t.tris.getShaderSourceTime().modified(),t.tris.getVAO().bind(),t.tris.getVAO().addAttributeArray(t.tris.getProgram(),t.tris.getCABO(),"vertexMC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||Md("Error setting vertexMC in shader VAO."));var i=t.renderable.getTextures();i.length||Md("vtkSkybox requires a texture map"),t.openGLTexture.getRenderable()!==i[0]&&(t.openGLTexture.releaseGraphicsResources(t.openGLRenderWindow),t.openGLTexture.setRenderable(i[0]))}}(e,t)}var Rd=ur.d(Id);yr("vtkSkybox",Rd);var Ed={keyMatricesTime:null,keyMatrices:null,propID:void 0,bufferShift:void 0};function Dd(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ed,n),pr.extend(e,t,n),t.keyMatricesTime={},ur.a.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={normalMatrix:new Float64Array(16),bcwc:new Float64Array(16),bcsc:new Float64Array(16)},ur.a.get(e,t,["propID","keyMatricesTime"]),t.bufferShift=[0,0,0,0],function(e,t){t.classHierarchy.push("vtkWebGPUActor"),e.buildPass=function(n){n&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.traverseOpaquePass=function(n){t.renderable&&t.renderable.getVisibility()&&t.renderable.getIsOpaque()&&(!t.WebGPURenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children[0]&&t.children[0].traverse(n),e.apply(n,!1))},e.traverseTranslucentPass=function(n){!t.renderable||!t.renderable.getVisibility()||t.renderable.getIsOpaque()||t.WebGPURenderer.getSelector()&&!t.renderable.getPickable()||(e.apply(n,!0),t.children[0]&&t.children[0].traverse(n),e.apply(n,!1))},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?n.incrementOpaqueActorCount():n.incrementTranslucentActorCount()}},e.getBufferShift=function(n){return e.getKeyMatrices(n),t.bufferShift},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime().getMTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var n=t.renderable.getMatrix(),r=e.getStabilizedCenterByReference();t.bufferShift[0]=n[3]-r[0],t.bufferShift[1]=n[7]-r[1],t.bufferShift[2]=n[11]-r[2],o.transpose(t.keyMatrices.bcwc,n),t.renderable.getIsIdentity()?o.identity(t.keyMatrices.normalMatrix):(o.copy(t.keyMatrices.normalMatrix,t.keyMatrices.bcwc),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,o.invert(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),o.transpose(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),o.translate(t.keyMatrices.bcwc,t.keyMatrices.bcwc,[-t.bufferShift[0],-t.bufferShift[1],-t.bufferShift[2]]),o.translate(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-r[0],-r[1],-r[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}(e,t)}var Vd=ur.a.newInstance(Dd);Ji("vtkActor",Vd);var Ld={repeat:!1,interpolate:!1,edgeClamp:!1,image:null,imageLoaded:!1};function Nd(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ld,n),ur.a.obj(e,t),ur.a.algo(e,t,6,0),ur.a.get(e,t,["imageLoaded"]),ur.a.setGet(e,t,["repeat","edgeClamp","interpolate","image"]),function(e,t){t.classHierarchy.push("vtkTexture"),e.imageLoaded=function(){t.image.removeEventListener("load",e.imageLoaded),t.imageLoaded=!0,e.modified()},e.setImage=function(n){t.image!==n&&(null!==n&&(e.setInputData(null),e.setInputConnection(null)),t.image=n,t.imageLoaded=!1,n.complete?e.imageLoaded():n.addEventListener("load",e.imageLoaded),e.modified())}}(e,t)}var Bd={newInstance:ur.a.newInstance(Nd,"vtkTexture"),extend:Nd},kd=cl.BufferUsage,Fd=cl.PrimitiveTypes,Gd=qs.Representation,_d=dd.ScalarMode,Ud={type:"StartEvent"},jd={type:"EndEvent"},Wd="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(vertex)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n var vertex: vec4 = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",zd="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n var ambientColor: vec4 = mapperUBO.AmbientColor;\n var diffuseColor: vec4 = mapperUBO.DiffuseColor;\n var opacity: f32 = mapperUBO.Opacity;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n var computedColor: vec4 = vec4(ambientColor.rgb * mapperUBO.AmbientIntensity\n + diffuse * mapperUBO.DiffuseIntensity\n + specular * mapperUBO.SpecularIntensity,\n opacity);\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n if (computedColor.a == 0.0) { discard; };\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";var Hd={colorTexture:null,renderEncoder:null,textures:null,textureViews:null,primitives:null,tmpMat4:null,fragmentShaderTemplate:null,vertexShaderTemplate:null};function Kd(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hd,n),pr.extend(e,t,n),t.tmpMat3=a.identity(new Float64Array(9)),t.tmpMat4=o.identity(new Float64Array(16)),t.fragmentShaderTemplate=t.fragmentShaderTemplate||zd,t.vertexShaderTemplate=t.vertexShaderTemplate||Wd,t.UBO=hl.newInstance(),t.UBO.setName("mapperUBO"),t.UBO.addEntry("BCWCMatrix","mat4x4"),t.UBO.addEntry("BCSCMatrix","mat4x4"),t.UBO.addEntry("MCWCNormals","mat4x4"),t.UBO.addEntry("AmbientColor","vec4"),t.UBO.addEntry("DiffuseColor","vec4"),t.UBO.addEntry("AmbientIntensity","f32"),t.UBO.addEntry("DiffuseIntensity","f32"),t.UBO.addEntry("SpecularColor","vec4"),t.UBO.addEntry("SpecularIntensity","f32"),t.UBO.addEntry("Opacity","f32"),t.UBO.addEntry("SpecularPower","f32"),t.UBO.addEntry("PropID","u32"),ur.b(e,t,["fragmentShaderTemplate","vertexShaderTemplate","UBO"]),ur.i(e,t,["renderEncoder"]),t.textures=[],t.textureViews=[],t.primitives=[],function(e,t){t.classHierarchy.push("vtkWebGPUPolyDataMapper"),e.buildPass=function(n){n&&(t.WebGPUActor=e.getFirstAncestorOfType("vtkWebGPUActor"),t.WebGPURenderer=t.WebGPUActor.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.device=t.WebGPURenderWindow.getDevice())},e.translucentPass=function(t){t&&e.render()},e.opaquePass=function(t){t&&e.render()},e.updateUBO=function(){var n=t.WebGPUActor.getRenderable().getProperty(),r=t.UBO.getSendTime();if(e.getMTime()>r||n.getMTime()>r||t.renderable.getMTime()>r){var a=t.WebGPUActor.getKeyMatrices(t.WebGPURenderer);t.UBO.setArray("BCWCMatrix",a.bcwc),t.UBO.setArray("BCSCMatrix",a.bcsc),t.UBO.setArray("MCWCNormals",a.normalMatrix);var o=n.getAmbientColorByReference();t.UBO.setValue("AmbientIntensity",n.getAmbient()),t.UBO.setArray("AmbientColor",[o[0],o[1],o[2],1]),t.UBO.setValue("DiffuseIntensity",n.getDiffuse()),o=n.getDiffuseColorByReference(),t.UBO.setArray("DiffuseColor",[o[0],o[1],o[2],1]),t.UBO.setValue("SpecularIntensity",n.getSpecular()),t.UBO.setValue("SpecularPower",n.getSpecularPower()),o=n.getSpecularColorByReference(),t.UBO.setArray("SpecularColor",[o[0],o[1],o[2],1]),t.UBO.setValue("Opacity",n.getOpacity()),t.UBO.setValue("PropID",t.WebGPUActor.getPropID());var i=t.WebGPURenderWindow.getDevice();t.UBO.sendIfNeeded(i)}},e.render=function(){e.invokeEvent(Ud),t.renderable.getStatic()||t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent(jd),t.renderEncoder=t.WebGPURenderer.getRenderEncoder(),e.buildPrimitives(),e.updateUBO()},e.replaceShaderPosition=function(e,t,n){var r=t.getShaderDescription("vertex");r.addBuiltinOutput("vec4","[[builtin(position)]] Position");var a=r.getCode();a=ps.substitute(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix*vertexBC;"]).result,r.setCode(a)},e.replaceShaderNormal=function(e,t,n){if(n.hasAttribute("normalMC")){var r=t.getShaderDescription("vertex");r.addOutput("vec3","normalVC");var a=r.getCode();a=ps.substitute(a,"//VTK::Normal::Impl",[" output.normalVC = normalize((rendererUBO.WCVCNormals * mapperUBO.MCWCNormals * normalMC).xyz);"]).result,r.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=ps.substitute(a,"//VTK::Normal::Impl",[" var normal: vec3 = input.normalVC;"," if (!input.frontFacing) { normal = -normal; }"]).result,o.setCode(a)}},e.replaceShaderLight=function(e,t,n){var r=t.getShaderDescription("fragment"),a=r.getCode();a.includes("var normal")?(a=ps.substitute(a,"//VTK::Light::Impl",[" var df: f32 = max(0.0, normal.z);"," var sf: f32 = pow(df, mapperUBO.SpecularPower);"," var diffuse: vec3 = df * diffuseColor.rgb;"," var specular: vec3 = sf * mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;"]).result,r.setCode(a)):(a=ps.substitute(a,"//VTK::Light::Impl",[" var diffuse: vec3 = diffuseColor.rgb;"," var specular: vec3 = mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;"]).result,r.setCode(a))},e.replaceShaderColor=function(e,t,n){if(n.hasAttribute("colorVI")){var r=t.getShaderDescription("vertex");r.addOutput("vec4","color");var a=r.getCode();a=ps.substitute(a,"//VTK::Color::Impl",[" output.color = colorVI;"]).result,r.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=ps.substitute(a,"//VTK::Color::Impl",["ambientColor = input.color;","diffuseColor = input.color;","opacity = mapperUBO.Opacity * input.color.a;"]).result,o.setCode(a)}},e.replaceShaderTCoord=function(e,n,r){if(r.hasAttribute("tcoord")){var a=n.getShaderDescription("vertex");a.addOutput("vec2","tcoordVS");var o=a.getCode();o=ps.substitute(o,"//VTK::TCoord::Impl",[" output.tcoordVS = tcoord;"]).result,a.setCode(o);var i=n.getShaderDescription("fragment");o=i.getCode(),t.textures.length&&(o=ps.substitute(o,"//VTK::TCoord::Impl",["var tcolor: vec4 = textureSample(Texture0, Texture0Sampler, input.tcoordVS);","computedColor = computedColor*tcolor;"]).result),i.setCode(o)}},e.replaceShaderSelect=function(e,t,n){if(e.includes("sel")){var r=t.getShaderDescription("fragment"),a=r.getCode();a=ps.substitute(a,"//VTK::Select::Impl",[" var compositeID: u32 = 0u;"]).result,r.setCode(a)}},e.getUsage=function(e,t){return e===Gd.POINTS||0===t?kd.Verts:1===t?kd.Lines:e===Gd.WIREFRAME?2===t?kd.LinesFromTriangles:kd.LinesFromStrips:2===t?kd.Triangles:kd.Strips},e.getHashFromUsage=function(e){return"pt".concat(e)},e.getTopologyFromUsage=function(e){switch(e){case kd.Triangles:return"triangle-list";case kd.Verts:return"point-list";default:case kd.Lines:return"line-list"}},e.buildVertexInput=function(n,r,a){var o=t.WebGPUActor.getRenderable().getProperty().getRepresentation(),i=t.WebGPURenderWindow.getDevice(),s=t.primitives[a].getVertexInput(),l=r.getMTime()+o,u=n.getPoints();if(u){var c=t.WebGPUActor.getBufferShift(t.WebGPURenderer),d={hash:l+u.getMTime(),dataArray:u,source:u,cells:r,primitiveType:a,representation:o,time:Math.max(u.getMTime(),r.getMTime(),t.WebGPUActor.getKeyMatricesTime().getMTime()),shift:c,usage:kd.PointArray,format:"float32x4",packExtra:!0},f=i.getBufferManager().getBuffer(d);s.addBuffer(f,["vertexBC"])}else s.removeBufferIfPresent("vertexBC");var p=e.getUsage(o,a);if(p===kd.Triangles||p===kd.Strips){var g=n.getPointData().getNormals(),m={cells:r,representation:o,primitiveType:a,format:"snorm8x4",packExtra:!0,shift:0,scale:127};if(g){m.hash=l+g.getMTime(),m.dataArray=g,m.source=g,m.time=Math.max(g.getMTime(),r.getMTime()),m.usage=kd.PointArray;var v=i.getBufferManager().getBuffer(m);s.addBuffer(v,["normalMC"])}else if(a===Fd.Triangles){m.hash=l+u.getMTime(),m.dataArray=u,m.source=u,m.time=Math.max(u.getMTime(),r.getMTime()),m.usage=kd.NormalsFromPoints;var h=i.getBufferManager().getBuffer(m);s.addBuffer(h,["normalMC"])}else s.removeBufferIfPresent("normalMC")}else s.removeBufferIfPresent("normalMC");var y=!1;if(t.renderable.getScalarVisibility()){var b=t.renderable.getColorMapColors();if(b){var T=t.renderable.getScalarMode(),C=!1;T!==_d.USE_CELL_DATA&&T!==_d.USE_CELL_FIELD_DATA&&T!==_d.USE_FIELD_DATA&&n.getPointData().getScalars()||T===_d.USE_POINT_FIELD_DATA||!b||(C=!0);var S={hash:l+u.getMTime(),dataArray:b,source:b,cells:r,primitiveType:a,representation:o,time:Math.max(b.getMTime(),r.getMTime()),usage:kd.PointArray,format:"unorm8x4",cellData:C,cellOffset:0},P=i.getBufferManager().getBuffer(S);s.addBuffer(P,["colorVI"]),y=!0}}y||s.removeBufferIfPresent("colorVI");var w=null;if(w=t.renderable.getInterpolateScalarsBeforeMapping()&&t.renderable.getColorCoordinates()?t.renderable.getColorCoordinates():n.getPointData().getTCoords()){var x={hash:l+w.getMTime(),dataArray:w,source:w,cells:r,primitiveType:a,representation:o,time:Math.max(w.getMTime(),r.getMTime()),usage:kd.PointArray,format:"float32x2"},O=i.getBufferManager().getBuffer(x);s.addBuffer(O,["tcoord"])}else s.removeBufferIfPresent("tcoord")},e.updateTextures=function(){var e=[],n=[],r=t.renderable.getColorTextureMap();r&&(t.colorTexture||(t.colorTexture=Bd.newInstance()),t.colorTexture.setInputData(r),n.push(t.colorTexture));for(var a=t.WebGPUActor.getRenderable().getTextures(),o=0;o=0;m--)e[m]||(t.textures.splice(m,1),t.textureViews.splice(m,1))},e.computePipelineHash=function(n,r){var a="pd";return n.hasAttribute("normalMC")&&(a+="n"),n.hasAttribute("colorVI")&&(a+="c"),n.hasAttribute("tcoord")&&(a+="t"),t.textures.length&&(a+="tx".concat(t.textures.length)),t.SSBO&&(a+="ssbo"),a+=e.getHashFromUsage(r),a+=t.renderEncoder.getPipelineHash()},e.buildPrimitives=function(){var n=t.currentInput,r=[n.getVerts(),n.getLines(),n.getPolys(),n.getStrips()],a=t.WebGPURenderWindow.getDevice();t.renderable.mapScalars(n,1),e.updateTextures();for(var o=Fd.Points;o<=Fd.Triangles;o++)if(r[o].getNumberOfValues()>0){var i=t.WebGPUActor.getRenderable().getProperty().getRepresentation(),s=e.getUsage(i,o),l=t.primitives[o];e.buildVertexInput(t.currentInput,r[o],o),l.setPipelineHash(e.computePipelineHash(l.getVertexInput(),s)),l.setTextureViews(t.textureViews),l.setWebGPURenderer(t.WebGPURenderer),l.setNumberOfInstances(1);var u=l.getVertexInput().getBuffer("vertexBC");l.setNumberOfVertices(u.getSizeInBytes()/u.getStrideInBytes()),l.setTopology(e.getTopologyFromUsage(s)),l.build(t.renderEncoder,a),l.registerToDraw()}},e.setShaderReplacement=function(e,n){for(var r=Fd.Start;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yd,n),ur.a.obj(e,t),t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,sampler:{}},t.bindGroupTime={},ur.a.obj(t.bindGroupTime,{mtime:0}),ur.a.get(e,t,["bindGroupTime","handle"]),ur.a.setGet(e,t,["bindGroupLayoutEntry","device","name"]),function(e,t){t.classHierarchy.push("vtkWebGPUSampler"),e.create=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.device=e,t.handle=t.device.getHandle().createSampler({magFilter:n.magFilter?n.magFilter:"nearest",minFilter:n.minFilter?n.minFilter:"nearest"}),t.bindGroupTime.modified()},e.getShaderCode=function(e,n){return"[[binding(".concat(e,"), group(").concat(n,")]] var ").concat(t.name,": sampler;")},e.getBindGroupEntry=function(){return{resource:t.handle}}}(e,t)}var Qd={newInstance:ur.a.newInstance(Zd),extend:Zd};var $d={texture:null,handle:null,name:null,sampler:null};function Jd(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,$d,n),ur.a.obj(e,t),t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,texture:{}},t.bindGroupTime={},ur.a.obj(t.bindGroupTime,{mtime:0}),ur.a.get(e,t,["bindGroupTime","name","texture"]),ur.a.setGet(e,t,["bindGroupLayoutEntry","sampler"]),function(e,t){t.classHierarchy.push("vtkWebGPUTextureView"),e.create=function(e,n){t.texture=e,t.options=n,t.textureHandle=e.getHandle(),t.handle=t.textureHandle.createView(t.options)},e.getBindGroupEntry=function(){return{resource:e.getHandle()}},e.getShaderCode=function(e,n){return"[[binding(".concat(e,"), group(").concat(n,")]] var ").concat(t.name,": texture_2d;")},e.addSampler=function(n,r){var a=Qd.newInstance();a.create(n,r),e.setSampler(a),t.sampler.setName("".concat(t.name,"Sampler"))},e.setName=function(n){t.sampler&&t.sampler.setName("".concat(n,"Sampler")),t.name!==n&&(t.name=n,e.modified())},e.getHandle=function(){return t.texture.getHandle()!==t.textureHandle&&(t.textureHandle=t.texture.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupTime.modified()),t.handle}}(e,t)}var ef={newInstance:ur.a.newInstance(Jd),extend:Jd},tf=cl.BufferUsage;var nf={device:null,handle:null,buffer:null,ready:!1};function rf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,nf,n),ur.a.obj(e,t),ur.a.get(e,t,["handle","ready","width","height","depth","format","usage"]),ur.a.setGet(e,t,["device"]),function(e,t){t.classHierarchy.push("vtkWebGPUTexture"),e.create=function(e,n){t.device=e,t.width=n.width,t.height=n.height,t.depth=n.depth?n.depth:1;var r=1===t.depth?"2d":"3d";t.format=n.format?n.format:"rgbaunorm",t.usage=n.usage?n.usage:GPUTextureUsage.SAMPLED|GPUTextureUsage.COPY_DST,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage,dimension:r})},e.assignFromHandle=function(e,n,r){t.device=e,t.handle=n,t.width=r.width,t.height=r.height,t.depth=r.depth?r.depth:1,t.format=r.format?r.format:"rgbaunorm",t.usage=r.usage?r.usage:GPUTextureUsage.SAMPLED|GPUTextureUsage.COPY_DST},e.writeImageData=function(e){var n=4*t.width;if(e.dataArray){var r={dataArray:e.dataArray,time:e.dataArray.getMTime(),usage:tf.Texture,format:"unorm8x4"};if(t.width%64){for(var a=e.dataArray.getData(),o=64*Math.floor((t.width+63)/64),i=new Uint8Array(o*t.height*4),s=0;s2&&void 0!==arguments[2]?arguments[2]:1;e===t.width&&n===t.height&&r===t.depth||(t.width=e,t.height=n,t.depth=r,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage}))},e.createView=function(t){var n=ef.newInstance();return n.create(e,t),n}}(e,t)}ur.a.newInstance(rf);var af={PassTypes:{MIN_KNOWN_PASS:0,ACTOR_PASS:0,COMPOSITE_INDEX_PASS:1,ID_LOW24:2,MAX_KNOWN_PASS:2}};function of(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function sf(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){of(o,r,a,i,s,"next",e)}function s(e){of(o,r,a,i,s,"throw",e)}i(void 0)})}}var lf={fieldAssociation:sc.FieldAssociations.FIELD_ASSOCIATION_CELLS,captureZValues:!1};function uf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,lf,n),ur.a.obj(e,t),ur.a.setGet(e,t,["fieldAssociation","captureZValues"]),function(e,t){t.classHierarchy.push("vtkHardwareSelector"),e.getSourceDataAsync=function(){var e=sf(regeneratorRuntime.mark(function e(t,n,r,a,o){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},e)}));return function(t,n,r,a,o){return e.apply(this,arguments)}}(),e.selectAsync=function(){var t=sf(regeneratorRuntime.mark(function t(n,r,a,o,i){var s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getSourceDataAsync(n,r,a,o,i);case 2:if(!(s=t.sent)){t.next=5;break}return t.abrupt("return",s.generateSelection(r,a,o,i));case 5:return t.abrupt("return",[]);case 6:case"end":return t.stop()}},t)}));return function(e,n,r,a,o){return t.apply(this,arguments)}}()}(e,t)}var cf={newInstance:ur.a.newInstance(uf,"vtkHardwareSelector"),extend:uf},df={SelectionContent:{GLOBALIDS:0,PEDIGREEIDS:1,VALUES:2,INDICES:3,FRUSTUM:4,LOCATIONS:5,THRESHOLDS:6,BLOCKS:7,QUERY:8},SelectionField:{CELL:0,POINT:1,FIELD:2,VERTEX:3,EDGE:4,ROW:5}};function ff(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gf={contentType:-1,fieldType:-1,properties:null,selectionList:[]};function mf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gf,n),ur.a.obj(e,t),t.properties={},ur.a.setGet(e,t,["contentType","fieldType","properties","selectionList"]),function(e,t){t.classHierarchy.push("vtkSelectionNode"),e.getBounds=function(){return t.points.getBounds()}}(e,t)}var vf=function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.area[2]||t[1]e.area[3])return null;var o=[t[0]-e.area[0],t[1]-e.area[1]],i=If(o[0],o[1],e.pixBuffer[Sf.ACTOR_PASS],e.area);if(i<=0)return null;var s={valid:!0};s.propID=i-Mf,s.prop=e.props[s.propID];var l=If(o[0],o[1],e.pixBuffer[Sf.COMPOSITE_INDEX_PASS],e.area);if((l<0||l>16777215)&&(l=0),s.compositeID=l-Mf,e.captureZValues){var u=4*(o[1]*(e.area[2]-e.area[0]+1)+o[0]);s.zValue=(256*e.zBuffer[u]+e.zBuffer[u+1])/65535,s.displayPosition=t}return s}var c=[t[0],t[1]],d=[0,0],f=Rf(e,t,0,r);if(f&&f.valid)return f;for(var p=1;pp?c[1]-p:0;g<=c[1]+p;++g){if(d[1]=g,c[0]>=p&&(d[0]=c[0]-p,(f=Rf(e,d,0,r))&&f.valid))return f;if(d[0]=c[0]+p,(f=Rf(e,d,0,r))&&f.valid)return f}for(var m=c[0]>=p?c[0]-(p-1):0;m<=c[0]+(p-1);++m){if(d[0]=m,c[1]>=p&&(d[1]=c[1]-p,(f=Rf(e,d,0,r))&&f.valid))return f;if(d[1]=c[1]+p,(f=Rf(e,d,0,r))&&f.valid)return f}}return r[0]=t[0],r[1]=t[1],null}function Ef(e,t,n,r,a){var o=[],i=0;return t.forEach(function(t,s){var l=vf.newInstance();switch(l.setContentType(Pf.INDICES),e){case xf.FIELD_ASSOCIATION_CELLS:l.setFieldType(wf.CELL);break;case xf.FIELD_ASSOCIATION_POINTS:l.setFieldType(wf.POINT);break;default:Of("Unknown field association")}l.getProperties().propID=t.info.propID,l.getProperties().prop=t.info.prop,l.getProperties().compositeID=t.info.compositeID,l.getProperties().pixelCount=t.pixelCount,n&&(l.getProperties().displayPosition=[t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue],l.getProperties().worldPosition=a.displayToWorld(t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue,r)),l.setSelectionList(t.attributeIDs),o[i]=l,i++}),o}function Df(e,t,n,r,a){for(var o=Math.floor(t),i=Math.floor(n),s=Math.floor(r),l=Math.floor(a),u=new Map,c=[0,0],d=i;d<=l;d++)for(var f=o;f<=s;f++){var p=Rf(e,[f,d],0,c);if(p&&p.valid){var g=Af(p);if(u.has(g)){var m=u.get(g);m.pixelCount++,e.captureZValues&&p.zValue0&&(--a in t.hitProps||(t.hitProps[a]=!0))}},e.renderProp=function(n){t.currentPass===Sf.ACTOR_PASS&&(e.setPropColorValueFromInt(t.props.length+Mf),t.props.push(n))},e.renderCompositeIndex=function(n){t.currentPass===Sf.COMPOSITE_INDEX_PASS&&e.setPropColorValueFromInt(n+Mf)},e.renderAttributeId=function(e){e<0||(t.maxAttributeId=e>t.maxAttributeId?e:t.maxAttributeId)},e.passTypeToString=function(e){return ur.a.enumToString(Sf,e)},e.isPropHit=function(e){return Boolean(t.hitProps[e])},e.setPropColorValueFromInt=function(e){t.propColorValue[0]=e%256/255,t.propColorValue[1]=Math.floor(e/256)%256/255,t.propColorValue[2]=Math.floor(e/65536)%256/255},e.getPixelInformation=function(n,r,a){var o=r<0?0:r;if(0===o){if(a[0]=n[0],a[1]=n[1],n[0]t.area[2]||n[1]t.area[3])return null;var i=[n[0]-t.area[0],n[1]-t.area[1]],s=If(i[0],i[1],t.pixBuffer[Sf.ACTOR_PASS],t.area);if(s<=0)return null;var l={valid:!0};l.propID=s-Mf,l.prop=t.props[l.propID];var u=If(i[0],i[1],t.pixBuffer[Sf.COMPOSITE_INDEX_PASS],t.area);if((u<0||u>16777215)&&(u=0),l.compositeID=u-Mf,t.captureZValues){var c=4*(i[1]*(t.area[2]-t.area[0]+1)+i[0]);l.zValue=(256*t.zBuffer[c]+t.zBuffer[c+1])/65535,l.displayPosition=n}return l}var d=[n[0],n[1]],f=[0,0],p=e.getPixelInformation(n,0,a);if(p&&p.valid)return p;for(var g=1;gg?d[1]-g:0;m<=d[1]+g;++m){if(f[1]=m,d[0]>=g&&(f[0]=d[0]-g,(p=e.getPixelInformation(f,0,a))&&p.valid))return p;if(f[0]=d[0]+g,(p=e.getPixelInformation(f,0,a))&&p.valid)return p}for(var v=d[0]>=g?d[0]-(g-1):0;v<=d[0]+(g-1);++v){if(f[0]=v,d[1]>=g&&(f[1]=d[1]-g,(p=e.getPixelInformation(f,0,a))&&p.valid))return p;if(f[1]=d[1]+g,(p=e.getPixelInformation(f,0,a))&&p.valid)return p}}return a[0]=n[0],a[1]=n[1],null},e.generateSelection=function(n,r,a,o){for(var i=Math.floor(n),s=Math.floor(r),l=Math.floor(a),u=Math.floor(o),c=new Map,d=[0,0],f=s;f<=u;f++)for(var p=i;p<=l;p++){var g=[p,f],m=e.getPixelInformation(g,0,d);if(m&&m.valid){var v=Af(m);if(c.has(v)){var h=c.get(v);h.pixelCount++,t.captureZValues&&m.zValue2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Lf,n),cf.extend(e,t,n),t.propColorValue=[0,0,0],t.props=[],t.area||(t.area=[0,0,0,0]),ur.a.setGetArray(e,t,["area"],4),ur.a.setGet(e,t,["renderer","currentPass","openGLRenderWindow"]),ur.a.setGetArray(e,t,["propColorValue"],3),ur.a.event(e,t,"event"),Vf(e,t)}var Bf=function(e){for(var t=1;t0){var o=e.Vertex;t.lastBoundBO.getCABO().getNormalOffset()&&(o=Uo.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","attribute mat3 gNormal;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=Uo.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * gNormal * normalMC;"]).result),e.Vertex=o}n.replaceShaderNormal(e,r,a)},e.replaceShaderColor=function(e,r,a){if(t.hardwareSupport&&t.renderable.getColorArray()){var o=e.Vertex,i=e.Geometry,s=e.Fragment,l=t.lastBoundBO.getReferenceByName("lastLightComplexity"),u=["uniform float ambient;","uniform float diffuse;","uniform float specular;","uniform float opacityUniform; // the fragment opacity"];l&&(u=u.concat(["uniform vec3 specularColorUniform;","uniform float specularPowerUniform;"]));var c=["vec3 ambientColor;"," vec3 diffuseColor;"," float opacity;"];l&&(c=c.concat([" vec3 specularColor;"," float specularPower;"])),c=c.concat([" opacity = opacityUniform;"]),l&&(c=c.concat([" specularColor = specularColorUniform;"," specularPower = specularPowerUniform;"])),t.drawingEdges||(u=u.concat(["varying vec4 vertexColorVSOutput;"]),o=Uo.substitute(o,"//VTK::Color::Dec",["attribute vec4 gColor;","varying vec4 vertexColorVSOutput;"]).result,o=Uo.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = gColor;"]).result,i=Uo.substitute(i,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,i=Uo.substitute(i,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result,c=c.concat([" diffuseColor = vertexColorVSOutput.rgb;"," ambientColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])),s=Uo.substitute(s,"//VTK::Color::Impl",c).result,s=Uo.substitute(s,"//VTK::Color::Dec",u).result,e.Vertex=o,e.Geometry=i,e.Fragment=s}n.replaceShaderColor(e,r,a)},e.replaceShaderPositionVC=function(e,r,a){if(t.hardwareSupport){var o=e.Vertex;t.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(o=Uo.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;","vertexVCVSOutput = MCVCMatrix * gVertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result,o=Uo.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result):(o=Uo.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;"]).result,o=Uo.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result),e.Vertex=o}n.replaceShaderPositionVC(e,r,a)},e.replaceShaderPicking=function(e,r,a){if(t.hardwareSupport){var o=e.Fragment,i=e.Vertex;i=Uo.substitute(i,"//VTK::Picking::Dec",["attribute vec3 mapperIndexVS;","varying vec3 mapperIndexVSOutput;"]).result,i=Uo.substitute(i,"//VTK::Picking::Impl"," mapperIndexVSOutput = mapperIndexVS;").result,e.Vertex=i,o=Uo.substitute(o,"//VTK::Picking::Dec",["varying vec3 mapperIndexVSOutput;","uniform vec3 mapperIndex;","uniform int picking;"]).result,o=Uo.substitute(o,"//VTK::Picking::Impl",[" vec4 pickColor = picking == 2 ? vec4(mapperIndexVSOutput,1.0) : vec4(mapperIndex,1.0);"," gl_FragData[0] = picking != 0 ? pickColor : gl_FragData[0];"]).result,e.Fragment=o}else n.replaceShaderPicking(e,r,a)},e.updateGlyphShaderParameters=function(n,r,a,o,i,s,l,u){var c=a.getProgram();if(n){var d=t.normalMatrix,f=s,p=9*l,g=t.tmpMat3,m=d[0],v=d[1],h=d[2],y=d[3],b=d[4],T=d[5],C=d[6],S=d[7],P=d[8],w=f[p],x=f[p+1],O=f[p+2],M=f[p+3],A=f[p+4],I=f[p+5],R=f[p+6],E=f[p+7],D=f[p+8];g[0]=w*m+x*y+O*C,g[1]=w*v+x*b+O*S,g[2]=w*h+x*T+O*P,g[3]=M*m+A*y+I*C,g[4]=M*v+A*b+I*S,g[5]=M*h+A*T+I*P,g[6]=R*m+E*y+D*C,g[7]=R*v+E*b+D*S,g[8]=R*h+E*T+D*P,c.setUniformMatrix3x3("normalMatrix",t.tmpMat3)}if(e.multiply4x4WithOffset(t.tmpMat4,t.mcpcMatrix,i,16*l),c.setUniformMatrix("MCPCMatrix",t.tmpMat4),r&&(e.multiply4x4WithOffset(t.tmpMat4,t.mcvcMatrix,i,16*l),c.setUniformMatrix("MCVCMatrix",t.tmpMat4)),o){var V=o.getData();t.tmpColor[0]=V[4*l]/255,t.tmpColor[1]=V[4*l+1]/255,t.tmpColor[2]=V[4*l+2]/255,c.setUniform3fArray("ambientColorUniform",t.tmpColor),c.setUniform3fArray("diffuseColorUniform",t.tmpColor)}u&&c.setUniform3fArray("mapperIndex",u.getPropColorValue())},e.renderPieceDraw=function(n,r){var i=r.getProperty().getRepresentation(),s=t.context,l=r.getProperty().getEdgeVisibility()&&i===_f.SURFACE,u=t.openGLCamera.getKeyMatrices(n),c=t.openGLActor.getKeyMatrices();a.multiply(t.normalMatrix,u.normalMatrix,c.normalMatrix),o.multiply(t.mcpcMatrix,u.wcpc,c.mcwc),o.multiply(t.mcvcMatrix,u.wcvc,c.mcwc);var d=t.renderable.getMatrixArray(),f=t.renderable.getNormalArray(),p=t.renderable.getColorArray(),g=d.length/16,m=!1;t.openGLRenderer.getSelector()&&t.openGLRenderer.getSelector().getCurrentPass()===jf.COMPOSITE_INDEX_PASS&&(m=!0);for(var v=t.primTypes.Start;ve.getAttributeUpdateTime().getMTime()||e.getShaderSourceTime().getMTime()>e.getAttributeUpdateTime().getMTime()))return e.getProgram().isAttributeUsed("gMatrix")?e.getVAO().addAttributeMatrixWithDivisor(e.getProgram(),t.matrixBuffer,"gMatrix",0,64,t.context.FLOAT,4,!1,1)||Gf("Error setting gMatrix in shader VAO."):e.getVAO().removeAttributeArray("gMatrix"),e.getProgram().isAttributeUsed("gNormal")?e.getVAO().addAttributeMatrixWithDivisor(e.getProgram(),t.normalBuffer,"gNormal",0,36,t.context.FLOAT,3,!1,1)||Gf("Error setting gNormal in shader VAO."):e.getVAO().removeAttributeArray("gNormal"),e.getProgram().isAttributeUsed("gColor")?e.getVAO().addAttributeArrayWithDivisor(e.getProgram(),t.colorBuffer,"gColor",0,4,t.context.UNSIGNED_BYTE,4,!0,1,!1)||Gf("Error setting gColor in shader VAO."):e.getVAO().removeAttributeArray("gColor"),e.getProgram().isAttributeUsed("mapperIndexVS")?e.getVAO().addAttributeArrayWithDivisor(e.getProgram(),t.pickBuffer,"mapperIndexVS",0,4,t.context.UNSIGNED_BYTE,4,!0,1,!1)||Gf("Error setting mapperIndexVS in shader VAO."):e.getVAO().removeAttributeArray("mapperIndexVS"),n.setMapperShaderParameters(e,r,a),void e.getAttributeUpdateTime().modified();n.setMapperShaderParameters(e,r,a)},e.getNeedToRebuildBufferObjects=function(e,r){return t.renderable.buildArrays(),t.VBOBuildTime.getMTime()t.glyphBOBuildTime.getMTime()){t.matrixBuffer.upload(a,Uf.ARRAY_BUFFER),t.normalBuffer.upload(o,Uf.ARRAY_BUFFER),i?t.colorBuffer.upload(i.getData(),Uf.ARRAY_BUFFER):t.colorBuffer.releaseGraphicsResources();for(var s=a.length/16,l=new Uint8Array(4*s),u=0;u2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Kf,n),Od.extend(e,t,n),t.tmpMat3=a.identity(new Float64Array(9)),t.normalMatrix=a.identity(new Float64Array(9)),t.mcpcMatrix=o.identity(new Float64Array(16)),t.mcvcMatrix=o.identity(new Float64Array(16)),t.tmpColor=[],t.glyphBOBuildTime={},ur.g(t.glyphBOBuildTime,{mtime:0}),Hf(e,t)}var qf=ur.d(Xf,"vtkOpenGLGlyph3DMapper");yr("vtkGlyph3DMapper",qf);var Yf=cl.BufferUsage,Zf=ur.a.vtkErrorMacro;var Qf={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,name:null,numberOfInstances:1};function $f(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qf,n),ur.a.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t._sendTime={},ur.a.obj(t._sendTime,{mtime:0}),t.bindGroupTime={},ur.a.obj(t.bindGroupTime,{mtime:0}),t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"read-only-storage"}},ur.a.get(e,t,["bindGroupTime"]),ur.a.setGet(e,t,["device","bindGroupLayoutEntry","name","numberOfInstances","sizeInBytes"]),function(e,t){t.classHierarchy.push("vtkWebGPUStorageBuffer"),e.addEntry=function(e,n){if(t._bufferEntryNames.has(e))Zf("entry named ".concat(e," already exists"));else{t._bufferEntryNames.set(e,t.bufferEntries.length);var r=Ts.getByteStrideFromShaderFormat(n);t.bufferEntries.push({name:e,type:n,sizeInBytes:r,offset:t.sizeInBytes,nativeType:Ts.getNativeTypeFromShaderFormat(n)}),t.sizeInBytes+=r}},e.send=function(e){if(!t._buffer){var n={nativeArray:t.Float32Array,time:0,usage:Yf.Storage};return t._buffer=e.getBufferManager().getBuffer(n),t.bindGroupTime.modified(),void t._sendTime.modified()}e.getHandle().queue.writeBuffer(t._buffer.getHandle(),0,t.arrayBuffer,0,t.sizeInBytes*t.numberOfInstances),t._sendTime.modified()},e.createView=function(e){e in t==0&&(t.arrayBuffer||(t.arrayBuffer=new ArrayBuffer(t.sizeInBytes*t.numberOfInstances)),t[e]=ur.a.newTypedArray(e,t.arrayBuffer))},e.setValue=function(n,r,a){var o=t._bufferEntryNames.get(n);if(void 0!==o){var i=t.bufferEntries[o];e.createView(i.nativeType);var s=t[i.nativeType];s[(i.offset+r*t.sizeInBytes)/s.BYTES_PER_ELEMENT]=a}else Zf("entry named ".concat(n," not found in UBO"))},e.setArray=function(n,r,a){var o=t._bufferEntryNames.get(n);if(void 0!==o){var i=t.bufferEntries[o];e.createView(i.nativeType);for(var s=t[i.nativeType],l=(i.offset+r*t.sizeInBytes)/s.BYTES_PER_ELEMENT,u=0;u;\n};\n[[binding(").concat(e,"), group(").concat(n,")]] var ").concat(t.name,": [[access(read)]] ").concat(t.name,"Struct;\n")),r.join("\n")},e.getBindGroupEntry=function(){return{resource:{buffer:t._buffer.getHandle()}}},e.clearData=function(){t.numberOfInstances=0,t.sizeInBytes=0,t.bufferEntries=[],t._bufferEntryNames=new Map,t._buffer=null,delete t.arrayBuffer,delete t.Float32Array}}(e,t)}var Jf={newInstance:ur.a.newInstance($f,"vtkWebGPUStorageBuffer"),extend:$f};function ep(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var np=cl.PrimitiveTypes;function rp(e,t){t.classHierarchy.push("vtkWebGPUGlyph3DMapper");var n=function(e){for(var t=1;t","[[builtin(position)]] Position");var a=r.getCode();a=ps.substitute(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix"," *glyphSSBO.values[input.instanceIndex].matrix"," *vertexBC;"]).result,r.setCode(a)},e.replaceShaderNormal=function(e,t,r){if(r.hasAttribute("normalMC")){var a=t.getShaderDescription("vertex"),o=a.getCode();o=ps.substitute(o,"//VTK::Normal::Impl",[" output.normalVC = normalize((rendererUBO.WCVCNormals"," * mapperUBO.MCWCNormals"," * glyphSSBO.values[input.instanceIndex].normal*normalMC).xyz);"]).result,a.setCode(o)}n.replaceShaderNormal(e,t,r)},e.replaceShaderColor=function(e,r,a){if(t.carray){var o=r.getShaderDescription("vertex");o.addOutput("vec4","color");var i=o.getCode();i=ps.substitute(i,"//VTK::Color::Impl",[" output.color = glyphSSBO.values[input.instanceIndex].color;"]).result,o.setCode(i);var s=r.getShaderDescription("fragment");i=s.getCode(),i=ps.substitute(i,"//VTK::Color::Impl",["ambientColor = input.color;","diffuseColor = input.color;","opacity = mapperUBO.Opacity * input.color.a;"]).result,s.setCode(i)}else n.replaceShaderColor(e,r,a)},e.replaceShaderSelect=function(e,t,n){if(e.includes("sel")){var r=t.getShaderDescription("vertex");r.addOutput("u32","compositeID");var a=r.getCode();a=ps.substitute(a,"//VTK::Select::Impl",[" output.compositeID = input.instanceIndex;"]).result,r.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=ps.substitute(a,"//VTK::Select::Impl",["var compositeID: u32 = input.compositeID;"]).result,o.setCode(a)}},e.buildPrimitives=function(){t.currentInput=t.renderable.getInputData(1),t.renderable.buildArrays();var e=t.renderable.getMatrixArray(),r=t.renderable.getNormalArray();t.carray=t.renderable.getColorArray();var a=e.length/16;if(t.renderable.getBuildTime().getMTime()>t.glyphBOBuildTime.getMTime()){var o=t.WebGPURenderWindow.getDevice();t.SSBO.clearData(),t.SSBO.setNumberOfInstances(a),t.SSBO.addEntry("matrix","mat4x4"),t.SSBO.addEntry("normal","mat4x4"),t.carray&&t.SSBO.addEntry("color","vec4"),t.SSBO.setAllInstancesFromArray("matrix",e),t.SSBO.setAllInstancesFromArray3x3To4x4("normal",r),t.carray&&t.SSBO.setAllInstancesFromArrayColorToFloat("color",t.carray.getData()),t.SSBO.send(o),t.glyphBOBuildTime.modified()}n.buildPrimitives();for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ap,n),qd.extend(e,t,n),t.glyphBOBuildTime={},ur.g(t.glyphBOBuildTime,{mtime:0}),t.SSBO=Jf.newInstance(),t.SSBO.setName("glyphSSBO"),rp(e,t);for(var r=np.Start;r1&&void 0!==arguments[1]?arguments[1]:{};return lp[e]&&lp[e](t)}var dp={defaultViewAPI:sp,renderers:[],views:[],interactor:null,neverRendered:!0,numberOfLayers:1};function fp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dp,n),ur.a.obj(e,t),ur.a.setGet(e,t,["interactor","numberOfLayers","views","defaultViewAPI"]),ur.a.get(e,t,["neverRendered"]),ur.a.getArray(e,t,["renderers"]),ur.a.event(e,t,"completion"),function(e,t){t.classHierarchy.push("vtkRenderWindow"),e.addRenderer=function(n){e.hasRenderer(n)||(n.setRenderWindow(e),t.renderers.push(n),e.modified())},e.removeRenderer=function(n){t.renderers=t.renderers.filter(function(e){return e!==n}),e.modified()},e.hasRenderer=function(e){return-1!==t.renderers.indexOf(e)},e.newAPISpecificView=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return cp(e||t.defaultViewAPI,n)},e.addView=function(n){e.hasView(n)||(n.setRenderable(e),t.views.push(n),e.modified())},e.removeView=function(n){t.views=t.views.filter(function(e){return e!==n}),e.modified()},e.hasView=function(e){return-1!==t.views.indexOf(e)},e.render=function(){t.interactor?t.interactor.render():t.views.forEach(function(e){return e.traverseAllPasses()})},e.getStatistics=function(){var e={propCount:0,invisiblePropCount:0};return t.renderers.forEach(function(t){t.getViewProps().forEach(function(t){if(t.getVisibility()){e.propCount+=1;var n=t.getMapper&&t.getMapper();if(n&&n.getPrimitiveCount){var r=n.getPrimitiveCount();Object.keys(r).forEach(function(t){e[t]||(e[t]=0),e[t]+=r[t]})}}else e.invisiblePropCount+=1})}),e.str=Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t])}).join("\n"),e},e.captureImages=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ur.a.setImmediate(e.render),t.views.map(function(e){return e.captureNextImage?e.captureNextImage(n,r):void 0}).filter(function(e){return!!e})}}(e,t)}var pp={newInstance:ur.a.newInstance(fp,"vtkRenderWindow"),extend:fp,registerViewConstructor:up,listViewAPIs:function(){return Object.keys(lp)},newAPISpecificView:cp};var gp={delegates:[],currentOperation:null,preDelegateOperations:[],postDelegateOperations:[],currentParent:null};function mp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gp,n),ur.a.obj(e,t),ur.a.get(e,t,["currentOperation"]),ur.a.setGet(e,t,["delegates","currentParent","preDelegateOperations","postDelegateOperations"]),function(e,t){t.classHierarchy.push("vtkRenderPass"),e.getOperation=function(){return t.currentOperation},e.setCurrentOperation=function(e){t.currentOperation=e,t.currentTraverseOperation="traverse".concat(ur.a.capitalize(t.currentOperation))},e.getTraverseOperation=function(){return t.currentTraverseOperation},e.traverse=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t.deleted||(t.currentParent=r,t.preDelegateOperations.forEach(function(t){e.setCurrentOperation(t),n.traverse(e)}),t.delegates.forEach(function(t){t.traverse(n,e)}),t.postDelegateOperations.forEach(function(t){e.setCurrentOperation(t),n.traverse(e)}))}}(e,t)}var vp={newInstance:ur.a.newInstance(mp,"vtkRenderPass"),extend:mp};var hp={opaqueActorCount:0,translucentActorCount:0,volumeCount:0,framebuffer:null,depthRequested:!1};function yp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hp,n),vp.extend(e,t,n),ur.a.get(e,t,["framebuffer"]),function(e,t){t.classHierarchy.push("vtkForwardPass"),e.traverse=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t.deleted){t.currentParent=r,e.setCurrentOperation("buildPass"),n.traverse(e);for(var a=n.getRenderable().getNumberOfLayers(),o=n.getChildren(),i=0;i0&&t.volumeCount>0||t.depthRequested){var c=n.getFramebufferSize();null===t.framebuffer&&(t.framebuffer=Ii.newInstance()),t.framebuffer.setOpenGLRenderWindow(n),t.framebuffer.saveCurrentBindingsAndBuffers();var d=t.framebuffer.getSize();null!==d&&d[0]===c[0]&&d[1]===c[1]||(t.framebuffer.create(c[0],c[1]),t.framebuffer.populateFramebuffer()),t.framebuffer.bind(),e.setCurrentOperation("opaqueZBufferPass"),l.traverse(e),t.framebuffer.restorePreviousBindingsAndBuffers(),t.depthRequested=!1}e.setCurrentOperation("cameraPass"),l.traverse(e),t.opaqueActorCount>0&&(e.setCurrentOperation("opaquePass"),l.traverse(e)),t.translucentActorCount>0&&(e.setCurrentOperation("translucentPass"),l.traverse(e)),t.volumeCount>0&&(e.setCurrentOperation("volumePass"),l.traverse(e))}}}},e.getZBufferTexture=function(){return t.framebuffer?t.framebuffer.getColorTexture():null},e.requestDepth=function(){t.depthRequested=!0},e.incrementOpaqueActorCount=function(){return t.opaqueActorCount++},e.incrementTranslucentActorCount=function(){return t.translucentActorCount++},e.incrementVolumeCount=function(){return t.volumeCount++}}(e,t)}var bp={newInstance:ur.a.newInstance(yp,"vtkForwardPass"),extend:yp},Tp=n(11),Cp=n.n(Tp),Sp=["lastShaderBound","context","openGLRenderWindow"];var Pp={lastShaderBound:null,shaderPrograms:null,context:null,openGLRenderWindow:null};function wp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Pp,n),t.shaderPrograms={},ur.a.obj(e,t),ur.a.setGet(e,t,Sp),function(e,t){t.classHierarchy.push("vtkShaderCache"),e.replaceShaderValues=function(e,n,r){var a=n;r.length>0&&(a=Uo.substitute(a,"VSOut","GSOut").result);var o=t.openGLRenderWindow.getWebgl2(),i="\n",s="#version 100\n";o?s="#version 300 es\n#define attribute in\n#define textureCube texture\n#define texture2D texture\n#define textureCubeLod textureLod\n#define texture2DLod textureLod\n":(t.context.getExtension("OES_standard_derivatives"),t.context.getExtension("EXT_frag_depth")&&(i="#extension GL_EXT_frag_depth : enable\n"),t.context.getExtension("EXT_shader_texture_lod")&&(i+="#extension GL_EXT_shader_texture_lod : enable\n#define textureCubeLod textureCubeLodEXT\n#define texture2DLod texture2DLodEXT")),a=Uo.substitute(a,"//VTK::System::Dec",["".concat(s,"\n"),o?"":"#extension GL_OES_standard_derivatives : enable\n",i,"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;var l=Uo.substitute(e,"//VTK::System::Dec",["".concat(s,"\n"),"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;return o&&(l=Uo.substitute(l,"varying","out").result,a=Uo.substitute(a,"varying","in").result,a=Uo.substitute(a,"gl_FragData\\[0\\]","fragOutput0").result,a=Uo.substitute(a,"//VTK::Output::Dec","layout(location = 0) out vec4 fragOutput0;").result),{VSSource:l,FSSource:a,GSSource:Uo.substitute(r,"//VTK::System::Dec",s).result}},e.readyShaderProgramArray=function(t,n,r){var a=e.replaceShaderValues(t,n,r),o=e.getShaderProgram(a.VSSource,a.FSSource,a.GSSource);return e.readyShaderProgram(o)},e.readyShaderProgram=function(t){return t&&(t.getCompiled()||t.compileShader())&&e.bindShader(t)?t:null},e.getShaderProgram=function(e,n,r){var a="".concat(e).concat(n).concat(r),o=Cp()(a);if(-1===Object.keys(t.shaderPrograms).indexOf(o)){var i=Uo.newInstance();return i.setContext(t.context),i.getVertexShader().setSource(e),i.getFragmentShader().setSource(n),r&&i.getGeometryShader().setSource(r),i.setMd5Hash(o),t.shaderPrograms[o]=i,i}return t.shaderPrograms[o]},e.releaseGraphicsResources=function(n){e.releaseCurrentShader(),Object.keys(t.shaderPrograms).map(function(e){return t.shaderPrograms[e]}).forEach(function(e){return e.releaseGraphicsResources(n)})},e.releaseGraphicsResources=function(){t.astShaderBound&&(t.lastShaderBound.release(),t.lastShaderBound=null)},e.bindShader=function(e){return t.lastShaderBound===e?1:(t.lastShaderBound&&t.lastShaderBound.release(),e.bind(),t.lastShaderBound=e,1)}}(e,t)}var xp={newInstance:ur.a.newInstance(wp,"vtkShaderCache"),extend:wp};var Op={size:void 0,selector:void 0};function Mp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Op,n),t.size||(t.size=[300,300]),ur.a.getArray(e,t,["size"],2),ur.a.get(e,t,["selector"]),pr.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkRenderWindowViewNode"),e.getViewNodeFactory=function(){return null},e.getAspectRatio=function(){return t.size[0]/t.size[1]},e.getAspectRatioForRenderer=function(e){var n=e.getViewportByReference();return t.size[0]*(n[2]-n[0])/((n[3]-n[1])*t.size[1])},e.isInViewport=function(t,n,r){var a=r.getViewportByReference(),o=e.getFramebufferSize();return a[0]*o[0]<=t&&a[2]*o[0]>=t&&a[1]*o[1]<=n&&a[3]*o[1]>=n},e.getViewportSize=function(t){var n=t.getViewportByReference(),r=e.getFramebufferSize();return[(n[2]-n[0])*r[0],(n[3]-n[1])*r[1]]},e.getViewportCenter=function(t){var n=e.getViewportSize(t);return[.5*n[0],.5*n[1]]},e.displayToNormalizedDisplay=function(t,n,r){var a=e.getFramebufferSize();return[t/a[0],n/a[1],r]},e.normalizedDisplayToDisplay=function(t,n,r){var a=e.getFramebufferSize();return[t*a[0],n*a[1],r]},e.worldToView=function(e,t,n,r){return r.worldToView(e,t,n)},e.viewToWorld=function(e,t,n,r){return r.viewToWorld(e,t,n)},e.worldToDisplay=function(t,n,r,a){var o=a.worldToView(t,n,r),i=e.getViewportSize(a),s=a.viewToProjection(o[0],o[1],o[2],i[0]/i[1]),l=a.projectionToNormalizedDisplay(s[0],s[1],s[2]);return e.normalizedDisplayToDisplay(l[0],l[1],l[2])},e.displayToWorld=function(t,n,r,a){var o=e.displayToNormalizedDisplay(t,n,r),i=a.normalizedDisplayToProjection(o[0],o[1],o[2]),s=e.getViewportSize(a),l=a.projectionToView(i[0],i[1],i[2],s[0]/s[1]);return a.viewToWorld(l[0],l[1],l[2])},e.normalizedDisplayToViewport=function(t,n,r,a){var o=a.getViewportByReference();o=e.normalizedDisplayToDisplay(o[0],o[1],0);var i=e.normalizedDisplayToDisplay(t,n,r);return[i[0]-o[0]-.5,i[1]-o[1]-.5,r]},e.viewportToNormalizedViewport=function(t,n,r,a){var o=e.getViewportSize(a);return o&&0!==o[0]&&0!==o[1]?[t/(o[0]-1),n/(o[1]-1),r]:[t,n,r]},e.normalizedViewportToViewport=function(t,n,r){var a=e.getFramebufferSize();return[t*(a[0]-1),n*(a[1]-1),r]},e.displayToLocalDisplay=function(t,n,r){return[t,e.getFramebufferSize()[1]-n-1,r]},e.viewportToNormalizedDisplay=function(t,n,r,a){var o=a.getViewportByReference(),i=t+(o=e.normalizedDisplayToDisplay(o[0],o[1],0))[0]+.5,s=n+o[1]+.5;return e.displayToNormalizedDisplay(i,s,r)},e.getPixelData=function(e,t,n,r){ur.a.vtkErrorMacro("not implemented")}}(e,t)}var Ap={newInstance:ur.a.newInstance(Mp,"vtkRenderWindowViewNode"),extend:Mp},Ip=ur.a.vtkErrorMacro;var Rp={context:null,numberOfTextureUnits:0,textureUnits:0};function Ep(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Rp,n),ur.a.obj(e,t),t.textureUnits=[],ur.a.get(e,t,["numberOfTextureUnits"]),ur.a.setGet(e,t,["context"]),function(e,t){t.classHierarchy.push("vtkOpenGLTextureUnitManager"),e.deleteTable=function(){for(var e=0;ee.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{preserveDrawingBuffer:!1,depth:!0,alpha:!0},r=null,a="undefined"!=typeof WebGL2RenderingContext;return t.webgl2=!1,t.defaultToWebgl2&&a&&(r=t.canvas.getContext("webgl2",n))&&(t.webgl2=!0,kp("using webgl2")),r||(kp("using webgl1"),r=t.canvas.getContext("webgl",n)||t.canvas.getContext("experimental-webgl",n)),navigator.getVRDisplays&&navigator.getVRDisplays().then(function(n){n.length>0&&(t.vrDisplay=n[0],t.vrDisplay.depthNear=.01,t.vrDisplay.depthFar=100,e.invokeHaveVRDisplay())}),t.canvas.addEventListener("webglcontextlost",function(e){e.preventDefault()},!1),t.canvas.addEventListener("webglcontextrestored",e.restoreContext,!1),r},e.startVR=function(){t.oldCanvasSize=t.size.slice(),t.vrDisplay.capabilities.canPresent?t.vrDisplay.requestPresent([{source:t.canvas}]).then(function(){if(t.el&&t.vrDisplay.capabilities.hasExternalDisplay&&t.hideCanvasInVR&&(t.el.style.display="none"),t.queryVRSize){var n=t.vrDisplay.getEyeParameters("left"),r=t.vrDisplay.getEyeParameters("right"),a=Math.floor(n.renderWidth+r.renderWidth),o=Math.floor(Math.max(n.renderHeight,r.renderHeight));e.setSize(a,o)}else e.setSize(t.vrResolution);t.renderable.getRenderers()[0].resetCamera(),t.vrFrameData=new VRFrameData,t.renderable.getInteractor().switchToVRAnimation(),t.vrSceneFrame=t.vrDisplay.requestAnimationFrame(e.vrRender),Gp&&(t.vrSceneFrame=t.vrDisplay.requestAnimationFrame(e.vrRender))}).catch(function(){console.error("failed to requestPresent")}):Fp("vrDisplay is not connected")},e.stopVR=function(){t.renderable.getInteractor().returnFromVRAnimation(),t.vrDisplay.exitPresent(),t.vrDisplay.cancelAnimationFrame(t.vrSceneFrame),e.setSize.apply(e,Lp(t.oldCanvasSize)),t.el&&t.vrDisplay.capabilities.hasExternalDisplay&&(t.el.style.display="block");var n=t.renderable.getRenderers()[0];n.getActiveCamera().setProjectionMatrix(null),n.setViewport(0,0,1,1),e.traverseAllPasses()},e.vrRender=function(){if(t.vrDisplay.isPresenting){t.renderable.getInteractor().updateGamepads(t.vrDisplay.displayId),t.vrSceneFrame=t.vrDisplay.requestAnimationFrame(e.vrRender),t.vrDisplay.getFrameData(t.vrFrameData);var n=t.renderable.getRenderers()[0];n.setViewport(0,0,.5,1),n.getActiveCamera().computeViewParametersFromPhysicalMatrix(t.vrFrameData.leftViewMatrix),n.getActiveCamera().setProjectionMatrix(t.vrFrameData.leftProjectionMatrix),e.traverseAllPasses(),n.setViewport(.5,0,1,1),n.getActiveCamera().computeViewParametersFromPhysicalMatrix(t.vrFrameData.rightViewMatrix),n.getActiveCamera().setProjectionMatrix(t.vrFrameData.rightProjectionMatrix),e.traverseAllPasses(),t.vrDisplay.submitFrame()}},e.restoreContext=function(){var t=vp.newInstance();t.setCurrentOperation("Release"),t.traverse(e,null)},e.activateTexture=function(n){var r=t._textureResourceIds.get(n);if(void 0===r){var a=e.getTextureUnitManager().allocate();a<0?Fp("Hardware does not support the number of textures defined."):(t._textureResourceIds.set(n,a),t.context.activeTexture(t.context.TEXTURE0+a))}else t.context.activeTexture(t.context.TEXTURE0+r)},e.deactivateTexture=function(n){var r=t._textureResourceIds.get(n);void 0!==r&&(e.getTextureUnitManager().free(r),t._textureResourceIds.delete(n))},e.getTextureUnitForTexture=function(e){var n=t._textureResourceIds.get(e);return void 0!==n?n:-1},e.getDefaultTextureInternalFormat=function(e,n,r){if(t.webgl2)switch(e){case to.UNSIGNED_CHAR:switch(n){case 1:return t.context.R8;case 2:return t.context.RG8;case 3:return t.context.RGB8;case 4:default:return t.context.RGBA8}default:case to.FLOAT:switch(n){case 1:return t.context.R16F;case 2:return t.context.RG16F;case 3:return t.context.RGB16F;case 4:default:return t.context.RGBA16F}}switch(n){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:return t.context.RGB;case 4:default:return t.context.RGBA}},e.setBackgroundImage=function(e){t.bgImage.src=e.src},e.setUseBackgroundImage=function(e){t.useBackgroundImage=e,t.useBackgroundImage&&!t.el.contains(t.bgImage)?t.el.appendChild(t.bgImage):!t.useBackgroundImage&&t.el.contains(t.bgImage)&&t.el.removeChild(t.bgImage)},e.captureNextImage=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.resetCamera,o=void 0!==a&&a,i=r.size,s=void 0===i?null:i,l=r.scale,u=void 0===l?1:l;if(t.deleted)return null;t.imageFormat=n;var c=t.notifyStartCaptureImage;return t.notifyStartCaptureImage=!0,t._screenshot={size:s||1!==u?s||t.size.map(function(e){return e*u}):null},new Promise(function(n,r){var a=e.onImageReady(function(r){if(null===t._screenshot.size)t.notifyStartCaptureImage=c,a.unsubscribe(),t._screenshot.placeHolder&&(t.size=t._screenshot.originalSize,e.modified(),t._screenshot.cameras&&t._screenshot.cameras.forEach(function(e){return(0,e.restoreParamsFn)(e.arg)}),e.traverseAllPasses(),t.el.removeChild(t._screenshot.placeHolder),t._screenshot.placeHolder.remove(),t._screenshot=null),n(r);else{var i=document.createElement("img");i.style=_p,i.src=r,t._screenshot.placeHolder=t.el.appendChild(i),t.canvas.style.display="none",t._screenshot.originalSize=t.size,t.size=t._screenshot.size,t._screenshot.size=null,e.modified(),o&&(t._screenshot.cameras=t.renderable.getRenderers().map(function(e){var t=e.getActiveCamera(),n=t.get("focalPoint","position","parallelScale");return{resetCameraFn:e.resetCamera,restoreParamsFn:t.set,arg:JSON.parse(JSON.stringify(n))}}),t._screenshot.cameras.forEach(function(e){return(0,e.resetCameraFn)()})),e.traverseAllPasses()}})})},e.getGLInformations=function(){for(var n=e.get3DContext(),r=n.getExtension("OES_texture_float"),a=n.getExtension("OES_texture_half_float"),o=n.getExtension("WEBGL_debug_renderer_info"),i=n.getExtension("WEBGL_draw_buffers"),s=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),l=[["Max Vertex Attributes","MAX_VERTEX_ATTRIBS",n.getParameter(n.MAX_VERTEX_ATTRIBS)],["Max Varying Vectors","MAX_VARYING_VECTORS",n.getParameter(n.MAX_VARYING_VECTORS)],["Max Vertex Uniform Vectors","MAX_VERTEX_UNIFORM_VECTORS",n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS)],["Max Fragment Uniform Vectors","MAX_FRAGMENT_UNIFORM_VECTORS",n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS)],["Max Fragment Texture Image Units","MAX_TEXTURE_IMAGE_UNITS",n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)],["Max Vertex Texture Image Units","MAX_VERTEX_TEXTURE_IMAGE_UNITS",n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS)],["Max Combined Texture Image Units","MAX_COMBINED_TEXTURE_IMAGE_UNITS",n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS)],["Max 2D Texture Size","MAX_TEXTURE_SIZE",n.getParameter(n.MAX_TEXTURE_SIZE)],["Max Cube Texture Size","MAX_CUBE_MAP_TEXTURE_SIZE",n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE)],["Max Texture Anisotropy","MAX_TEXTURE_MAX_ANISOTROPY_EXT",s&&n.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT)],["Point Size Range","ALIASED_POINT_SIZE_RANGE",n.getParameter(n.ALIASED_POINT_SIZE_RANGE).join(" - ")],["Line Width Range","ALIASED_LINE_WIDTH_RANGE",n.getParameter(n.ALIASED_LINE_WIDTH_RANGE).join(" - ")],["Max Viewport Dimensions","MAX_VIEWPORT_DIMS",n.getParameter(n.MAX_VIEWPORT_DIMS).join(" - ")],["Max Renderbuffer Size","MAX_RENDERBUFFER_SIZE",n.getParameter(n.MAX_RENDERBUFFER_SIZE)],["Framebuffer Red Bits","RED_BITS",n.getParameter(n.RED_BITS)],["Framebuffer Green Bits","GREEN_BITS",n.getParameter(n.GREEN_BITS)],["Framebuffer Blue Bits","BLUE_BITS",n.getParameter(n.BLUE_BITS)],["Framebuffer Alpha Bits","ALPHA_BITS",n.getParameter(n.ALPHA_BITS)],["Framebuffer Depth Bits","DEPTH_BITS",n.getParameter(n.DEPTH_BITS)],["Framebuffer Stencil Bits","STENCIL_BITS",n.getParameter(n.STENCIL_BITS)],["Framebuffer Subpixel Bits","SUBPIXEL_BITS",n.getParameter(n.SUBPIXEL_BITS)],["MSAA Samples","SAMPLES",n.getParameter(n.SAMPLES)],["MSAA Sample Buffers","SAMPLE_BUFFERS",n.getParameter(n.SAMPLE_BUFFERS)],["Supported Formats for UByte Render Targets ","UNSIGNED_BYTE RENDER TARGET FORMATS",[r&&Up(n,n.RGBA,n.UNSIGNED_BYTE)?"RGBA":"",r&&Up(n,n.RGB,n.UNSIGNED_BYTE)?"RGB":"",r&&Up(n,n.LUMINANCE,n.UNSIGNED_BYTE)?"LUMINANCE":"",r&&Up(n,n.ALPHA,n.UNSIGNED_BYTE)?"ALPHA":"",r&&Up(n,n.LUMINANCE_ALPHA,n.UNSIGNED_BYTE)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Half Float Render Targets","HALF FLOAT RENDER TARGET FORMATS",[a&&Up(n,n.RGBA,a.HALF_FLOAT_OES)?"RGBA":"",a&&Up(n,n.RGB,a.HALF_FLOAT_OES)?"RGB":"",a&&Up(n,n.LUMINANCE,a.HALF_FLOAT_OES)?"LUMINANCE":"",a&&Up(n,n.ALPHA,a.HALF_FLOAT_OES)?"ALPHA":"",a&&Up(n,n.LUMINANCE_ALPHA,a.HALF_FLOAT_OES)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Full Float Render Targets","FLOAT RENDER TARGET FORMATS",[r&&Up(n,n.RGBA,n.FLOAT)?"RGBA":"",r&&Up(n,n.RGB,n.FLOAT)?"RGB":"",r&&Up(n,n.LUMINANCE,n.FLOAT)?"LUMINANCE":"",r&&Up(n,n.ALPHA,n.FLOAT)?"ALPHA":"",r&&Up(n,n.LUMINANCE_ALPHA,n.FLOAT)?"LUMINANCE_ALPHA":""].join(" ")],["Max Multiple Render Targets Buffers","MAX_DRAW_BUFFERS_WEBGL",i?n.getParameter(i.MAX_DRAW_BUFFERS_WEBGL):0],["High Float Precision in Vertex Shader","HIGH_FLOAT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Vertex Shader","MEDIUM_FLOAT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Vertex Shader","LOW_FLOAT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).rangeMax,")"].join("")],["High Float Precision in Fragment Shader","HIGH_FLOAT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Fragment Shader","MEDIUM_FLOAT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Fragment Shader","LOW_FLOAT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).rangeMax,")"].join("")],["High Int Precision in Vertex Shader","HIGH_INT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Vertex Shader","MEDIUM_INT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Vertex Shader","LOW_INT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).rangeMax,")"].join("")],["High Int Precision in Fragment Shader","HIGH_INT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Fragment Shader","MEDIUM_INT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Fragment Shader","LOW_INT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).rangeMax,")"].join("")],["Supported Extensions","EXTENSIONS",n.getSupportedExtensions().join("
\t\t\t\t\t ")],["WebGL Renderer","RENDERER",n.getParameter(n.RENDERER)],["WebGL Vendor","VENDOR",n.getParameter(n.VENDOR)],["WebGL Version","VERSION",n.getParameter(n.VERSION)],["Shading Language Version","SHADING_LANGUAGE_VERSION",n.getParameter(n.SHADING_LANGUAGE_VERSION)],["Unmasked Renderer","UNMASKED_RENDERER",o&&n.getParameter(o.UNMASKED_RENDERER_WEBGL)],["Unmasked Vendor","UNMASKED_VENDOR",o&&n.getParameter(o.UNMASKED_VENDOR_WEBGL)],["WebGL Version","WEBGL_VERSION",t.webgl2?2:1]],u={};l.length;){var c=Vp(l.pop(),3),d=c[0],f=c[1],p=c[2];f&&(u[f]={label:d,value:p})}return u},e.traverseAllPasses=function(){if(t.renderPasses)for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:t.imageFormat,r=document.createElement("canvas"),a=r.getContext("2d");r.width=t.canvas.width,r.height=t.canvas.height,a.drawImage(t.canvas,0,0);var o=t.canvas.getBoundingClientRect();t.renderable.getRenderers().forEach(function(e){e.getViewProps().forEach(function(e){if(e.getContainer)for(var t=e.getContainer().getElementsByTagName("canvas"),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Kp,n),Ap.extend(e,t,n),t.canvas=document.createElement("canvas"),t.canvas.style.width="100%",jp++,Wp.forEach(function(e){return e(jp)}),t.selector||(t.selector=Bf.newInstance(),t.selector.setOpenGLRenderWindow(e)),t.bgImage=new Image,t.bgImage.style.position="absolute",t.bgImage.style.left="0",t.bgImage.style.top="0",t.bgImage.style.width="100%",t.bgImage.style.height="100%",t.bgImage.style.zIndex="-1",t._textureResourceIds=new Map,t.myFactory=Cr.newInstance(),t.myFactory.registerOverride("vtkRenderWindow",qp),t.shaderCache=xp.newInstance(),t.shaderCache.setOpenGLRenderWindow(e),t.renderPasses[0]=bp.newInstance(),ur.a.event(e,t,"imageReady"),ur.a.event(e,t,"haveVRDisplay"),ur.a.get(e,t,["shaderCache","textureUnitManager","webgl2","vrDisplay","useBackgroundImage"]),ur.a.setGet(e,t,["initialized","context","canvas","renderPasses","notifyStartCaptureImage","defaultToWebgl2","cursor","queryVRSize","hideCanvasInVR","useOffScreen","activeFramebuffer"]),ur.a.setGetArray(e,t,["size","vrResolution"],2),Hp(e,t)}var qp=ur.a.newInstance(Xp,"vtkOpenGLRenderWindow");up("WebGL",qp);var Yp={newInstance:qp,extend:Xp,pushMonitorGLContextCount:function(e){Wp.push(e)},popMonitorGLContextCount:function(e){return Wp.pop()}};function Zp(e){return function(e){if(Array.isArray(e))return Qp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Qp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qp(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jp,n),ur.a.obj(e,t),ur.a.get(e,t,["distance"]),ur.a.setGet(e,t,["parallelProjection","useHorizontalViewAngle","viewAngle","parallelScale","useOffAxisProjection","freezeFocalPoint","physicalScale"]),ur.a.getArray(e,t,["directionOfProjection","viewPlaneNormal","position","focalPoint"]),ur.a.setGetArray(e,t,["clippingRange","windowCenter"],2),ur.a.setGetArray(e,t,["viewUp","screenBottomLeft","screenBottomRight","screenTopRight","physicalTranslation","physicalViewUp","physicalViewNorth"],3),function(e,t){t.classHierarchy.push("vtkCamera");var n=new Float64Array(3),r=new Float64Array([0,0,-1]),a=new Float64Array([0,1,0]),u=o.identity(new Float64Array(16)),c=new Float64Array(3),d=new Float64Array(3),f=new Float64Array(3),p=o.identity(new Float64Array(16)),g=o.identity(new Float64Array(16)),m=new Float64Array(3),v=new Float64Array(3);function h(){t.viewPlaneNormal[0]=-t.directionOfProjection[0],t.viewPlaneNormal[1]=-t.directionOfProjection[1],t.viewPlaneNormal[2]=-t.directionOfProjection[2]}e.orthogonalizeViewUp=function(){var n=e.getViewMatrix();t.viewUp[0]=n[4],t.viewUp[1]=n[5],t.viewUp[2]=n[6],e.modified()},e.setPosition=function(n,r,a){n===t.position[0]&&r===t.position[1]&&a===t.position[2]||(t.position[0]=n,t.position[1]=r,t.position[2]=a,e.computeDistance(),e.modified())},e.setFocalPoint=function(n,r,a){n===t.focalPoint[0]&&r===t.focalPoint[1]&&a===t.focalPoint[2]||(t.focalPoint[0]=n,t.focalPoint[1]=r,t.focalPoint[2]=a,e.computeDistance(),e.modified())},e.setDistance=function(n){if(t.distance!==n){t.distance=n,t.distance<1e-20&&(t.distance=1e-20,$p("Distance is set to minimum."));var r=t.directionOfProjection;t.focalPoint[0]=t.position[0]+r[0]*t.distance,t.focalPoint[1]=t.position[1]+r[1]*t.distance,t.focalPoint[2]=t.position[2]+r[2]*t.distance,e.modified()}},e.computeDistance=function(){var e=t.focalPoint[0]-t.position[0],n=t.focalPoint[1]-t.position[1],r=t.focalPoint[2]-t.position[2];if(t.distance=Math.sqrt(e*e+n*n+r*r),t.distance<1e-20){t.distance=1e-20,$p("Distance is set to minimum.");var a=t.directionOfProjection;t.focalPoint[0]=t.position[0]+a[0]*t.distance,t.focalPoint[1]=t.position[1]+a[1]*t.distance,t.focalPoint[2]=t.position[2]+a[2]*t.distance}t.directionOfProjection[0]=e/t.distance,t.directionOfProjection[1]=n/t.distance,t.directionOfProjection[2]=r/t.distance,h()},e.dolly=function(n){if(!(n<=0)){var r=t.distance/n;e.setPosition(t.focalPoint[0]-r*t.directionOfProjection[0],t.focalPoint[1]-r*t.directionOfProjection[1],t.focalPoint[2]-r*t.directionOfProjection[2])}},e.roll=function(n){var r=t.position,a=t.focalPoint,i=t.viewUp,l=new Float64Array([i[0],i[1],i[2],0]);o.identity(p);var u=new Float64Array([a[0]-r[0],a[1]-r[1],a[2]-r[2]]);o.rotate(p,p,kr(n),u),s.transformMat4(l,l,p),t.viewUp[0]=l[0],t.viewUp[1]=l[1],t.viewUp[2]=l[2],e.modified()},e.azimuth=function(n){var r=t.focalPoint;o.identity(g),o.translate(g,g,r),o.rotate(g,g,kr(n),t.viewUp),o.translate(g,g,[-r[0],-r[1],-r[2]]),i.transformMat4(m,t.position,g),e.setPosition(m[0],m[1],m[2])},e.yaw=function(n){var r=t.position;o.identity(g),o.translate(g,g,r),o.rotate(g,g,kr(n),t.viewUp),o.translate(g,g,[-r[0],-r[1],-r[2]]),i.transformMat4(v,t.focalPoint,g),e.setFocalPoint(v[0],v[1],v[2])},e.elevation=function(n){var r=t.focalPoint,a=e.getViewMatrix(),s=[-a[0],-a[1],-a[2]];o.identity(g),o.translate(g,g,r),o.rotate(g,g,kr(n),s),o.translate(g,g,[-r[0],-r[1],-r[2]]),i.transformMat4(m,t.position,g),e.setPosition(m[0],m[1],m[2])},e.pitch=function(n){var r=t.position,a=e.getViewMatrix(),s=[a[0],a[1],a[2]];o.identity(g),o.translate(g,g,r),o.rotate(g,g,kr(n),s),o.translate(g,g,[-r[0],-r[1],-r[2]]),i.transformMat4(v,t.focalPoint,g),e.setFocalPoint.apply(e,Zp(v))},e.zoom=function(n){n<=0||(t.parallelProjection?t.parallelScale/=n:t.viewAngle/=n,e.modified())},e.translate=function(n,r,a){var o=[n,r,a];Zr(t.position,o,t.position),Zr(t.focalPoint,o,t.focalPoint),e.computeDistance(),e.modified()},e.applyTransform=function(n){var r=[].concat(Zp(t.viewUp),[1]),a=[],o=[],i=[];r[0]+=t.position[0],r[1]+=t.position[1],r[2]+=t.position[2],s.transformMat4(a,[].concat(Zp(t.position),[1]),n),s.transformMat4(o,[].concat(Zp(t.focalPoint),[1]),n),s.transformMat4(i,r,n),i[0]-=a[0],i[1]-=a[1],i[2]-=a[2],e.setPosition.apply(e,Zp(a.slice(0,3))),e.setFocalPoint.apply(e,Zp(o.slice(0,3))),e.setViewUp.apply(e,Zp(i.slice(0,3)))},e.getThickness=function(){return t.clippingRange[1]-t.clippingRange[0]},e.setThickness=function(n){var r=n;r<1e-20&&(r=1e-20,$p("Thickness is set to minimum.")),e.setClippingRange(t.clippingRange[0],t.clippingRange[0]+r)},e.setThicknessFromFocalPoint=function(n){var r=n;r<1e-20&&(r=1e-20,$p("Thickness is set to minimum.")),e.setClippingRange(t.distance-r/2,t.distance+r/2)},e.setRoll=function(e){},e.getRoll=function(){},e.setObliqueAngles=function(e,t){},e.getOrientation=function(){},e.getOrientationWXYZ=function(){},e.getFrustumPlanes=function(e){},e.getCameraLightTransformMatrix=function(){},e.deepCopy=function(e){},e.physicalOrientationToWorldDirection=function(e){var t=l.fromValues(e[0],e[1],e[2],e[3]),n=l.create(),r=l.fromValues(0,0,1,0);return l.conjugate(n,t),l.multiply(r,t,r),l.multiply(r,r,n),[r[0],r[1],r[2]]},e.getPhysicalToWorldMatrix=function(t){e.getWorldToPhysicalMatrix(t),o.invert(t,t)},e.getWorldToPhysicalMatrix=function(e){o.identity(e);var n=[3];ta(t.physicalViewNorth,t.physicalViewUp,n),e[0]=n[0],e[1]=n[1],e[2]=n[2],e[4]=t.physicalViewUp[0],e[5]=t.physicalViewUp[1],e[6]=t.physicalViewUp[2],e[8]=-t.physicalViewNorth[0],e[9]=-t.physicalViewNorth[1],e[10]=-t.physicalViewNorth[2],o.transpose(e,e),i.set(c,1/t.physicalScale,1/t.physicalScale,1/t.physicalScale),o.scale(e,e,c),o.translate(e,e,t.physicalTranslation)},e.computeViewParametersFromViewMatrix=function(s){o.invert(u,s),i.transformMat4(c,n,u),e.computeDistance();var l=t.distance;e.setPosition(c[0],c[1],c[2]),i.transformMat4(d,r,u),i.subtract(d,d,c),i.normalize(d,d),e.setDirectionOfProjection(d[0],d[1],d[2]),i.transformMat4(f,a,u),i.subtract(f,f,c),i.normalize(f,f),e.setViewUp(f[0],f[1],f[2]),e.setDistance(l)},e.computeViewParametersFromPhysicalMatrix=function(t){e.getWorldToPhysicalMatrix(u),o.multiply(u,t,u),e.computeViewParametersFromViewMatrix(u)},e.setViewMatrix=function(n){t.viewMatrix=n,t.viewMatrix&&(o.copy(u,t.viewMatrix),e.computeViewParametersFromViewMatrix(u),o.transpose(t.viewMatrix,t.viewMatrix))},e.getViewMatrix=function(){if(t.viewMatrix)return t.viewMatrix;o.lookAt(u,t.position,t.focalPoint,t.viewUp),o.transpose(u,u);var e=new Float64Array(16);return o.copy(e,u),e},e.setProjectionMatrix=function(e){t.projectionMatrix=e},e.getProjectionMatrix=function(e,n,r){var a=new Float64Array(16);if(o.identity(a),t.projectionMatrix){var s=1/t.physicalScale;return i.set(c,s,s,s),o.copy(a,t.projectionMatrix),o.scale(a,a,c),o.transpose(a,a),a}o.identity(u);var l=t.clippingRange[1]-t.clippingRange[0],d=[t.clippingRange[0]+(n+1)*l/2,t.clippingRange[0]+(r+1)*l/2];if(t.parallelProjection){var f=t.parallelScale*e,p=t.parallelScale,g=(t.windowCenter[0]-1)*f,m=(t.windowCenter[0]+1)*f,v=(t.windowCenter[1]-1)*p,h=(t.windowCenter[1]+1)*p;o.ortho(u,g,m,v,h,d[0],d[1]),o.transpose(u,u)}else{if(t.useOffAxisProjection)throw new Error("Off-Axis projection is not supported at this time");var y,b,T=Math.tan(kr(t.viewAngle)/2);!0===t.useHorizontalViewAngle?(y=t.clippingRange[0]*T,b=t.clippingRange[0]*T/e):(y=t.clippingRange[0]*T*e,b=t.clippingRange[0]*T);var C=(t.windowCenter[0]-1)*y,S=(t.windowCenter[0]+1)*y,P=(t.windowCenter[1]-1)*b,w=(t.windowCenter[1]+1)*b,x=d[0],O=d[1];u[0]=2*x/(S-C),u[5]=2*x/(w-P),u[2]=(C+S)/(S-C),u[6]=(P+w)/(w-P),u[10]=-(x+O)/(O-x),u[14]=-1,u[11]=-2*x*O/(O-x),u[15]=0}return o.copy(a,u),a},e.getCompositeProjectionMatrix=function(t,n,r){var a=e.getViewMatrix(),i=e.getProjectionMatrix(t,n,r);return o.multiply(i,a,i),i},e.setDirectionOfProjection=function(e,n,r){if(t.directionOfProjection[0]!==e||t.directionOfProjection[1]!==n||t.directionOfProjection[2]!==r){t.directionOfProjection[0]=e,t.directionOfProjection[1]=n,t.directionOfProjection[2]=r;var a=t.directionOfProjection;t.focalPoint[0]=t.position[0]+a[0]*t.distance,t.focalPoint[1]=t.position[1]+a[1]*t.distance,t.focalPoint[2]=t.position[2]+a[2]*t.distance,h()}},e.setDeviceAngles=function(n,r,a,s){var l=[3];ta(t.physicalViewNorth,t.physicalViewUp,l);var u=o.identity(new Float64Array(16));o.rotate(u,u,kr(n),t.physicalViewUp),o.rotate(u,u,kr(r),l),o.rotate(u,u,kr(a),t.physicalViewNorth),o.rotate(u,u,kr(-s),t.physicalViewUp);var c=new Float64Array([-t.physicalViewUp[0],-t.physicalViewUp[1],-t.physicalViewUp[2]]),d=new Float64Array(t.physicalViewNorth);i.transformMat4(c,c,u),i.transformMat4(d,d,u),e.setDirectionOfProjection(c[0],c[1],c[2]),e.setViewUp(d[0],d[1],d[2]),e.modified()},e.setOrientationWXYZ=function(t,n,r,a){var s=o.identity(new Float64Array(16));if(0!==t&&(0!==n||0!==r||0!==a)){var u=kr(t),c=l.create();l.setAxisAngle(c,[n,r,a],u),o.fromQuat(s,c)}var d=new Float64Array(3);i.transformMat4(d,[0,0,-1],s);var f=new Float64Array(3);i.transformMat4(f,[0,1,0],s),e.setDirectionOfProjection.apply(e,Zp(d)),e.setViewUp.apply(e,Zp(f)),e.modified()},e.computeClippingRange=function(e){var n,r;n=t.viewPlaneNormal,r=t.position;for(var a=-n[0],o=-n[1],i=-n[2],s=-(a*r[0]+o*r[1]+i*r[2]),l=[a*e[0]+o*e[2]+i*e[4]+s,1e-18],u=0;u<2;u++)for(var c=0;c<2;c++)for(var d=0;d<2;d++){var f=a*e[d]+o*e[2+c]+i*e[4+u]+s;l[0]=fl[1]?f:l[1]}return l}}(e,t)}var tg={newInstance:ur.a.newInstance(eg,"vtkCamera"),extend:eg};var ng={switch:!0,intensity:1,color:[1,1,1],position:[0,0,1],focalPoint:[0,0,0],positional:!1,exponent:1,coneAngle:30,attenuationValues:[1,0,0],transformMatrix:null,lightType:"SceneLight",shadowAttenuation:1,direction:[0,0,0],directionMTime:0};function rg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ng,n),ur.a.obj(e,t),ur.a.setGet(e,t,["intensity","switch","positional","exponent","coneAngle","transformMatrix","lightType","shadowAttenuation"]),ur.a.setGetArray(e,t,["color","position","focalPoint","attenuationValues"],3),function(e,t){t.classHierarchy.push("vtkLight"),e.getTransformedPosition=function(){return t.transformMatrix?[]:[].concat(t.position)},e.getTransformedFocalPoint=function(){return t.transformMatrix?[]:[].concat(t.focalPoint)},e.getDirection=function(){return t.directionMTime1&&void 0!==arguments[1]?arguments[1]:[];t.push(e);var r=e.getNestedProps();if(r&&r.length)for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sg,n),ur.a.obj(e,t),ur.a.event(e,t,"event"),ur.a.setGetArray(e,t,["viewport"],4),ur.a.setGetArray(e,t,["background","background2"],3),ig(e,t)}var ug={newInstance:ur.a.newInstance(lg,"vtkViewport"),extend:lg},cg=ur.k,dg=ur.l,fg=ur.m;function pg(e){return function(){return dg("vtkRenderer::".concat(e," - NOT IMPLEMENTED"))}}var gg={pickedProp:null,activeCamera:null,allBounds:[],ambient:[1,1,1],allocatedRenderTime:100,timeFactor:1,createdLight:null,automaticLightCreation:!0,twoSidedLighting:!0,lastRenderTimeInSeconds:-1,renderWindow:null,lights:[],actors:[],volumes:[],lightFollowCamera:!0,numberOfPropsRendered:0,propArray:null,pathArray:null,layer:0,preserveColorBuffer:!1,preserveDepthBuffer:!1,computeVisiblePropBounds:Ka(),interactive:!0,nearClippingPlaneTolerance:0,clippingRangeExpansion:.05,erase:!0,draw:!0,useShadows:!1,useDepthPeeling:!1,occlusionRatio:0,maximumNumberOfPeels:4,selector:null,delegate:null,texturedBackground:!1,backgroundTexture:null,pass:0};function mg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gg,n),ug.extend(e,t,n),ur.b(e,t,["renderWindow","allocatedRenderTime","timeFactor","lastRenderTimeInSeconds","numberOfPropsRendered","lastRenderingUsedDepthPeeling","selector"]),ur.i(e,t,["twoSidedLighting","lightFollowCamera","automaticLightCreation","erase","draw","nearClippingPlaneTolerance","clippingRangeExpansion","backingStore","interactive","layer","preserveColorBuffer","preserveDepthBuffer","useDepthPeeling","occlusionRatio","maximumNumberOfPeels","delegate","backgroundTexture","texturedBackground","useShadows","pass"]),ur.c(e,t,["actors","volumes","lights"]),ur.j(e,t,["background"],4,1),function(e,t){for(t.classHierarchy.push("vtkRenderer"),t.background||(t.background=[0,0,0,1]);t.background.length<3;)t.background.push(0);3===t.background.length&&t.background.push(1);var n={type:"ComputeVisiblePropBoundsEvent",renderer:e},r={type:"ResetCameraClippingRangeEvent",renderer:e},a={type:"ResetCameraEvent",renderer:e};e.updateCamera=function(){return t.activeCamera||(cg("No cameras are on, creating one."),e.getActiveCameraAndResetIfCreated()),t.activeCamera.render(e),!0},e.updateLightsGeometryToFollowCamera=function(){var n=e.getActiveCameraAndResetIfCreated();t.lights.forEach(function(e){e.lightTypeIsSceneLight()||e.lightTypeIsCameraLight()||(e.lightTypeIsHeadLight()?(e.setPositionFrom(n.getPositionByReference()),e.setFocalPointFrom(n.getFocalPointByReference()),e.modified(n.getMTime())):dg("light has unknown light type",e.get()))})},e.updateLightGeometry=function(){return!t.lightFollowCamera||e.updateLightsGeometryToFollowCamera()},e.allocateTime=pg("allocateTime"),e.updateGeometry=pg("updateGeometry"),e.getVTKWindow=function(){return t.renderWindow},e.setLayer=function(n){cg(e.getClassName(),e,"setting Layer to ",n),t.layer!==n&&(t.layer=n,e.modified()),e.setPreserveColorBuffer(!!n)},e.setActiveCamera=function(n){return t.activeCamera!==n&&(t.activeCamera=n,e.modified(),e.invokeEvent({type:"ActiveCameraEvent",camera:n}),!0)},e.makeCamera=function(){var t=tg.newInstance();return e.invokeEvent({type:"CreateCameraEvent",camera:t}),t},e.getActiveCamera=function(){return t.activeCamera||(t.activeCamera=e.makeCamera()),t.activeCamera},e.getActiveCameraAndResetIfCreated=function(){return t.activeCamera||(e.getActiveCamera(),e.resetCamera()),t.activeCamera},e.getActors=function(){return t.actors=[],t.props.forEach(function(e){t.actors=t.actors.concat(e.getActors())}),t.actors},e.addActor=e.addViewProp,e.removeActor=function(n){t.actors=t.actors.filter(function(e){return e!==n}),e.removeViewProp(n),e.modified()},e.removeAllActors=function(){e.getActors().forEach(function(t){e.removeViewProp(t)}),t.actors=[],e.modified()},e.getVolumes=function(){return t.volumes=[],t.props.forEach(function(e){t.volumes=t.volumes.concat(e.getVolumes())}),t.volumes},e.addVolume=e.addViewProp,e.removeVolume=function(n){t.volumes=t.volumes.filter(function(e){return e!==n}),e.removeViewProp(n),e.modified()},e.removeAllVolumes=function(){e.getVolumes().forEach(function(t){e.removeViewProp(t)}),t.volumes=[],e.modified()},e.addLight=function(n){t.lights=[].concat(t.lights,n),e.modified()},e.removeLight=function(n){t.lights=t.lights.filter(function(e){return e!==n}),e.modified()},e.removeAllLights=function(){t.lights=[],e.modified()},e.setLightCollection=function(n){t.lights=n,e.modified()},e.makeLight=ag.newInstance,e.createLight=function(){t.automaticLightCreation&&(t.createdLight&&(e.removeLight(t.createdLight),t.createdLight.delete(),t.createdLight=null),t.createdLight=e.makeLight(),e.addLight(t.createdLight),t.createdLight.setLightTypeToHeadLight(),t.createdLight.setPosition(e.getActiveCamera().getPosition()),t.createdLight.setFocalPoint(e.getActiveCamera().getFocalPoint()))},e.normalizedDisplayToWorld=function(t,n,r,a){var o=e.normalizedDisplayToProjection(t,n,r);return o=e.projectionToView(o[0],o[1],o[2],a),e.viewToWorld(o[0],o[1],o[2])},e.worldToNormalizedDisplay=function(t,n,r,a){var o=e.worldToView(t,n,r);return o=e.viewToProjection(o[0],o[1],o[2],a),e.projectionToNormalizedDisplay(o[0],o[1],o[2])},e.viewToWorld=function(e,n,r){if(null===t.activeCamera)return dg("ViewToWorld: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();o.invert(a,a),o.transpose(a,a);var s=new Float64Array([e,n,r]);return i.transformMat4(s,s,a),s},e.projectionToView=function(e,n,r,a){if(null===t.activeCamera)return dg("ProjectionToView: no active camera, cannot compute projection to view, returning 0,0,0"),[0,0,0];var s=t.activeCamera.getProjectionMatrix(a,-1,1);o.invert(s,s),o.transpose(s,s);var l=new Float64Array([e,n,r]);return i.transformMat4(l,l,s),l},e.worldToView=function(e,n,r){if(null===t.activeCamera)return dg("WorldToView: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();o.transpose(a,a);var s=new Float64Array([e,n,r]);return i.transformMat4(s,s,a),s},e.viewToProjection=function(e,n,r,a){if(null===t.activeCamera)return dg("ViewToProjection: no active camera, cannot compute view to projection, returning 0,0,0"),[0,0,0];var s=t.activeCamera.getProjectionMatrix(a,-1,1);o.transpose(s,s);var l=new Float64Array([e,n,r]);return i.transformMat4(l,l,s),l},e.computeVisiblePropBounds=function(){t.allBounds[0]=_u.INIT_BOUNDS[0],t.allBounds[1]=_u.INIT_BOUNDS[1],t.allBounds[2]=_u.INIT_BOUNDS[2],t.allBounds[3]=_u.INIT_BOUNDS[3],t.allBounds[4]=_u.INIT_BOUNDS[4],t.allBounds[5]=_u.INIT_BOUNDS[5];var r=!0;e.invokeEvent(n);for(var a=0;at.allBounds[1]&&(t.allBounds[1]=i[1]),i[2]t.allBounds[3]&&(t.allBounds[3]=i[3]),i[4]t.allBounds[5]&&(t.allBounds[5]=i[5]))}}return r&&(Na(t.allBounds),cg("Can't compute bounds, no 3D props are visible")),t.allBounds},e.resetCamera=function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||e.computeVisiblePropBounds(),r=[0,0,0];if(!Ba(n))return cg("Cannot reset camera!"),!1;var o=null;if(!e.getActiveCamera())return dg("Trying to reset non-existent camera"),!1;o=t.activeCamera.getViewPlaneNormal(),t.activeCamera.setViewAngle(30),r[0]=(n[0]+n[1])/2,r[1]=(n[2]+n[3])/2,r[2]=(n[4]+n[5])/2;var i=n[1]-n[0],s=n[3]-n[2],l=n[5]-n[4],u=(i*=i)+(s*=s)+(l*=l);u=0===u?1:u,u=.5*Math.sqrt(u);var c=kr(t.activeCamera.getViewAngle()),d=u,f=u/Math.sin(.5*c),p=t.activeCamera.getViewUp();return Math.abs(ea(p,o))>.999&&(fg("Resetting view-up since view plane normal is parallel"),t.activeCamera.setViewUp(-p[2],p[0],p[1])),t.activeCamera.setFocalPoint(r[0],r[1],r[2]),t.activeCamera.setPosition(r[0]+f*o[0],r[1]+f*o[1],r[2]+f*o[2]),e.resetCameraClippingRange(n),t.activeCamera.setParallelScale(d),t.activeCamera.setPhysicalScale(u),t.activeCamera.setPhysicalTranslation(-r[0],-r[1],-r[2]),e.invokeEvent(a),!0},e.resetCameraClippingRange=function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||e.computeVisiblePropBounds();if(!Ba(n))return cg("Cannot reset camera clipping range!"),!1;if(e.getActiveCameraAndResetIfCreated(),!t.activeCamera)return dg("Trying to reset clipping range of non-existent camera"),!1;var a=t.activeCamera.computeClippingRange(n),o=0;if(t.activeCamera.getParallelProjection())o=.1*t.activeCamera.getParallelScale();else{var i=kr(t.activeCamera.getViewAngle());o=.2*Math.tan(i/2)*a[1]}return a[1]-a[0]=a[1]?.01*a[1]:a[0],t.nearClippingPlaneTolerance||(t.nearClippingPlaneTolerance=.01),a[0]e&&(e=n);var r=t.createdLight?t.createdLight.getMTime():0;return r>e&&(e=r),e},e.getTransparent=function(){return!!t.preserveColorBuffer},e.isActiveCameraCreated=function(){return!!t.activeCamera}}(e,t)}var vg={newInstance:ur.d(mg,"vtkRenderer"),extend:mg},hg={Unknown:0,LeftController:1,RightController:2},yg={Unknown:0,Trigger:1,TrackPad:2,Grip:3,ApplicationMenu:4},bg={Device:hg,Input:yg};function Tg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Cg(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Dg,n),ur.a.obj(e,t),ur.a.event(e,t,"RenderEvent"),Rg.forEach(function(n){return ur.a.event(e,t,n)}),ur.a.get(e,t,["initialized","container","interactorStyle","lastFrameTime","view"]),ur.a.setGet(e,t,["lightFollowCamera","enabled","enableRender","recognizeGestures","desiredUpdateRate","stillUpdateRate","picker"]),function(e,t){t.classHierarchy.push("vtkRenderWindowInteractor");var n=new Set,r=0;function a(n,r){t.currentRenderer=e.findPokedRenderer(n,r)}function o(e){var n=t.container.getBoundingClientRect(),r=t.view.getCanvas(),o=r.width/n.width,i=r.height/n.height,s={x:o*(e.clientX-n.left),y:i*(n.height-e.clientY+n.top),z:0};return a(s.x,s.y),s}function i(e){for(var t={},n=0;n1&&void 0!==arguments[1]&&arguments[1],o=document,i=n?"addEventListener":"removeEventListener",s=n?"removeEventListener":"addEventListener";!a&&!n&&r>0&&--r,r&&!a||(r=0,t.container&&t.container[s]("mousemove",e.handleMouseMove),o[i]("mouseup",e.handleMouseUp),o[i]("mousemove",e.handleMouseMove),o[i]("touchend",e.handleTouchEnd,!1),o[i]("touchcancel",e.handleTouchEnd,!1),o[i]("touchmove",e.handleTouchMove,!1)),!a&&n&&++r}function c(){t.view&&t.enabled&&t.enableRender&&(t.inRender=!0,t.view.traverseAllPasses(),t.inRender=!1),e.invokeRenderEvent()}e.start=function(){(t.initialized||(e.initialize(),t.initialized))&&e.startEventLoop()},e.setRenderWindow=function(e){Og("you want to call setView(view) instead of setRenderWindow on a vtk.js interactor")},e.setInteractorStyle=function(n){t.interactorStyle!==n&&(null!=t.interactorStyle&&t.interactorStyle.setInteractor(null),t.interactorStyle=n,null!=t.interactorStyle&&t.interactorStyle.getInteractor()!==e&&t.interactorStyle.setInteractor(e))},e.initialize=function(){t.initialized=!0,e.enable(),e.render()},e.enable=function(){return e.setEnabled(!0)},e.disable=function(){return e.setEnabled(!1)},e.startEventLoop=function(){return xg("empty event loop")},e.getCurrentRenderer=function(){return t.currentRenderer?t.currentRenderer:(a(0,0),t.currentRenderer)},e.bindEvents=function(n){t.container=n,n.addEventListener("contextmenu",Eg),n.addEventListener("wheel",e.handleWheel),n.addEventListener("DOMMouseScroll",e.handleWheel),n.addEventListener("mouseenter",e.handleMouseEnter),n.addEventListener("mouseleave",e.handleMouseLeave),n.addEventListener("mousemove",e.handleMouseMove),n.addEventListener("mousedown",e.handleMouseDown),document.addEventListener("keypress",e.handleKeyPress),document.addEventListener("keydown",e.handleKeyDown),document.addEventListener("keyup",e.handleKeyUp),document.addEventListener("pointerlockchange",e.handlePointerLockChange),n.addEventListener("touchstart",e.handleTouchStart,!1)},e.unbindEvents=function(){u(!1,!0),t.container.removeEventListener("contextmenu",Eg),t.container.removeEventListener("wheel",e.handleWheel),t.container.removeEventListener("DOMMouseScroll",e.handleWheel),t.container.removeEventListener("mouseenter",e.handleMouseEnter),t.container.removeEventListener("mouseleave",e.handleMouseLeave),t.container.removeEventListener("mousemove",e.handleMouseMove),t.container.removeEventListener("mousedown",e.handleMouseDown),document.removeEventListener("keypress",e.handleKeyPress),document.removeEventListener("keydown",e.handleKeyDown),document.removeEventListener("keyup",e.handleKeyUp),document.removeEventListener("pointerlockchange",e.handlePointerLockChange),t.container.removeEventListener("touchstart",e.handleTouchStart),t.container=null},e.handleKeyPress=function(t){var n=l(t);e.keyPressEvent(n)},e.handleKeyDown=function(t){var n=l(t);e.keyDownEvent(n)},e.handleKeyUp=function(t){var n=l(t);e.keyUpEvent(n)},e.handleMouseDown=function(t){if(!(t.button>2)){u(!0),t.stopPropagation(),t.preventDefault();var n=Cg(Cg({},s(t)),{},{position:o(t)});switch(t.button){case 0:e.leftButtonPressEvent(n);break;case 1:e.middleButtonPressEvent(n);break;case 2:e.rightButtonPressEvent(n);break;default:Og("Unknown mouse button pressed: ".concat(t.button))}}},e.requestPointerLock=function(){e.getView().getCanvas().requestPointerLock()},e.exitPointerLock=function(){return document.exitPointerLock()},e.isPointerLocked=function(){return!!document.pointerLockElement},e.handlePointerLockChange=function(){e.isPointerLocked()?e.startPointerLockEvent():e.endPointerLockEvent()},e.requestAnimation=function(r){void 0!==r?n.has(r)?xg("requester is already registered for animating"):(n.add(r),1===n.size&&(t.lastFrameTime=.1,t.lastFrameStart=Date.now(),t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())):Og("undefined requester, can not start animating")},e.isAnimating=function(){return t.vrAnimation||null!==t.animationRequest},e.cancelAnimation=function(r){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n.has(r))n.delete(r),t.animationRequest&&0===n.size&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null,e.endAnimationEvent(),e.render());else if(!a){var o=r&&r.getClassName?r.getClassName():r;xg("".concat(o," did not request an animation"))}},e.switchToVRAnimation=function(){t.animationRequest&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null),t.vrAnimation=!0},e.returnFromVRAnimation=function(){t.vrAnimation=!1,0!==n.size&&(t.FrameTime=-1,t.animationRequest=requestAnimationFrame(e.handleAnimation))},e.updateGamepads=function(n){for(var r=navigator.getGamepads(),a=0;a1){var r=i(n.touches);if(2===n.touches.length){var a={position:o(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(a)}e.recognizeGesture("TouchStart",r)}else{var s={position:o(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(s)}},e.handleTouchMove=function(n){if(n.stopPropagation(),n.preventDefault(),t.recognizeGestures&&n.touches.length>1){var r=i(n.touches);e.recognizeGesture("TouchMove",r)}else{var a={position:o(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.mouseMoveEvent(a)}},e.handleTouchEnd=function(n){if(n.stopPropagation(),n.preventDefault(),t.recognizeGestures)if(0===n.touches.length)if(1===n.changedTouches.length){var r={position:o(n.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(r),u(!1)}else{var a=i(n.changedTouches);e.recognizeGesture("TouchEnd",a),u(!1)}else if(1===n.touches.length){var s=i(n.changedTouches);e.recognizeGesture("TouchEnd",s);var l={position:o(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(l)}else{var c=i(n.touches);e.recognizeGesture("TouchMove",c)}else{var d={position:o(n.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(d),u(!1)}},e.setView=function(n){t.view!==n&&(t.view=n,t.view.getRenderable().setInteractor(e),e.modified())},e.getFirstRenderer=function(){return t.view.getRenderable().getRenderersByReference()[0]},e.findPokedRenderer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!t.view)return null;var r=t.view.getRenderable().getRenderers();r.sort(function(e,t){return e.getLayer()-t.getLayer()});for(var a=null,o=null,i=null,s=r.length;s--;){var l=r[s];if(t.view.isInViewport(e,n,l)&&l.getInteractive()){i=l;break}null===a&&l.getInteractive()&&(a=l),null===o&&t.view.isInViewport(e,n,l)&&(o=l)}return null===i&&(i=a),null===i&&(i=o),null==i&&(i=r[0]),i},e.render=function(){null!==t.animationRequest||t.inRender||c()},Rg.forEach(function(n){var r=n.charAt(0).toLowerCase()+n.slice(1);e["".concat(r,"Event")]=function(r){if(t.enabled)if(e.getCurrentRenderer()){var a=Cg({type:n,pokedRenderer:t.currentRenderer,firstRenderer:e.getFirstRenderer()},r);e["invoke".concat(n)](a)}else Ag("\n Can not forward events without a current renderer on the interactor.\n ")}}),e.recognizeGesture=function(n,r){if(!(Object.keys(r).length>2)){if(t.startingEventPositions||(t.startingEventPositions={}),"TouchStart"===n)return Object.keys(r).forEach(function(e){t.startingEventPositions[e]=r[e]}),void(t.currentGesture="Start");if("TouchEnd"===n)return"Pinch"===t.currentGesture&&(e.render(),e.endPinchEvent()),"Rotate"===t.currentGesture&&(e.render(),e.endRotateEvent()),"Pan"===t.currentGesture&&(e.render(),e.endPanEvent()),t.currentGesture="Start",void(t.startingEventPositions={});var a=0,o=[],i=[];Object.keys(r).forEach(function(e){o[a]=r[e],i[a]=t.startingEventPositions[e],a++});var s=Math.sqrt((i[0].x-i[1].x)*(i[0].x-i[1].x)+(i[0].y-i[1].y)*(i[0].y-i[1].y)),l=Math.sqrt((o[0].x-o[1].x)*(o[0].x-o[1].x)+(o[0].y-o[1].y)*(o[0].y-o[1].y)),u=Fr(Math.atan2(i[1].y-i[0].y,i[1].x-i[0].x)),c=Fr(Math.atan2(o[1].y-o[0].y,o[1].x-o[0].x)),d=c-u;c=c+180>=360?c-180:c+180,u=u+180>=360?u-180:u+180,Math.abs(c-u)p&&g>m&&g>v){t.currentGesture="Pinch";var h={scale:1,touches:r};e.startPinchEvent(h)}else if(m>p&&m>v){t.currentGesture="Rotate";var y={rotation:0,touches:r};e.startRotateEvent(y)}else if(v>p){t.currentGesture="Pan";var b={translation:[0,0],touches:r};e.startPanEvent(b)}}else{if("Rotate"===t.currentGesture){var T={rotation:d,touches:r};e.rotateEvent(T)}if("Pinch"===t.currentGesture){var C={scale:l/s,touches:r};e.pinchEvent(C)}if("Pan"===t.currentGesture){var S={translation:f,touches:r};e.panEvent(S)}}}},e.handleVisibilityChange=function(){t.lastFrameStart=Date.now()};var d=e.delete;e.delete=function(){for(;n.size;)e.cancelAnimation(n.values().next().value);void 0!==document.hidden&&document.removeEventListener("visibilitychange",e.handleVisibilityChange),d()},void 0!==document.hidden&&document.addEventListener("visibilitychange",e.handleVisibilityChange,!1)}(e,t)}var Lg=Cg({newInstance:ur.a.newInstance(Vg,"vtkRenderWindowInteractor"),extend:Vg,handledEvents:Rg},bg);function Ng(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bg(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ug,n),ur.a.obj(e,t),ur.a.event(e,t,"InteractionEvent"),ur.a.event(e,t,"StartInteractionEvent"),ur.a.event(e,t,"EndInteractionEvent"),ur.a.get(e,t,["interactor","enabled"]),ur.a.setGet(e,t,["priority","processEvents"]),function(e,t){t.classHierarchy.push("vtkInteractorObserver");var n=Bg({},e);function r(){for(;t.subscribedEvents.length;)t.subscribedEvents.pop().unsubscribe()}function a(){Lg.handledEvents.forEach(function(n){e["handle".concat(n)]&&t.subscribedEvents.push(t.interactor["on".concat(n)](function(r){return t.processEvents?e["handle".concat(n)](r):Gg},t.priority))})}e.setInteractor=function(n){n!==t.interactor&&(r(),t.interactor=n,n&&t.enabled&&a(),e.modified())},e.setEnabled=function(n){n!==t.enabled&&(r(),n&&(t.interactor?a():Fg("\n The interactor must be set before subscribing to events\n ")),t.enabled=n,e.modified())},e.computeDisplayToWorld=function(e,n,r,a){return e?t.interactor.getView().displayToWorld(n,r,a,e):null},e.computeWorldToDisplay=function(e,n,r,a){return e?t.interactor.getView().worldToDisplay(n,r,a,e):null},e.setPriority=function(e){n.setPriority(e)&&t.interactor&&(r(),a())}}(e,t)}var Wg=Bg({newInstance:ur.a.newInstance(jg,"vtkInteractorObserver"),extend:jg},_g),zg={States:{IS_START:0,IS_NONE:0,IS_ROTATE:1,IS_PAN:2,IS_SPIN:3,IS_DOLLY:4,IS_CAMERA_POSE:11,IS_WINDOW_LEVEL:1024,IS_SLICE:1025}};function Hg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Xg=zg.States,qg={Rotate:Xg.IS_ROTATE,Pan:Xg.IS_PAN,Spin:Xg.IS_SPIN,Dolly:Xg.IS_DOLLY,CameraPose:Xg.IS_CAMERA_POSE,WindowLevel:Xg.IS_WINDOW_LEVEL,Slice:Xg.IS_SLICE};var Yg={state:Xg.IS_NONE,handleObservers:1,autoAdjustCameraClippingRange:1};function Zg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yg,n),Wg.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkInteractorStyle"),Object.keys(qg).forEach(function(n){ur.a.event(e,t,"Start".concat(n,"Event")),e["start".concat(n)]=function(){t.state===Xg.IS_NONE&&(t.state=qg[n],t.interactor.requestAnimation(e),e.invokeStartInteractionEvent({type:"StartInteractionEvent"}),e["invokeStart".concat(n,"Event")]({type:"Start".concat(n,"Event")}))},ur.a.event(e,t,"End".concat(n,"Event")),e["end".concat(n)]=function(){t.state===qg[n]&&(t.state=Xg.IS_NONE,t.interactor.cancelAnimation(e),e.invokeEndInteractionEvent({type:"EndInteractionEvent"}),e["invokeEnd".concat(n,"Event")]({type:"End".concat(n,"Event")}),t.interactor.render())}}),e.handleKeyPress=function(e){var n=t.interactor;switch(e.key){case"r":case"R":e.pokedRenderer.resetCamera(),n.render();break;case"w":case"W":e.pokedRenderer.getActors().forEach(function(e){var t=e.getProperty();t.setRepresentationToWireframe&&t.setRepresentationToWireframe()}),n.render();break;case"s":case"S":e.pokedRenderer.getActors().forEach(function(e){var t=e.getProperty();t.setRepresentationToSurface&&t.setRepresentationToSurface()}),n.render();break;case"v":case"V":e.pokedRenderer.getActors().forEach(function(e){var t=e.getProperty();t.setRepresentationToPoints&&t.setRepresentationToPoints()}),n.render()}}}(e,t)}var Qg=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jg,n),Qg.extend(e,t,n),ur.a.setGet(e,t,["motionFactor"]),function(e,t){t.classHierarchy.push("vtkInteractorStyleTrackballCamera"),e.handleMouseMove=function(n){var r=n.position,a=n.pokedRenderer;switch(t.state){case $g.IS_ROTATE:e.handleMouseRotate(a,r),e.invokeInteractionEvent({type:"InteractionEvent"});break;case $g.IS_PAN:e.handleMousePan(a,r),e.invokeInteractionEvent({type:"InteractionEvent"});break;case $g.IS_DOLLY:e.handleMouseDolly(a,r),e.invokeInteractionEvent({type:"InteractionEvent"});break;case $g.IS_SPIN:e.handleMouseSpin(a,r),e.invokeInteractionEvent({type:"InteractionEvent"})}t.previousPosition=r},e.handleButton3D=function(n){n&&n.pressed&&n.device===hg.RightController&&n.input===yg.TrackPad?e.startCameraPose():n&&!n.pressed&&n.device===hg.RightController&&n.input===yg.TrackPad&&t.state===$g.IS_CAMERA_POSE&&e.endCameraPose()},e.handleMove3D=function(n){switch(t.state){case $g.IS_CAMERA_POSE:e.updateCameraPose(n)}},e.updateCameraPose=function(e){var t=e.pokedRenderer.getActiveCamera(),n=t.getPhysicalTranslation(),r=.05*e.gamepad.axes[1]/t.getPhysicalScale(),a=t.physicalOrientationToWorldDirection(e.orientation);t.setPhysicalTranslation(n[0]+a[0]*r,n[1]+a[1]*r,n[2]+a[2]*r)},e.handleLeftButtonPress=function(n){var r=n.position;t.previousPosition=r,n.shiftKey?n.controlKey||n.altKey?e.startDolly():e.startPan():n.controlKey||n.altKey?e.startSpin():e.startRotate()},e.handleLeftButtonRelease=function(){switch(t.state){case $g.IS_DOLLY:e.endDolly();break;case $g.IS_PAN:e.endPan();break;case $g.IS_SPIN:e.endSpin();break;case $g.IS_ROTATE:e.endRotate()}},e.handleStartMouseWheel=function(t){e.startDolly(),e.handleMouseWheel(t)},e.handleEndMouseWheel=function(){e.endDolly()},e.handleStartPinch=function(n){t.previousScale=n.scale,e.startDolly()},e.handleEndPinch=function(){e.endDolly()},e.handleStartRotate=function(n){t.previousRotation=n.rotation,e.startRotate()},e.handleEndRotate=function(){e.endRotate()},e.handleStartPan=function(n){t.previousTranslation=n.translation,e.startPan()},e.handleEndPan=function(){e.endPan()},e.handlePinch=function(n){e.dollyByFactor(n.pokedRenderer,n.scale/t.previousScale),t.previousScale=n.scale},e.handlePan=function(n){var r=n.pokedRenderer.getActiveCamera(),a=r.getFocalPoint(),o=(a=e.computeWorldToDisplay(n.pokedRenderer,a[0],a[1],a[2]))[2],i=n.translation,s=t.previousTranslation,l=e.computeDisplayToWorld(n.pokedRenderer,a[0]+i[0]-s[0],a[1]+i[1]-s[1],o),u=e.computeDisplayToWorld(n.pokedRenderer,a[0],a[1],o),c=[];c[0]=u[0]-l[0],c[1]=u[1]-l[1],c[2]=u[2]-l[2],a=r.getFocalPoint();var d=r.getPosition();r.setFocalPoint(c[0]+a[0],c[1]+a[1],c[2]+a[2]),r.setPosition(c[0]+d[0],c[1]+d[1],c[2]+d[2]),t.interactor.getLightFollowCamera()&&n.pokedRenderer.updateLightsGeometryToFollowCamera(),r.orthogonalizeViewUp(),t.previousTranslation=n.translation},e.handleRotate=function(e){var n=e.pokedRenderer.getActiveCamera();n.roll(e.rotation-t.previousRotation),n.orthogonalizeViewUp(),t.previousRotation=e.rotation},e.handleMouseRotate=function(e,n){var r=t.interactor,a=n.x-t.previousPosition.x,o=n.y-t.previousPosition.y,i=r.getView().getViewportSize(e),s=-.1,l=-.1;i[0]&&i[1]&&(s=-20/i[1],l=-20/i[0]);var u=a*l*t.motionFactor,c=o*s*t.motionFactor,d=e.getActiveCamera();Number.isNaN(u)||Number.isNaN(c)||(d.azimuth(u),d.elevation(c),d.orthogonalizeViewUp()),t.autoAdjustCameraClippingRange&&e.resetCameraClippingRange(),r.getLightFollowCamera()&&e.updateLightsGeometryToFollowCamera()},e.handleMouseSpin=function(e,n){var r=t.interactor,a=e.getActiveCamera(),o=r.getView().getViewportCenter(e),i=Fr(Math.atan2(t.previousPosition.y-o[1],t.previousPosition.x-o[0])),s=Fr(Math.atan2(n.y-o[1],n.x-o[0]))-i;Number.isNaN(s)||(a.roll(s),a.orthogonalizeViewUp())},e.handleMousePan=function(n,r){var a=n.getActiveCamera(),o=a.getFocalPoint(),i=(o=e.computeWorldToDisplay(n,o[0],o[1],o[2]))[2],s=e.computeDisplayToWorld(n,r.x,r.y,i),l=e.computeDisplayToWorld(n,t.previousPosition.x,t.previousPosition.y,i),u=[];u[0]=l[0]-s[0],u[1]=l[1]-s[1],u[2]=l[2]-s[2],o=a.getFocalPoint();var c=a.getPosition();a.setFocalPoint(u[0]+o[0],u[1]+o[1],u[2]+o[2]),a.setPosition(u[0]+c[0],u[1]+c[1],u[2]+c[2]),t.interactor.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera()},e.handleMouseDolly=function(n,r){var a=r.y-t.previousPosition.y,o=t.interactor.getView().getViewportCenter(n),i=t.motionFactor*a/o[1];e.dollyByFactor(n,Math.pow(1.1,i))},e.handleMouseWheel=function(t){var n=1-t.spinY/10;e.dollyByFactor(t.pokedRenderer,n)},e.dollyByFactor=function(e,n){if(!Number.isNaN(n)){var r=e.getActiveCamera();r.getParallelProjection()?r.setParallelScale(r.getParallelScale()/n):(r.dolly(n),t.autoAdjustCameraClippingRange&&e.resetCameraClippingRange()),t.interactor.getLightFollowCamera()&&e.updateLightsGeometryToFollowCamera()}}}(e,t)}var tm={newInstance:ur.a.newInstance(em,"vtkInteractorStyleTrackballCamera"),extend:em},nm=ur.a.vtkErrorMacro,rm=[1,-1,1,-1,1,-1];var am={empty:!0,numberOfComponents:3,dataType:to.FLOAT,bounds:[1,-1,1,-1,1,-1]};function om(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,am,n),vo.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkPoints"),e.getNumberOfPoints=e.getNumberOfTuples,e.setNumberOfPoints=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;e.getNumberOfPoints()!==n&&(t.size=n*r,t.values=ur.a.newTypedArray(t.dataType,t.size),e.setNumberOfComponents(r),e.modified())},e.setPoint=function(e){for(var n=e*t.numberOfComponents,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};vo.extend(e,t,function(e){return lm({empty:!0,numberOfComponents:1,dataType:to.UNSIGNED_INT},e)}(n)),function(e,t){t.classHierarchy.push("vtkCellArray"),e.getNumberOfCells=function(e){return void 0===t.numberOfCells||e?(t.cellSizes=cm(t.values),t.numberOfCells=t.cellSizes.length,t.numberOfCells):t.numberOfCells},e.getCellSizes=function(e){return void 0===t.cellSizes||e?(t.cellSizes=cm(t.values),t.cellSizes):t.cellSizes};var n=e.setData;e.setData=function(e){n(e,1),t.numberOfCells=void 0,t.cellSizes=void 0},e.getCell=function(e){var n=e,r=t.values[n++];return t.values.subarray(n,n+r)}}(e,t)}var pm=lm({newInstance:ur.a.newInstance(fm,"vtkCellArray"),extend:fm},dm);var gm={bounds:[-1,-1,-1,-1,-1,-1],pointsIds:[]};function mm(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gm,n),ur.a.obj(e,t),t.points||(t.points=im.newInstance()),ur.a.get(e,t,["points","pointsIds"]),function(e,t){t.classHierarchy.push("vtkCell"),e.initialize=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(n){t.pointsIds=n;var r=t.points.getData();r.length!==3*t.pointsIds.length&&(r=ur.a.newTypedArray(e.getDataType(),3*t.pointsIds.length));var a=e.getData();t.pointsIds.forEach(function(e,t){var n=3*e,o=3*t;r[o]=a[n],r[++o]=a[++n],r[++o]=a[++n]}),t.points.setData(r)}else{t.points=e,t.pointsIds=new Array(e.getNumberOfPoints());for(var o=e.getNumberOfPoints()-1;o>=0;--o)t.pointsIds[o]=o}},e.getBounds=function(){var e=t.points.getNumberOfPoints(),n=[];if(e){t.points.getPoint(0,n),t.bounds[0]=n[0],t.bounds[1]=n[0],t.bounds[2]=n[1],t.bounds[3]=n[1],t.bounds[4]=n[2],t.bounds[5]=n[2];for(var r=1;rt.bounds[1]?n[0]:t.bounds[1],t.bounds[2]=n[1]t.bounds[3]?n[1]:t.bounds[3],t.bounds[4]=n[2]t.bounds[5]?n[2]:t.bounds[5]}else Na(t.bounds);return t.bounds},e.getLength2=function(){e.getBounds();for(var n=0,r=0,a=0;a<3;a++)n+=(r=t.bounds[2*a+1]-t.bounds[2*a])*r;return n},e.getParametricDistance=function(e){for(var t,n=0,r=0;r<3;r++)(t=e[r]<0?-e[r]:e[r]>1?e[r]-1:0)>n&&(n=t);return n},e.getNumberOfPoints=function(){return t.points.getNumberOfPoints()},e.deepCopy=function(e){e.initialize(t.points,t.pointsIds)},e.getCellDimension=function(){},e.intersectWithLine=function(e,t,n,r,a,o,i){},e.evaluatePosition=function(e,t,n,r,a,o){}}(e,t)}var vm={newInstance:ur.a.newInstance(mm,"vtkCell"),extend:mm};function hm(e){return function(e){if(Array.isArray(e))return ym(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ym(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ym(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ym(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bm,n),ur.a.obj(e,t),function(e,t){t.classHierarchy.push("vtkCellLinks"),e.buildLinks=function(n){var r=n.getPoints().getNumberOfPoints(),a=n.getNumberOfCells(),o=new Uint32Array(r);if(n.isA("vtkPolyData")){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:1e3;t.array=Array(e).fill().map(function(){return{ncells:0,cells:null}}),t.extend=n,t.maxId=-1},e.initialize=function(){t.array=null},e.getLink=function(e){return t.array[e]},e.getNcells=function(e){return t.array[e].ncells},e.getCells=function(e){return t.array[e].cells},e.insertNextPoint=function(e){t.array.push({ncells:e,cells:Array(e)}),++t.maxId},e.insertNextCellReference=function(e,n){t.array[e].cells[t.array[e].ncells++]=n},e.deletePoint=function(e){t.array[e].ncells=0,t.array[e].cells=null},e.removeCellReference=function(e,n){t.array[n].cells=t.array[n].cells.filter(function(t){return t!==e}),t.array[n].ncells=t.array[n].cells.length},e.addCellReference=function(e,n){t.array[n].cells[t.array[n].ncells++]=e},e.resizeCellList=function(e,n){t.array[e].cells.length=n},e.squeeze=function(){!function(e,t){var n=t;for(t>=e.array.length&&(n+=e.array.length);n>e.array.length;)e.array.push({ncells:0,cells:null});e.array.length=n}(t,t.maxId+1)},e.reset=function(){t.maxId=-1},e.deepCopy=function(e){t.array=hm(e.array),t.extend=e.extend,t.maxId=e.maxId},e.incrementLinkCount=function(e){++t.array[e].ncells},e.allocateLinks=function(e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mm,n),ur.a.obj(e,t),ur.a.get(e,t,["size","maxId","extend"]),ur.a.getArray(e,t,["typeArray","locationArray"]),function(e,t){t.classHierarchy.push("vtkCellTypes"),e.allocate=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:512,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;t.size=e>0?e:1,t.extend=n>0?n:1,t.maxId=-1,t.typeArray=new Uint8Array(e),t.locationArray=new Uint32Array(e)},e.insertCell=function(e,n,r){t.typeArray[e]=n,t.locationArray[e]=r,e>t.maxId&&(t.maxId=e)},e.insertNextCell=function(n,r){return e.insertCell(++t.maxId,n,r),t.maxId},e.setCellTypes=function(e,n,r){t.size=e,t.typeArray=n,t.locationArray=r,t.maxId=e-1},e.getCellLocation=function(e){return t.locationArray[e]},e.deleteCell=function(e){t.typeArray[e]=Sm.VTK_EMPTY_CELL},e.getNumberOfTypes=function(){return t.maxId+1},e.isType=function(t){for(var n=e.getNumberOfTypes(),r=0;r3&&void 0!==arguments[3]?arguments[3]:null,o={t:Number.MIN_VALUE,distance:0},i=[];i[0]=n[0]-t[0],i[1]=n[1]-t[1],i[2]=n[2]-t[2];var s=i[0]*(e[0]-t[0])+i[1]*(e[1]-t[1])+i[2]*(e[2]-t[2]),l=ea(i,i),u=1e-5*s;return 0!==l&&(o.t=s/l),u<0&&(u=-u),-u1?r=n:(r=i,i[0]=t[0]+o.t*i[0],i[1]=t[1]+o.t*i[1],i[2]=t[2]+o.t*i[2]),a&&(a[0]=r[0],a[1]=r[1],a[2]=r[2]),o.distance=oa(r,e),o}function Bm(e,t,n,r,a,o){var i=[],s=[],l=[];a[0]=0,o[0]=0,i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],s[0]=r[0]-n[0],s[1]=r[1]-n[1],s[2]=r[2]-n[2],l[0]=n[0]-e[0],l[1]=n[1]-e[1],l[2]=n[2]-e[2];var u=[];u[0]=[ea(i,i),-ea(i,s)],u[1]=[u[0][1],ea(s,s)];var c=[];if(c[0]=ea(i,l),c[1]=-ea(s,l),0===wa(u,c,2)){for(var d,f=Number.MAX_VALUE,p=[e,t,n,r],g=[n,n,e,e],m=[r,r,t,t],v=[o[0],o[0],a[0],a[0]],h=[a[0],a[0],o[0],o[0]],y=0;y<4;y++)(d=Nm(p[y],g[y],m[y])).distance=0&&a[0]<=1&&o[0]>=0&&o[0]<=1?Lm.YES_INTERSECTION:Lm.NO_INTERSECTION}var km={distanceToLine:Nm,intersection:Bm};var Fm={};function Gm(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fm,n),vm.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkLine"),e.getCellDimension=function(){return 1},e.intersectWithLine=function(e,n,r,a,o){var i={intersect:0,t:Number.MAX_VALUE,subId:0,betweenPoints:null};o[1]=0,o[2]=0;var s=[],l=[],u=[];t.points.getPoint(0,l),t.points.getPoint(1,u);var c=[],d=[],f=Bm(e,n,l,u,c,d);if(i.t=c[0],i.betweenPoints=function(e){return e>=0&&e<=1}(i.t),o[0]=d[0],f===Lm.YES_INTERSECTION){for(var p=0;p<3;p++)a[p]=l[p]+o[0]*(u[p]-l[p]),s[p]=e[p]+i.t*(n[p]-e[p]);if(oa(a,s)<=r*r)return i.intersect=1,i}else{var g;if(i.t<0)return(g=Nm(e,l,u,a)).distance<=r*r?(i.t=0,i.intersect=1,i.betweenPoints=!0,i):i;if(i.t>1)return(g=Nm(n,l,u,a)).distance<=r*r?(i.t=1,i.intersect=1,i.betweenPoints=!0,i):i;if(o[0]<0)return o[0]=0,g=Nm(l,e,n,a),i.t=g.t,g.distance<=r*r?(i.intersect=1,i):i;if(o[0]>1)return o[0]=1,g=Nm(u,e,n,a),i.t=g.t,g.distance<=r*r?(i.intersect=1,i):i}return i},e.evaluatePosition=function(e,t,n,r,a,o){}}(e,t)}var _m=Dm(Dm({newInstance:ur.a.newInstance(Gm,"vtkLine"),extend:Gm},km),Rm);var Um={};function jm(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Um,n),sc.extend(e,t,n),ur.a.setGet(e,t,["points"]),function(e,t){t.classHierarchy.push("vtkPointSet"),t.points?t.points=Object(Uu.a)(t.points):t.points=im.newInstance(),e.getNumberOfPoints=function(){return t.points.getNumberOfPoints()},e.getBounds=function(){return t.points.getBounds()},e.computeBounds=function(){e.getBounds()};var n=e.shallowCopy;e.shallowCopy=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n(e,r),t.points=im.newInstance(),t.points.shallowCopy(e.getPoints())}}(e,t)}var Wm={newInstance:ur.a.newInstance(jm,"vtkPointSet"),extend:jm};function zm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Km(e,t,n,r){var a=n[0]-t[0],o=n[1]-t[1],i=n[2]-t[2],s=e[0]-t[0],l=e[1]-t[1],u=e[2]-t[2];r[0]=o*u-i*l,r[1]=i*s-a*u,r[2]=a*l-o*s}function Xm(e,t,n,r){Km(e,t,n,r);var a=Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);0!==a&&(r[0]/=a,r[1]/=a,r[2]/=a)}var qm={computeNormalDirection:Km,computeNormal:Xm};var Ym={};function Zm(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ym,n),vm.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkTriangle"),e.getCellDimension=function(){return 2},e.intersectWithLine=function(n,r,a,o,i){var s={subId:0,t:Number.MAX_VALUE,intersect:0,betweenPoints:!1};i[2]=0;var l=a*a,u=[],c=[],d=[];t.points.getPoint(0,u),t.points.getPoint(1,c),t.points.getPoint(2,d);var f=[];if(Xm(u,c,d,f),0!==f[0]||0!==f[1]||0!==f[2]){var p=Jl.intersectWithLine(n,r,u,f);if(s.betweenPoints=p.betweenPoints,s.t=p.t,o[0]=p.x[0],o[1]=p.x[1],o[2]=p.x[2],!p.intersection)return i[0]=0,i[1]=0,s.intersect=0,s;var g=e.evaluatePosition(o,[],i,[]);if(g.evaluation>=0)return g.dist2<=l?(s.intersect=1,s):(s.intersect=g.evaluation,s)}var m=oa(u,c),v=oa(c,d),h=oa(d,u);t.line||(t.line=_m.newInstance()),m>v&&m>h?(t.line.getPoints().setPoint(0,u),t.line.getPoints().setPoint(1,c)):v>h&&v>m?(t.line.getPoints().setPoint(0,c),t.line.getPoints().setPoint(1,d)):(t.line.getPoints().setPoint(0,d),t.line.getPoints().setPoint(1,u));var y=t.line.intersectWithLine(n,r,a,o,i);if(s.betweenPoints=y.betweenPoints,s.t=y.t,y.intersect){for(var b=[],T=[],C=[],S=0;S<3;S++)b[S]=u[S]-d[S],T[S]=c[S]-d[S],C[S]=o[S]-d[S];return i[0]=ea(C,b)/h,i[1]=ea(C,T)/v,s.intersect=1,s}return i[0]=0,i[1]=0,s.intersect=0,s},e.evaluatePosition=function(e,n,r,a){var o,i,s,l,u,c,d,f={subId:0,dist2:0,evaluation:-1},p=[],g=[],m=[],v=[],h=[],y=[],b=[],T=0,C=[],S=[],P=[],w=[],x=[];f.subId=0,r[2]=0,t.points.getPoint(1,p),t.points.getPoint(2,g),t.points.getPoint(0,m),Km(p,g,m,v),Jl.generalizedProjectPoint(e,p,v,x);var O=0;for(o=0;o<3;o++)(s=v[o]<0?-v[o]:v[o])>O&&(O=s,T=o);for(i=0,o=0;o<3;o++)o!==T&&(C[i++]=o);for(o=0;o<2;o++)h[o]=x[C[o]]-m[C[o]],y[o]=p[C[o]]-m[C[o]],b[o]=g[C[o]]-m[C[o]];if(0===(l=la(y,b)))return r[0]=0,r[1]=0,f.evaluation=-1,f;if(r[0]=la(h,b)/l,r[1]=la(y,h)/l,a[0]=1-(r[0]+r[1]),a[1]=r[0],a[2]=r[1],a[0]>=0&&a[0]<=1&&a[1]>=0&&a[1]<=1&&a[2]>=0&&a[2]<=1)n&&(f.dist2=oa(x,e),n[0]=x[0],n[1]=x[1],n[2]=x[2]),f.evaluation=1;else{var M;if(n)if(a[1]<0&&a[2]<0)for(u=oa(e,m),c=_m.distanceToLine(e,p,m,M,P),d=_m.distanceToLine(e,m,g,M,w),u1?r[a]-1:0)>n&&(n=t);return n}}(e,t)}var Qm,$m=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rv,n),Wm.extend(e,t,n),ur.a.get(e,t,["cells","links"]),ur.a.setGet(e,t,["verts","lines","polys","strips"]),function(e,t){t.classHierarchy.push("vtkPolyData"),Jm.forEach(function(n){e["getNumberOf".concat(function(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,function(e){return e.toUpperCase()}).replace(/\s+/g,"")}(n))]=function(){return t[n].getNumberOfCells()},t[n]?t[n]=Object(Uu.a)(t[n]):t[n]=pm.newInstance()}),e.getNumberOfCells=function(){return Jm.reduce(function(e,n){return e+t[n].getNumberOfCells()},0)};var n=e.shallowCopy;e.shallowCopy=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n(e,r),Jm.forEach(function(n){t[n]=pm.newInstance(),t[n].shallowCopy(e.getReferenceByName(n))})},e.buildCells=function(){var n=e.getNumberOfVerts(),r=e.getNumberOfLines(),a=e.getNumberOfPolys(),o=e.getNumberOfStrips(),i=n+r+a+o,s=new Uint8Array(i),l=s,u=new Uint32Array(i),c=u;if(n){var d=0;t.verts.getCellSizes().forEach(function(e,t){c[t]=d,l[t]=e>1?Sm.VTK_POLY_VERTEX:Sm.VTK_VERTEX,d+=e+1}),c=c.subarray(n),l=l.subarray(n)}if(r){var f=0;t.lines.getCellSizes().forEach(function(e,t){c[t]=f,l[t]=e>2?Sm.VTK_POLY_LINE:Sm.VTK_LINE,1===e&&tv("Building VTK_LINE ",t," with only one point, but VTK_LINE needs at least two points. Check the input."),f+=e+1}),c=c.subarray(r),l=l.subarray(r)}if(a){var p=0;t.polys.getCellSizes().forEach(function(e,t){switch(c[t]=p,e){case 3:l[t]=Sm.VTK_TRIANGLE;break;case 4:l[t]=Sm.VTK_QUAD;break;default:l[t]=Sm.VTK_POLYGON}e<3&&tv("Building VTK_TRIANGLE ",t," with less than three points, but VTK_TRIANGLE needs at least three points. Check the input."),p+=e+1}),c+=c.subarray(a),l+=l.subarray(a)}if(o){var g=0;l.fill(Sm.VTK_TRIANGLE_STRIP,0,o),t.strips.getCellSizes().forEach(function(e,t){c[t]=g,g+=e+1})}t.cells=Im.newInstance(),t.cells.setCellTypes(i,s,u)},e.buildLinks=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;void 0===t.cells&&e.buildCells(),t.links=Cm.newInstance(),n>0?t.links.allocate(n):t.links.allocate(e.getPoints().getNumberOfPoints()),t.links.buildLinks(e)},e.getCellPoints=function(e){var n=t.cells.getCellType(e),r=null;switch(n){case Sm.VTK_VERTEX:case Sm.VTK_POLY_VERTEX:r=t.verts;break;case Sm.VTK_LINE:case Sm.VTK_POLY_LINE:r=t.lines;break;case Sm.VTK_TRIANGLE:case Sm.VTK_QUAD:case Sm.VTK_POLYGON:r=t.polys;break;case Sm.VTK_TRIANGLE_STRIP:r=t.strips;break;default:return r=null,{type:0,cellPointIds:null}}var a=t.cells.getCellLocation(e);return{cellType:n,cellPointIds:r.getCell(a)}},e.getPointCells=function(e){return t.links.getCells(e)},e.getCellEdgeNeighbors=function(e,n,r){var a=t.links.getLink(n),o=t.links.getLink(r);return a.cells.filter(function(t){return t!==e&&-1!==o.cells.indexOf(t)})},e.getCell=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.getCellPoints(t),a=n||nv[r.cellType].newInstance();return a.initialize(e.getPoints(),r.cellPointIds),a}}(e,t)}var ov={newInstance:ur.a.newInstance(av,"vtkPolyData"),extend:av};function iv(e){return function(){return ur.a.vtkErrorMacro("vtkProp::".concat(e," - NOT IMPLEMENTED"))}}var sv={visibility:!0,pickable:!0,dragable:!0,useBounds:!0,allocatedRenderTime:10,estimatedRenderTime:0,savedEstimatedRenderTime:0,renderTimeMultiplier:1,paths:null,textures:[]};function lv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sv,n),ur.a.obj(e,t),ur.a.get(e,t,["estimatedRenderTime","allocatedRenderTime"]),ur.a.setGet(e,t,["visibility","pickable","dragable","useBounds","renderTimeMultiplier"]),function(e,t){t.classHierarchy.push("vtkProp"),e.getMTime=function(){for(var e=t.mtime,n=0;ne&&(e=r)}return e},e.getNestedProps=function(){return null},e.getActors=function(){return[]},e.getActors2D=function(){return[]},e.getVolumes=function(){return[]},e.pick=iv("pick"),e.hasKey=iv("hasKey"),e.getRedrawMTime=function(){return t.mtime},e.setEstimatedRenderTime=function(e){t.estimatedRenderTime=e,t.savedEstimatedRenderTime=e},e.restoreEstimatedRenderTime=function(){t.estimatedRenderTime=t.savedEstimatedRenderTime},e.addEstimatedRenderTime=function(e){t.estimatedRenderTime+=e},e.setAllocatedRenderTime=function(e){t.allocatedRenderTime=e,t.savedEstimatedRenderTime=t.estimatedRenderTime,t.estimatedRenderTime=0},e.getSupportsSelection=function(){return!1},e.getTextures=function(){return t.textures},e.hasTexture=function(e){return-1!==t.textures.indexOf(e)},e.addTexture=function(n){n&&!e.hasTexture(n)&&(t.textures=t.textures.concat(n),e.modified())},e.removeTexture=function(n){var r=t.textures.filter(function(e){return e!==n});t.textures.length!==r.length&&(t.textures=r,e.modified())},e.removeAllTextures=function(){t.textures=[],e.modified()}}(e,t)}var uv={newInstance:ur.a.newInstance(lv,"vtkProp"),extend:lv};var cv={origin:[0,0,0],position:[0,0,0],orientation:[0,0,0],rotation:null,scale:[1,1,1],bounds:[1,-1,1,-1,1,-1],userMatrix:null,userMatrixMTime:null,cachedProp3D:null,isIdentity:!0,matrixMTime:null};function dv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,cv,n),uv.extend(e,t,n),t.matrixMTime={},ur.a.obj(t.matrixMTime),ur.a.get(e,t,["bounds","isIdentity"]),ur.a.getArray(e,t,["orientation"]),ur.a.setGetArray(e,t,["origin","position","scale"],3),t.matrix=o.identity(new Float64Array(16)),t.rotation=o.identity(new Float64Array(16)),t.userMatrix=o.identity(new Float64Array(16)),t.transform=null,function(e,t){t.classHierarchy.push("vtkProp3D"),e.addPosition=function(n){t.position=t.position.map(function(e,t){return e+n[t]}),e.modified()},e.getOrientationWXYZ=function(){var e=l.create();o.getRotation(e,t.rotation);var n=new Float64Array(3);return[Fr(l.getAxisAngle(n,e)),n[0],n[1],n[2]]},e.rotateX=function(n){0!==n&&(o.rotateX(t.rotation,t.rotation,kr(n)),e.modified())},e.rotateY=function(n){0!==n&&(o.rotateY(t.rotation,t.rotation,kr(n)),e.modified())},e.rotateZ=function(n){0!==n&&(o.rotateZ(t.rotation,t.rotation,kr(n)),e.modified())},e.rotateWXYZ=function(n,r,a,i){if(0!==n&&(0!==r||0!==a||0!==i)){var s=kr(n),u=l.create();l.setAxisAngle(u,[r,a,i],s);var c=new Float64Array(16);o.fromQuat(c,u),o.multiply(t.rotation,t.rotation,c),e.modified()}},e.setOrientation=function(n,r,a){return(n!==t.orientation[0]||r!==t.orientation[1]||a!==t.orientation[2])&&(t.orientation=[n,r,a],o.identity(t.rotation),e.rotateZ(a),e.rotateX(n),e.rotateY(r),e.modified(),!0)},e.setUserMatrix=function(n){o.copy(t.userMatrix,n),e.modified()},e.getMatrix=function(){return e.computeMatrix(),t.matrix},e.computeMatrix=function(){if(e.getMTime()>t.matrixMTime.getMTime()){o.identity(t.matrix),t.userMatrix&&o.multiply(t.matrix,t.matrix,t.userMatrix),o.translate(t.matrix,t.matrix,t.origin),o.translate(t.matrix,t.matrix,t.position),o.multiply(t.matrix,t.matrix,t.rotation),o.scale(t.matrix,t.matrix,t.scale),o.translate(t.matrix,t.matrix,[-t.origin[0],-t.origin[1],-t.origin[2]]),o.transpose(t.matrix,t.matrix),t.isIdentity=!0;for(var n=0;n<4;++n)for(var r=0;r<4;++r)(n===r?1:0)!==t.matrix[n+4*r]&&(t.isIdentity=!1);t.matrixMTime.modified()}},e.getCenter=function(){return _u.getCenter(t.bounds)},e.getLength=function(){return _u.getLength(t.bounds)},e.getXRange=function(){return _u.getXRange(t.bounds)},e.getYRange=function(){return _u.getYRange(t.bounds)},e.getZRange=function(){return _u.getZRange(t.bounds)},e.getUserMatrix=function(){return t.userMatrix},e.onModified(function(){e.computeMatrix()})}(e,t)}var fv={newInstance:ur.a.newInstance(dv,"vtkProp3D"),extend:dv};function pv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var mv=ur.a.vtkDebugMacro;function vv(e,t){t.classHierarchy.push("vtkActor");var n=function(e){for(var t=1;t=1;return n=(n=n&&(!t.texture||!t.texture.isTranslucent()))&&(!t.mapper||t.mapper.getIsOpaque())},e.hasTranslucentPolygonalGeometry=function(){return null!==t.mapper&&(null===t.property&&e.setProperty(e.makeProperty()),!e.getIsOpaque())},e.makeProperty=qs.newInstance,e.getProperty=function(){return null===t.property&&(t.property=e.makeProperty()),t.property},e.getBounds=function(){if(null===t.mapper)return t.bounds;var n=t.mapper.getBounds();if(!n||6!==n.length)return n;if(n[0]>n[1])return t.mapperBounds=n.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),n;if(!t.mapperBounds||n[0]!==t.mapperBounds[0]||n[1]!==t.mapperBounds[1]||n[2]!==t.mapperBounds[2]||n[3]!==t.mapperBounds[3]||n[4]!==t.mapperBounds[4]||n[5]!==t.mapperBounds[5]||e.getMTime()>t.boundsMTime.getMTime()){mv("Recomputing bounds..."),t.mapperBounds=n.concat();var r=[];_u.getCorners(n,r),e.computeMatrix();var a=new Float64Array(16);o.transpose(a,t.matrix),r.forEach(function(e){return i.transformMat4(e,e,a)}),t.bounds[0]=t.bounds[2]=t.bounds[4]=Number.MAX_VALUE,t.bounds[1]=t.bounds[3]=t.bounds[5]=-Number.MAX_VALUE,t.bounds=t.bounds.map(function(e,t){return t%2==0?r.reduce(function(e,n){return e>n[t/2]?n[t/2]:e},e):r.reduce(function(e,n){return ee?r:e}if(null!==t.backfaceProperty){var a=t.backfaceProperty.getMTime();e=a>e?a:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var n=t.mapper.getMTime();e=n>e?n:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(n=t.mapper.getInput().getMTime())>e?n:e)}return e},e.getSupportsSelection=function(){return!!t.mapper&&t.mapper.getSupportsSelection()}}var hv={mapper:null,property:null,backfaceProperty:null,forceOpaque:!1,forceTranslucent:!1,bounds:[1,-1,1,-1,1,-1]};function yv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hv,n),fv.extend(e,t,n),t.boundsMTime={},ur.a.obj(t.boundsMTime),ur.a.set(e,t,["property"]),ur.a.setGet(e,t,["backfaceProperty","forceOpaque","forceTranslucent","mapper"]),vv(e,t)}var bv={newInstance:ur.a.newInstance(yv,"vtkActor"),extend:yv};function Tv(e){return function(e){if(Array.isArray(e))return Cv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Cv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cv(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Sv,n),ur.a.obj(e,t),ur.a.get(e,t,["renderWindow","renderer","openGLRenderWindow","interactor","container"]),ur.a.event(e,t,"resize"),function(e,t){var n=e.invokeResize;delete e.invokeResize,t.renderWindow=pp.newInstance(),t.renderer=vg.newInstance(),t.renderWindow.addRenderer(t.renderer),t.openGLRenderWindow=Yp.newInstance(),t.renderWindow.addView(t.openGLRenderWindow),t.interactor=Lg.newInstance(),t.interactor.setInteractorStyle(tm.newInstance()),t.interactor.setView(t.openGLRenderWindow),t.interactor.initialize(),e.setBackground=t.renderer.setBackground,e.setBackground.apply(e,Tv(t.background)),e.resize=function(){if(t.container){var e=t.container.getBoundingClientRect(),r=window.devicePixelRatio||1;t.openGLRenderWindow.setSize(Math.floor(e.width*r),Math.floor(e.height*r)),n(),t.renderWindow.render()}},e.setContainer=function(e){t.container&&t.interactor.unbindEvents(t.container),t.container=e,t.openGLRenderWindow.setContainer(t.container),t.container&&t.interactor.bindEvents(t.container)},e.delete=ur.a.chain(e.setContainer,t.openGLRenderWindow.delete,e.delete),t.listenWindowResize&&window.addEventListener("resize",e.resize),e.resize()}(e,t)}var wv={newInstance:ur.a.newInstance(Pv),extend:Pv},xv={ColorSpace:{RGB:0,HSV:1,LAB:2,DIVERGING:3},Scale:{LINEAR:0,LOG10:1}};function Ov(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Av=xv.ColorSpace,Iv=xv.Scale,Rv=Nc.ScalarMappingTarget,Ev=ur.a.vtkDebugMacro,Dv=ur.a.vtkErrorMacro,Vv=ur.a.vtkWarningMacro;function Lv(e,t){var n=e[0],r=e[1],a=e[2],o=Math.sqrt(n*n+r*r+a*a),i=o>.001?Math.acos(n/o):0,s=i>.001?Math.atan2(a,r):0;t[0]=o,t[1]=i,t[2]=s}function Nv(e,t){if(e[0]>=t-.1)return e[2];var n=e[1]*Math.sqrt(t*t-e[0]*e[0])/(e[0]*Math.sin(e[1]));return e[2]>-.3*Math.PI?e[2]+n:e[2]-n}function Bv(e,t,n,r){var a=[],o=[];Va(t,a),Va(n,o);var i=[],s=[];Lv(a,i),Lv(o,s);var l=e;if(i[1]>.05&&s[1]>.05&&function(e,t){var n=e-t;for(n<0&&(n=-n);n>=2*Math.PI;)n-=2*Math.PI;return n>Math.PI&&(n=2*Math.PI-n),n}(i[2],s[2])>.33*Math.PI){var u=Math.max(i[0],s[0]);u=Math.max(88,u),e<.5?(s[0]=u,s[1]=0,s[2]=0,l*=2):(i[0]=u,i[1]=0,i[2]=0,l=2*l-1)}i[1]<.05&&s[1]>.05?i[2]=Nv(s,i[0]):s[1]<.05&&i[1]>.05&&(s[2]=Nv(i,s[0]));var c=[];c[0]=(1-l)*i[0]+l*s[0],c[1]=(1-l)*i[1]+l*s[1],c[2]=(1-l)*i[2]+l*s[2];var d=[];!function(e,t){var n=e[0],r=e[1],a=e[2];t[0]=n*Math.cos(r),t[1]=n*Math.sin(r)*Math.cos(a),t[2]=n*Math.sin(r)*Math.sin(a)}(c,d),La(d,r)}var kv={clamping:!0,colorSpace:Av.RGB,hSVWrap:!0,scale:Iv.LINEAR,nanColor:null,belowRangeColor:null,aboveRangeColor:null,useAboveRangeColor:!1,useBelowRangeColor:!1,allowDuplicateScalars:!1,table:null,tableSize:0,buildTime:null,nodes:null,discretize:!1,numberOfValues:256};function Fv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kv,n),Nc.extend(e,t,n),t.table=[],t.nodes=[],t.nanColor=[.5,0,0,1],t.belowRangeColor=[0,0,0,1],t.aboveRangeColor=[1,1,1,1],t.buildTime={},ur.a.obj(t.buildTime),ur.a.get(e,t,["buildTime","mappingRange"]),ur.a.setGet(e,t,["useAboveRangeColor","useBelowRangeColor","colorSpace","discretize","numberOfValues"]),ur.a.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),ur.a.getArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"]),function(e,t){t.classHierarchy.push("vtkColorTransferFunction"),e.getSize=function(){return t.nodes.length},e.addRGBPoint=function(t,n,r,a){return e.addRGBPointLong(t,n,r,a,.5,0)},e.addRGBPointLong=function(n,r,a,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(i<0||i>1)return Dv("Midpoint outside range [0.0, 1.0]"),-1;if(s<0||s>1)return Dv("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(n);var l={x:n,r:r,g:a,b:o,midpoint:i,sharpness:s};t.nodes.push(l),e.sortAndUpdateRange();for(var u=0;u4&&void 0!==arguments[4]?arguments[4]:.5,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=[];return Aa([n,r,a],s),e.addRGBPoint(t,s[0],s[1],s[2],o,i)},e.setNodes=function(n){t.nodes!==n&&(t.nodes=n,e.sortAndUpdateRange())},e.sortAndUpdateRange=function(){t.nodes.sort(function(e,t){return e.x-t.x}),e.updateRange()||e.modified()},e.updateRange=function(){var n=[2];n[0]=t.mappingRange[0],n[1]=t.mappingRange[1];var r=t.nodes.length;return r?(t.mappingRange[0]=t.nodes[0].x,t.mappingRange[1]=t.nodes[r-1].x):(t.mappingRange[0]=0,t.mappingRange[1]=0),(n[0]!==t.mappingRange[0]||n[1]!==t.mappingRange[1])&&(e.modified(),!0)},e.removePoint=function(n){for(var r=0;r=t.nodes.length)return-1;var o=!1;return t.nodes.splice(r,1),0!==r&&r!==t.nodes.length||(o=e.updateRange()),o||e.modified(),a},e.movePoint=function(n,r){if(n!==r){e.removePoint(r);for(var a=0;a=n&&t.nodes[c].x<=i?t.nodes.splice(c,1):c++;e.addRGBPointLong(n,r,a,o,.5,0),e.addRGBPointLong(i,s,l,u,.5,0),e.modified()},e.addHSVSegment=function(t,n,r,a,o,i,s,l){var u=[i,s,l],c=[],d=[];Aa([n,r,a],c),Aa(u,d),e.addRGBSegment(t,c[0],c[1],c[2],o,d[0],d[1],d[2])},e.mapValue=function(t){var n=[];return e.getColor(t,n),[Math.floor(255*n[0]+.5),Math.floor(255*n[1]+.5),Math.floor(255*n[2]+.5),255]},e.getColor=function(n,r){if(t.indexedLookup){var a=e.getSize(),o=e.getAnnotatedValueIndexInternal(n);if(o<0||0===a)e.getNanColor(r);else{var i=[];e.getNodeValue(o%a,i),r[0]=i.r,r[1]=i.g,r[2]=i.b}}else e.getTable(n,n,1,r)},e.getRedValue=function(t){var n=[];return e.getColor(t,n),n[0]},e.getGreenValue=function(t){var n=[];return e.getColor(t,n),n[1]},e.getBlueValue=function(t){var n=[];return e.getColor(t,n),n[2]},e.getTable=function(n,r,a,o){if(Ha(n)||Ha(r))for(var i=0;i0);var C=0,S=0,P=0;T&&(C=Math.log10(n),S=Math.log10(r));for(var w=0;w1?T?(P=C+w/(a-1)*(S-C),f=Math.pow(10,P)):f=n+w/(a-1)*(r-n):T?(P=.5*(C+S),f=Math.pow(10,P)):f=.5*(n+r),t.discretize){var O=t.mappingRange;if(f>=O[0]&&f<=O[1]){var M=t.numberOfValues,A=O[1]-O[0];if(M<=1)f=O[0]+A/2;else{var I=(f-O[0])/A,R=_r(M*I);f=O[0]+R/(M-1)*A}}}for(;st.nodes[s].x;)++s.99999&&(h=.99999));if(f>t.mappingRange[1])o[x]=0,o[x+1]=0,o[x+2]=0,t.clamping&&(e.getUseAboveRangeColor()?(o[x]=t.aboveRangeColor[0],o[x+1]=t.aboveRangeColor[1],o[x+2]=t.aboveRangeColor[2]):(o[x]=u,o[x+1]=c,o[x+2]=d));else if(f0&&(o[x]=t.nodes[0].r,o[x+1]=t.nodes[0].g,o[x+2]=t.nodes[0].b));else if(0===s&&(Math.abs(f-n)<1e-6||t.discretize))l>0?(o[x]=t.nodes[0].r,o[x+1]=t.nodes[0].g,o[x+2]=t.nodes[0].b):(o[x]=0,o[x+1]=0,o[x+2]=0);else{var E=0;if(E=(E=T?(P-p)/(g-p):(f-p)/(g-p)).99){if(E<.5){o[x]=m[0],o[x+1]=m[1],o[x+2]=m[2];continue}o[x]=v[0],o[x+1]=v[1],o[x+2]=v[2];continue}if(y<.01){if(t.colorSpace===Av.RGB)o[x]=(1-E)*m[0]+E*v[0],o[x+1]=(1-E)*m[1]+E*v[1],o[x+2]=(1-E)*m[2]+E*v[2];else if(t.colorSpace===Av.HSV){var D=[],V=[];Ma(m,D),Ma(v,V),t.hSVWrap&&(D[0]-V[0]>.5||V[0]-D[0]>.5)&&(D[0]>V[0]?D[0]-=1:V[0]-=1);var L=[];L[0]=(1-E)*D[0]+E*V[0],L[0]<0&&(L[0]+=1),L[1]=(1-E)*D[1]+E*V[1],L[2]=(1-E)*D[2]+E*V[2],Aa(L,b),o[x]=b[0],o[x+1]=b[1],o[x+2]=b[2]}else if(t.colorSpace===Av.LAB){var N=[],B=[];Va(m,N),Va(v,B);var k=[];k[0]=(1-E)*N[0]+E*B[0],k[1]=(1-E)*N[1]+E*B[1],k[2]=(1-E)*N[2]+E*B[2],La(k,b),o[x]=b[0],o[x+1]=b[1],o[x+2]=b[2]}else t.colorSpace===Av.DIVERGING?(Bv(E,m,v,b),o[x]=b[0],o[x+1]=b[1],o[x+2]=b[2]):Dv("ColorSpace set to invalid value.",t.colorSpace);continue}E<.5?E=.5*Math.pow(2*E,1+10*y):E>.5&&(E=1-.5*Math.pow(2*(1-E),1+10*y));var F=E*E,G=F*E,_=2*G-3*F+1,U=-2*G+3*F,j=G-2*F+E,W=G-F,z=void 0;if(t.colorSpace===Av.RGB)for(var H=0;H<3;H++)z=(1-y)*(v[H]-m[H]),o[x+H]=_*m[H]+U*v[H]+j*z+W*z;else if(t.colorSpace===Av.HSV){var K=[],X=[];Ma(m,K),Ma(v,X),t.hSVWrap&&(K[0]-X[0]>.5||X[0]-K[0]>.5)&&(K[0]>X[0]?K[0]-=1:X[0]-=1);for(var q=[],Y=0;Y<3;Y++)z=(1-y)*(X[Y]-K[Y]),q[Y]=_*K[Y]+U*X[Y]+j*z+W*z,0===Y&&q[Y]<0&&(q[Y]+=1);Aa(q,b),o[x]=b[0],o[x+1]=b[1],o[x+2]=b[2]}else if(t.colorSpace===Av.LAB){var Z=[],Q=[];Va(m,Z),Va(v,Q);for(var $=[],J=0;J<3;J++)z=(1-y)*(Q[J]-Z[J]),$[J]=_*Z[J]+U*Q[J]+j*z+W*z;La($,b),o[x]=b[0],o[x+1]=b[1],o[x+2]=b[2]}else t.colorSpace===Av.DIVERGING?(Bv(E,m,v,b),o[x]=b[0],o[x+1]=b[1],o[x+2]=b[2]):Dv("ColorSpace set to invalid value.");for(var ee=0;ee<3;ee++)o[x+ee]=o[x+ee]<0?0:o[x+ee],o[x+ee]=o[x+ee]>1?1:o[x+ee]}}}},e.getUint8Table=function(n,r,a){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.getMTime()<=t.buildTime&&t.tableSize===a&&t.tableWithAlpha!==o)return t.table;if(0===t.nodes.length)return Dv("Attempting to lookup a value with no points in the function"),t.table;var i=o?4:3;t.tableSize===a&&t.tableWithAlpha===o||(t.table=new Uint8Array(a*i),t.tableSize=a,t.tableWithAlpha=o);var s=[];e.getTable(n,r,a,s);for(var l=0;l1&&(i=(r-n)/(a-1));for(var s=0;s=t.nodes.length?(Dv("Index out of range!"),-1):(n[0]=t.nodes[e].x,n[1]=t.nodes[e].r,n[2]=t.nodes[e].g,n[3]=t.nodes[e].b,n[4]=t.nodes[e].midpoint,n[5]=t.nodes[e].sharpness,1)},e.setNodeValue=function(n,r){if(n<0||n>=t.nodes.length)return Dv("Index out of range!"),-1;var a=t.nodes[n].x;return t.nodes[n].x=r[0],t.nodes[n].r=r[1],t.nodes[n].g=r[2],t.nodes[n].b=r[3],t.nodes[n].midpoint=r[4],t.nodes[n].sharpness=r[5],a!==r[0]?e.sortAndUpdateRange():e.modified(),1},e.getNumberOfAvailableColors=function(){return t.indexedLookup&&e.getSize()?e.getSize():t.tableSize?t.tableSize:16777216},e.getIndexedColor=function(t,n){var r=e.getSize();if(r>0&&t>=0){var a=[];e.getNodeValue(t%r,a);for(var o=0;o<3;++o)n[o]=a[o+1];n[3]=1}else e.getNanColor(n),n[3]=1},e.fillFromDataPointer=function(t,n){if(!(t<=0)&&n){e.removeAllPoints();for(var r=0;rn[1]?(e.getColor(n[1],a),e.addRGBPoint(n[1],a[0],a[1],a[2])):(e.getColor(r[1],a),e.addRGBPoint(n[1],a[0],a[1],a[2])),e.sortAndUpdateRange();for(var o=0;o=n[0]&&t.nodes[o].x<=n[1]?t.nodes.splice(o,1):++o;return 1},e.estimateMinNumberOfSamples=function(t,n){var r=e.findMinimumXDistance();return Math.ceil((n-t)/r)},e.findMinimumXDistance=function(){if(t.nodes.length<2)return-1;for(var e=Number.MAX_VALUE,n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Uv,n),ur.a.obj(e,t),t.nodes=[],ur.a.setGet(e,t,["allowDuplicateScalars","clamping"]),ur.a.setArray(e,t,["range"],2),ur.a.getArray(e,t,["range"]),function(e,t){t.classHierarchy.push("vtkPiecewiseFunction"),e.getSize=function(){return t.nodes.length},e.getType=function(){var e,n=0,r=0;t.nodes.length>0&&(n=t.nodes[0].y);for(var a=1;an)switch(r){case 0:case 1:r=1;break;default:case 2:r=3}else switch(r){case 0:case 2:r=2;break;default:case 1:r=3}if(n=e,3===r)break}switch(r){case 0:return"Constant";case 1:return"NonDecreasing";case 2:return"NonIncreasing";default:case 3:return"Varied"}},e.getDataPointer=function(){var e=t.nodes.length;if(t.function=null,e>0){t.function=[];for(var n=0;n0?t.nodes[n-1].x:t.clamping?-Number.MAX_VALUE:t.nodes[0].x},e.getNodeValue=function(e,n){var r=t.nodes.length;return e<0||e>=r?(_v("Index out of range!"),-1):(n[0]=t.nodes[e].x,n[1]=t.nodes[e].y,n[2]=t.nodes[e].midpoint,n[3]=t.nodes[e].sharpness,1)},e.setNodeValue=function(n,r){var a=t.nodes.length;if(n<0||n>=a)return _v("Index out of range!"),-1;var o=t.nodes[n].x;return t.nodes[n].x=r[0],t.nodes[n].y=r[1],t.nodes[n].midpoint=r[2],t.nodes[n].sharpness=r[3],o!==r[0]?e.sortAndUpdateRange():e.modified(),1},e.addPoint=function(t,n){return e.addPointLong(t,n,.5,0)},e.addPointLong=function(n,r,a,o){if(a<0||a>1)return _v("Midpoint outside range [0.0, 1.0]"),-1;if(o<0||o>1)return _v("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(n);var i,s={x:n,y:r,midpoint:a,sharpness:o};for(t.nodes.push(s),e.sortAndUpdateRange(),i=0;i=t.nodes.length)return-1;var a=r,o=!1;return t.nodes.splice(r,1),0!==r&&r!==t.nodes.length||(o=e.updateRange()),o||e.modified(),a},e.removeAllPoints=function(){t.nodes=[],e.sortAndUpdateRange()},e.addSegment=function(n,r,a,o){e.sortAndUpdateRange();for(var i=0;i=n&&t.nodes[i].x<=a?t.nodes.splice(i,1):i++;e.addPoint(n,r,.5,0),e.addPoint(a,o,.5,0)},e.getValue=function(t){var n=[];return e.getTable(t,t,1,n),n[0]},e.adjustRange=function(n){if(n.length<2)return 0;var r=e.getRange();r[0]n[1]?e.addPoint(n[1],e.getValue(n[1])):e.addPoint(n[1],e.getValue(r[1])),e.sortAndUpdateRange();for(var a=0;a=n[0]&&t.nodes[a].x<=n[1]?t.nodes.splice(a,1):++a;return e.sortAndUpdateRange(),1},e.estimateMinNumberOfSamples=function(t,n){var r=e.findMinimumXDistance();return Math.ceil((n-t)/r)},e.findMinimumXDistance=function(){var e=t.nodes.length;if(e<2)return-1;for(var n=t.nodes[1].x-t.nodes[0].x,r=0;r4&&void 0!==arguments[4]?arguments[4]:1,s=0,l=t.nodes.length,u=0;0!==l&&(u=t.nodes[l-1].y);var c=0,d=0,f=0,p=0,g=0,m=0,v=0;for(o=0;o1?e+o/(r-1)*(n-e):.5*(e+n);st.nodes[s].x;)++s.99999&&(m=.99999));if(s>=l)a[h]=t.clamping?u:0;else if(0===s)a[h]=t.clamping?t.nodes[0].y:0;else{var y=(c-d)/(f-d);if(y=y.99){if(y<.5){a[h]=p;continue}a[h]=g;continue}if(v<.01){a[h]=(1-y)*p+y*g;continue}y<.5?y=.5*Math.pow(2*y,1+10*v):y>.5&&(y=1-.5*Math.pow(2*(1-y),1+10*v));var b=y*y,T=b*y,C=2*T-3*b+1,S=-2*T+3*b,P=T-2*b+y,w=T-b,x=(1-v)*(g-p);a[h]=C*p+S*g+P*x+w*x;var O=pg?p:g;a[h]=a[h]M?M:a[h]}}}}(e,t)}var Wv={newInstance:ur.a.newInstance(jv,"vtkPiecewiseFunction"),extend:jv},zv={DEFAULT:0,GEOMETRY:1,SLICE:2,VOLUME:3,YZ_PLANE:4,XZ_PLANE:5,XY_PLANE:6},Hv={PICKING_BUFFER:0,FRONT_BUFFER:1},Kv={ViewTypes:zv,RenderingTypes:Hv,CaptureOn:{MOUSE_MOVE:0,MOUSE_RELEASE:1}},Xv=.5;var qv={contextVisibility:!0,handleVisibility:!0,hasFocus:!1};function Yv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,qv,n),uv.extend(e,t,n),Wg.extend(e,t,n),ur.a.setGet(e,t,["contextVisibility","handleVisibility","widgetManager"]),ur.a.get(e,t,["representations","widgetState"]),ur.a.event(e,t,"ActivateHandle"),function(e,t){t.classHierarchy.push("vtkAbstractWidget"),t.actorToRepresentationMap=new WeakMap,e.getBounds=t.widgetState.getBounds,e.getNestedProps=function(){return t.representations},e.activateHandle=function(n){var r=n.selectedState,a=n.representation;t.widgetState.activateOnly(r),t.activeState=r,r&&r.updateManipulator&&r.updateManipulator(),e.invokeActivateHandle({selectedState:r,representation:a}),e.updateCursor&&e.updateCursor()},e.deactivateAllHandles=function(){t.widgetState.deactivate()},e.hasActor=function(e){return t.actorToRepresentationMap.has(e)},e.grabFocus=function(){t.hasFocus=!0},e.loseFocus=function(){t.hasFocus=!1},e.hasFocus=function(){return t.hasFocus},e.placeWidget=function(e){return t.widgetState.placeWidget(e)},e.getPlaceFactor=function(){return t.widgetState.getPlaceFactor()},e.setPlaceFactor=function(e){return t.widgetState.setPlaceFactor(e)},e.getRepresentationFromActor=function(e){return t.actorToRepresentationMap.get(e)},e.updateRepresentationForRender=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hv.FRONT_BUFFER,n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qv,n),dd.extend(e,t,n),ur.a.setGet(e,t,["callback","useZValues"]),function(e,t){t.classHierarchy.push("vtkPixelSpaceCallbackMapper"),t.callback||(t.callback=function(){}),e.invokeCallback=function(e,n,r,a,s){if(t.callback){var l=n.getCompositeProjectionMatrix(r,-1,1);o.transpose(l,l);for(var u=e.getPoints(),c=new Float64Array(3),d=a.usize,f=a.vsize,p=d/2,g=f/2,m=[],v=0;ve.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ih,n),uv.extend(e,t,n),ur.a.algo(e,t,1,1),ur.a.get(e,t,["labels","coincidentTopologyParameters"]),ur.a.set(e,t,["displayScaleParams"]),ur.a.setGet(e,t,["scaleInPixels"]),function(e,t){t.classHierarchy.push("vtkWidgetRepresentation");var n={mtimes:{},states:[]};function r(e,t){e&&e.setResolveCoincidentTopologyToPolygonOffset&&(e.setResolveCoincidentTopologyToPolygonOffset(),Yc.forEach(function(n){if(t[n]){var r="setRelativeCoincidentTopology".concat(n,"OffsetParameters");if(e[r]){var a=t[n],o=a.factor,i=a.offset;e[r](o,i)}}}))}e.getActors=function(){return t.actors},e.getNestedProps=e.getActors,e.setLabels=function(){for(var n=arguments.length,r=new Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:t.inputData[0];return n.mtimes.representation===e.getMTime()&&n.mtimes.input===r.getMTime()?n.states:(n.mtimes.representation=e.getMTime(),n.mtimes.input=r.getMTime(),n.states=[],t.labels.forEach(function(e){n.states=n.states.concat(r.getStatesWithLabel(e)||[])}),n.states)},e.getSelectedState=function(t,n){var r=e.getRepresentationStates();return n0&&void 0!==arguments[0]?arguments[0]:Hv.FRONT_BUFFER,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!0;switch(t.behavior){case eh.HANDLE:o=e===Hv.PICKING_BUFFER||a;break;case eh.CONTEXT:o=e===Hv.FRONT_BUFFER&&r;break;default:o=!0}for(var i=n&&o,s=0;s1?t-1:0),r=1;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n=i;f--)d(f)}return n}function hh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ah,n),ur.a.obj(e,t),ur.a.setGet(e,t,["captureOn",{type:"enum",name:"viewType",enum:bh}]),ur.a.get(e,t,["selections","widgets","viewId","pickingEnabled","useSvgLayer"]),Mh(e,t)}var Rh={newInstance:ur.a.newInstance(Ih,"vtkWidgetManager"),extend:Ih,Constants:Kv};function Eh(e){return function(e){if(Array.isArray(e))return Dh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Dh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dh(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2];ur.a.obj(e,t),ur.a.get(e,t,["widgetState"]),ur.a.event(e,t,"WidgetChange"),function(e,t){t.classHierarchy.push("vtkAbstractWidgetFactory");var n={};e.getWidgetForView=function(r){var a=r.viewId,o=r.renderer,i=r.viewType,s=r.initialValues;if(!n[a]){if(!o)return null;var l=Oh(o),u=l.interactor,c=l.apiSpecificRenderWindow,d=l.camera,f={},p={onWidgetChange:e.onWidgetChange};Object.assign(f,t,{viewType:i,renderer:o,camera:d,apiSpecificRenderWindow:c,factory:e}),ur.a.safeArrays(f),Zv.extend(p,f,s);var g=s;f.representations=e.getRepresentationsForViewType(i).map(function(e){var t=e.builder,n=e.labels,r=e.initialValues;return t.newInstance(Lh(Lh({labels:n},r),g))}),f.representations.forEach(function(e){e.setInputData(f.widgetState),e.getActors().forEach(function(t){f.actorToRepresentationMap.set(t,e)})}),t.behavior(p,f),["coincidentTopologyParameters"].concat(Eh(t.methodsToLink||[])).forEach(function(e){var t,n="set".concat(ur.a.capitalize(e)),r="get".concat(ur.a.capitalize(e)),a=(Nh(t={},e,[]),Nh(t,n,[]),Nh(t,r,[]),t);f.representations.forEach(function(t){t[e]&&a[e].push(t[e]),t[n]&&a[n].push(t[n]),t[r]&&a[r].push(t[r])}),Object.keys(a).forEach(function(e){var t=a[e];1===t.length?p[e]=t[0]:t.length>1&&(p[e]=ur.a.chain.apply(ur.a,Eh(t)))})}),p.delete=ur.a.chain(function(){delete n[a]},p.delete),p.setInteractor(u);var m=Object.freeze(p);return n[a]=m,m}return n[a]},e.getViewIds=function(){return Object.keys(n)},e.setVisibility=function(e){for(var t=Object.keys(n),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_h,n),ur.a.obj(e,t),ur.a.setGetArray(e,t,["normal","origin"],3),function(e,t){t.classHierarchy.push("vtkPlaneManipulator"),e.handleEvent=function(e,n){return Gh(e.position.x,e.position.y,t.origin,t.normal,e.pokedRenderer,n)}}(e,t)}var jh={intersectDisplayWithPlane:Gh,extend:Uh,newInstance:ur.a.newInstance(Uh,"vtkPlaneManipulator")};function Wh(e,t,n,r,a,o){var i=o.displayToWorld(e,t,0,a),s=[0,0,0];Qr(o.displayToWorld(e,t,1,a),i,s);var l=[0,0,0];ta(r,s,l),ta(l,s,l);var u=ea([i[0]-n[0],i[1]-n[1],i[2]-n[2]],l),c=ea(l,r),d=r.slice();return $r(d,u/c),Zr(n,d,d),d}var zh={origin:[0,0,0],normal:[0,0,1]};function Hh(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zh,n),ur.a.obj(e,t),ur.a.setGetArray(e,t,["origin","normal"],3),function(e,t){t.classHierarchy.push("vtkLineManipulator"),e.handleEvent=function(e,n){return Wh(e.position.x,e.position.y,t.origin,t.normal,e.pokedRenderer,n)}}(e,t)}var Kh={projectDisplayToLine:Wh,extend:Hh,newInstance:ur.a.newInstance(Hh,"vtkLineManipulator")},Xh={OrientationModes:{DIRECTION:0,ROTATION:1,MATRIX:2},ScaleModes:{SCALE_BY_CONSTANT:0,SCALE_BY_MAGNITUDE:1,SCALE_BY_COMPONENTS:2}};function qh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Yh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zh(e){return function(e){if(Array.isArray(e))return Qh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Qh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qh(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ty,n),dd.extend(e,t,n),ur.a.algo(e,t,2,0),t.buildTime={},ur.a.obj(t.buildTime,{mtime:0}),t.boundsTime={},ur.a.obj(t.boundsTime,{mtime:0}),ur.a.setGet(e,t,["orient","orientationMode","orientationArray","scaleArray","scaleFactor","scaleMode","scaling"]),ur.a.get(e,t,["colorArray","matrixArray","normalArray","buildTime"]),function(e,t){t.classHierarchy.push("vtkGlyph3DMapper"),e.getOrientationModeAsString=function(){return ur.a.enumToString($h,t.orientationMode)},e.setOrientationModeToDirection=function(){return e.setOrientationMode($h.DIRECTION)},e.setOrientationModeToRotation=function(){return e.setOrientationMode($h.ROTATION)},e.setOrientationModeToMatrix=function(){return e.setOrientationMode($h.MATRIX)},e.getOrientationArrayData=function(){var n=e.getInputData(0);return n&&n.getPointData()?t.orientationArray?n.getPointData().getArray(t.orientationArray):n.getPointData().getVectors():null},e.getScaleModeAsString=function(){return ur.a.enumToString(Jh,t.scaleMode)},e.setScaleModeToScaleByMagnitude=function(){return e.setScaleMode(Jh.SCALE_BY_MAGNITUDE)},e.setScaleModeToScaleByComponents=function(){return e.setScaleMode(Jh.SCALE_BY_COMPONENTS)},e.setScaleModeToScaleByConstant=function(){return e.setScaleMode(Jh.SCALE_BY_CONSTANT)},e.getScaleArrayData=function(){var n=e.getInputData(0);return n&&n.getPointData()?t.scaleArray?n.getPointData().getArray(t.scaleArray):n.getPointData().getScalars():null},e.getBounds=function(){var n=e.getInputData(0),r=e.getInputData(1);return n&&r?(e.buildArrays(),t.bounds):Ka()},e.buildArrays=function(){var n=e.getInputData(0),r=e.getInputData(1);if(t.buildTime.getMTime()t.bounds[1]&&(t.bounds[1]=p[0]),p[1]>t.bounds[3]&&(t.bounds[3]=p[1]),p[2]>t.bounds[5]&&(t.bounds[5]=p[2]);var E=new Float32Array(T,36*S,9);a.fromMat4(E,P),a.invert(E,E),a.transpose(E,E)}var D=e.getAbstractScalars(n,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]),t.colorArray=null;var V=e.getLookupTable();V&&D&&(V.build(),t.colorArray=V.mapScalars(D,t.colorMode,0)),t.buildTime.modified()}},e.getPrimitiveCount=function(){var t=e.getInputData(1),n=e.getInputData().getPoints().getNumberOfValues()/3;return{points:n*t.getPoints().getNumberOfValues()/3,verts:n*(t.getVerts().getNumberOfValues()-t.getVerts().getNumberOfCells()),lines:n*(t.getLines().getNumberOfValues()-2*t.getLines().getNumberOfCells()),triangles:n*(t.getPolys().getNumberOfValues()-3*t.getLines().getNumberOfCells())}}}(e,t)}var ry=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},r=oy(oy({},sy),n);sh.extend(e,t,r),ur.a.setGet(e,t,["activeScaleFactor","activeColor","useActiveColor"]),function(e,t){t.classHierarchy.push("vtkHandleRepresentation")}(0,t)}};var uy={radius:.5,latLongTessellation:!1,thetaResolution:8,startTheta:0,endTheta:360,phiResolution:8,startPhi:0,endPhi:180,center:[0,0,0],pointType:"Float32Array"};function cy(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uy,n),ur.a.obj(e,t),ur.a.setGet(e,t,["radius","latLongTessellation","thetaResolution","startTheta","endTheta","phiResolution","startPhi","endPhi"]),ur.a.setGetArray(e,t,["center"],3),ur.a.algo(e,t,0,1),function(e,t){t.classHierarchy.push("vtkSphereSource"),e.requestData=function(e,n){if(!t.deleted){var r=n[0],a=r?r.getPoints().getDataType():"Float32Array";r=ov.newInstance();var o=0,i=t.thetaResolution,s=t.startThetat.startTheta?t.endTheta:t.startTheta;l*=Math.PI/180;var u=t.startPhit.startPhi?t.endPhi:t.startPhi;c*=Math.PI/180,Math.abs(s-l)<2*Math.PI&&++i;var d=(l-s)/t.thetaResolution,f=t.startPhi<=0?1:0,p=t.phiResolution+(t.endPhi>=180?-1:0),g=t.phiResolution*i+2,m=2*t.phiResolution*t.thetaResolution,v=0,h=ur.a.newTypedArray(a,3*g),y=new Float32Array(3*g),b=0,T=new Uint32Array(5*m);t.startPhi<=0&&(h[3*v+0]=t.center[0],h[3*v+1]=t.center[1],h[3*v+2]=t.center[2]+t.radius,y[3*v+0]=0,y[3*v+1]=0,y[3*v+2]=1,v++,o++),t.endPhi>=180&&(h[3*v+0]=t.center[0],h[3*v+1]=t.center[1],h[3*v+2]=t.center[2]-t.radius,y[3*v+0]=0,y[3*v+1]=0,y[3*v+2]=-1,v++,o++);for(var C=t.phiResolution-o,S=(c-u)/(t.phiResolution-1),P=0;P=180)for(var E=C-1+o,D=0;D2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fy,n),ly.extend(e,t,n),ur.a.get(e,t,["glyph","mapper","actor"]),function(e,t){function n(n){if(t.displayCallback){for(var r=[],a=e.getRepresentationStates(),o=0;o2&&void 0!==arguments[2]?arguments[2]:{},r=vy(vy({},yy),n);sh.extend(e,t,r),function(e,t){t.classHierarchy.push("vtkContextRepresentation")}(0,t)}};function Ty(e){return function(e){if(Array.isArray(e))return Cy(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Cy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cy(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,wy,n),by.extend(e,t,n),ur.a.setGetArray(e,t,["edgeColor"],3),ur.a.get(e,t,["mapper","actor"]),function(e,t){var n;t.classHierarchy.push("vtkCroppingOutlineRepresentation"),t.internalPolyData=ov.newInstance({mtime:0}),t.points=new Float32Array(24),t.internalPolyData.getPoints().setData(t.points,3),t.internalPolyData.getLines().setData(Uint16Array.from(Py)),t.mapper=dd.newInstance({scalarVisibility:!1}),t.actor=bv.newInstance(),(n=t.actor.getProperty()).setEdgeColor.apply(n,Ty(t.edgeColor)),t.mapper.setInputConnection(e.getOutputPort()),t.actor.setMapper(t.mapper),e.addActor(t.actor),e.requestData=function(n,r){var a=e.getRepresentationStates(n[0]);if(8===a.length){for(var o=0,i=0;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ky,n),ur.a.obj(e,t),ur.a.setGet(e,t,["active"]),function(e,t){t.classHierarchy.push("vtkWidgetState");var n=[];t.labels={},t.nestedStates=[],e.bindState=function(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Ny];if(t.nestedStates.push(r),n.push(r.onModified(e.modified)),Array.isArray(a)&&a.length)for(var o=0;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Uy,n),ur.a.setGetArray(e,t,["bounds"],6),ur.a.get(e,t,["placeFactor"]),ur.a.event(e,t,"BoundsChange"),t.bounds=t.bounds.slice(),function(e,t){var n=[],r=Gy(_u.INIT_BOUNDS);e.containsPoint=function(e,t,n){return Array.isArray(e)?_u.containsPoint(r,e[0],e[1],e[2]):_u.containsPoint(r,e,t,n)},e.placeWidget=function(a){t.bounds=[];for(var o=[(a[0]+a[1])/2,(a[2]+a[3])/2,(a[4]+a[5])/2],i=0;i<6;i++){var s=o[Math.floor(i/2)];n[i]=a[i],t.bounds[i]=(a[i]-s)*t.placeFactor+s}_u.setBounds(r,t.bounds),e.invokeBoundsChange(t.bounds),e.modified()},e.setPlaceFactor=function(a){if(t.placeFactor!==a){t.placeFactor=a,t.bounds=[];for(var o=[(n[0]+n[1])/2,(n[2]+n[3])/2,(n[4]+n[5])/2],i=0;i<6;i++){var s=o[Math.floor(i/2)];t.bounds[i]=(n[i]-s)*t.placeFactor+s}_u.setBounds(r,t.bounds),e.invokeBoundsChange(t.bounds),e.modified()}}}(e,t)}},Wy={color:.5};var zy={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Wy,n),ur.a.setGet(e,t,["color"])}};function Hy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ky(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ky(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ky(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Xy,n),ur.a.setGetArray(e,t,["corner"],3),function(e,t){e.translate=function(t,n,r){var a=Hy(e.getCornerByReference(),3),o=a[0],i=a[1],s=a[2];e.setCorner(o+t,i+n,s+r)}}(e)}};function Yy(e){return function(e){if(Array.isArray(e))return Zy(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Zy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zy(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]&&arguments[0];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.matrix=o.identity(new Float64Array(16)),this.tmp=new Float64Array(3),this.angleConv=t?r.toRadian:$y}return function(e,t,n){t&&Qy(e.prototype,t),n&&Qy(e,n)}(e,[{key:"rotateFromDirections",value:function(e,t){var n=new Float64Array(3),r=new Float64Array(3),a=new Float64Array(16);i.set(n,e[0],e[1],e[2]),i.set(r,t[0],t[1],t[2]),i.normalize(n,n),i.normalize(r,r);var s=i.dot(n,r);return s>=1?this:(i.cross(this.tmp,n,r),i.length(this.tmp)<1e-6&&(i.cross(this.tmp,[1,0,0],e),i.length(this.tmp)<1e-6&&i.cross(this.tmp,[0,1,0],e)),o.fromRotation(a,Math.acos(s),this.tmp),o.multiply(this.matrix,this.matrix,a),this)}},{key:"rotate",value:function(e,t){return i.set.apply(i,[this.tmp].concat(Yy(t))),i.normalize(this.tmp,this.tmp),o.rotate(this.matrix,this.matrix,this.angleConv(e),this.tmp),this}},{key:"rotateX",value:function(e){return o.rotateX(this.matrix,this.matrix,this.angleConv(e)),this}},{key:"rotateY",value:function(e){return o.rotateY(this.matrix,this.matrix,this.angleConv(e)),this}},{key:"rotateZ",value:function(e){return o.rotateZ(this.matrix,this.matrix,this.angleConv(e)),this}},{key:"translate",value:function(e,t,n){return i.set(this.tmp,e,t,n),o.translate(this.matrix,this.matrix,this.tmp),this}},{key:"scale",value:function(e,t,n){return i.set(this.tmp,e,t,n),o.scale(this.matrix,this.matrix,this.tmp),this}},{key:"multiply",value:function(e){return o.multiply(this.matrix,this.matrix,e),this}},{key:"identity",value:function(){return o.identity(this.matrix),this}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(ma(Jy,this.matrix))return this;for(var r=-1===n?e.length:t+3*n,a=t;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,nb,n),ur.a.setGetArray(e,t,["direction"],3),function(e,t){var n="degree"===t.angleUnit?tb.buildFromDegree():tb.buildFromRadian();e.rotateFromDirections=function(r,a){n.identity().rotateFromDirections(r,a).apply(t.direction),e.modified()},e.rotate=function(e,r){n.identity().rotate(e,r).apply(t.direction)},e.rotateX=function(e){n.identity().rotateX(e).apply(t.direction)},e.rotateY=function(e){n.identity().rotateY(e).apply(t.direction)},e.rotateZ=function(e){n.identity().rotateZ(e).apply(t.direction)}}(e,t)}};var ab={manipulator:null};var ob={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ab,n),ur.a.setGet(e,t,["manipulator"]),function(e,t){e.updateManipulator=function(){if(t.manipulator){var e=t.origin,n=t.normal,r=t.direction,a=t.manipulator,o=a.setOrigin,i=a.setCenter,s=a.setNormal,l=a.setDirection;e&&o?o(e):e&&i&&i(e),r&&l?l(r):r&&!n&&s?s(r):n&&l&&l(n)}}}(e,t)}},ib={name:""};var sb={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ib,n),ur.a.setGet(e,t,["name"])}};function lb(e,t){return 3===e.length&&3===t.length&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function ub(e,t){var n={o:[],p1:[],p2:[]};e.normalize=function(){ra(t.up),ra(t.right),ra(t.direction),e.modified()},e.updateFromOriginRightUp=function(r,a,o){(function(e,t,n,r){return lb(e,r.o)&&lb(t,r.p1)&&lb(n,r.p2)})(r,a,o,n)||(n.o=r.slice(),n.p1=a.slice(),n.p2=o.slice(),t.up=[o[0]-r[0],o[1]-r[1],o[2]-r[2]],t.right=[a[0]-r[0],a[1]-r[1],a[2]-r[2]],ta(t.up,t.right,t.direction),ta(t.direction,t.up,t.right),e.normalize(),e.modified())}}var cb={up:[0,1,0],right:[1,0,0],direction:[0,0,1]};var db={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,cb,n),ur.a.setGetArray(e,t,["up","right","direction"],3),ub(e,t)}};function fb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gb,n),ur.a.setGetArray(e,t,["origin"],3),function(e,t){e.translate=function(t,n,r){var a=fb(e.getOriginByReference(),3),o=a[0],i=a[1],s=a[2];e.setOrigin(o+t,i+n,s+r)}}(e)}},vb={scale1:.5};var hb={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vb,n),ur.a.setGet(e,t,["scale1"])}},yb={scale3:[1,1,1]};var bb={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yb,n),ur.a.setGetArray(e,t,["scale3"],3)}},Tb={text:"DefaultText"};var Cb={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tb,n),ur.a.setGet(e,t,["text"])}},Sb={visible:!0};var Pb={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Sb,n),ur.a.setGet(e,t,["visible"]),e.isVisible=e.getVisible}},wb={shape:""};var xb={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,wb,n),ur.a.setGet(e,t,["shape"])}};function Ob(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};arguments.length>4&&void 0!==arguments[4]&&arguments[4]||Fy.extend(n,r,t);for(var a=0;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zb,n),Fh.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkImageCroppingWidget");var n=null;function r(e,n){t.widgetState.getStatesWithLabel(e).forEach(function(e){e.setVisible(n)})}e.setFaceHandlesEnabled=function(e){return r("faces",e)},e.setEdgeHandlesEnabled=function(e){return r("edges",e)},e.setCornerHandlesEnabled=function(e){return r("corners",e)},e.copyImageDataDescription=function(n){var r,a;(r=t.widgetState).setIndexToWorldT.apply(r,Ub(n.getIndexToWorld())),(a=t.widgetState).setWorldToIndexT.apply(a,Ub(n.getWorldToIndex()));var o=n.getDimensions();t.widgetState.getCroppingPlanes().setPlanes([0,o[0],0,o[1],0,o[2]]),e.modified()},e.updateHandles=function(){for(var e=t.widgetState.getCroppingPlanes().getPlanes(),n=[(e[0]+e[1])/2,(e[2]+e[3])/2,(e[4]+e[5])/2],r=[e[0],n[0],e[1]],a=[e[2],n[1],e[3]],o=[e[4],n[2],e[5]],i=t.widgetState.getIndexToWorldT(),s=function(e){return Iy[e]},l=0;l<3;l++)for(var u=0;u<3;u++)for(var c=0;c<3;c++)if(1!==l||1!==u||1!==c){var d=[l,u,c].map(s).join(""),f=Ry([r[l],a[u],o[c]],i),p=_b(t.widgetState.getStatesWithLabel(d),1)[0];p.setOrigin.apply(p,Ub(f))}},e.delete=ur.a.chain(e.delete,function(){n&&n.unsubscribe()}),t.behavior=Ly,t.widgetState=Gb(),e.getRepresentationsForViewType=function(e){switch(e){case zv.DEFAULT:case zv.GEOMETRY:case zv.SLICE:case zv.VOLUME:default:return[{builder:gy,labels:["handles"]},{builder:Oy,labels:["corners"]}]}},n=t.widgetState.getCroppingPlanes().onModified(e.updateHandles);var a=jh.newInstance(),o=Kh.newInstance();t.widgetState.getStatesWithLabel("corners").forEach(function(e){return e.setManipulator(a)}),t.widgetState.getStatesWithLabel("edges").forEach(function(e){return e.setManipulator(a)}),t.widgetState.getStatesWithLabel("faces").forEach(function(e){return e.setManipulator(o)})}(e,t)}var Kb={newInstance:ur.a.newInstance(Hb,"vtkImageCroppingWidget"),extend:Hb};function Xb(e){return function(e){if(Array.isArray(e))return qb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return qb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qb(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zb,n),ur.a.obj(e,t),ur.a.algo(e,t,1,1),ur.a.setGetArray(e,t,["croppingPlanes"],6),function(e,t){t.classHierarchy.push("vtkImageCropFilter"),e.reset=function(){var t=e.getInputData();t&&e.setCroppingPlanes.apply(e,Xb(t.getExtent()))},e.requestData=function(e,n){var r=e[0];if(r){var a=r.getPointData().getScalars();if(a){var o=r.getExtent(),i=6===t.croppingPlanes.length?o.map(function(e,n){return n%2==0?Math.max(e,Math.round(t.croppingPlanes[n])):Math.min(e,Math.round(t.croppingPlanes[n]))}):o.slice();if(i[0]===o[0]&&i[1]===o[1]&&i[2]===o[2]&&i[3]===o[3]&&i[4]===o[4]&&i[5]===o[5]){var s=bc.newInstance();return s.shallowCopy(r),void(n[0]=s)}for(var l=0;l<3;++l)if(i[2*l]>i[2*l+1]){var u=[i[2*l+1],i[2*l]];i[2*l]=u[0],i[2*l+1]=u[1]}for(var c=0;c<6;c+=2)i[c]=Math.max(i[c],o[c]),i[c+1]=Math.min(i[c+1],o[c+1]);for(var d=a.getNumberOfComponents(),f=(i[1]-i[0]+1)*(i[3]-i[2]+1)*(i[5]-i[4]+1)*d,p=a.getData(),g=r.getDimensions(),m=d*g[0],v=d*g[0]*g[1],h=(i[0]-o[0])*d,y=(i[1]-i[0]+1)*d,b=new p.constructor(f),T=0,C=i[4];C<=i[5];++C)for(var S=i[2];S<=i[3];++S){var P=h+(S-o[2])*m+(C-o[4])*v,w=P+y,x=p.subarray(P,w);b.set(x,T),T+=x.length}var O=bc.newInstance({extent:i,origin:r.getOrigin(),direction:r.getDirection(),spacing:r.getSpacing()}),M=vo.newInstance({name:a.getName(),numberOfComponents:d,values:b});O.getPointData().setScalars(M),n[0]=O}else Yb("No scalars from input")}else Yb("Invalid or missing input")},e.isResetAvailable=function(){if(0===t.croppingPlanes.length)return!1;var n=e.getInputData();return!!n&&void 0!==n.getExtent().find(function(e,n){return Math.abs(t.croppingPlanes[n]-e)>Number.EPSILON})}}(e,t)}var $b={newInstance:ur.a.newInstance(Qb,"vtkImageCropFilter"),extend:Qb},Jb=n(12),eT=Object.create(null);Jb.filter(function(e){return e.RGBPoints}).filter(function(e){return"CIELAB"!==e.ColorSpace}).forEach(function(e){eT[e.Name]=e});var tT=Object.keys(eT);tT.sort();var nT={addPreset:function(e){e.RGBPoints&&"CIELAB"!==e.ColorSpace&&(eT[e.Name]||(tT.push(e.Name),tT.sort()),eT[e.Name]=e)},removePresetByName:function(e){var t=tT.indexOf(e);t>-1&&tT.splice(t,1),delete eT[e]},getPresetByName:function(e){return eT[e]},rgbPresetNames:tT},rT=n(13),aT=n.n(rT),oT=n(14),iT=n.n(oT);function sT(){return iT()('!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r1?t-1:0),o=1;o1?r-1:0),a=1;a3&&void 0!==arguments[3]?arguments[3]:[];r([l,e,t,n],o)},m=function(e,t,n){if(!t)throw new Error("eventName is required");if("string"!=typeof t)throw new Error("eventName should be string");r([c,e,t,n])};return self.addEventListener("message",function(e){var t=e.data;Array.isArray(t)?function(e,t,r){var n=function(t){t&&t instanceof b?d(e,p,t.payload,t.transferable):d(e,p,t)},o=function(t){d(e,s,{message:t.message,stack:t.stack})};try{var i=h(e,t,r);v(i)?i.then(n).catch(o):n(i)}catch(e){o(e)}}.apply(void 0,a(t)):t&&t.eventName&&i.emitLocally.apply(i,[t.eventName].concat(a(t.args)))}),i},e.exports.TransferableResponse=b},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n);o()(function(e,t){var r=e.array,n=e.min,i=e.max,a=e.component||0,u=e.numberOfComponents||1,f=e.numberOfBins,l=i-n,c=new Float32Array(f);c.fill(0);for(var s=r.length,p=a;p1?t-1:0),n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:256,n=[];n.lengtho+s||do+l?f===l?o:o+f/(f-l)*(d-o-l):-f===l?o:o-f/(f+l)*(d-o-l))-o)/f,g=Math.exp(-4*p*p),m=1-p*p,v=i*(u<1?u*m+(1-u)*g:(2-u)*m+1*(u-1));v>n[c]&&(n[c]=v)}}return n}function TT(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{lineWidth:1,strokeStyle:"#000"},a=t[3],o=t[2]/(n.length-1),i=!!r.fillStyle,s=a+t[1];e.lineWidth=r.lineWidth,e.strokeStyle=r.strokeStyle,e.beginPath(),e.moveTo(t[0],t[1]+t[3]);for(var l=0;l3&&void 0!==arguments[3]?arguments[3]:[0,1];return[r[0]+(e-n[0])/n[2]*(r[1]-r[0]),(t-n[1])/n[3]]}function ST(e,t){var n=t.map(function(t){return Math.abs(t.position-e)}),r=Math.min.apply(Math,fT(n));return n.indexOf(r)}function PT(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(n){var r=n.offsetX,a=n.offsetY;t&&n.preventDefault(),e(r,a)}}function wT(){hT.filter(function(e){return e.ready}).forEach(function(e){e.callbacks.forEach(function(t){t.touches===e.touches&&t.clicks===e.count&&t.action.apply(t,fT(e.singleTouche))}),e.ts=0,e.count=0,e.touches=0,e.ready=!1})}function xT(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return function(a){var o=a.target.getBoundingClientRect(),i=Array.prototype.map.call(a.touches,function(e){return[e.pageX-o.left,e.pageY-o.top]}).reduce(function(e,t){return[e[0]+t[0],e[1]+t[1]]},[0,0]).map(function(e){return e/a.touches.length});"touchstart"===a.type?(clearTimeout(hT[e].timeout),hT[e].ts=a.timeStamp,hT[e].singleTouche=i,hT[e].touches=a.touches.length):"touchmove"===a.type?(hT[e].ts=0,hT[e].count=0,hT[e].ready=!1):"touchend"===a.type&&(a.timeStamp-hT[e].ts1&&void 0!==arguments[1]?arguments[1]:{},a=r.numberOfBinToConsiders,o=void 0===a?1:a,i=r.numberOfBinsToSkip,s=void 0===i?1:i,l=r.numberOfComponents,u=void 0===l?1:l,c=r.component,d=void 0===c?0:c;t.histogram=null,t.histogramArray=n,t.dataRange=zr(n,d,u);var f=lT(t.dataRange,2),p=f[0],g=f[1],m=Math.floor(n.length/4)||1;m+=m%u;for(var v=0,h=[],y=[];vr;)a.shift();for(var l=a.reduce(function(e,t){return e+t},0)/r,u=0,c=t.histogram.length;u1){for(var s=t.style.iconSize+t.style.padding,l=s,u=0;r>l;)u+=1,l+=s;switch(u){case 0:var c=e.addGaussian(0,1,.1,0,0),d=t.gaussians[c],f=cT({},d),p=yT.adjustPosition;t.activeGaussian=c,t.selectedGaussian=c,ur.a.setImmediate(function(){e.onDown(n,r),t.dragAction={originalXY:[0,0],action:p,gaussian:d,originalGaussian:f}});break;case 1:-1!==t.selectedGaussian&&e.removeGaussian(t.selectedGaussian);break;default:t.selectedGaussian=-1,t.dragAction=null}}else if(o<0||o>1||i<0||i>1)t.selectedGaussian=-1,t.dragAction=null;else{var g=ST(o,t.gaussians);g!==t.selectedGaussian&&(t.selectedGaussian=g,e.modified())}return!0},e.onHover=function(n,r){var a=20/t.canvas.height,o=lT(CT(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),i=o[0],s=o[1],l=lT(CT(n,r,t.graphArea),1)[0],u=i<0?t.selectedGaussian:ST(i,t.gaussians);t.canvas.style.cursor="default";var c=t.gaussians[u];if(t.enableRangeZoom&&l>=0&&rt.rangeZoom[1]-d?t.canvas.style.cursor=vT.adjustZoom:t.canvas.style.cursor=vT.adjustPosition,t.dragAction={rangeZoom:t.rangeZoom,action:yT.adjustZoom}}else if(c&&l>=0){var f=1-s,p=null;p=f>c.height+a?"adjustPosition":f>c.height-a?Math.abs(i-c.position).5*c.height+a?"adjustPosition":f>.5*c.height-a?Math.abs(i-c.position)a?"adjustPosition":"adjustWidth",t.canvas.style.cursor=vT[p];var g=yT[p],m=cT({},c);t.dragAction={originalXY:[i,s],action:g,gaussian:c,originalGaussian:m}}return u!==t.activeGaussian&&(t.activeGaussian=u,e.modified()),!0},e.onDown=function(n,r){t.mouseIsDown||e.invokeAnimation(!0),t.mouseIsDown=!0;var a=CT(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],o=ST(a,t.gaussians);t.gaussianSide=0;var i=t.gaussians[o];return i&&(t.gaussianSide=i.position-a),o!==t.selectedGaussian&&a>0&&(t.selectedGaussian=o,e.modified()),!0},e.onDrag=function(n,r){if(t.dragAction){var a=lT(CT(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),o=a[0],i=a[1];(0,t.dragAction.action)(o,i,cT({gaussianSide:t.gaussianSide,model:t,publicAPI:e},t.dragAction))&&(t.opacities=bT(t.gaussians,t.piecewiseSize),e.invokeOpacityChange(e,!0)),e.modified()}return!0},e.onUp=function(n,r){return t.mouseIsDown&&e.invokeAnimation(!1),t.mouseIsDown=!1,!0},e.onLeave=function(n,r){return e.onUp(n,r),t.canvas.style.cursor="default",t.activeGaussian=-1,e.modified(),!0},e.onAddGaussian=function(n,r){var a=lT(CT(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),o=a[0],i=a[1];return o>=0&&e.addGaussian(o,1-i,.1,0,0),!0},e.onRemoveGaussian=function(n,r){var a=CT(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],o=ST(a,t.gaussians);return a>=0&&-1!==o&&e.removeGaussian(o),!0},e.bindMouseListeners=function(){if(!t.listeners){var n=function(){return!!t.mouseIsDown},r=function(){for(var e=hT.length,t=arguments.length,n=new Array(t),r=0;r1){var l=Math.round(t.style.iconSize/2-t.style.strokeWidth),u=Math.round(l+o+t.style.strokeWidth);e.beginPath(),e.lineWidth=t.style.buttonStrokeWidth,e.strokeStyle=t.style.buttonStrokeColor,e.arc(u-o/2,u,l,0,2*Math.PI,!1),e.fillStyle=t.style.buttonFillColor,e.fill(),e.stroke(),e.moveTo(u-l+t.style.strokeWidth+2-o/2,u),e.lineTo(u+l-t.style.strokeWidth-2-o/2,u),e.stroke(),e.moveTo(u-o/2,u-l+t.style.strokeWidth+2),e.lineTo(u-o/2,u+l-t.style.strokeWidth-2),e.stroke(),-1===t.selectedGaussian?(e.fillStyle=t.style.buttonDisableFillColor,e.lineWidth=t.style.buttonDisableStrokeWidth,e.strokeStyle=t.style.buttonDisableStrokeColor):(e.fillStyle=t.style.buttonFillColor,e.lineWidth=t.style.buttonStrokeWidth,e.strokeStyle=t.style.buttonStrokeColor),e.beginPath(),e.arc(u-o/2,u+o/2+t.style.iconSize,l,0,2*Math.PI,!1),e.fill(),e.stroke(),e.moveTo(u-l+t.style.strokeWidth+2-o/2,u+o/2+t.style.iconSize),e.lineTo(u+l-t.style.strokeWidth-2-o/2,u+o/2+t.style.iconSize),e.stroke()}if(t.histogram&&TT(e,i,MT(t.histogram,t.rangeZoom),{lineWidth:1,strokeStyle:t.style.histogramColor,fillStyle:t.style.histogramColor}),TT(e,i,MT(t.opacities,t.enableRangeZoom&&t.rangeZoom),{lineWidth:t.style.strokeWidth,strokeStyle:t.style.strokeColor}),t.colorTransferFunction&&t.colorTransferFunction.getSize()){var c=t.dataRange||t.colorTransferFunction.getMappingRange();t.colorCanvas&&t.colorCanvasMTime===t.colorTransferFunction.getMTime()||(t.colorCanvasMTime=t.colorTransferFunction.getMTime(),t.colorCanvas=function(e,t,n,r){var a=r||document.createElement("canvas");a.setAttribute("width",t),a.setAttribute("height",256);for(var o=a.getContext("2d"),i=e.getUint8Table(n[0],n[1],t,4),s=o.getImageData(0,0,t,256),l=0;l<256;l++)s.data.set(i,4*l*t);for(var u=256*t*4,c=4*t,d=3;d0&&(a=Math.min(a,i)),t.opacities[i]>0&&(o=Math.max(o,i));return[n[0]+a*r,n[0]+o*r]};var n=e.setEnableRangeZoom;e.setEnableRangeZoom=function(e){var r=n(e);return r&&(t.colorCanvasMTime=0,t.rangeZoom=[0,1]),r};var r=e.setRangeZoom;e.setRangeZoom=function(){var e=r.apply(void 0,arguments);return e&&(t.colorCanvasMTime=0),e},e.onModified(function(){return e.render()}),e.setSize.apply(e,fT(t.size))}var RT={histogram:[],numberOfBins:256,histogramArray:null,dataRange:[0,1],gaussians:[],opacities:[],size:[600,300],piecewiseSize:256,colorCanvasMTime:0,gaussianMinimumHeight:.05,style:{backgroundColor:"rgba(255, 255, 255, 1)",histogramColor:"rgba(200, 200, 200, 0.5)",strokeColor:"rgb(0, 0, 0)",activeColor:"rgb(0, 0, 150)",buttonDisableFillColor:"rgba(255, 255, 255, 0.5)",buttonDisableStrokeColor:"rgba(0, 0, 0, 0.5)",buttonStrokeColor:"rgba(0, 0, 0, 1)",buttonFillColor:"rgba(255, 255, 255, 1)",handleColor:"rgb(0, 150, 0)",strokeWidth:2,activeStrokeWidth:3,buttonStrokeWidth:1.5,handleWidth:3,iconSize:20,padding:10,zoomControlHeight:10,zoomControlColor:"#999"},activeGaussian:-1,selectedGaussian:-1,enableRangeZoom:!0,rangeZoom:[0,1]};function ET(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,RT,n),ur.a.obj(e,t),ur.a.setGet(e,t,["piecewiseSize","numberOfBins","colorTransferFunction","backgroundImage","enableRangeZoom","gaussianMinimumHeight"]),ur.a.setGetArray(e,t,["rangeZoom"],2),ur.a.get(e,t,["size","canvas","gaussians"]),ur.a.event(e,t,"opacityChange"),ur.a.event(e,t,"animation"),ur.a.event(e,t,"zoomChange"),IT(e,t)}var DT=cT({newInstance:ur.a.newInstance(ET,"vtkPiecewiseGaussianWidget"),extend:ET},AT);var VT={center:[0,0,0],rotationFactor:1,displayCenter:[0,0]};var LT={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,VT,n),ur.a.setGet(e,t,["rotationFactor"]),ur.a.setGetArray(e,t,["displayCenter"],2),ur.a.setGetArray(e,t,["center"],3),function(e,t){t.classHierarchy.push("vtkCompositeCameraManipulator"),e.computeDisplayCenter=function(e,n){var r=e.computeWorldToDisplay(n,t.center[0],t.center[1],t.center[2]);t.displayCenter[0]=r[0],t.displayCenter[1]=r[1]}}(e,t)}};var NT={button:1,shift:!1,control:!1,alt:!1,dragEnabled:!0,scrollEnabled:!1};var BT={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,NT,n),ur.a.setGet(e,t,["button","shift","control","alt"]),ur.a.set(e,t,["dragEnabled","scrollEnabled"]),function(e,t){t.classHierarchy.push("vtkCompositeMouseManipulator"),e.startInteraction=function(){},e.endInteraction=function(){},e.onButtonDown=function(e,t,n){},e.onButtonUp=function(e){},e.onMouseMove=function(e,t,n){},e.onStartScroll=function(e,t,n){},e.onScroll=function(e,t,n){},e.onEndScroll=function(e){},e.isDragEnabled=function(){return t.dragEnabled},e.isScrollEnabled=function(){return t.scrollEnabled}}(e,t)}};var kT={};function FT(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kT,n),ur.a.obj(e,t),BT.extend(e,t,n),LT.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkMouseCameraTrackballRotateManipulator");var n=new Float64Array(3),r=new Float64Array(3),a=new Float64Array(3),s=new Float64Array(16),l=new Float64Array(3),u=new Float64Array(3),c=new Float64Array(3);e.onButtonDown=function(e,n,r){t.previousPosition=r},e.onMouseMove=function(e,d,f){if(f){var p=d.getActiveCamera(),g=p.getPosition(),m=p.getFocalPoint();o.identity(s);var v=t.center,h=t.rotationFactor;o.translate(s,s,v);var y=t.previousPosition.x-f.x,b=t.previousPosition.y-f.y,T=e.getView().getSize(),C=p.getViewUp();o.rotate(s,s,kr(360*y/T[0]*h),C),ta(p.getDirectionOfProjection(),C,l),o.rotate(s,s,kr(-360*b/T[1]*h),l),u[0]=-v[0],u[1]=-v[1],u[2]=-v[2],o.translate(s,s,u),i.transformMat4(n,g,s),i.transformMat4(r,m,s),c[0]=C[0]+g[0],c[1]=C[1]+g[1],c[2]=C[2]+g[2],i.transformMat4(a,c,s),p.setPosition(n[0],n[1],n[2]),p.setFocalPoint(r[0],r[1],r[2]),p.setViewUp(a[0]-n[0],a[1]-n[1],a[2]-n[2]),p.orthogonalizeViewUp(),d.resetCameraClippingRange(),e.getLightFollowCamera()&&d.updateLightsGeometryToFollowCamera(),t.previousPosition=f}}}(e,t)}var GT={newInstance:ur.a.newInstance(FT,"vtkMouseCameraTrackballRotateManipulator"),extend:FT};var _T={};function UT(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_T,n),ur.a.obj(e,t),LT.extend(e,t,n),BT.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkMouseCameraTrackballPanManipulator"),e.onButtonDown=function(e,n,r){t.previousPosition=r},e.onMouseMove=function(e,n,r){if(r){var a=r,o=t.previousPosition;t.previousPosition=r;var i=n.getActiveCamera(),s=i.getPosition(),l=i.getFocalPoint();if(i.getParallelProjection()){i.orthogonalizeViewUp();var u=i.getViewUp(),c=[0,0,0];ta(i.getViewPlaneNormal(),u,c);var d=e.getView().getSize()[1],f=(a.x-o.x)/d,p=(o.y-a.y)/d,g=i.getParallelScale();p*=2*g;var m=c[0]*(f*=2*g)+u[0]*p;s[0]+=m,l[0]+=m,m=c[1]*f+u[1]*p,s[1]+=m,l[1]+=m,m=c[2]*f+u[2]*p,s[2]+=m,l[2]+=m,i.setPosition(s[0],s[1],s[2]),i.setFocalPoint(l[0],l[1],l[2])}else{var v=t.center,h=e.getInteractorStyle(),y=h.computeWorldToDisplay(n,v[0],v[1],v[2])[2],b=h.computeDisplayToWorld(n,a.x,a.y,y),T=h.computeDisplayToWorld(n,o.x,o.y,y),C=[s[0]+(T[0]-b[0]),s[1]+(T[1]-b[1]),s[2]+(T[2]-b[2])],S=[l[0]+(T[0]-b[0]),l[1]+(T[1]-b[1]),l[2]+(T[2]-b[2])];i.setPosition(C[0],C[1],C[2]),i.setFocalPoint(S[0],S[1],S[2])}n.resetCameraClippingRange(),e.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera()}}}(e,t)}var jT={newInstance:ur.a.newInstance(UT,"vtkMouseCameraTrackballPanManipulator"),extend:UT};var WT={zoomScale:0,flipDirection:!1};function zT(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,WT,n),ur.a.obj(e,t),BT.extend(e,t,n),LT.extend(e,t,n),ur.a.setGet(e,t,["flipDirection"]),function(e,t){t.classHierarchy.push("vtkMouseCameraTrackballZoomManipulator"),e.onButtonDown=function(e,n,r){t.previousPosition=r;var a=e.getView().getSize(),o=n.getActiveCamera(),i=t.flipDirection?-1:1;if(o.getParallelProjection())t.zoomScale=1.5/a[1]*i;else{var s=o.getClippingRange();t.zoomScale=s[1]/a[1]*1.5*i}},e.onMouseMove=function(e,n,r){if(r){var a=t.previousPosition.y-r.y,o=n.getActiveCamera();if(o.getParallelProjection()){var i=a*t.zoomScale;o.setParallelScale((1-i)*o.getParallelScale())}else{var s=o.getPosition(),l=o.getFocalPoint(),u=o.getDirectionOfProjection(),c=a*t.zoomScale,d=c*u[0];s[0]+=d,l[0]+=d,d=c*u[1],s[1]+=d,l[1]+=d,d=c*u[2],s[2]+=d,l[2]+=d,o.getFreezeFocalPoint()||o.setFocalPoint(l[0],l[1],l[2]),o.setPosition(s[0],s[1],s[2]),n.resetCameraClippingRange()}e.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera(),t.previousPosition=r}},e.onScroll=function(e,t,n){if(n){var r=t.getActiveCamera(),a=1-n/10;r.getParallelProjection()?r.setParallelScale(r.getParallelScale()/a):(r.dolly(a),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}}(e,t)}var HT={newInstance:ur.a.newInstance(zT,"vtkMouseCameraTrackballZoomManipulator"),extend:zT};var KT={horizontalListener:null,verticalListener:null,scrollListener:null};function XT(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,KT,n),ur.a.obj(e,t),BT.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkMouseRangeManipulator");var n=new Map;function r(e,t){return t*((e.max-e.min)/(e.step+1))}function a(e,t){var r=e.getValue(),a=t*e.scale+n.get(e),o=r+a,i=o-e.min,s=Math.round(i/e.step);o=e.min+e.step*s,o=Math.max(o,e.min),(o=Math.min(o,e.max))!==r?(e.setValue(o),n.set(e,0)):o===e.min&&a<0||o===e.max&&a>0?n.set(e,0):n.set(e,a)}e.setHorizontalListener=function(r,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,u=Number.isFinite(i)?function(){return i}:i;t.horizontalListener={min:r,max:a,step:o,getValue:u,setValue:s,scale:l},n.set(t.horizontalListener,0),e.modified()},e.setVerticalListener=function(r,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,u=Number.isFinite(i)?function(){return i}:i;t.verticalListener={min:r,max:a,step:o,getValue:u,setValue:s,scale:l},n.set(t.verticalListener,0),e.modified()},e.setScrollListener=function(r,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,u=Number.isFinite(i)?function(){return i}:i;t.scrollListener={min:r,max:a,step:o,getValue:u,setValue:s,scale:l},n.set(t.scrollListener,0),e.modified()},e.removeHorizontalListener=function(){t.verticalListener&&(n.delete(t.verticalListener),delete t.verticalListener,e.modified())},e.removeVerticalListener=function(){t.horizontalListener&&(n.delete(t.horizontalListener),delete t.horizontalListener,e.modified())},e.removeScrollListener=function(){t.scrollListener&&(n.delete(t.scrollListener),delete t.scrollListener,e.modified())},e.removeAllListeners=function(){e.removeHorizontalListener(),e.removeVerticalListener(),e.removeScrollListener()},e.onButtonDown=function(e,n,r){t.previousPosition=r;var a=e.getView(),o=a.getContainerSize()[0]/a.getSize()[0],i=a.getViewportSize(n);t.containerSize=i.map(function(e){return e*o})},e.onMouseMove=function(e,n,o){if((t.verticalListener||t.horizontalListener)&&o){if(t.horizontalListener){var i=(o.x-t.previousPosition.x)/t.containerSize[0],s=r(t.horizontalListener,i);a(t.horizontalListener,s)}if(t.verticalListener){var l=(o.y-t.previousPosition.y)/t.containerSize[1],u=r(t.verticalListener,l);a(t.verticalListener,u)}t.previousPosition=o}},e.onScroll=function(e,n,r){t.scrollListener&&r&&a(t.scrollListener,r*t.scrollListener.step)},e.onStartScroll=e.onScroll}(e,t)}var qT={newInstance:ur.a.newInstance(XT,"vtkMouseRangeManipulator"),extend:XT};function YT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZT(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var QT=ur.a.vtkDebugMacro,$T=Qg.States,JT={type:"StartInteractionEvent"},eC={type:"InteractionEvent"},tC={type:"EndInteractionEvent"};function nC(e,t,n,r,a,o){var i=e.getActiveCamera(),s=i.getFocalPoint(),l=(s=t.getInteractorStyle().computeWorldToDisplay(e,s[0],s[1],s[2]))[2],u=t.getInteractorStyle().computeDisplayToWorld(e,n,r,l),c=t.getInteractorStyle().computeDisplayToWorld(e,a,o,l),d=[c[0]-u[0],c[1]-u[1],c[2]-u[2]];s=i.getFocalPoint();var f=i.getPosition();i.setFocalPoint(d[0]+s[0],d[1]+s[1],d[2]+s[2]),i.setPosition(d[0]+f[0],d[1]+f[1],d[2]+f[2])}var rC={dollyToPosition:function(e,t,n,r){var a=n.getActiveCamera();if(a.getParallelProjection()){var o=r.getView().getSize(),i=o[0]/2,s=o[1]/2,l=t.x,u=t.y;nC(n,r,i,s,l,u),a.setParallelScale(a.getParallelScale()/e),nC(n,r,l,u,i,s)}else{var c=a.getFocalPoint(),d=a.getViewPlaneNormal();c=r.getInteractorStyle().computeWorldToDisplay(n,c[0],c[1],c[2]);var f=r.getInteractorStyle().computeDisplayToWorld(n,t.x,t.y,c[2]);a.setFocalPoint(f[0],f[1],f[2]),a.dolly(e),n.resetCameraClippingRange();var p=a.getPosition();c=a.getFocalPoint();var g=[0,0,0],m=d[0]*(c[0]-p[0])+d[1]*(c[1]-p[1])+d[2]*(c[2]-p[2]);m/=Math.pow(d[0],2)+Math.pow(d[1],2)+Math.pow(d[2],2),g[0]=p[0]+d[0]*m,g[1]=p[1]+d[1]*m,g[2]=p[2]+d[2]*m,a.setFocalPoint(g[0],g[1],g[2]),n.resetCameraClippingRange()}},translateCamera:nC,dollyByFactor:function(e,t,n){if(!Number.isNaN(n)){var r=t.getActiveCamera();r.getParallelProjection()?r.setParallelScale(r.getParallelScale()/n):(r.dolly(n),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}};var aC={cachedMousePosition:null,currentManipulator:null,currentWheelManipulator:null,centerOfRotation:[0,0,0],rotationFactor:1};function oC(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,aC,n),Qg.extend(e,t,n),ur.a.setGet(e,t,["rotationFactor"]),ur.a.get(e,t,["mouseManipulators","keyboardManipulators","vrManipulators","gestureManipulators"]),ur.a.setGetArray(e,t,["centerOfRotation"],3),function(e,t){t.classHierarchy.push("vtkInteractorStyleManipulator"),t.mouseManipulators=[],t.keyboardManipulators=[],t.vrManipulators=[],t.gestureManipulators=[],t.currentManipulator=null,t.currentWheelManipulator=null,t.centerOfRotation=[0,0,0],t.rotationFactor=1,e.removeAllManipulators=function(){e.removeAllMouseManipulators(),e.removeAllKeyboardManipulators(),e.removeAllVRManipulators(),e.removeAllGestureManipulators()},e.removeAllMouseManipulators=function(){t.mouseManipulators=[]},e.removeAllKeyboardManipulators=function(){t.keyboardManipulators=[]},e.removeAllVRManipulators=function(){t.vrManipulators=[]},e.removeAllGestureManipulators=function(){t.gestureManipulators=[]};var n=function(t,n){var r=n.indexOf(t);return-1!==r&&(n.splice(r,1),e.modified(),!0)};e.removeMouseManipulator=function(e){return n(e,t.mouseManipulators)},e.removeKeyboardManipulator=function(e){return n(e,t.keyboardManipulators)},e.removeVRManipulator=function(e){return n(e,t.vrManipulators)},e.removeGestureManipulator=function(e){return n(e,t.gestureManipulators)};var r=function(t,n){return-1===n.indexOf(t)&&(n.push(t),e.modified(),!0)};e.addMouseManipulator=function(e){return r(e,t.mouseManipulators)},e.addKeyboardManipulator=function(e){return r(e,t.keyboardManipulators)},e.addVRManipulator=function(e){return r(e,t.vrManipulators)},e.addGestureManipulator=function(e){return r(e,t.gestureManipulators)},e.getNumberOfMouseManipulators=function(){return t.mouseManipulators.length},e.getNumberOfKeyboardManipulators=function(){return t.keyboardManipulators.length},e.getNumberOfVRManipulators=function(){return t.vrManipulators.length},e.getNumberOfGestureManipulators=function(){return t.gestureManipulators.length},e.resetCurrentManipulator=function(){t.currentManipulator=null,t.currentWheelManipulator=null},e.handleLeftButtonPress=function(n){t.previousPosition=n.position,e.onButtonDown(1,n)},e.handleMiddleButtonPress=function(n){t.previousPosition=n.position,e.onButtonDown(2,n)},e.handleRightButtonPress=function(n){t.previousPosition=n.position,e.onButtonDown(3,n)},e.handleButton3D=function(n){n&&(t.currentManipulator=e.findVRManipulator(n.device,n.input,n.pressed),t.currentManipulator?(t.currentManipulator.onButton3D(e,n.pokedRenderer,t.state,n.device,n.input,n.pressed),n.pressed?e.startCameraPose():e.endCameraPose()):QT("No manipulator found"))},e.handleMove3D=function(n){t.currentManipulator&&t.state===$T.IS_CAMERA_POSE&&t.currentManipulator.onMove3D(e,n.pokedRenderer,t.state,n)},e.onButtonDown=function(n,r){t.currentManipulator||(t.currentManipulator=e.findMouseManipulator(n,r.shiftKey,r.controlKey,r.altKey),t.currentManipulator?(t.currentManipulator.setCenter&&t.currentManipulator.setCenter(t.centerOfRotation),t.currentManipulator.setRotationFactor&&t.currentManipulator.setRotationFactor(t.rotationFactor),t.currentManipulator.startInteraction(),t.currentManipulator.onButtonDown(t.interactor,r.pokedRenderer,r.position),t.interactor.requestAnimation(e.onButtonDown),e.invokeStartInteractionEvent(JT)):QT("No manipulator found"))},e.findMouseManipulator=function(e,n,r,a){for(var o=null,i=t.mouseManipulators.length;i--;){var s=t.mouseManipulators[i];s&&s.getButton()===e&&s.getShift()===n&&s.getControl()===r&&s.getAlt()===a&&s.isDragEnabled()&&(o=s)}return o},e.findVRManipulator=function(e,n){for(var r=null,a=t.vrManipulators.length;a--;){var o=t.vrManipulators[a];o&&o.getDevice()===e&&o.getInput()===n&&(r=o)}return r},e.handleLeftButtonRelease=function(){e.onButtonUp(1)},e.handleMiddleButtonRelease=function(){e.onButtonUp(2)},e.handleRightButtonRelease=function(){e.onButtonUp(3)},e.onButtonUp=function(n){t.currentManipulator&&t.currentManipulator.getButton&&t.currentManipulator.getButton()===n&&(t.currentManipulator.onButtonUp(t.interactor),t.currentManipulator.endInteraction(),t.currentManipulator=null,t.interactor.cancelAnimation(e.onButtonDown),e.invokeEndInteractionEvent(tC))},e.handleStartMouseWheel=function(n){if(!t.currentWheelManipulator){for(var r=null,a=t.mouseManipulators.length;a--;){var o=t.mouseManipulators[a];o&&o.isScrollEnabled()&&o.getShift()===n.shiftKey&&o.getControl()===n.controlKey&&o.getAlt()===n.altKey&&(r=o)}r?(t.currentWheelManipulator=r,t.currentWheelManipulator.onStartScroll(t.interactor,n.pokedRenderer,n.spinY),t.currentWheelManipulator.startInteraction(),t.interactor.requestAnimation(e.handleStartMouseWheel),e.invokeStartInteractionEvent(JT)):QT("No manipulator found")}},e.handleEndMouseWheel=function(){t.currentWheelManipulator&&t.currentWheelManipulator.onEndScroll&&(t.currentWheelManipulator.onEndScroll(t.interactor),t.currentWheelManipulator.endInteraction(),t.currentWheelManipulator=null,t.interactor.cancelAnimation(e.handleStartMouseWheel),e.invokeEndInteractionEvent(tC))},e.handleMouseWheel=function(n){t.currentWheelManipulator&&t.currentWheelManipulator.onScroll&&(t.currentWheelManipulator.onScroll(t.interactor,n.pokedRenderer,n.spinY,t.cachedMousePosition),e.invokeInteractionEvent(eC))},e.handleMouseMove=function(n){t.cachedMousePosition=n.position,t.currentManipulator&&t.currentManipulator.onMouseMove&&(t.currentManipulator.onMouseMove(t.interactor,n.pokedRenderer,n.position),e.invokeInteractionEvent(eC))},e.handleKeyPress=function(n){t.keyboardManipulators.filter(function(e){return e.onKeyPress}).forEach(function(r){r.onKeyPress(t.interactor,n.pokedRenderer,n.key),e.invokeInteractionEvent(eC)})},e.handleKeyDown=function(n){t.keyboardManipulators.filter(function(e){return e.onKeyDown}).forEach(function(r){r.onKeyDown(t.interactor,n.pokedRenderer,n.key),e.invokeInteractionEvent(eC)})},e.handleKeyUp=function(n){t.keyboardManipulators.filter(function(e){return e.onKeyUp}).forEach(function(r){r.onKeyUp(t.interactor,n.pokedRenderer,n.key),e.invokeInteractionEvent(eC)})},e.handleStartPinch=function(n){e.startDolly();for(var r=t.gestureManipulators.length;r--;){var a=t.gestureManipulators[r];a&&a.isPinchEnabled()&&(a.onStartPinch(t.interactor,n.scale),a.startInteraction())}t.interactor.requestAnimation(e.handleStartPinch),e.invokeStartInteractionEvent(JT)},e.handleEndPinch=function(){e.endDolly();for(var n=t.gestureManipulators.length;n--;){var r=t.gestureManipulators[n];r&&r.isPinchEnabled()&&(r.onEndPinch(t.interactor),r.endInteraction())}t.interactor.cancelAnimation(e.handleStartPinch),e.invokeEndInteractionEvent(tC)},e.handleStartRotate=function(n){e.startRotate();for(var r=t.gestureManipulators.length;r--;){var a=t.gestureManipulators[r];a&&a.isRotateEnabled()&&(a.onStartRotate(t.interactor,n.rotation),a.startInteraction())}t.interactor.requestAnimation(e.handleStartRotate),e.invokeStartInteractionEvent(JT)},e.handleEndRotate=function(){e.endRotate();for(var n=t.gestureManipulators.length;n--;){var r=t.gestureManipulators[n];r&&r.isRotateEnabled()&&(r.onEndRotate(t.interactor),r.endInteraction())}t.interactor.cancelAnimation(e.handleStartRotate),e.invokeEndInteractionEvent(tC)},e.handleStartPan=function(n){e.startPan();for(var r=t.gestureManipulators.length;r--;){var a=t.gestureManipulators[r];a&&a.isPanEnabled()&&(a.onStartPan(t.interactor,n.translation),a.startInteraction())}t.interactor.requestAnimation(e.handleStartPan),e.invokeStartInteractionEvent(JT)},e.handleEndPan=function(){e.endPan();for(var n=t.gestureManipulators.length;n--;){var r=t.gestureManipulators[n];r&&r.isPanEnabled()&&(r.onEndPan(t.interactor),r.endInteraction())}t.interactor.cancelAnimation(e.handleStartPan),e.invokeEndInteractionEvent(tC)},e.handlePinch=function(n){for(var r=t.gestureManipulators.length,a=0;r--;){var o=t.gestureManipulators[r];o&&o.isPinchEnabled()&&(o.onPinch(t.interactor,n.pokedRenderer,n.scale),a++)}a&&e.invokeInteractionEvent(eC)},e.handlePan=function(n){for(var r=t.gestureManipulators.length,a=0;r--;){var o=t.gestureManipulators[r];o&&o.isPanEnabled()&&(o.onPan(t.interactor,n.pokedRenderer,n.translation),a++)}a&&e.invokeInteractionEvent(eC)},e.handleRotate=function(n){for(var r=t.gestureManipulators.length,a=0;r--;){var o=t.gestureManipulators[r];o&&o.isRotateEnabled()&&(o.onRotate(t.interactor,n.pokedRenderer,n.rotation),a++)}a&&e.invokeInteractionEvent(eC)}}(e,t)}var iC=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sC,n),ur.a.obj(e,t),ur.a.get(e,t,["renderer"]),ur.a.getArray(e,t,["selectionPoint","pickPosition"]),ur.a.setGet(e,t,["pickFromList","pickList"]),function(e,t){t.classHierarchy.push("vtkAbstractPicker"),e.initialize=function(){t.renderer=null,t.selectionPoint[0]=0,t.selectionPoint[1]=0,t.selectionPoint[2]=0,t.pickPosition[0]=0,t.pickPosition[1]=0,t.pickPosition[2]=0},e.initializePickList=function(){t.pickList=[]},e.addPickList=function(e){t.pickList.push(e)},e.deletePickList=function(e){var n=t.pickList.indexOf(e);-1!==n&&t.pickList.splice(n,1)}}(e,t)}var uC={newInstance:ur.a.newInstance(lC,"vtkAbstractPicker"),extend:lC};function cC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var fC=ur.a.vtkErrorMacro,pC=ur.a.vtkWarningMacro;function gC(e,t){t.classHierarchy.push("vtkPicker");var n=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mC,n),uC.extend(e,t,n),ur.a.setGet(e,t,["tolerance"]),ur.a.setGetArray(e,t,["mapperPosition"],3),ur.a.get(e,t,["mapper","dataSet","actors","pickedPositions"]),ur.a.event(e,t,"pickChange"),gC(e,t)}var hC={newInstance:ur.a.newInstance(vC,"vtkPicker"),extend:vC},yC=ur.a.vtkErrorMacro;var bC={pointId:-1,pointIJK:[],useCells:!1};function TC(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bC,n),hC.extend(e,t,n),ur.a.getArray(e,t,["pointIJK"]),ur.a.get(e,t,["pointId"]),ur.a.setGet(e,t,["useCells"]),function(e,t){t.classHierarchy.push("vtkPointPicker"),e.intersectWithLine=function(n,r,a,o){var i=Number.MAX_VALUE;if(o.isA("vtkImageMapper")){var s=o.intersectWithLineForPointPicking(n,r);s&&(i=s.t,t.pointIJK=s.ijk)}else o.isA("vtkMapper")&&(i=e.intersectActorWithLine(n,r,a,o));return i},e.intersectActorWithLine=function(e,n,r,a){var o=a.getInputData(),i=0,s=o.getPoints().getNumberOfPoints();if(s<=i)return 2;for(var l=[],u=0;u<3;u++)l[u]=n[u]-e[u];var c,d=ea(l,l);if(0===d)return yC("Cannot process points"),2;var f=-1,p=Number.MAX_VALUE,g=Number.MAX_VALUE,m=[],v=[],h=[],y=o.getPoints();if(t.useCells)for(var b=o.getPolys().getData(),T=b[0],C=o.getPolys().getNumberOfCells(),S=0;S=0&&c<=1&&c<=p+t.tolerance){for(var M=0,A=0;A<3;A++){m[A]=e[A]+c*l[A];var I=Math.abs(h[A]-m[A]);I>M&&(M=I)}M<=r&&M=0&&c<=1&&c<=p+t.tolerance){for(var R=0,E=0;E<3;E++){m[E]=e[E]+c*l[E];var D=Math.abs(h[E]-m[E]);D>R&&(R=D)}R<=r&&Re.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,OC,n),t.normal=[0,0,1],t.center=[0,0,0],ur.a.obj(e,t),ur.a.setGet(e,t,["xResolution","yResolution"]),ur.a.setGetArray(e,t,["origin"],3),ur.a.getArray(e,t,["point1","point2","normal","center"],3),ur.a.algo(e,t,0,1),function(e,t){t.classHierarchy.push("vtkPlaneSource"),e.requestData=function(n,r){if(!t.deleted){var a=r[0],o=a?a.getPoints().getDataType():"Float32Array",i=ov.newInstance(),s=new Float32Array(3),l=new Float32Array(3);if(Qr(t.point1,t.origin,s),Qr(t.point2,t.origin,l),e.updatePlane(s,l)){var u=t.xResolution,c=t.yResolution,d=(u+1)*(c+1),f=u*c,p=ur.a.newTypedArray(o,3*d);i.getPoints().setData(p,3);var g=new Uint32Array(5*f);i.getPolys().setData(g,1);var m=new Float32Array(3*d),v=vo.newInstance({numberOfComponents:3,values:m,name:"Normals"});i.getPointData().setNormals(v);var h=new Float32Array(2*d),y=vo.newInstance({numberOfComponents:2,values:h,name:"TextureCoordinates"});i.getPointData().setTCoords(y);for(var b=new Float32Array(2),T=0,C=0;C2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,LC,n),ur.a.obj(e,t),ur.a.set(e,t,["property"]),ur.a.get(e,t,["value"]),ur.a.setGet(e,t,["coordinateSystem","referenceCoordinate","renderer"]),ur.a.getArray(e,t,["value"],3),function(e,t){t.classHierarchy.push("vtkCoordinate"),e.setValue=function(){if(t.deleted)return VC("instance deleted - cannot call any method"),!1;for(var n=arguments.length,r=new Array(n),a=0;a2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,WC,n),ur.a.obj(e,t),!t.componentData){t.componentData=[];for(var r=0;r(e=t.componentData[r].grayTransferFunction.getMTime())?n:e):3===t.componentData[r].colorChannels&&t.componentData[r].rGBTransferFunction&&(n=n>(e=t.componentData[r].rGBTransferFunction.getMTime())?n:e),t.componentData[r].scalarOpacity&&(n=n>(e=t.componentData[r].scalarOpacity.getMTime())?n:e),t.componentData[r].gradientOpacity&&(t.componentData[r].disableGradientOpacity||(n=n>(e=t.componentData[r].gradientOpacity.getMTime())?n:e));return n},e.getColorChannels=function(e){return e<0||e>3?(UC("Bad index - must be between 0 and 3"),0):t.componentData[e].colorChannels},e.setGrayTransferFunction=function(n,r){var a=!1;return t.componentData[n].grayTransferFunction!==r&&(t.componentData[n].grayTransferFunction=r,a=!0),1!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=1,a=!0),a&&e.modified(),a},e.getGrayTransferFunction=function(n){return null===t.componentData[n].grayTransferFunction&&(t.componentData[n].grayTransferFunction=Wv.newInstance(),t.componentData[n].grayTransferFunction.addPoint(0,0),t.componentData[n].grayTransferFunction.addPoint(1024,1),1!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=1),e.modified()),t.componentData[n].grayTransferFunction},e.setRGBTransferFunction=function(n,r){var a=!1;return t.componentData[n].rGBTransferFunction!==r&&(t.componentData[n].rGBTransferFunction=r,a=!0),3!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=3,a=!0),a&&e.modified(),a},e.getRGBTransferFunction=function(n){return null===t.componentData[n].rGBTransferFunction&&(t.componentData[n].rGBTransferFunction=Gv.newInstance(),t.componentData[n].rGBTransferFunction.addRGBPoint(0,0,0,0),t.componentData[n].rGBTransferFunction.addRGBPoint(1024,1,1,1),3!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=3),e.modified()),t.componentData[n].rGBTransferFunction},e.setScalarOpacity=function(n,r){return t.componentData[n].scalarOpacity!==r&&(t.componentData[n].scalarOpacity=r,e.modified(),!0)},e.getScalarOpacity=function(n){return null===t.componentData[n].scalarOpacity&&(t.componentData[n].scalarOpacity=Wv.newInstance(),t.componentData[n].scalarOpacity.addPoint(0,1),t.componentData[n].scalarOpacity.addPoint(1024,1),e.modified()),t.componentData[n].scalarOpacity},e.setComponentWeight=function(n,r){if(n<0||n>=jC)return UC("Invalid index"),!1;var a=Math.min(1,Math.max(0,r));return t.componentData[n].componentWeight!==a&&(t.componentData[n].componentWeight=a,e.modified(),!0)},e.getComponentWeight=function(e){return e<0||e>=jC?(UC("Invalid index"),0):t.componentData[e].componentWeight},e.setInterpolationTypeToNearest=function(){return e.setInterpolationType(GC.NEAREST)},e.setInterpolationTypeToLinear=function(){return e.setInterpolationType(GC.LINEAR)},e.setInterpolationTypeToFastLinear=function(){return e.setInterpolationType(GC.FAST_LINEAR)},e.getInterpolationTypeAsString=function(){return ur.a.enumToString(GC,t.interpolationType)},["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach(function(n){var r=ur.a.capitalize(n);e["set".concat(r)]=function(r,a){return t.componentData[r]["".concat(n)]!==a&&(t.componentData[r]["".concat(n)]=a,e.modified(),!0)}}),["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach(function(n){var r=ur.a.capitalize(n);e["get".concat(r)]=function(e){return t.componentData[e]["".concat(n)]}})}(e,t)}var HC=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,XC,n),fv.extend(e,t,n),t.boundsMTime={},ur.a.obj(t.boundsMTime),ur.a.set(e,t,["property"]),ur.a.setGet(e,t,["mapper"]),ur.a.getArray(e,t,["bounds"],6),function(e,t){t.classHierarchy.push("vtkVolume"),e.getVolumes=function(){return e},e.makeProperty=HC.newInstance,e.getProperty=function(){return null===t.property&&(t.property=e.makeProperty()),t.property},e.getBounds=function(){if(null===t.mapper)return t.bounds;var n=t.mapper.getBounds();if(!n||6!==n.length)return n;if(n[0]>n[1])return t.mapperBounds=n.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),n;if(!t.mapperBounds||!function(e){return e[0].map(function(t,n){return e.map(function(e){return e[n]})})}([n,t.mapperBounds]).reduce(function(e,t){return e&&t[0]===t[1]},!0)||e.getMTime()>t.boundsMTime.getMTime()){KC("Recomputing bounds..."),t.mapperBounds=n.map(function(e){return e});var r=[];_u.getCorners(n,r),e.computeMatrix();var a=new Float64Array(16);o.transpose(a,t.matrix),r.forEach(function(e){return i.transformMat4(e,e,a)}),t.bounds[0]=t.bounds[2]=t.bounds[4]=Number.MAX_VALUE,t.bounds[1]=t.bounds[3]=t.bounds[5]=-Number.MAX_VALUE,t.bounds=t.bounds.map(function(e,t){return t%2==0?r.reduce(function(e,n){return e>n[t/2]?n[t/2]:e},e):r.reduce(function(e,n){return ee?n:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var n=t.mapper.getMTime();e=n>e?n:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(n=t.mapper.getInput().getMTime())>e?n:e)}return e}}(e,t)}var YC={newInstance:ur.a.newInstance(qC,"vtkVolume"),extend:qC},ZC=Li.BlendMode;var QC={bounds:[1,-1,1,-1,1,-1],sampleDistance:1,imageSampleDistance:1,maximumSamplesPerRay:1e3,autoAdjustSampleDistances:!0,blendMode:ZC.COMPOSITE_BLEND,averageIPScalarRange:[-1e6,1e6]};function $C(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,QC,n),Bl.extend(e,t,n),ur.a.obj(e,t),ur.a.algo(e,t,1,0),ur.a.setGet(e,t,["sampleDistance","imageSampleDistance","maximumSamplesPerRay","autoAdjustSampleDistances","blendMode"]),ur.a.setGetArray(e,t,["averageIPScalarRange"],2),ur.a.event(e,t,"lightingActivated"),function(e,t){t.classHierarchy.push("vtkVolumeMapper"),e.getBounds=function(){var n=e.getInputData();return n?(t.static||e.update(),t.bounds=n.getBounds()):t.bounds=Ka(),t.bounds},e.update=function(){e.getInputData()},e.setBlendModeToComposite=function(){e.setBlendMode(ZC.COMPOSITE_BLEND)},e.setBlendModeToMaximumIntensity=function(){e.setBlendMode(ZC.MAXIMUM_INTENSITY_BLEND)},e.setBlendModeToMinimumIntensity=function(){e.setBlendMode(ZC.MINIMUM_INTENSITY_BLEND)},e.setBlendModeToAverageIntensity=function(){e.setBlendMode(ZC.AVERAGE_INTENSITY_BLEND)},e.getBlendModeAsString=function(){return ur.a.enumToString(ZC,t.blendMode)}}(e,t)}var JC={newInstance:ur.a.newInstance($C,"vtkVolumeMapper"),extend:$C};function eS(e,t){const n=[e.volume.cols,e.volume.rows,e.volume.imageIds.length];if(n[0]*n[1]*n[2]<1||n[1]<2||n[1]<2||n[2]<2)return;const r=bc.newInstance(),a=e.volume.imagePosition,o=e.volume.pixelSpacing.concat(e.volume.sliceThickness);r.setDimensions(n),r.setOrigin(a),r.setSpacing(o);const i=vo.newInstance({name:"Scalars",values:t,numberOfComponents:1});return r.getPointData().setScalars(i),r.modified(),r}let tS=!1;function nS(e,t,n){let r=[],a=0,o=function(){let t="knee"==e?24:364,n=[];for(let r=1;r{t.resetImageParsing(),t.readFiles(r,function(e,r){let a=e[_.keys(e)[0]];t.renderImage(a,"viewer"),n&&setTimeout(n,3e3,a)})})})}function rS(e){return e*Math.PI/180}const aS=(e,t,n)=>{try{let r=Jl.intersectWithPlane(e.position,e.normal,t.position,t.normal);if(r.intersection){const{l0:e,l1:t}=r,a=Jl.intersectWithLine(e,t,n.position,n.normal);if(a.intersection)return a.x}}catch(e){console.log("some issue calculating the plane intersection",e)}return NaN};function oS(e){const t=YC.newInstance(),n=JC.newInstance();n.setSampleDistance(1),t.setMapper(n),n.setInputData(e);const r=e.getPointData().getScalars().getRange();return t.getProperty().getRGBTransferFunction(0).setMappingRange(r[0],r[1]),t}const iS={Length:function(e,t,n){if(e.p1[0]&&e.p2[0]?(e.p1=t,e.p1_world=n,e.p2=[void 0,void 0],e.p2_world=[void 0,void 0],e.label=void 0):e.p1[0]?(e.p2=t,e.p2_world=n):(e.p1=t,e.p1_world=n),e.p1[0]&&e.p2[0]){let t=oa(e.p1_world,e.p2_world),n=Math.sqrt(t).toFixed(1);e.label=`${n} mm`}else e.label=""},Angle:function(e,t,n){if(e.p1[0]&&e.p2[0]&&e.p3[0]?(e.p1=t,e.p1_world=n,e.p2=e.p3=[void 0,void 0],e.p2_world=e.p3_world=[void 0,void 0],e.label=void 0):e.p1[0]&&e.p2[0]?(e.p3=t,e.p3_world=n):e.p1[0]?(e.p2=t,e.p2_world=n):(e.p1=t,e.p1_world=n),e.p1[0]&&e.p2[0]&&e.p3[0]){let t=new Array(3),n=new Array(3);Qr(e.p2_world,e.p3_world,t),Qr(e.p2_world,e.p1_world,n);let r=Fr(ia(t,n)).toFixed(1);e.label=`${r}°`}else e.label=""}};class sS{constructor(e){this.VERBOSE=!1,this.element=e,this.renderer=null,this.renderWindow=null,this._genericRenderWindow=null,this.actor=null,this._raysDistance=2.5,this._blurOnInteraction=null,this._rescaleLUT=!1,this.PGwidgetElement=null,this.PGwidget=null,this.gaussians=null,this._PGwidgetLoaded=!1,this._cropWidget=null,this.ww=.25,this.wl=.3,this.wwwl=[0,0],this._measurementState=null,this.initVR()}set wwwl(e){if(!this.actor)return;const t=this.actor.getMapper().getInputData().getPointData().getScalars().getRange();let n=e[0]/(t[1]-t[0]),r=(e[1]-t[0])/t[1];this.wl=r,this.ww=n,this.PGwidget&&this.updateWidget()}get wwwl(){const e=this.actor.getMapper().getInputData().getPointData().getScalars().getRange();return[rel_ww*(e[1]-e[0]),rel_wl*e[1]+e[0]]}set resolution(e){this._raysDistance=5/e,this.actor.getMapper().setSampleDistance(this._raysDistance),this.renderWindow.render()}get resolution(){return Math.round(5*this._raysDistance)}get presetsList(){return nT.rgbPresetNames}set widgetElement(e){this.PGwidgetElement=e;let t=e.offsetHeight?e.offsetHeight-5:100,n=e.offsetWidth?e.offsetWidth-5:300;this.PGwidget.setSize(n,t),this.PGwidget.setContainer(this.PGwidgetElement),this.PGwidget.render()}set rescaleLUT(e){let t;this._rescaleLUT=e,t=this._rescaleLUT&&this.PGwidget?this.PGwidget.getOpacityRange():this.actor.getMapper().getInputData().getPointData().getScalars().getRange(),this.ctfun.setMappingRange(...t),this.ctfun.updateRange()}set cropWidget(e){this._cropWidget||this.setupCropWidget(),this._cropWidget.setVisibility(e),this._widgetManager.renderWidgets(),this.renderWindow.render()}set lut(e){const t=Gv.newInstance();let n;t.applyColorMap(nT.getPresetByName(e)),n=this._rescaleLUT&&this._PGwidgetLoaded?this.PGwidget.getOpacityRange():this.actor.getMapper().getInputData().getPointData().getScalars().getRange(),t.setMappingRange(...n),t.updateRange(),this.actor.getProperty().setRGBTransferFunction(0,t);const r=Wv.newInstance();this.actor.getProperty().setScalarOpacity(0,r),this.ctfun=t,this.ofun=r,this.updateWidget()}initVR(){const e=wv.newInstance();e.setContainer(this.element),e.setBackground([0,0,0]),e.onResize(()=>{let t=[e.getContainer().getBoundingClientRect().width,e.getContainer().getBoundingClientRect().height];e.getRenderWindow().getViews()[0].setSize(t),this.VERBOSE&&console.log("resize",t)}),window.addEventListener("resize",t=>{e.resize()}),e.resize(),this.renderer=e.getRenderer(),this.renderWindow=e.getRenderWindow(),this._genericRenderWindow=e,this.setupPGwidget()}setImage(e){this.renderer.removeAllVolumes();let t=oS(e);this.actor=t,this.lut="Grayscale",this.renderer.addVolume(t),this.setCamera(t.getCenter()),this.PGwidget&&(this.updateWidget(),this.setWidgetCallbacks()),this.setupInteractor(),this.blurOnInteraction=!0,this._genericRenderWindow.resize(),this.renderer.resetCamera(),this.renderWindow.render()}setCamera(e){this.renderer.resetCamera(),this.renderer.getActiveCamera().zoom(1.5),this.renderer.getActiveCamera().elevation(70),this.renderer.getActiveCamera().setViewUp(0,0,1),this.renderer.getActiveCamera().setFocalPoint(e[0],e[1],e[2]),this.renderer.getActiveCamera().setPosition(e[0],e[1]-2e3,e[2]),this.renderer.getActiveCamera().setThickness(1e4),this.renderer.getActiveCamera().setParallelProjection(!0)}getLutList(){return nT.rgbPresetNames}setActorProperties(){this.actor.getProperty().setScalarOpacityUnitDistance(0,30),this.actor.getProperty().setInterpolationTypeToLinear(),this.actor.getProperty().setUseGradientOpacity(0,!0),this.actor.getProperty().setGradientOpacityMinimumValue(0,2),this.actor.getProperty().setGradientOpacityMinimumOpacity(0,0),this.actor.getProperty().setGradientOpacityMaximumValue(0,20),this.actor.getProperty().setGradientOpacityMaximumOpacity(0,2),this.actor.getProperty().setShade(!0),this.actor.getProperty().setAmbient(state.ambient),this.actor.getProperty().setDiffuse(state.diffuse),this.actor.getProperty().setSpecular(state.specular),this.actor.getProperty().setSpecularPower(state.specularPower)}setupCropWidget(){const e=Rh.newInstance();e.setRenderer(this.renderer);const t=Kb.newInstance(),n=(e.addWidget(t),$b.newInstance()),r=t.getWidgetState().getCroppingPlanes();r.onModified(()=>{n.setCroppingPlanes(r.getPlanes())});let a=this.actor.getMapper(),o=a.getInputData();n.setCroppingPlanes(...o.getExtent()),t.copyImageDataDescription(o),t.set({faceHandlesEnabled:!0,edgeHandlesEnabled:!0,cornerHandlesEnabled:!0}),n.setInputData(o),a.setInputConnection(n.getOutputPort()),e.enablePicking(),this._widgetManager=e,this._cropWidget=t,this.renderWindow.render()}setupPGwidget(){let e=this.PGwidgetElement?this.PGwidgetElement.offsetWidth-5:300,t=this.PGwidgetElement?this.PGwidgetElement.offsetHeight-5:100;const n=DT.newInstance({numberOfBins:256,size:[e,t]});n.updateStyle({backgroundColor:"rgba(255, 255, 255, 0.6)",histogramColor:"rgba(50, 50, 50, 0.8)",strokeColor:"rgb(0, 0, 0)",activeColor:"rgb(255, 255, 255)",handleColor:"rgb(50, 150, 50)",buttonDisableFillColor:"rgba(255, 255, 255, 0.5)",buttonDisableStrokeColor:"rgba(0, 0, 0, 0.5)",buttonStrokeColor:"rgba(0, 0, 0, 1)",buttonFillColor:"rgba(255, 255, 255, 1)",strokeWidth:1,activeStrokeWidth:1.5,buttonStrokeWidth:1,handleWidth:1,iconSize:0,padding:1}),n.setContainer(this.PGwidgetElement),window.addEventListener("resize",e=>{n.setSize(this.PGwidgetElement.offsetWidth-5,this.PGwidgetElement.offsetHeight-5),n.render()}),this.PGwidget=n}updateWidget(){const e=this.actor.getMapper().getInputData().getPointData().getScalars();this.PGwidget.setDataArray(e.getData());let t=this.PGwidget.getGaussians();if(t.length>0){let e=t[0];e.position=this.wl,e.width=this.ww,this.PGwidget.setGaussians([e])}else{const e=1,t=0,n=0;this.PGwidget.addGaussian(this.wl,e,this.ww,n,t)}this.PGwidget.applyOpacity(this.ofun),this.PGwidget.setColorTransferFunction(this.ctfun),this.ctfun.onModified(()=>{this.PGwidget.render(),this.renderWindow.render()}),this._PGwidgetLoaded=!0}setWidgetCallbacks(){this.PGwidget.bindMouseListeners(),this.PGwidget.onAnimation(e=>{e?this.renderWindow.getInteractor().requestAnimation(this.PGwidget):this.renderWindow.getInteractor().cancelAnimation(this.PGwidget)}),this.PGwidget.onOpacityChange(e=>{if(this.PGwidget=e,this.gaussians=e.getGaussians().slice(),this.PGwidget.applyOpacity(this.ofun),this.renderWindow.getInteractor().isAnimating()||this.renderWindow.render(),this._rescaleLUT&&this.PGwidget){const e=this.PGwidget.getOpacityRange();this.ctfun.setMappingRange(...e),this.ctfun.updateRange()}})}setSampleDistance(e){this.actor.getMapper().setSampleDistance(e)}set blurOnInteraction(e){this._blurOnInteraction=e;let t=this.renderWindow.getInteractor(),n=this.actor.getMapper();e?(t.onLeftButtonPress(()=>{n.setSampleDistance(5*this._raysDistance)}),t.onLeftButtonRelease(()=>{n.setSampleDistance(this._raysDistance);let e=this.renderer.getActiveCamera();this._pickingPlane&&this._pickingPlane.setNormal(e.getDirectionOfProjection()),this.renderWindow.render()})):(t.onLeftButtonPress(()=>{n.setSampleDistance(this._raysDistance)}),t.onLeftButtonRelease(()=>{n.setSampleDistance(this._raysDistance);let e=this.renderer.getActiveCamera();this._pickingPlane&&this._pickingPlane.setNormal(e.getDirectionOfProjection()),this.renderWindow.render()}))}setupInteractor(){const e=GT.newInstance({button:1}),t=jT.newInstance({button:3,control:!0}),n=HT.newInstance({button:3,scrollEnabled:!0}),r=qT.newInstance({button:1,shift:!0});let a=this;r.setVerticalListener(-1,1,.001,function(){return a.wl},function(e){let t=a.wl+(e-a.wl)/25;a.wl=t;let n=a.PGwidget.getGaussians().slice();n[0].position=a.wl,a.PGwidget.setGaussians(n)}),r.setHorizontalListener(.1,2.1,.001,function(){return a.ww},function(e){let t=a.ww+(e-a.ww)/5;a.ww=t;let n=a.PGwidget.getGaussians().slice();n[0].width=a.ww,a.PGwidget.setGaussians(n)});const o=iC.newInstance();o.addMouseManipulator(r),o.addMouseManipulator(e),o.addMouseManipulator(t),o.addMouseManipulator(n),o.setCenterOfRotation(this.actor.getCenter()),this.renderWindow.getInteractor().setInteractorStyle(o),this.renderWindow.getInteractor().onMouseWheel(()=>this.resetMeasurementState()),this.renderWindow.getInteractor().onRightButtonPress(()=>this.resetMeasurementState())}resetMeasurementState(e){this._measurementState?(this._measurementState.p1=new Array(2),this._measurementState.p2=new Array(2),this._measurementState.p3=new Array(2),this._measurementState.p1_world=new Array(2),this._measurementState.p2_world=new Array(2),this._measurementState.p3_world=new Array(2),this._measurementState.label=null):e&&(e.p1=new Array(2),e.p2=new Array(2),e.p3=new Array(2),e.p1_world=new Array(2),e.p2_world=new Array(2),e.p3_world=new Array(2),e.label=null)}setTool(e,t,n){switch(this._leftButtonCb&&this._leftButtonCb.unsubscribe(),e){case"Length":case"Angle":this._initPicker(n,e);break;case"Rotation":this.resetMeasurementState(n),this.setupInteractor();break;default:console.warn("No tool found for",e)}}_initPicker(e,t){this.blurOnInteraction=!1;let n=this.renderWindow.getInteractor().getInteractorStyle().getMouseManipulators().filter(e=>"vtkMouseCameraTrackballRotateManipulator"==e.getClassName()).pop();this.renderWindow.getInteractor().getInteractorStyle().removeMouseManipulator(n);const r=CC.newInstance();if(r.setPickFromList(1),r.initializePickList(),!this._pickingPlane){const e=AC.newInstance({xResolution:1e3,yResolution:1e3});let t=this.renderer.getActiveCamera();e.setPoint1(0,0,1e3),e.setPoint2(1e3,0,0),e.setCenter(this.actor.getCenter()),e.setNormal(t.getDirectionOfProjection());const n=dd.newInstance();n.setInputConnection(e.getOutputPort());const r=bv.newInstance();r.setMapper(n),r.getProperty().setOpacity(.01),this.renderer.addActor(r),this._pickingPlane=e,this._planeActor=r}r.addPickList(this._planeActor),this._leftButtonCb=this.renderWindow.getInteractor().onLeftButtonPress(n=>{if(this.renderer!==n.pokedRenderer)return;const a=n.position,o=[a.x,a.y,0];if(r.pick(o,this.renderer),0===r.getActors().length){const e=r.getPickPosition();this.VERBOSE&&console.log(`No point picked, default: ${e}`)}else{const n=r.getPickedPositions()[0];this.VERBOSE&&console.log(`Picked: ${n}`);const a=BC.newInstance();a.setCoordinateSystemToWorld(),a.setValue(...n);const o=a.getComputedDisplayValue(this.renderer);!function(e,t,n,r){iS[r](e,t,n)}(e,o,n,t),this.VERBOSE&&console.log(e),this._measurementState=e}this.renderWindow.render()})}resetView(){let e=this.actor.getCenter();console.log(e),this.setCamera(e),this.renderWindow.render()}resize(){this._genericRenderWindow.resize()}destroy(){this.element=null,this._genericRenderWindow.delete(),this._genericRenderWindow=null,this.actor.getMapper().delete(),this.actor.delete(),this.actor=null,this._planeActor&&(this._planeActor.getMapper().delete(),this._planeActor.delete(),this._planeActor=null),this.PGwidgetElement&&(this.PGwidgetElement=null,this.PGwidget.delete(),this.PGwidget=null,this.gaussians=null),this._cropWidget&&(this._cropWidget.delete(),this._cropWidget=null)}}function lS(e,t){t.classHierarchy.push("vtkInteractorStyleMPRSlice"),t.trackballManipulator=GT.newInstance({button:1}),t.panManipulator=jT.newInstance({button:1,shift:!0}),t.zoomManipulator=HT.newInstance({button:3}),t.scrollManipulator=qT.newInstance({scrollEnabled:!0,dragEnabled:!1});const n={sliceNormal:[0,0,0],sliceRange:[0,0],slicePosition:[0,0,0]};function r(){const n=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(n[0],n[1],1,e.getSlice,e.setSlice)}let a=null,o=null;const i=e.setInteractor;e.setInteractor=(n=>{if(i(n),a&&(a.unsubscribe(),a=null),o&&(o.unsubscribe(),o=null),n){const i=n.getCurrentRenderer().getActiveCamera();a=i.onModified(()=>{r(),e.modified()}),o=n.onAnimation(()=>{const{slabThickness:e}=t,n=i.getDistance(),r=n-e/2,a=n+e/2;i.setClippingRange(r,a)})}}),e.handleMouseMove=ur.a.chain(e.handleMouseMove,()=>{const e=t.interactor.getCurrentRenderer(),{slabThickness:n}=t,r=e.getActiveCamera(),a=r.getDistance(),o=a-n/2,i=a+n/2;r.setClippingRange(o,i)});const s=e.setVolumeMapper;e.setVolumeMapper=(e=>{if(s(e)){const n=t.interactor.getCurrentRenderer().getActiveCamera();e?n.setFreezeFocalPoint(!0):n.setFreezeFocalPoint(!1)}}),e.getSlice=(()=>{const n=t.interactor.getCurrentRenderer().getActiveCamera(),r=e.getSliceNormal(),a=tb.buildFromDegree().identity().rotateFromDirections(r,[1,0,0]),o=n.getFocalPoint();return a.apply(o),o[0]}),e.setSlice=(n=>{const r=t.interactor.getCurrentRenderer().getActiveCamera();if(t.volumeMapper){const a=e.getSliceRange(),o=t.volumeMapper.getBounds(),i=function(e,t,n){return en?n:e}(n,...a),s=[(o[0]+o[1])/2,(o[2]+o[3])/2,(o[4]+o[5])/2],l=r.getDistance(),u=r.getDirectionOfProjection();Ya.normalize(u);const c=(a[1]+a[0])/2,d=[s[0]-u[0]*c,s[1]-u[1]*c,s[2]-u[2]*c],f=[d[0]+u[0]*i,d[1]+u[1]*i,d[2]+u[2]*i],p=[f[0]-u[0]*l,f[1]-u[1]*l,f[2]-u[2]*l];r.setPosition(...p),r.setFocalPoint(...f);const g=e.getOnScroll();g&&g(f)}}),e.getSliceRange=(()=>{if(t.volumeMapper){const r=e.getSliceNormal();if(r[0]===n.sliceNormal[0]&&r[1]===n.sliceNormal[1]&&r[2]===n.sliceNormal[2])return n.sliceRange;const a=function(e){return[[e[0],e[2],e[4]],[e[0],e[2],e[5]],[e[0],e[3],e[4]],[e[0],e[3],e[5]],[e[1],e[2],e[4]],[e[1],e[2],e[5]],[e[1],e[3],e[4]],[e[1],e[3],e[5]]]}(t.volumeMapper.getBounds()),o=tb.buildFromDegree().identity().rotateFromDirections(r,[1,0,0]);a.forEach(e=>o.apply(e));let i=1/0,s=-1/0;for(let e=0;e<8;e++){const t=a[e][0];t>s&&(s=t),t{if(t.volumeMapper&&t.interactor){return t.interactor.getCurrentRenderer().getActiveCamera().getDirectionOfProjection()}return[0,0,0]}),e.setSliceNormal=((n,r=[0,1,0])=>{const a=t.interactor.getCurrentRenderer().getActiveCamera();t.sliceNormal=[...n],t.viewUp=[...r];const o=[...n],i=[...r];if(t.volumeMapper){Ya.normalize(o);let n=t.volumeMapper;!t.volumeMapper.getInputData&&t.volumeMapper.getMapper&&(n=t.volumeMapper.getMapper());let r=function(e){if(9!==e.length)throw Error("Array not length 9");return[[e[0],e[1],e[2]],[e[3],e[4],e[5]],[e[6],e[7],e[8]]]}(n.getInputData().getDirection());Ya.transpose3x3(r,r),Ya.multiply3x3_vect3(r,o,o);let s=a.getFocalPoint(),l=a.getDistance(),u=a.getViewAngle();if(Number.isNaN(l)||void 0===l){const e=t.volumeMapper.getBounds(),n=Math.sqrt(Ya.distance2BetweenPoints([e[0],e[2],e[4]],[e[1],e[3],e[5]]));s=[(e[0]+e[1])/2,(e[2]+e[3])/2,(e[4]+e[5])/2],u=90,l=n/(2*Math.tan(u/360*Math.PI))}const c=[s[0]-o[0]*l,s[1]-o[1]*l,s[2]-o[2]*l];Ya.multiply3x3_vect3(r,i,i);const{slabThickness:d}=t;a.setPosition(...c),a.setDistance(l),a.setDirectionOfProjection(...o),a.setViewUp(...i),a.setViewAngle(u),a.setClippingRange(l-d/2,l+d/2),e.setCenterOfRotation(s)}}),e.setSlabThickness=(e=>{t.slabThickness=e;const n=t.interactor.getCurrentRenderer().getActiveCamera(),r=n.getDistance();n.setClippingRange(r-e/2,r+e/2)}),e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulator),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),r()}const uS={slabThickness:.1};function cS(e,t,n={}){Object.assign(t,uS,n),iC.extend(e,t,n),ur.a.setGet(e,t,["volumeMapper","onScroll"]),ur.a.get(e,t,["slabThickness","viewUp"]),lS(e,t)}const dS=ur.a.newInstance(cS,"vtkInteractorStyleMPRSlice");var fS=Object.assign({newInstance:dS,extend:cS});const{States:pS}=zg;function gS(e,t){t.classHierarchy.push("vtkInteractorStyleMPRWindowLevel"),t.trackballManipulator=GT.newInstance({button:1}),t.panManipulatorShift=jT.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=jT.newInstance({button:3,control:!0}),t.zoomManipulator=HT.newInstance({button:3}),t.scrollManipulator=qT.newInstance({scrollEnabled:!0,dragEnabled:!1});const n=e.handleMouseMove;e.handleMouseMove=(r=>{const a=[r.position.x,r.position.y];t.state===pS.IS_WINDOW_LEVEL&&(e.windowLevelFromMouse(a),e.invokeInteractionEvent({type:"InteractionEvent"})),n&&n(r)});const r=e.setVolumeMapper;e.setVolumeMapper=(e=>{if(r(e)){const n=t.interactor.getCurrentRenderer().getActiveCamera();e?n.setFreezeFocalPoint(!0):n.setFreezeFocalPoint(!1)}}),e.windowLevelFromMouse=(([n,r])=>{const a=t.volumeMapper.getMapper().getInputData().getPointData().getScalars().getRange(),o=(a[1]-a[0])/1024*t.levelScale,i=(n-t.wlStartPos[0])*o,s=(r-t.wlStartPos[1])*o*.5;let{windowWidth:l,windowCenter:u}=e.getWindowLevel();l=Math.max(1,Math.round(l+i)),u=Math.round(u+s),e.setWindowLevel(l,u),t.wlStartPos=[n,r];const c=e.getOnLevelsChanged();c&&c({windowCenter:u,windowWidth:l})}),e.getWindowLevel=(()=>{return function(e,t){const n=Math.abs(e-t);return{windowWidth:n,windowCenter:e+n/2}}(...t.volumeMapper.getProperty().getRGBTransferFunction(0).getMappingRange().slice())}),e.setWindowLevel=((e,n)=>{const r=function(e,t){return{lower:t-e/2,upper:t+e/2}}(e,n);t.volumeMapper.getProperty().getRGBTransferFunction(0).setMappingRange(r.lower,r.upper)});const a=e.handleLeftButtonPress;e.handleLeftButtonPress=(n=>{t.wlStartPos=[n.position.x,n.position.y],n.shiftKey||n.controlKey?a&&a(n):e.startWindowLevel()}),e.superHandleLeftButtonRelease=e.handleLeftButtonRelease,e.handleLeftButtonRelease=(()=>{switch(t.state){case pS.IS_WINDOW_LEVEL:e.endWindowLevel();break;default:e.superHandleLeftButtonRelease()}}),e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),function(){const n=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(n[0],n[1],1,e.getSlice,e.setSlice)}()}const mS={wlStartPos:[0,0],levelScale:1};function vS(e,t,n={}){Object.assign(t,mS,n),fS.extend(e,t,n),ur.a.setGet(e,t,["volumeMapper","onLevelsChanged","levelScale"]),gS(e,t)}const hS=ur.a.newInstance(vS,"vtkInteractorStyleMPRWindowLevel");var yS=Object.assign({newInstance:hS,extend:vS});const{States:bS}=zg;function TS(e,t){function n(t){const n=[t.position.x,t.position.y],r=t.pokedRenderer,a=e.getOnClickCallback(),o=BC.newInstance();o.setCoordinateSystemToDisplay(),o.setValue(n[0],n[1],0);const i=o.getComputedWorldValue(r);i.length&&a({worldPos:i,displayPos:n}),e.invokeInteractionEvent({type:"InteractionEvent"})}t.classHierarchy.push("vtkInteractorStyleMPRCrosshairs"),t.trackballManipulator=GT.newInstance({button:1}),t.panManipulatorShift=jT.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=jT.newInstance({button:3,control:!0}),t.zoomManipulator=HT.newInstance({button:3}),t.scrollManipulator=qT.newInstance({scrollEnabled:!0,dragEnabled:!1});const r=e.handleMouseMove;e.handleMouseMove=(e=>{t.state===bS.IS_SLICE&&n(e),r&&r(e)});const a=e.handleLeftButtonPress;e.handleLeftButtonPress=(r=>{r.shiftKey||r.controlKey?a&&a(r):t.volumeMapper&&(n(r),e.startSlice())});const o=e.setVolumeMapper;e.setVolumeMapper=(e=>{if(o(e)){const n=t.interactor.getCurrentRenderer().getActiveCamera();e?n.setFreezeFocalPoint(!0):n.setFreezeFocalPoint(!1)}}),e.superHandleLeftButtonRelease=e.handleLeftButtonRelease,e.handleLeftButtonRelease=(()=>{switch(t.state){case bS.IS_SLICE:e.endSlice();break;default:e.superHandleLeftButtonRelease()}}),e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),function(){const n=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(n[0],n[1],1,e.getSlice,e.setSlice)}()}const CS={};function SS(e,t,n={}){Object.assign(t,CS,n),fS.extend(e,t,n),ur.a.setGet(e,t,["volumeMapper","onClickCallback"]),TS(e,t)}const PS=ur.a.newInstance(SS,"vtkInteractorStyleMPRCrosshairs");var wS=Object.assign({newInstance:PS,extend:SS});const{States:xS}=zg;function OS(e,t){function n(){e.removeAllMouseManipulators(),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),e.addMouseManipulator(t.leftManipulator),function(){const n=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(n[0],n[1],1,e.getSlice,e.setSlice)}()}t.classHierarchy.push("vtkInteractorStyleMPRPanZoom"),t.panManipulatorShift=jT.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=jT.newInstance({button:3,control:!0}),t.zoomManipulator=HT.newInstance({button:3}),t.scrollManipulator=qT.newInstance({scrollEnabled:!0,dragEnabled:!1}),e.setLeftButton=(e=>{"zoom"==e?t.leftManipulator=HT.newInstance({button:1}):"pan"==e?t.leftManipulator=jT.newInstance({button:1}):console.error("No tool found for",e),n()}),t.leftButtonTool||(t.leftButtonTool="pan"),e.setLeftButton(t.leftButtonTool),n();const r=e.setInteractor;e.setInteractor=(n=>{if(r(n),null===n)return;let a="pan"==t.leftButtonTool?e.getOnPanChanged():e.getOnZoomChanged();n.onAnimation(a)})}const MS={wlStartPos:[0,0],levelScale:1};function AS(e,t,n={}){Object.assign(t,MS,n),fS.extend(e,t,n),ur.a.setGet(e,t,["volumeMapper","onPanChanged","onZoomChanged","levelScale"]),OS(e,t)}const IS=ur.a.newInstance(AS,"vtkInteractorStyleMPRPanZoom");var RS=Object.assign({newInstance:IS,extend:AS});const ES=[[0,0,1],[-1,0,0],[0,1,0]],DS=[[0,-1,0],[0,0,1],[0,0,1]];class VS{constructor(e,t,n){this.VERBOSE=!1,this._key=e,this._element=n,this._volume=null,this._renderer=null,this._parallel=!0,this.slicePlaneNormal=ES[t],this.sliceViewUp=DS[t],this.slicePlaneXRotation=0,this.slicePlaneYRotation=0,this.viewRotation=0,this._sliceThickness=.1,this._blendMode="MIP",this.window={width:0,center:0},this._cachedSlicePlane=[...this.slicePlaneNormal],this._cachedSliceViewUp=[...this.sliceViewUp],this._genericRenderWindow=wv.newInstance({background:[0,0,0]}),this._genericRenderWindow.setContainer(n),this._renderWindow=this._genericRenderWindow.getRenderWindow(),this._renderer=this._genericRenderWindow.getRenderer(),this._parallel&&this._renderer.getActiveCamera().setParallelProjection(!0),this._genericRenderWindow.getOpenGLRenderWindow().buildPass(!0),this.onResize()}set blendMode(e){this._blendMode=e,this.updateBlendMode(this._sliceThickness,this._blendMode)}set sliceThickness(e){this._sliceThickness=e;const t=this._renderWindow.getInteractor().getInteractorStyle();t.setSlabThickness&&t.setSlabThickness(this._sliceThickness),this.updateBlendMode(this._sliceThickness,this._blendMode)}set wwwl([e,t]){this.window.center=t,this.window.width=e,this._genericRenderWindow.getRenderWindow().render()}get camera(){return this._genericRenderWindow.getRenderer().getActiveCamera()}initView(e,t,n,r){this._volume=e;const a=fS.newInstance();a.setOnScroll(n),this._renderWindow.getInteractor().setInteractorStyle(a),this.VERBOSE&&console.log(this._volumes);const o=this._volume.getMapper();a.setVolumeMapper(o);const i=a.getSliceRange();a.setSlice((i[0]+i[1])/2),this.updateVolumesForRendering(),this.VERBOSE&&console.log("view data",this._key,t.views[this.key]),this.updateSlicePlane(t.views[this._key]),this.fill2DView(this._genericRenderWindow,this._key),r()}updateVolumesForRendering(){this._renderer.removeAllVolumes(),this._volume&&(this._volume.isA("vtkVolume")?this._renderer.addVolume(this._volume):console.warn("Data to is not vtkVolume data")),this._renderWindow.render()}updateSlicePlane(e){let t=this._cachedSlicePlane,n=this._cachedSliceViewUp;this.VERBOSE&&console.log(e);let r=[];i.cross(r,e.sliceViewUp,e.slicePlaneNormal),i.normalize(r,r);let a=e.sliceViewUp;const s=o.create();o.rotate(s,s,rS(e.slicePlaneYRotation),a),o.rotate(s,s,rS(e.slicePlaneXRotation),r),this.VERBOSE&&console.log(t,e.slicePlaneNormal,s),i.transformMat4(t,e.slicePlaneNormal,s);const u=l.create();l.setAxisAngle(u,t,rS(-e.viewRotation)),l.normalize(u,u);const c=l.create();l.setAxisAngle(c,r,rS(e.slicePlaneXRotation)),l.normalize(c,c);const d=l.create();l.add(d,c,u),i.transformQuat(n,e.sliceViewUp,u);const f=this._genericRenderWindow.getRenderWindow(),p=f.getInteractor().getInteractorStyle();p&&p.setSliceNormal&&p.setSliceNormal(t,n),f.render()}fill2DView(){const e=this._renderer.computeVisiblePropBounds(),t=[(e[1]-e[0])/2,(e[3]-e[2])/2,(e[5]-e[4])/2],n=this._genericRenderWindow.getContainer().clientWidth/this._genericRenderWindow.getContainer().clientHeight;let r,a;"left"===this._key?(r=t[1],a=t[2]):"front"===this._key?(r=t[0],a=t[2]):"top"===this._key&&(r=t[0],a=t[1]),n>=r/a?this._renderer.getActiveCamera().setParallelScale(a+1):this._renderer.getActiveCamera().setParallelScale(r/n+1),this.onResize()}onResize(){this._genericRenderWindow.resize()}updateBlendMode(e,t){if(e>=1)switch(t){case"MIP":this._volume.getMapper().setBlendModeToMaximumIntensity();break;case"MINIP":this._volume.getMapper().setBlendModeToMinimumIntensity();break;case"AVG":this._volume.getMapper().setBlendModeToAverageIntensity();break;case"none":default:this._volume.getMapper().setBlendModeToComposite()}else this._volume.getMapper().setBlendModeToComposite();this._renderWindow.render()}setInteractor(e){const t=this._genericRenderWindow.getRenderWindow(),n=t.getInteractor().getInteractorStyle();t.getInteractor().setInteractorStyle(e),e.setInteractor(t.getInteractor()),t.getInteractor().setInteractorStyle(e),e.setSliceNormal&&n.getSliceNormal()&&e.setSliceNormal(n.getSliceNormal(),n.getViewUp()),e.setSlabThickness&&n.getSlabThickness()&&e.setSlabThickness(n.getSlabThickness()),e.setVolumeMapper(this._volume)}destroy(){this.VERBOSE&&console.log("DESTROY",this._key),this.VERBOSE=null,this._key=null,this._element=null,this._volume.getMapper()&&this._volume.getMapper().delete(),this._volume.delete(),this._volume=null,this._renderer.delete(),this._renderer=null,this._parallel=null,this.slicePlaneNormal=null,this.sliceViewUp=null,this.slicePlaneXRotation=null,this.slicePlaneYRotation=null,this.viewRotation=null,this._sliceThickness=null,this._blendMode=null,this.window=null,this._cachedSlicePlane=null,this._cachedSliceViewUp=null,this._genericRenderWindow.delete()}}class LS{constructor(e){this.VERBOSE=!1,this.syncWindowLevels=!0,this._activeTool=null,this.elements=e,this.volume=null,this.sliceIntersection=[0,0,0],this.mprViews={},this.initMPR()}set wwwl([e,t]){const n=t-e/2,r=t+e/2;this.volume.getProperty().getRGBTransferFunction(0).setMappingRange(n,r),Object.keys(this.elements).forEach((n,r)=>{this.mprViews[n].wwwl=[e,t]})}initMPR(){Object.keys(this.elements).forEach((e,t)=>{try{this.mprViews[e]=new VS(e,t,this.elements[e].element)}catch(t){console.error("Error creating MPRView",e),console.error(t)}}),this.VERBOSE&&console.log("initialized")}getInitialState(){let e=Object.keys(this.mprViews).reduce((e,t)=>{let{slicePlaneNormal:n,sliceViewUp:r,slicePlaneXRotation:a,slicePlaneYRotation:o,viewRotation:i,_sliceThickness:s,_blendMode:l,window:u}=e[t];return e[t]={slicePlaneNormal:n,sliceViewUp:r,slicePlaneXRotation:a,slicePlaneYRotation:o,viewRotation:i,sliceThickness:s,blendMode:l,window:u},e},Object.assign({},this.mprViews));return{interactorCenters:Object.keys(this.elements).reduce((e,t)=>({...e,[t]:[0,0]}),{}),sliceIntersection:[...this.sliceIntersection],views:e}}setImage(e,t){let n=oS(t);this.volume=n,this.sliceIntersection=function(e){const t=e.getBounds();return[(t[0]+t[1])/2,(t[2]+t[3])/2,(t[4]+t[5])/2]}(n.getMapper()),e.sliceIntersection=[...this.sliceIntersection],Object.keys(this.elements).forEach(t=>{this.mprViews[t].initView(n,e,()=>{this.onScrolled.call(this,e)},()=>{this.onScrolled.call(this,e)})}),this._activeTool&&this.setTool(this._activeTool,e)}setTool(e,t){switch(e){case"level":this.setLevelTool(t);break;case"crosshair":this.setCrosshairTool(t);break;case"zoom":this.setZoomTool(t);break;case"pan":this.setPanTool(t)}}setPanTool(e){Object.entries(e.views).forEach(([t])=>{const n=RS.newInstance({leftButtonTool:"pan"});n.setOnScroll(()=>{this.onScrolled(e)}),n.setOnPanChanged(()=>{this.updateInteractorCenters(e)}),this.mprViews[t].setInteractor(n)}),this._activeTool="pan"}setZoomTool(e){Object.entries(e.views).forEach(([t])=>{const n=RS.newInstance({leftButtonTool:"zoom"});n.setOnScroll(()=>{this.onScrolled(e)}),n.setOnZoomChanged(()=>{this.updateInteractorCenters(e)}),this.mprViews[t].setInteractor(n)}),this._activeTool="zoom"}setLevelTool(e){Object.entries(e.views).forEach(([t])=>{const n=yS.newInstance();n.setOnScroll(()=>{this.onScrolled(e)}),n.setOnLevelsChanged(n=>{this.updateLevels({...n,srcKey:t},e)}),this.mprViews[t].setInteractor(n)}),this._activeTool="level"}setCrosshairTool(e){let t=this;Object.entries(e.views).forEach(([n])=>{const r=wS.newInstance();r.setOnScroll(()=>{t.onScrolled(e)}),r.setOnClickCallback(({worldPos:r})=>{t.onCrosshairPointSelected({worldPos:r,srcKey:n},e)}),this.mprViews[n].setInteractor(r)}),this._activeTool="crosshair"}onCrosshairPointSelected({srcKey:e,worldPos:t},n){Object.keys(this.elements).forEach(r=>{if(r!==e){const e=this.mprViews[r]._genericRenderWindow.getRenderWindow(),n=e.getInteractor().getInteractorStyle(),a=n.getSliceNormal(),o=tb.buildFromDegree().identity().rotateFromDirections(a,[1,0,0]),i=t.slice();o.apply(i);const s=i[0];n.setSlice(s),e.render()}this.updateInteractorCenters(n)}),this.sliceIntersection=[...t],n.sliceIntersection=[...t]}updateLevels({windowCenter:e,windowWidth:t,srcKey:n},r){r.views[n].window.center=e,r.views[n].window.width=t,this.syncWindowLevels&&Object.keys(this.elements).filter(e=>e!==n).forEach(n=>{this.mprViews[n].wwwl=[t,e]})}onScrolled(e){let t=[];Object.keys(this.elements).forEach(e=>{const n=this.mprViews[e].camera;t.push({position:n.getFocalPoint(),normal:n.getDirectionOfProjection()})});const n=aS(...t);return Number.isNaN(n)||n.some(e=>Number.isNaN(e))||(this.sliceIntersection=[...n],e.sliceIntersection=[...n],this.VERBOSE&&console.log("updating slice intersection",n)),this.updateInteractorCenters(e),n}onRotate(e,t,n,r){switch(e){case"top":"x"===t?r.views.front.slicePlaneYRotation=n:"y"===t&&(r.views.left.slicePlaneYRotation=n);break;case"left":"x"===t?r.views.top.slicePlaneXRotation=n:"y"===t&&(r.views.front.slicePlaneXRotation=n);break;case"front":"x"===t?r.views.top.slicePlaneYRotation=n:"y"===t&&(r.views.left.slicePlaneXRotation=n)}Object.keys(this.elements).filter(t=>t!==e).forEach(e=>{this.mprViews[e].updateSlicePlane(r.views[e])}),this.VERBOSE&&console.log("afterOnRotate",r)}onThickness(e,t,n,r){const a=n>1;let o;switch(e){case"top":"x"===t?o="front":"y"===t&&(o="left");break;case"left":"x"===t?o="top":"y"===t&&(o="front");break;case"front":"x"===t?o="top":"y"===t&&(o="left")}a&&"none"===this.mprViews[o].blendMode&&(this.mprViews[o].blendMode="MIP",r.mprViews[o].blendMode="MIP"),this.mprViews[o].sliceThickness=n,r.views[o].sliceThickness=n}updateInteractorCenters(e){Object.keys(this.elements).forEach(t=>{const n=this.mprViews[t]._genericRenderWindow.getRenderer(),r=BC.newInstance();r.setCoordinateSystemToWorld(),r.setValue(...this.sliceIntersection);const a=r.getComputedDisplayValue(n);this.VERBOSE&&console.log("interactor center",t,a),e.interactorCenters[t]=a})}resize(e,t){t?this.mprViews[t].onResize():Object.values(this.mprViews).forEach(e=>{e.onResize()}),this.updateInteractorCenters(e)}destroy(){Object.keys(this.elements).forEach(e=>{this.mprViews[e].destroy()})}}n.d(t,"MPRManager",function(){return LS}),n.d(t,"VRView",function(){return sS}),n.d(t,"loadDemoSerieWithLarvitar",function(){return nS}),n.d(t,"buildVtkVolume",function(){return eS})}])}); \ No newline at end of file diff --git a/docs/documentation/MPRManager.html b/docs/documentation/MPRManager.html index f418707..5f469b6 100644 --- a/docs/documentation/MPRManager.html +++ b/docs/documentation/MPRManager.html @@ -83,7 +83,7 @@

new MPRMana
Source:
@@ -313,7 +313,7 @@

wwwlSource:
@@ -396,7 +396,7 @@

destroySource:
@@ -483,7 +483,7 @@

getIni
Source:
@@ -592,7 +592,7 @@

onRotateSource:
@@ -797,7 +797,7 @@

onThicknes
Source:
@@ -1002,7 +1002,7 @@

resizeSource:
@@ -1138,7 +1138,7 @@

setImageSource:
@@ -1297,7 +1297,7 @@

setToolSource:
diff --git a/docs/documentation/global.html b/docs/documentation/global.html index 20fe9f9..1a23161 100644 --- a/docs/documentation/global.html +++ b/docs/documentation/global.html @@ -418,7 +418,7 @@

State

Source:
diff --git a/docs/documentation/mprManager.js.html b/docs/documentation/mprManager.js.html index 841086e..dec1c23 100644 --- a/docs/documentation/mprManager.js.html +++ b/docs/documentation/mprManager.js.html @@ -65,8 +65,6 @@

mprManager.js

import { MPRView } from "./mprView"; -window.istyle = {}; - /** * Internal state of a single view * @typedef {Object} State @@ -106,9 +104,6 @@

mprManager.js

this.mprViews = {}; this.initMPR(); - - // FOR DEV - window.mpr = this; } /** @@ -255,12 +250,11 @@

mprManager.js

istyle.setOnScroll(() => { this.onScrolled(state); }); - // TODO update something if needed - // istyle.setOnPanChanged(levels => { - // this.updateLevels({ ...levels, srcKey: key }, state); - // }); + // update interactor center + istyle.setOnPanChanged(() => { + this.updateInteractorCenters(state); + }); this.mprViews[key].setInteractor(istyle); - window.istyle[key] = istyle; }); this._activeTool = "pan"; } @@ -278,58 +272,15 @@

mprManager.js

istyle.setOnScroll(() => { this.onScrolled(state); }); - // TODO update something if needed - // istyle.setOnZoomChanged(levels => { - // this.updateLevels({ ...levels, srcKey: key }, state); - // }); + // update interactor center + istyle.setOnZoomChanged(() => { + this.updateInteractorCenters(state); + }); this.mprViews[key].setInteractor(istyle); - window.istyle[key] = istyle; }); this._activeTool = "zoom"; } - /** - * Set "pan" as active tool - * @private - * @param {State} state - The current manager state - */ - // setPanTool(state) { - // Object.entries(state.views).forEach(([key]) => { - // const istyle = vtkInteractorStyleManipulator.newInstance(); - // const panManipulator = vtkMouseCameraTrackballPanManipulator.newInstance({ - // button: 1 - // // control: true - // }); - // istyle.addMouseManipulator(panManipulator); - // this.mprViews[key]._renderWindow - // .getInteractor() - // .setInteractorStyle(istyle); - // }); - // this._activeTool = "pan"; - // } - - /** - * Set "zoom" as active tool - * @private - * @param {State} state - The current manager state - */ - // setZoomTool(state) { - // Object.entries(state.views).forEach(([key]) => { - // const istyle = vtkInteractorStyleManipulator.newInstance(); - // const zoomManipulator = vtkMouseCameraTrackballZoomManipulator.newInstance( - // { - // button: 1 - // // scrollEnabled: true - // } - // ); - // istyle.addMouseManipulator(zoomManipulator); - // this.mprViews[key]._renderWindow - // .getInteractor() - // .setInteractorStyle(istyle); - // }); - // this._activeTool = "zoom"; - // } - /** * Set "level" as active tool * @private @@ -345,7 +296,6 @@

mprManager.js

this.updateLevels({ ...levels, srcKey: key }, state); }); this.mprViews[key].setInteractor(istyle); - window.istyle[key] = istyle; }); this._activeTool = "level"; } @@ -556,7 +506,7 @@

mprManager.js

* Force views resize * @param {String} key - If provided, resize just its view, otherwise all views */ - resize(key) { + resize(state, key) { if (key) { this.mprViews[key].onResize(); } else { @@ -564,6 +514,7 @@

mprManager.js

view.onResize(); }); } + this.updateInteractorCenters(state); } /** diff --git a/docs/documentation/mprView.js.html b/docs/documentation/mprView.js.html index d0dd7a9..fafd72d 100644 --- a/docs/documentation/mprView.js.html +++ b/docs/documentation/mprView.js.html @@ -378,7 +378,6 @@

mprView.js

const oldStyle = renderWindow.getInteractor().getInteractorStyle(); renderWindow.getInteractor().setInteractorStyle(istyle); - // NOTE: react-vtk-viewport's code put this here, so we're copying it. Seems redundant? istyle.setInteractor(renderWindow.getInteractor()); // Make sure to set the style to the interactor itself, because reasons...?! diff --git a/docs/examples/diglettk.js b/docs/examples/diglettk.js index 68e084a..c53563a 100644 --- a/docs/examples/diglettk.js +++ b/docs/examples/diglettk.js @@ -1,2900 +1 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["diglettk"] = factory(); - else - root["diglettk"] = factory(); -})(window, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./src/index.js"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./node_modules/blueimp-md5/js/md5.js": -/*!********************************************!*\ - !*** ./node_modules/blueimp-md5/js/md5.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/* global define */\n\n/* eslint-disable strict */\n\n;(function ($) {\n 'use strict'\n\n /**\n * Add integers, wrapping at 2^32.\n * This uses 16-bit operations internally to work around bugs in interpreters.\n *\n * @param {number} x First integer\n * @param {number} y Second integer\n * @returns {number} Sum\n */\n function safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff)\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16)\n return (msw << 16) | (lsw & 0xffff)\n }\n\n /**\n * Bitwise rotate a 32-bit number to the left.\n *\n * @param {number} num 32-bit number\n * @param {number} cnt Rotation count\n * @returns {number} Rotated number\n */\n function bitRotateLeft(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }\n\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} q q\n * @param {number} a a\n * @param {number} b b\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b)\n }\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} a a\n * @param {number} b b\n * @param {number} c c\n * @param {number} d d\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5ff(a, b, c, d, x, s, t) {\n return md5cmn((b & c) | (~b & d), a, b, x, s, t)\n }\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} a a\n * @param {number} b b\n * @param {number} c c\n * @param {number} d d\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5gg(a, b, c, d, x, s, t) {\n return md5cmn((b & d) | (c & ~d), a, b, x, s, t)\n }\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} a a\n * @param {number} b b\n * @param {number} c c\n * @param {number} d d\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t)\n }\n /**\n * Basic operation the algorithm uses.\n *\n * @param {number} a a\n * @param {number} b b\n * @param {number} c c\n * @param {number} d d\n * @param {number} x x\n * @param {number} s s\n * @param {number} t t\n * @returns {number} Result\n */\n function md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t)\n }\n\n /**\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n *\n * @param {Array} x Array of little-endian words\n * @param {number} len Bit length\n * @returns {Array} MD5 Array\n */\n function binlMD5(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << len % 32\n x[(((len + 64) >>> 9) << 4) + 14] = len\n\n var i\n var olda\n var oldb\n var oldc\n var oldd\n var a = 1732584193\n var b = -271733879\n var c = -1732584194\n var d = 271733878\n\n for (i = 0; i < x.length; i += 16) {\n olda = a\n oldb = b\n oldc = c\n oldd = d\n\n a = md5ff(a, b, c, d, x[i], 7, -680876936)\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586)\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819)\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330)\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897)\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426)\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341)\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983)\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416)\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417)\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063)\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162)\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682)\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101)\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290)\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329)\n\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510)\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632)\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713)\n b = md5gg(b, c, d, a, x[i], 20, -373897302)\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691)\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083)\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335)\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848)\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438)\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690)\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961)\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501)\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467)\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784)\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473)\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734)\n\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558)\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463)\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562)\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556)\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060)\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353)\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632)\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640)\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174)\n d = md5hh(d, a, b, c, x[i], 11, -358537222)\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979)\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189)\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487)\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835)\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520)\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651)\n\n a = md5ii(a, b, c, d, x[i], 6, -198630844)\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415)\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905)\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055)\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571)\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606)\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523)\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799)\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359)\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744)\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380)\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649)\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070)\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379)\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259)\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551)\n\n a = safeAdd(a, olda)\n b = safeAdd(b, oldb)\n c = safeAdd(c, oldc)\n d = safeAdd(d, oldd)\n }\n return [a, b, c, d]\n }\n\n /**\n * Convert an array of little-endian words to a string\n *\n * @param {Array} input MD5 Array\n * @returns {string} MD5 string\n */\n function binl2rstr(input) {\n var i\n var output = ''\n var length32 = input.length * 32\n for (i = 0; i < length32; i += 8) {\n output += String.fromCharCode((input[i >> 5] >>> i % 32) & 0xff)\n }\n return output\n }\n\n /**\n * Convert a raw string to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n *\n * @param {string} input Raw input string\n * @returns {Array} Array of little-endian words\n */\n function rstr2binl(input) {\n var i\n var output = []\n output[(input.length >> 2) - 1] = undefined\n for (i = 0; i < output.length; i += 1) {\n output[i] = 0\n }\n var length8 = input.length * 8\n for (i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << i % 32\n }\n return output\n }\n\n /**\n * Calculate the MD5 of a raw string\n *\n * @param {string} s Input string\n * @returns {string} Raw MD5 string\n */\n function rstrMD5(s) {\n return binl2rstr(binlMD5(rstr2binl(s), s.length * 8))\n }\n\n /**\n * Calculates the HMAC-MD5 of a key and some data (raw strings)\n *\n * @param {string} key HMAC key\n * @param {string} data Raw input string\n * @returns {string} Raw MD5 string\n */\n function rstrHMACMD5(key, data) {\n var i\n var bkey = rstr2binl(key)\n var ipad = []\n var opad = []\n var hash\n ipad[15] = opad[15] = undefined\n if (bkey.length > 16) {\n bkey = binlMD5(bkey, key.length * 8)\n }\n for (i = 0; i < 16; i += 1) {\n ipad[i] = bkey[i] ^ 0x36363636\n opad[i] = bkey[i] ^ 0x5c5c5c5c\n }\n hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)\n return binl2rstr(binlMD5(opad.concat(hash), 512 + 128))\n }\n\n /**\n * Convert a raw string to a hex string\n *\n * @param {string} input Raw input string\n * @returns {string} Hex encoded string\n */\n function rstr2hex(input) {\n var hexTab = '0123456789abcdef'\n var output = ''\n var x\n var i\n for (i = 0; i < input.length; i += 1) {\n x = input.charCodeAt(i)\n output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f)\n }\n return output\n }\n\n /**\n * Encode a string as UTF-8\n *\n * @param {string} input Input string\n * @returns {string} UTF8 string\n */\n function str2rstrUTF8(input) {\n return unescape(encodeURIComponent(input))\n }\n\n /**\n * Encodes input string as raw MD5 string\n *\n * @param {string} s Input string\n * @returns {string} Raw MD5 string\n */\n function rawMD5(s) {\n return rstrMD5(str2rstrUTF8(s))\n }\n /**\n * Encodes input string as Hex encoded string\n *\n * @param {string} s Input string\n * @returns {string} Hex encoded string\n */\n function hexMD5(s) {\n return rstr2hex(rawMD5(s))\n }\n /**\n * Calculates the raw HMAC-MD5 for the given key and data\n *\n * @param {string} k HMAC key\n * @param {string} d Input string\n * @returns {string} Raw MD5 string\n */\n function rawHMACMD5(k, d) {\n return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d))\n }\n /**\n * Calculates the Hex encoded HMAC-MD5 for the given key and data\n *\n * @param {string} k HMAC key\n * @param {string} d Input string\n * @returns {string} Raw MD5 string\n */\n function hexHMACMD5(k, d) {\n return rstr2hex(rawHMACMD5(k, d))\n }\n\n /**\n * Calculates MD5 value for a given string.\n * If a key is provided, calculates the HMAC-MD5 value.\n * Returns a Hex encoded string unless the raw argument is given.\n *\n * @param {string} string Input string\n * @param {string} [key] HMAC key\n * @param {boolean} [raw] Raw output switch\n * @returns {string} MD5 output\n */\n function md5(string, key, raw) {\n if (!key) {\n if (!raw) {\n return hexMD5(string)\n }\n return rawMD5(string)\n }\n if (!raw) {\n return hexHMACMD5(key, string)\n }\n return rawHMACMD5(key, string)\n }\n\n if (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n return md5\n }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))\n } else {}\n})(this)\n\n\n//# sourceURL=webpack://diglettk/./node_modules/blueimp-md5/js/md5.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/common.js": -/*!**********************************************!*\ - !*** ./node_modules/gl-matrix/esm/common.js ***! - \**********************************************/ -/*! exports provided: EPSILON, ARRAY_TYPE, RANDOM, setMatrixArrayType, toRadian, equals */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EPSILON\", function() { return EPSILON; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ARRAY_TYPE\", function() { return ARRAY_TYPE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RANDOM\", function() { return RANDOM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setMatrixArrayType\", function() { return setMatrixArrayType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadian\", function() { return toRadian; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/**\r\n * Common utilities\r\n * @module glMatrix\r\n */\n// Configuration Constants\nvar EPSILON = 0.000001;\nvar ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nvar RANDOM = Math.random;\n/**\r\n * Sets the type of array used when creating new vectors and matrices\r\n *\r\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\r\n */\n\nfunction setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\r\n * Convert Degree To Radian\r\n *\r\n * @param {Number} a Angle in Degrees\r\n */\n\nfunction toRadian(a) {\n return a * degree;\n}\n/**\r\n * Tests whether or not the arguments have approximately the same value, within an absolute\r\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\r\n * than or equal to 1.0, and a relative tolerance is used for larger values)\r\n *\r\n * @param {Number} a The first number to test.\r\n * @param {Number} b The second number to test.\r\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/common.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/index.js": -/*!*********************************************!*\ - !*** ./node_modules/gl-matrix/esm/index.js ***! - \*********************************************/ -/*! exports provided: glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"glMatrix\", function() { return _common_js__WEBPACK_IMPORTED_MODULE_0__; });\n/* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat2.js */ \"./node_modules/gl-matrix/esm/mat2.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat2\", function() { return _mat2_js__WEBPACK_IMPORTED_MODULE_1__; });\n/* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mat2d.js */ \"./node_modules/gl-matrix/esm/mat2d.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat2d\", function() { return _mat2d_js__WEBPACK_IMPORTED_MODULE_2__; });\n/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mat3.js */ \"./node_modules/gl-matrix/esm/mat3.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat3\", function() { return _mat3_js__WEBPACK_IMPORTED_MODULE_3__; });\n/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mat4.js */ \"./node_modules/gl-matrix/esm/mat4.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat4\", function() { return _mat4_js__WEBPACK_IMPORTED_MODULE_4__; });\n/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./quat.js */ \"./node_modules/gl-matrix/esm/quat.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"quat\", function() { return _quat_js__WEBPACK_IMPORTED_MODULE_5__; });\n/* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./quat2.js */ \"./node_modules/gl-matrix/esm/quat2.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"quat2\", function() { return _quat2_js__WEBPACK_IMPORTED_MODULE_6__; });\n/* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vec2.js */ \"./node_modules/gl-matrix/esm/vec2.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"vec2\", function() { return _vec2_js__WEBPACK_IMPORTED_MODULE_7__; });\n/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./vec3.js */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"vec3\", function() { return _vec3_js__WEBPACK_IMPORTED_MODULE_8__; });\n/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./vec4.js */ \"./node_modules/gl-matrix/esm/vec4.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"vec4\", function() { return _vec4_js__WEBPACK_IMPORTED_MODULE_9__; });\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/index.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/mat2.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/mat2.js ***! - \********************************************/ -/*! exports provided: create, clone, copy, identity, fromValues, set, transpose, invert, adjoint, determinant, multiply, rotate, scale, fromRotation, fromScaling, str, frob, LDU, add, subtract, exactEquals, equals, multiplyScalar, multiplyScalarAndAdd, mul, sub */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose\", function() { return transpose; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"adjoint\", function() { return adjoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LDU\", function() { return LDU; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 2x2 Matrix\r\n * @module mat2\r\n */\n\n/**\r\n * Creates a new identity mat2\r\n *\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2} a matrix to clone\r\n * @returns {mat2} a new 2x2 matrix\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Copy the values from one mat2 to another\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set a mat2 to the identity matrix\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @returns {mat2} out\r\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Create a new mat2 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out A new 2x2 matrix\r\n */\n\nfunction fromValues(m00, m01, m10, m11) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Set the components of a mat2 to the given values\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\r\n * @returns {mat2} out\r\n */\n\nfunction set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\r\n * Transpose the values of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nfunction invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3]; // Calculate the determinant\n\n var det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {mat2} out\r\n */\n\nfunction adjoint(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nfunction determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n/**\r\n * Multiplies two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nfunction multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n/**\r\n * Rotates a mat2 by the given angle\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nfunction rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n/**\r\n * Scales the mat2 by the dimensions in the given vec2\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2} out\r\n **/\n\nfunction scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2} out\r\n */\n\nfunction fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2.identity(dest);\r\n * mat2.scale(dest, dest, vec);\r\n *\r\n * @param {mat2} out mat2 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2} out\r\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2\r\n *\r\n * @param {ReadonlyMat2} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nfunction str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2\r\n *\r\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\r\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\r\n * @param {ReadonlyMat2} L the lower triangular matrix\r\n * @param {ReadonlyMat2} D the diagonal matrix\r\n * @param {ReadonlyMat2} U the upper triangular matrix\r\n * @param {ReadonlyMat2} a the input matrix to factorize\r\n */\n\nfunction LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n/**\r\n * Adds two mat2's\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @returns {mat2} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2} a The first matrix.\r\n * @param {ReadonlyMat2} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2} out the receiving matrix\r\n * @param {ReadonlyMat2} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2} out\r\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2} out the receiving vector\r\n * @param {ReadonlyMat2} a the first operand\r\n * @param {ReadonlyMat2} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2} out\r\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Alias for {@link mat2.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link mat2.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/mat2.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/mat2d.js": -/*!*********************************************!*\ - !*** ./node_modules/gl-matrix/esm/mat2d.js ***! - \*********************************************/ -/*! exports provided: create, clone, copy, identity, fromValues, set, invert, determinant, multiply, rotate, scale, translate, fromRotation, fromScaling, fromTranslation, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 2x3 Matrix\r\n * @module mat2d\r\n * @description\r\n * A mat2d contains six elements defined as:\r\n *
\r\n * [a, b,\r\n *  c, d,\r\n *  tx, ty]\r\n * 
\r\n * This is a short form for the 3x3 matrix:\r\n *
\r\n * [a, b, 0,\r\n *  c, d, 0,\r\n *  tx, ty, 1]\r\n * 
\r\n * The last column is ignored so the array is shorter and operations are faster.\r\n */\n\n/**\r\n * Creates a new identity mat2d\r\n *\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](6);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\r\n * Creates a new mat2d initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat2d} a matrix to clone\r\n * @returns {mat2d} a new 2x3 matrix\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Copy the values from one mat2d to another\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\r\n * Set a mat2d to the identity matrix\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @returns {mat2d} out\r\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Create a new mat2d with the given values\r\n *\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} A new mat2d\r\n */\n\nfunction fromValues(a, b, c, d, tx, ty) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Set the components of a mat2d to the given values\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {Number} a Component A (index 0)\r\n * @param {Number} b Component B (index 1)\r\n * @param {Number} c Component C (index 2)\r\n * @param {Number} d Component D (index 3)\r\n * @param {Number} tx Component TX (index 4)\r\n * @param {Number} ty Component TY (index 5)\r\n * @returns {mat2d} out\r\n */\n\nfunction set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\r\n * Inverts a mat2d\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {mat2d} out\r\n */\n\nfunction invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nfunction determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n/**\r\n * Multiplies two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nfunction multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n/**\r\n * Rotates a mat2d by the given angle\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nfunction rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Scales the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nfunction scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\r\n * Translates the mat2d by the dimensions in the given vec2\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to translate\r\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\r\n * @returns {mat2d} out\r\n **/\n\nfunction translate(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.rotate(dest, dest, rad);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat2d} out\r\n */\n\nfunction fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.scale(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat2d} out\r\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat2d.identity(dest);\r\n * mat2d.translate(dest, dest, vec);\r\n *\r\n * @param {mat2d} out mat2d receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat2d} out\r\n */\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n/**\r\n * Returns a string representation of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nfunction str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat2d\r\n *\r\n * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);\n}\n/**\r\n * Adds two mat2d's\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @returns {mat2d} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat2d} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat2d} out\r\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n/**\r\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat2d} out the receiving vector\r\n * @param {ReadonlyMat2d} a the first operand\r\n * @param {ReadonlyMat2d} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat2d} out\r\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat2d} a The first matrix.\r\n * @param {ReadonlyMat2d} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5));\n}\n/**\r\n * Alias for {@link mat2d.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link mat2d.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/mat2d.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/mat3.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/mat3.js ***! - \********************************************/ -/*! exports provided: create, fromMat4, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, rotate, scale, fromTranslation, fromRotation, fromScaling, fromMat2d, fromQuat, normalFromMat4, projection, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat4\", function() { return fromMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose\", function() { return transpose; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"adjoint\", function() { return adjoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat2d\", function() { return fromMat2d; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromQuat\", function() { return fromQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalFromMat4\", function() { return normalFromMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"projection\", function() { return projection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 3x3 Matrix\r\n * @module mat3\r\n */\n\n/**\r\n * Creates a new identity mat3\r\n *\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](9);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the upper-left 3x3 values into the given mat3.\r\n *\r\n * @param {mat3} out the receiving 3x3 matrix\r\n * @param {ReadonlyMat4} a the source 4x4 matrix\r\n * @returns {mat3} out\r\n */\n\nfunction fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\r\n * Creates a new mat3 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat3} a matrix to clone\r\n * @returns {mat3} a new 3x3 matrix\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Copy the values from one mat3 to another\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Create a new mat3 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} A new mat3\r\n */\n\nfunction fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set the components of a mat3 to the given values\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\r\n * @returns {mat3} out\r\n */\n\nfunction set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\r\n * Set a mat3 to the identity matrix\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @returns {mat3} out\r\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nfunction invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {mat3} out\r\n */\n\nfunction adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\r\n * Calculates the determinant of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nfunction determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\r\n * Multiplies two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nfunction multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\r\n * Translate a mat3 by the given vector\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to translate\r\n * @param {ReadonlyVec2} v vector to translate by\r\n * @returns {mat3} out\r\n */\n\nfunction translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\r\n * Rotates a mat3 by the given angle\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nfunction rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\r\n * Scales the mat3 by the dimensions in the given vec2\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to rotate\r\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\r\n * @returns {mat3} out\r\n **/\n\nfunction scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.translate(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Translation vector\r\n * @returns {mat3} out\r\n */\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.rotate(dest, dest, rad);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat3} out\r\n */\n\nfunction fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat3.identity(dest);\r\n * mat3.scale(dest, dest, vec);\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyVec2} v Scaling vector\r\n * @returns {mat3} out\r\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\r\n * Copies the values from a mat2d into a mat3\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat2d} a the matrix to copy\r\n * @returns {mat3} out\r\n **/\n\nfunction fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\r\n * Calculates a 3x3 matrix from the given quaternion\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nfunction fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\r\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\r\n *\r\n * @param {mat3} out mat3 receiving operation result\r\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\r\n *\r\n * @returns {mat3} out\r\n */\n\nfunction normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\r\n * Generates a 2D projection matrix with the given bounds\r\n *\r\n * @param {mat3} out mat3 frustum matrix will be written into\r\n * @param {number} width Width of your gl context\r\n * @param {number} height Height of gl context\r\n * @returns {mat3} out\r\n */\n\nfunction projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat3\r\n *\r\n * @param {ReadonlyMat3} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nfunction str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat3\r\n *\r\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\r\n * Adds two mat3's\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @returns {mat3} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat3} out the receiving matrix\r\n * @param {ReadonlyMat3} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat3} out\r\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\r\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat3} out the receiving vector\r\n * @param {ReadonlyMat3} a the first operand\r\n * @param {ReadonlyMat3} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat3} out\r\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat3} a The first matrix.\r\n * @param {ReadonlyMat3} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\r\n * Alias for {@link mat3.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link mat3.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/mat3.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/mat4.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/mat4.js ***! - \********************************************/ -/*! exports provided: create, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, scale, rotate, rotateX, rotateY, rotateZ, fromTranslation, fromScaling, fromRotation, fromXRotation, fromYRotation, fromZRotation, fromRotationTranslation, fromQuat2, getTranslation, getScaling, getRotation, fromRotationTranslationScale, fromRotationTranslationScaleOrigin, fromQuat, frustum, perspective, perspectiveFromFieldOfView, ortho, lookAt, targetTo, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose\", function() { return transpose; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"adjoint\", function() { return adjoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromXRotation\", function() { return fromXRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromYRotation\", function() { return fromYRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromZRotation\", function() { return fromZRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslation\", function() { return fromRotationTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromQuat2\", function() { return fromQuat2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTranslation\", function() { return getTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScaling\", function() { return getScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRotation\", function() { return getRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslationScale\", function() { return fromRotationTranslationScale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslationScaleOrigin\", function() { return fromRotationTranslationScaleOrigin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromQuat\", function() { return fromQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frustum\", function() { return frustum; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perspective\", function() { return perspective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perspectiveFromFieldOfView\", function() { return perspectiveFromFieldOfView; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ortho\", function() { return ortho; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lookAt\", function() { return lookAt; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"targetTo\", function() { return targetTo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\r\n * @module mat4\r\n */\n\n/**\r\n * Creates a new identity mat4\r\n *\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](16);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 initialized with values from an existing matrix\r\n *\r\n * @param {ReadonlyMat4} a matrix to clone\r\n * @returns {mat4} a new 4x4 matrix\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Copy the values from one mat4 to another\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Create a new mat4 with the given values\r\n *\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} A new mat4\r\n */\n\nfunction fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set the components of a mat4 to the given values\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\r\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\r\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\r\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\r\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\r\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\r\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\r\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\r\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\r\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\r\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\r\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\r\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\r\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\r\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\r\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\r\n * @returns {mat4} out\r\n */\n\nfunction set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\r\n * Set a mat4 to the identity matrix\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @returns {mat4} out\r\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Transpose the values of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Inverts a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nfunction invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\r\n * Calculates the adjugate of a mat4\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {mat4} out\r\n */\n\nfunction adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\r\n * Calculates the determinant of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the source matrix\r\n * @returns {Number} determinant of a\r\n */\n\nfunction determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\r\n * Multiplies two mat4s\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nfunction multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\r\n * Translate a mat4 by the given vector\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {mat4} out\r\n */\n\nfunction translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\r\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\r\n * @returns {mat4} out\r\n **/\n\nfunction scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\r\n * Rotates a mat4 by the given angle around the given axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nfunction rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the X axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nfunction rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Y axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nfunction rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\r\n * Rotates a matrix by the given angle around the Z axis\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to rotate\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nfunction rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\r\n * Creates a matrix from a vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a vector scaling\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.scale(dest, dest, vec);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyVec3} v Scaling vector\r\n * @returns {mat4} out\r\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a given angle around a given axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotate(dest, dest, rad, axis);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @returns {mat4} out\r\n */\n\nfunction fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the X axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateX(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nfunction fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Y axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateY(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nfunction fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from the given angle around the Z axis\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.rotateZ(dest, dest, rad);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {Number} rad the angle to rotate the matrix by\r\n * @returns {mat4} out\r\n */\n\nfunction fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation and vector translation\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @returns {mat4} out\r\n */\n\nfunction fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a new mat4 from a dual quat.\r\n *\r\n * @param {mat4} out Matrix\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @returns {mat4} mat4 receiving operation result\r\n */\n\nfunction fromQuat2(out, a) {\n var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\r\n * Returns the translation vector component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslation,\r\n * the returned vector will be the same as the translation vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive translation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nfunction getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\r\n * Returns the scaling factor component of a transformation\r\n * matrix. If a matrix is built with fromRotationTranslationScale\r\n * with a normalized Quaternion paramter, the returned vector will be\r\n * the same as the scaling vector\r\n * originally supplied.\r\n * @param {vec3} out Vector to receive scaling factor component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {vec3} out\r\n */\n\nfunction getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\r\n * Returns a quaternion representing the rotational component\r\n * of a transformation matrix. If a matrix is built with\r\n * fromRotationTranslation, the returned quaternion will be the\r\n * same as the quaternion originally supplied.\r\n * @param {quat} out Quaternion to receive the rotation component\r\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\r\n * @return {quat} out\r\n */\n\nfunction getRotation(out, mat) {\n var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @returns {mat4} out\r\n */\n\nfunction fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\r\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\r\n * This is equivalent to (but much faster than):\r\n *\r\n * mat4.identity(dest);\r\n * mat4.translate(dest, vec);\r\n * mat4.translate(dest, origin);\r\n * let quatMat = mat4.create();\r\n * quat4.toMat4(quat, quatMat);\r\n * mat4.multiply(dest, quatMat);\r\n * mat4.scale(dest, scale)\r\n * mat4.translate(dest, negativeOrigin);\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {quat4} q Rotation quaternion\r\n * @param {ReadonlyVec3} v Translation vector\r\n * @param {ReadonlyVec3} s Scaling vector\r\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\r\n * @returns {mat4} out\r\n */\n\nfunction fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\r\n * Calculates a 4x4 matrix from the given quaternion\r\n *\r\n * @param {mat4} out mat4 receiving operation result\r\n * @param {ReadonlyQuat} q Quaternion to create matrix from\r\n *\r\n * @returns {mat4} out\r\n */\n\nfunction fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a frustum matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Number} left Left bound of the frustum\r\n * @param {Number} right Right bound of the frustum\r\n * @param {Number} bottom Bottom bound of the frustum\r\n * @param {Number} top Top bound of the frustum\r\n * @param {Number} near Near bound of the frustum\r\n * @param {Number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nfunction frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given bounds.\r\n * Passing null/undefined/no value for far will generate infinite projection matrix.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} fovy Vertical field of view in radians\r\n * @param {number} aspect Aspect ratio. typically viewport width/height\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum, can be null or Infinity\r\n * @returns {mat4} out\r\n */\n\nfunction perspective(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\r\n * Generates a perspective projection matrix with the given field of view.\r\n * This is primarily useful for generating projection matrices to be used\r\n * with the still experiemental WebVR API.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nfunction perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\r\n * Generates a orthogonal projection matrix with the given bounds\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {number} left Left bound of the frustum\r\n * @param {number} right Right bound of the frustum\r\n * @param {number} bottom Bottom bound of the frustum\r\n * @param {number} top Top bound of the frustum\r\n * @param {number} near Near bound of the frustum\r\n * @param {number} far Far bound of the frustum\r\n * @returns {mat4} out\r\n */\n\nfunction ortho(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\r\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nfunction lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\r\n * Generates a matrix that makes something look at something else.\r\n *\r\n * @param {mat4} out mat4 frustum matrix will be written into\r\n * @param {ReadonlyVec3} eye Position of the viewer\r\n * @param {ReadonlyVec3} center Point the viewer is looking at\r\n * @param {ReadonlyVec3} up vec3 pointing up\r\n * @returns {mat4} out\r\n */\n\nfunction targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\r\n * Returns a string representation of a mat4\r\n *\r\n * @param {ReadonlyMat4} a matrix to represent as a string\r\n * @returns {String} string representation of the matrix\r\n */\n\nfunction str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\r\n * Returns Frobenius norm of a mat4\r\n *\r\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\r\n * @returns {Number} Frobenius norm\r\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\r\n * Adds two mat4's\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\r\n * Subtracts matrix b from matrix a\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @returns {mat4} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\r\n * Multiply each element of the matrix by a scalar.\r\n *\r\n * @param {mat4} out the receiving matrix\r\n * @param {ReadonlyMat4} a the matrix to scale\r\n * @param {Number} b amount to scale the matrix's elements by\r\n * @returns {mat4} out\r\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\r\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\r\n *\r\n * @param {mat4} out the receiving vector\r\n * @param {ReadonlyMat4} a the first operand\r\n * @param {ReadonlyMat4} b the second operand\r\n * @param {Number} scale the amount to scale b's elements by before adding\r\n * @returns {mat4} out\r\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\r\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\r\n * Returns whether or not the matrices have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyMat4} a The first matrix.\r\n * @param {ReadonlyMat4} b The second matrix.\r\n * @returns {Boolean} True if the matrices are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\r\n * Alias for {@link mat4.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link mat4.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/mat4.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/quat.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/quat.js ***! - \********************************************/ -/*! exports provided: create, identity, setAxisAngle, getAxisAngle, getAngle, multiply, rotateX, rotateY, rotateZ, calculateW, exp, ln, pow, slerp, random, invert, conjugate, fromMat3, fromEuler, str, clone, fromValues, copy, set, add, mul, scale, dot, lerp, length, len, squaredLength, sqrLen, normalize, exactEquals, equals, rotationTo, sqlerp, setAxes */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setAxisAngle\", function() { return setAxisAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAxisAngle\", function() { return getAxisAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAngle\", function() { return getAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"calculateW\", function() { return calculateW; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exp\", function() { return exp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ln\", function() { return ln; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pow\", function() { return pow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"slerp\", function() { return slerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"conjugate\", function() { return conjugate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat3\", function() { return fromMat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromEuler\", function() { return fromEuler; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotationTo\", function() { return rotationTo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqlerp\", function() { return sqlerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setAxes\", function() { return setAxes; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat3.js */ \"./node_modules/gl-matrix/esm/mat3.js\");\n/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vec3.js */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./vec4.js */ \"./node_modules/gl-matrix/esm/vec4.js\");\n\n\n\n\n/**\r\n * Quaternion\r\n * @module quat\r\n */\n\n/**\r\n * Creates a new identity quat\r\n *\r\n * @returns {quat} a new quaternion\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\r\n * Set a quat to the identity quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nfunction identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\r\n * Sets a quat from the given angle and rotation axis,\r\n * then returns it.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyVec3} axis the axis around which to rotate\r\n * @param {Number} rad the angle in radians\r\n * @returns {quat} out\r\n **/\n\nfunction setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\r\n * Gets the rotation axis and angle for a given\r\n * quaternion. If a quaternion is created with\r\n * setAxisAngle, this method will return the same\r\n * values as providied in the original parameter list\r\n * OR functionally equivalent values.\r\n * Example: The quaternion formed by axis [0, 0, 1] and\r\n * angle -90 is the same as the quaternion formed by\r\n * [0, 0, 1] and 270. This method favors the latter.\r\n * @param {vec3} out_axis Vector receiving the axis of rotation\r\n * @param {ReadonlyQuat} q Quaternion to be decomposed\r\n * @return {Number} Angle, in radians, of the rotation\r\n */\n\nfunction getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\r\n * Gets the angular distance between two unit quaternions\r\n *\r\n * @param {ReadonlyQuat} a Origin unit quaternion\r\n * @param {ReadonlyQuat} b Destination unit quaternion\r\n * @return {Number} Angle, in radians, between the two quaternions\r\n */\n\nfunction getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\r\n * Multiplies two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n */\n\nfunction multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the X axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nfunction rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Y axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nfunction rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\r\n * Rotates a quaternion by the given angle about the Z axis\r\n *\r\n * @param {quat} out quat receiving operation result\r\n * @param {ReadonlyQuat} a quat to rotate\r\n * @param {number} rad angle (in radians) to rotate\r\n * @returns {quat} out\r\n */\n\nfunction rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\r\n * Calculates the W component of a quat from the X, Y, and Z components.\r\n * Assumes that quaternion is 1 unit in length.\r\n * Any existing W component will be ignored.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate W component of\r\n * @returns {quat} out\r\n */\n\nfunction calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\r\n * Calculate the exponential of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nfunction exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\r\n * Calculate the natural logarithm of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @returns {quat} out\r\n */\n\nfunction ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\r\n * Calculate the scalar power of a unit quaternion.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate the exponential of\r\n * @param {Number} b amount to scale the quaternion by\r\n * @returns {quat} out\r\n */\n\nfunction pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\r\n * Performs a spherical linear interpolation between two quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nfunction slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\r\n * Generates a random unit quaternion\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @returns {quat} out\r\n */\n\nfunction random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]();\n var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]();\n var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\r\n * Calculates the inverse of a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate inverse of\r\n * @returns {quat} out\r\n */\n\nfunction invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\r\n * Calculates the conjugate of a quat\r\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quat to calculate conjugate of\r\n * @returns {quat} out\r\n */\n\nfunction conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a quaternion from the given 3x3 rotation matrix.\r\n *\r\n * NOTE: The resultant quaternion is not normalized, so you should be sure\r\n * to renormalize the quaternion yourself where necessary.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyMat3} m rotation matrix\r\n * @returns {quat} out\r\n * @function\r\n */\n\nfunction fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\r\n * Creates a quaternion from the given euler angle x, y, z.\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {x} Angle to rotate around X axis in degrees.\r\n * @param {y} Angle to rotate around Y axis in degrees.\r\n * @param {z} Angle to rotate around Z axis in degrees.\r\n * @returns {quat} out\r\n * @function\r\n */\n\nfunction fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\r\n * Returns a string representation of a quatenion\r\n *\r\n * @param {ReadonlyQuat} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nfunction str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat} a quaternion to clone\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nvar clone = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"clone\"];\n/**\r\n * Creates a new quat initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} a new quaternion\r\n * @function\r\n */\n\nvar fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"fromValues\"];\n/**\r\n * Copy the values from one quat to another\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the source quaternion\r\n * @returns {quat} out\r\n * @function\r\n */\n\nvar copy = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"copy\"];\n/**\r\n * Set the components of a quat to the given values\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {quat} out\r\n * @function\r\n */\n\nvar set = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"set\"];\n/**\r\n * Adds two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {quat} out\r\n * @function\r\n */\n\nvar add = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"add\"];\n/**\r\n * Alias for {@link quat.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Scales a quat by a scalar number\r\n *\r\n * @param {quat} out the receiving vector\r\n * @param {ReadonlyQuat} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {quat} out\r\n * @function\r\n */\n\nvar scale = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"scale\"];\n/**\r\n * Calculates the dot product of two quat's\r\n *\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nvar dot = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"dot\"];\n/**\r\n * Performs a linear interpolation between two quat's\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n * @function\r\n */\n\nvar lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"lerp\"];\n/**\r\n * Calculates the length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nvar length = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"length\"];\n/**\r\n * Alias for {@link quat.length}\r\n * @function\r\n */\n\nvar len = length;\n/**\r\n * Calculates the squared length of a quat\r\n *\r\n * @param {ReadonlyQuat} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nvar squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"squaredLength\"];\n/**\r\n * Alias for {@link quat.squaredLength}\r\n * @function\r\n */\n\nvar sqrLen = squaredLength;\n/**\r\n * Normalize a quat\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a quaternion to normalize\r\n * @returns {quat} out\r\n * @function\r\n */\n\nvar normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"normalize\"];\n/**\r\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat} a The first quaternion.\r\n * @param {ReadonlyQuat} b The second quaternion.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nvar exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"exactEquals\"];\n/**\r\n * Returns whether or not the quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat} a The first vector.\r\n * @param {ReadonlyQuat} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nvar equals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"equals\"];\n/**\r\n * Sets a quaternion to represent the shortest rotation from one\r\n * vector to another.\r\n *\r\n * Both vectors are assumed to be unit length.\r\n *\r\n * @param {quat} out the receiving quaternion.\r\n * @param {ReadonlyVec3} a the initial vector\r\n * @param {ReadonlyVec3} b the destination vector\r\n * @returns {quat} out\r\n */\n\nvar rotationTo = function () {\n var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"create\"]();\n var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"fromValues\"](1, 0, 0);\n var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"fromValues\"](0, 1, 0);\n return function (out, a, b) {\n var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"dot\"](a, b);\n\n if (dot < -0.999999) {\n _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](tmpvec3, xUnitVec3, a);\n if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"len\"](tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](tmpvec3, yUnitVec3, a);\n _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"normalize\"](tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\r\n * Performs a spherical linear interpolation with two control points\r\n *\r\n * @param {quat} out the receiving quaternion\r\n * @param {ReadonlyQuat} a the first operand\r\n * @param {ReadonlyQuat} b the second operand\r\n * @param {ReadonlyQuat} c the third operand\r\n * @param {ReadonlyQuat} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat} out\r\n */\n\nvar sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\r\n * Sets the specified quaternion with values corresponding to the given\r\n * axes. Each axis is a vec3 and is expected to be unit length and\r\n * perpendicular to all other specified axes.\r\n *\r\n * @param {ReadonlyVec3} view the vector representing the viewing direction\r\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\r\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\r\n * @returns {quat} out\r\n */\n\nvar setAxes = function () {\n var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_1__[\"create\"]();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/quat.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/quat2.js": -/*!*********************************************!*\ - !*** ./node_modules/gl-matrix/esm/quat2.js ***! - \*********************************************/ -/*! exports provided: create, clone, fromValues, fromRotationTranslationValues, fromRotationTranslation, fromTranslation, fromRotation, fromMat4, copy, identity, set, getReal, getDual, setReal, setDual, getTranslation, translate, rotateX, rotateY, rotateZ, rotateByQuatAppend, rotateByQuatPrepend, rotateAroundAxis, add, multiply, mul, scale, dot, lerp, invert, conjugate, length, len, squaredLength, sqrLen, normalize, str, exactEquals, equals */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslationValues\", function() { return fromRotationTranslationValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslation\", function() { return fromRotationTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat4\", function() { return fromMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getReal\", function() { return getReal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDual\", function() { return getDual; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setReal\", function() { return setReal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setDual\", function() { return setDual; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTranslation\", function() { return getTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateByQuatAppend\", function() { return rotateByQuatAppend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateByQuatPrepend\", function() { return rotateByQuatPrepend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateAroundAxis\", function() { return rotateAroundAxis; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"conjugate\", function() { return conjugate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quat.js */ \"./node_modules/gl-matrix/esm/quat.js\");\n/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mat4.js */ \"./node_modules/gl-matrix/esm/mat4.js\");\n\n\n\n/**\r\n * Dual Quaternion
\r\n * Format: [real, dual]
\r\n * Quaternion format: XYZW
\r\n * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
\r\n * @module quat2\r\n */\n\n/**\r\n * Creates a new identity dual quat\r\n *\r\n * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]\r\n */\n\nfunction create() {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n dq[0] = 0;\n dq[1] = 0;\n dq[2] = 0;\n dq[4] = 0;\n dq[5] = 0;\n dq[6] = 0;\n dq[7] = 0;\n }\n\n dq[3] = 1;\n return dq;\n}\n/**\r\n * Creates a new quat initialized with values from an existing quaternion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to clone\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nfunction clone(a) {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n dq[0] = a[0];\n dq[1] = a[1];\n dq[2] = a[2];\n dq[3] = a[3];\n dq[4] = a[4];\n dq[5] = a[5];\n dq[6] = a[6];\n dq[7] = a[7];\n return dq;\n}\n/**\r\n * Creates a new dual quat initialized with the given values\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nfunction fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n dq[4] = x2;\n dq[5] = y2;\n dq[6] = z2;\n dq[7] = w2;\n return dq;\n}\n/**\r\n * Creates a new dual quat from the given values (quat and translation)\r\n *\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component (translation)\r\n * @param {Number} y2 Y component (translation)\r\n * @param {Number} z2 Z component (translation)\r\n * @returns {quat2} new dual quaternion\r\n * @function\r\n */\n\nfunction fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n var ax = x2 * 0.5,\n ay = y2 * 0.5,\n az = z2 * 0.5;\n dq[4] = ax * w1 + ay * z1 - az * y1;\n dq[5] = ay * w1 + az * x1 - ax * z1;\n dq[6] = az * w1 + ax * y1 - ay * x1;\n dq[7] = -ax * x1 - ay * y1 - az * z1;\n return dq;\n}\n/**\r\n * Creates a dual quat from a quaternion and a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q a normalized quaternion\r\n * @param {ReadonlyVec3} t tranlation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nfunction fromRotationTranslation(out, q, t) {\n var ax = t[0] * 0.5,\n ay = t[1] * 0.5,\n az = t[2] * 0.5,\n bx = q[0],\n by = q[1],\n bz = q[2],\n bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Creates a dual quat from a translation\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyVec3} t translation vector\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nfunction fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a dual quat from a quaternion\r\n *\r\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\r\n * @param {ReadonlyQuat} q the quaternion\r\n * @returns {quat2} dual quaternion receiving operation result\r\n * @function\r\n */\n\nfunction fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Creates a new dual quat from a matrix (4x4)\r\n *\r\n * @param {quat2} out the dual quaternion\r\n * @param {ReadonlyMat4} a the matrix\r\n * @returns {quat2} dual quat receiving operation result\r\n * @function\r\n */\n\nfunction fromMat4(out, a) {\n //TODO Optimize this\n var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"create\"]();\n _mat4_js__WEBPACK_IMPORTED_MODULE_2__[\"getRotation\"](outer, a);\n var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n _mat4_js__WEBPACK_IMPORTED_MODULE_2__[\"getTranslation\"](t, a);\n fromRotationTranslation(out, outer, t);\n return out;\n}\n/**\r\n * Copy the values from one dual quat to another\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the source dual quaternion\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Set a dual quat to the identity dual quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @returns {quat2} out\r\n */\n\nfunction identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\r\n * Set the components of a dual quat to the given values\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {Number} x1 X component\r\n * @param {Number} y1 Y component\r\n * @param {Number} z1 Z component\r\n * @param {Number} w1 W component\r\n * @param {Number} x2 X component\r\n * @param {Number} y2 Y component\r\n * @param {Number} z2 Z component\r\n * @param {Number} w2 W component\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nfunction set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n}\n/**\r\n * Gets the real part of a dual quat\r\n * @param {quat} out real part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} real part\r\n */\n\nvar getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"copy\"];\n/**\r\n * Gets the dual part of a dual quat\r\n * @param {quat} out dual part\r\n * @param {ReadonlyQuat2} a Dual Quaternion\r\n * @return {quat} dual part\r\n */\n\nfunction getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n}\n/**\r\n * Set the real component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the real part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nvar setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"copy\"];\n/**\r\n * Set the dual component of a dual quat to the given quaternion\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat} q a quaternion representing the dual part\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nfunction setDual(out, q) {\n out[4] = q[0];\n out[5] = q[1];\n out[6] = q[2];\n out[7] = q[3];\n return out;\n}\n/**\r\n * Gets the translation of a normalized dual quat\r\n * @param {vec3} out translation\r\n * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed\r\n * @return {vec3} translation\r\n */\n\nfunction getTranslation(out, a) {\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n}\n/**\r\n * Translates a dual quat by the given vector\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to translate\r\n * @param {ReadonlyVec3} v vector to translate by\r\n * @returns {quat2} out\r\n */\n\nfunction translate(out, a, v) {\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3],\n bx1 = v[0] * 0.5,\n by1 = v[1] * 0.5,\n bz1 = v[2] * 0.5,\n ax2 = a[4],\n ay2 = a[5],\n az2 = a[6],\n aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n}\n/**\r\n * Rotates a dual quat around the X axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nfunction rotateX(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"rotateX\"](out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Y axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nfunction rotateY(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"rotateY\"](out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around the Z axis\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {number} rad how far should the rotation be\r\n * @returns {quat2} out\r\n */\n\nfunction rotateZ(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"rotateZ\"](out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (a * q)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @returns {quat2} out\r\n */\n\nfunction rotateByQuatAppend(out, a, q) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n}\n/**\r\n * Rotates a dual quat by a given quaternion (q * a)\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat} q quaternion to rotate by\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @returns {quat2} out\r\n */\n\nfunction rotateByQuatPrepend(out, q, a) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n bx = a[0],\n by = a[1],\n bz = a[2],\n bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n}\n/**\r\n * Rotates a dual quat around a given axis. Does the normalisation automatically\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\r\n * @param {ReadonlyVec3} axis the axis to rotate around\r\n * @param {Number} rad how far the rotation should be\r\n * @returns {quat2} out\r\n */\n\nfunction rotateAroundAxis(out, a, axis, rad) {\n //Special case for rad = 0\n if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return copy(out, a);\n }\n\n var axisLength = Math.hypot(axis[0], axis[1], axis[2]);\n rad = rad * 0.5;\n var s = Math.sin(rad);\n var bx = s * axis[0] / axisLength;\n var by = s * axis[1] / axisLength;\n var bz = s * axis[2] / axisLength;\n var bw = Math.cos(rad);\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\r\n * Adds two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n}\n/**\r\n * Multiplies two dual quat's\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {quat2} out\r\n */\n\nfunction multiply(out, a, b) {\n var ax0 = a[0],\n ay0 = a[1],\n az0 = a[2],\n aw0 = a[3],\n bx1 = b[4],\n by1 = b[5],\n bz1 = b[6],\n bw1 = b[7],\n ax1 = a[4],\n ay1 = a[5],\n az1 = a[6],\n aw1 = a[7],\n bx0 = b[0],\n by0 = b[1],\n bz0 = b[2],\n bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n}\n/**\r\n * Alias for {@link quat2.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Scales a dual quat by a scalar number\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the dual quat to scale\r\n * @param {Number} b amount to scale the dual quat by\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n}\n/**\r\n * Calculates the dot product of two dual quat's (The dot product of the real parts)\r\n *\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n * @function\r\n */\n\nvar dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"dot\"];\n/**\r\n * Performs a linear interpolation between two dual quats's\r\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)\r\n *\r\n * @param {quat2} out the receiving dual quat\r\n * @param {ReadonlyQuat2} a the first operand\r\n * @param {ReadonlyQuat2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {quat2} out\r\n */\n\nfunction lerp(out, a, b, t) {\n var mt = 1 - t;\n if (dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n}\n/**\r\n * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quat to calculate inverse of\r\n * @returns {quat2} out\r\n */\n\nfunction invert(out, a) {\n var sqlen = squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n}\n/**\r\n * Calculates the conjugate of a dual quat\r\n * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.\r\n *\r\n * @param {quat2} out the receiving quaternion\r\n * @param {ReadonlyQuat2} a quat to calculate conjugate of\r\n * @returns {quat2} out\r\n */\n\nfunction conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n}\n/**\r\n * Calculates the length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate length of\r\n * @returns {Number} length of a\r\n * @function\r\n */\n\nvar length = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"length\"];\n/**\r\n * Alias for {@link quat2.length}\r\n * @function\r\n */\n\nvar len = length;\n/**\r\n * Calculates the squared length of a dual quat\r\n *\r\n * @param {ReadonlyQuat2} a dual quat to calculate squared length of\r\n * @returns {Number} squared length of a\r\n * @function\r\n */\n\nvar squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"squaredLength\"];\n/**\r\n * Alias for {@link quat2.squaredLength}\r\n * @function\r\n */\n\nvar sqrLen = squaredLength;\n/**\r\n * Normalize a dual quat\r\n *\r\n * @param {quat2} out the receiving dual quaternion\r\n * @param {ReadonlyQuat2} a dual quaternion to normalize\r\n * @returns {quat2} out\r\n * @function\r\n */\n\nfunction normalize(out, a) {\n var magnitude = squaredLength(a);\n\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n var a0 = a[0] / magnitude;\n var a1 = a[1] / magnitude;\n var a2 = a[2] / magnitude;\n var a3 = a[3] / magnitude;\n var b0 = a[4];\n var b1 = a[5];\n var b2 = a[6];\n var b3 = a[7];\n var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n\n return out;\n}\n/**\r\n * Returns a string representation of a dual quatenion\r\n *\r\n * @param {ReadonlyQuat2} a dual quaternion to represent as a string\r\n * @returns {String} string representation of the dual quat\r\n */\n\nfunction str(a) {\n return \"quat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \")\";\n}\n/**\r\n * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quaternion.\r\n * @param {ReadonlyQuat2} b the second dual quaternion.\r\n * @returns {Boolean} true if the dual quaternions are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n}\n/**\r\n * Returns whether or not the dual quaternions have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyQuat2} a the first dual quat.\r\n * @param {ReadonlyQuat2} b the second dual quat.\r\n * @returns {Boolean} true if the dual quats are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a7), Math.abs(b7));\n}\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/quat2.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/vec2.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/vec2.js ***! - \********************************************/ -/*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat2, transformMat2d, transformMat3, transformMat4, rotate, angle, zero, str, exactEquals, equals, len, sub, mul, div, dist, sqrDist, sqrLen, forEach */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"divide\", function() { return divide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAndAdd\", function() { return scaleAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredDistance\", function() { return squaredDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negate\", function() { return negate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat2\", function() { return transformMat2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat2d\", function() { return transformMat2d; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat3\", function() { return transformMat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat4\", function() { return transformMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angle\", function() { return angle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zero\", function() { return zero; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"div\", function() { return div; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dist\", function() { return dist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrDist\", function() { return sqrDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEach\", function() { return forEach; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 2 Dimensional Vector\r\n * @module vec2\r\n */\n\n/**\r\n * Creates a new, empty vec2\r\n *\r\n * @returns {vec2} a new 2D vector\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](2);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec2} a vector to clone\r\n * @returns {vec2} a new 2D vector\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Creates a new vec2 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} a new 2D vector\r\n */\n\nfunction fromValues(x, y) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Copy the values from one vec2 to another\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the source vector\r\n * @returns {vec2} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\r\n * Set the components of a vec2 to the given values\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @returns {vec2} out\r\n */\n\nfunction set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\r\n * Adds two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\r\n * Multiplies two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\r\n * Divides two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to ceil\r\n * @returns {vec2} out\r\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to floor\r\n * @returns {vec2} out\r\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec2} out\r\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\r\n * Math.round the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to round\r\n * @returns {vec2} out\r\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\r\n * Scales a vec2 by a scalar number\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec2} out\r\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\r\n * Adds two vec2's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec2} out\r\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\r\n * Calculates the length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nfunction length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\r\n * Calculates the squared length of a vec2\r\n *\r\n * @param {ReadonlyVec2} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nfunction squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\r\n * Negates the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to negate\r\n * @returns {vec2} out\r\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to invert\r\n * @returns {vec2} out\r\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\r\n * Normalize a vec2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a vector to normalize\r\n * @returns {vec2} out\r\n */\n\nfunction normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec2's\r\n *\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\r\n * Computes the cross product of two vec2's\r\n * Note that the cross product must by definition produce a 3D vector\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec2's\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the first operand\r\n * @param {ReadonlyVec2} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec2} out\r\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec2} out\r\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0;\n var r = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nfunction transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat2d\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat2d} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nfunction transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat3\r\n * 3rd vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat3} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nfunction transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\r\n * Transforms the vec2 with a mat4\r\n * 3rd vector component is implicitly '0'\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @param {ReadonlyVec2} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec2} out\r\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\r\n * Rotate a 2D vector\r\n * @param {vec2} out The receiving vec2\r\n * @param {ReadonlyVec2} a The vec2 point to rotate\r\n * @param {ReadonlyVec2} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec2} out\r\n */\n\nfunction rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\r\n * Get the angle between two 2D vectors\r\n * @param {ReadonlyVec2} a The first operand\r\n * @param {ReadonlyVec2} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nfunction angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec2 to zero\r\n *\r\n * @param {vec2} out the receiving vector\r\n * @returns {vec2} out\r\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec2} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nfunction str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\r\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec2} a The first vector.\r\n * @param {ReadonlyVec2} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\r\n * Alias for {@link vec2.length}\r\n * @function\r\n */\n\nvar len = length;\n/**\r\n * Alias for {@link vec2.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n/**\r\n * Alias for {@link vec2.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link vec2.divide}\r\n * @function\r\n */\n\nvar div = divide;\n/**\r\n * Alias for {@link vec2.distance}\r\n * @function\r\n */\n\nvar dist = distance;\n/**\r\n * Alias for {@link vec2.squaredDistance}\r\n * @function\r\n */\n\nvar sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec2.squaredLength}\r\n * @function\r\n */\n\nvar sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec2s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/vec2.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/vec3.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/vec3.js ***! - \********************************************/ -/*! exports provided: create, clone, length, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, squaredLength, negate, inverse, normalize, dot, cross, lerp, hermite, bezier, random, transformMat4, transformMat3, transformQuat, rotateX, rotateY, rotateZ, angle, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"divide\", function() { return divide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAndAdd\", function() { return scaleAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredDistance\", function() { return squaredDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negate\", function() { return negate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hermite\", function() { return hermite; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bezier\", function() { return bezier; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat4\", function() { return transformMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat3\", function() { return transformMat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformQuat\", function() { return transformQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angle\", function() { return angle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zero\", function() { return zero; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"div\", function() { return div; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dist\", function() { return dist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrDist\", function() { return sqrDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEach\", function() { return forEach; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 3 Dimensional Vector\r\n * @module vec3\r\n */\n\n/**\r\n * Creates a new, empty vec3\r\n *\r\n * @returns {vec3} a new 3D vector\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec3 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec3} a vector to clone\r\n * @returns {vec3} a new 3D vector\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Calculates the length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nfunction length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Creates a new vec3 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} a new 3D vector\r\n */\n\nfunction fromValues(x, y, z) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Copy the values from one vec3 to another\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the source vector\r\n * @returns {vec3} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\r\n * Set the components of a vec3 to the given values\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @returns {vec3} out\r\n */\n\nfunction set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\r\n * Adds two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\r\n * Multiplies two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\r\n * Divides two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to ceil\r\n * @returns {vec3} out\r\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to floor\r\n * @returns {vec3} out\r\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\r\n * Math.round the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to round\r\n * @returns {vec3} out\r\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\r\n * Scales a vec3 by a scalar number\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec3} out\r\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\r\n * Adds two vec3's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec3} out\r\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Calculates the squared length of a vec3\r\n *\r\n * @param {ReadonlyVec3} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nfunction squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\r\n * Negates the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to negate\r\n * @returns {vec3} out\r\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to invert\r\n * @returns {vec3} out\r\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\r\n * Normalize a vec3\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a vector to normalize\r\n * @returns {vec3} out\r\n */\n\nfunction normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec3's\r\n *\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\r\n * Computes the cross product of two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @returns {vec3} out\r\n */\n\nfunction cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec3's\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\r\n * Performs a hermite interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nfunction hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Performs a bezier interpolation with two control points\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the first operand\r\n * @param {ReadonlyVec3} b the second operand\r\n * @param {ReadonlyVec3} c the third operand\r\n * @param {ReadonlyVec3} d the fourth operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec3} out\r\n */\n\nfunction bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec3} out\r\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0;\n var r = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2.0 * Math.PI;\n var z = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat4.\r\n * 4th vector component is implicitly '1'\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\r\n * Transforms the vec3 with a mat3.\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\r\n * @returns {vec3} out\r\n */\n\nfunction transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\r\n * Transforms the vec3 with a quat\r\n * Can also be used for dual quaternions. (Multiply it with the real part)\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @param {ReadonlyVec3} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec3} out\r\n */\n\nfunction transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\r\n * Rotate a 3D vector around the x-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nfunction rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the y-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nfunction rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Rotate a 3D vector around the z-axis\r\n * @param {vec3} out The receiving vec3\r\n * @param {ReadonlyVec3} a The vec3 point to rotate\r\n * @param {ReadonlyVec3} b The origin of the rotation\r\n * @param {Number} rad The angle of rotation in radians\r\n * @returns {vec3} out\r\n */\n\nfunction rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\r\n * Get the angle between two 3D vectors\r\n * @param {ReadonlyVec3} a The first operand\r\n * @param {ReadonlyVec3} b The second operand\r\n * @returns {Number} The angle in radians\r\n */\n\nfunction angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\r\n * Set the components of a vec3 to zero\r\n *\r\n * @param {vec3} out the receiving vector\r\n * @returns {vec3} out\r\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec3} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nfunction str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec3} a The first vector.\r\n * @param {ReadonlyVec3} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\r\n * Alias for {@link vec3.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n/**\r\n * Alias for {@link vec3.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link vec3.divide}\r\n * @function\r\n */\n\nvar div = divide;\n/**\r\n * Alias for {@link vec3.distance}\r\n * @function\r\n */\n\nvar dist = distance;\n/**\r\n * Alias for {@link vec3.squaredDistance}\r\n * @function\r\n */\n\nvar sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec3.length}\r\n * @function\r\n */\n\nvar len = length;\n/**\r\n * Alias for {@link vec3.squaredLength}\r\n * @function\r\n */\n\nvar sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec3s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/vec3.js?"); - -/***/ }), - -/***/ "./node_modules/gl-matrix/esm/vec4.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/vec4.js ***! - \********************************************/ -/*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat4, transformQuat, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"divide\", function() { return divide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAndAdd\", function() { return scaleAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredDistance\", function() { return squaredDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negate\", function() { return negate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat4\", function() { return transformMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformQuat\", function() { return transformQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zero\", function() { return zero; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"div\", function() { return div; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dist\", function() { return dist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrDist\", function() { return sqrDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEach\", function() { return forEach; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\r\n * 4 Dimensional Vector\r\n * @module vec4\r\n */\n\n/**\r\n * Creates a new, empty vec4\r\n *\r\n * @returns {vec4} a new 4D vector\r\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with values from an existing vector\r\n *\r\n * @param {ReadonlyVec4} a vector to clone\r\n * @returns {vec4} a new 4D vector\r\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Creates a new vec4 initialized with the given values\r\n *\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} a new 4D vector\r\n */\n\nfunction fromValues(x, y, z, w) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Copy the values from one vec4 to another\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the source vector\r\n * @returns {vec4} out\r\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to the given values\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} x X component\r\n * @param {Number} y Y component\r\n * @param {Number} z Z component\r\n * @param {Number} w W component\r\n * @returns {vec4} out\r\n */\n\nfunction set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\r\n * Adds two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\r\n * Subtracts vector b from vector a\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\r\n * Multiplies two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\r\n * Divides two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\r\n * Math.ceil the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to ceil\r\n * @returns {vec4} out\r\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\r\n * Math.floor the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to floor\r\n * @returns {vec4} out\r\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\r\n * Returns the minimum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\r\n * Returns the maximum of two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {vec4} out\r\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\r\n * Math.round the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to round\r\n * @returns {vec4} out\r\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\r\n * Scales a vec4 by a scalar number\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to scale\r\n * @param {Number} b amount to scale the vector by\r\n * @returns {vec4} out\r\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\r\n * Adds two vec4's after scaling the second operand by a scalar value\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} scale the amount to scale b by before adding\r\n * @returns {vec4} out\r\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\r\n * Calculates the euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} distance between a and b\r\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared euclidian distance between two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} squared distance between a and b\r\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Calculates the length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate length of\r\n * @returns {Number} length of a\r\n */\n\nfunction length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\r\n * Calculates the squared length of a vec4\r\n *\r\n * @param {ReadonlyVec4} a vector to calculate squared length of\r\n * @returns {Number} squared length of a\r\n */\n\nfunction squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\r\n * Negates the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to negate\r\n * @returns {vec4} out\r\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\r\n * Returns the inverse of the components of a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to invert\r\n * @returns {vec4} out\r\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\r\n * Normalize a vec4\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a vector to normalize\r\n * @returns {vec4} out\r\n */\n\nfunction normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\r\n * Calculates the dot product of two vec4's\r\n *\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @returns {Number} dot product of a and b\r\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\r\n * Returns the cross-product of three vectors in a 4-dimensional space\r\n *\r\n * @param {ReadonlyVec4} result the receiving vector\r\n * @param {ReadonlyVec4} U the first vector\r\n * @param {ReadonlyVec4} V the second vector\r\n * @param {ReadonlyVec4} W the third vector\r\n * @returns {vec4} result\r\n */\n\nfunction cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\r\n * Performs a linear interpolation between two vec4's\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the first operand\r\n * @param {ReadonlyVec4} b the second operand\r\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\r\n * @returns {vec4} out\r\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\r\n * Generates a random vector with the given scale\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\r\n * @returns {vec4} out\r\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\r\n * Transforms the vec4 with a mat4.\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyMat4} m matrix to transform with\r\n * @returns {vec4} out\r\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\r\n * Transforms the vec4 with a quat\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @param {ReadonlyVec4} a the vector to transform\r\n * @param {ReadonlyQuat} q quaternion to transform with\r\n * @returns {vec4} out\r\n */\n\nfunction transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\r\n * Set the components of a vec4 to zero\r\n *\r\n * @param {vec4} out the receiving vector\r\n * @returns {vec4} out\r\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\r\n * Returns a string representation of a vector\r\n *\r\n * @param {ReadonlyVec4} a vector to represent as a string\r\n * @returns {String} string representation of the vector\r\n */\n\nfunction str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\r\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\r\n * Returns whether or not the vectors have approximately the same elements in the same position.\r\n *\r\n * @param {ReadonlyVec4} a The first vector.\r\n * @param {ReadonlyVec4} b The second vector.\r\n * @returns {Boolean} True if the vectors are equal, false otherwise.\r\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\r\n * Alias for {@link vec4.subtract}\r\n * @function\r\n */\n\nvar sub = subtract;\n/**\r\n * Alias for {@link vec4.multiply}\r\n * @function\r\n */\n\nvar mul = multiply;\n/**\r\n * Alias for {@link vec4.divide}\r\n * @function\r\n */\n\nvar div = divide;\n/**\r\n * Alias for {@link vec4.distance}\r\n * @function\r\n */\n\nvar dist = distance;\n/**\r\n * Alias for {@link vec4.squaredDistance}\r\n * @function\r\n */\n\nvar sqrDist = squaredDistance;\n/**\r\n * Alias for {@link vec4.length}\r\n * @function\r\n */\n\nvar len = length;\n/**\r\n * Alias for {@link vec4.squaredLength}\r\n * @function\r\n */\n\nvar sqrLen = squaredLength;\n/**\r\n * Perform some operation over an array of vec4s.\r\n *\r\n * @param {Array} a the array of vectors to iterate over\r\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\r\n * @param {Number} offset Number of elements to skip at the beginning of the array\r\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\r\n * @param {Function} fn Function to call for each vector in the array\r\n * @param {Object} [arg] additional argument to pass to fn\r\n * @returns {Array} a\r\n * @function\r\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack://diglettk/./node_modules/gl-matrix/esm/vec4.js?"); - -/***/ }), - -/***/ "./node_modules/regenerator-runtime/runtime.js": -/*!*****************************************************!*\ - !*** ./node_modules/regenerator-runtime/runtime.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n true ? module.exports : undefined\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n\n\n//# sourceURL=webpack://diglettk/./node_modules/regenerator-runtime/runtime.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/index.js": -/*!******************************************!*\ - !*** ./node_modules/seedrandom/index.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = __webpack_require__(/*! ./lib/alea */ \"./node_modules/seedrandom/lib/alea.js\");\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = __webpack_require__(/*! ./lib/xor128 */ \"./node_modules/seedrandom/lib/xor128.js\");\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = __webpack_require__(/*! ./lib/xorwow */ \"./node_modules/seedrandom/lib/xorwow.js\");\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = __webpack_require__(/*! ./lib/xorshift7 */ \"./node_modules/seedrandom/lib/xorshift7.js\");\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = __webpack_require__(/*! ./lib/xor4096 */ \"./node_modules/seedrandom/lib/xor4096.js\");\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = __webpack_require__(/*! ./lib/tychei */ \"./node_modules/seedrandom/lib/tychei.js\");\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = __webpack_require__(/*! ./seedrandom */ \"./node_modules/seedrandom/seedrandom.js\");\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/index.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/lib/alea.js": -/*!*********************************************!*\ - !*** ./node_modules/seedrandom/lib/alea.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = String(data);\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (__webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\")) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n true && module, // present in node.js\n __webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") // present with an AMD loader\n);\n\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/lib/alea.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/lib/tychei.js": -/*!***********************************************!*\ - !*** ./node_modules/seedrandom/lib/tychei.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (__webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\")) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n true && module, // present in node.js\n __webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") // present with an AMD loader\n);\n\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/lib/tychei.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/lib/xor128.js": -/*!***********************************************!*\ - !*** ./node_modules/seedrandom/lib/xor128.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (__webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\")) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n true && module, // present in node.js\n __webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") // present with an AMD loader\n);\n\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/lib/xor128.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/lib/xor4096.js": -/*!************************************************!*\ - !*** ./node_modules/seedrandom/lib/xor4096.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (__webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\")) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n true && module, // present in node.js\n __webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") // present with an AMD loader\n);\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/lib/xor4096.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/lib/xorshift7.js": -/*!**************************************************!*\ - !*** ./node_modules/seedrandom/lib/xorshift7.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (__webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\")) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n true && module, // present in node.js\n __webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") // present with an AMD loader\n);\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/lib/xorshift7.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/lib/xorwow.js": -/*!***********************************************!*\ - !*** ./node_modules/seedrandom/lib/xorwow.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (__webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") && __webpack_require__(/*! !webpack amd options */ \"./node_modules/webpack/buildin/amd-options.js\")) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n true && module, // present in node.js\n __webpack_require__(/*! !webpack amd define */ \"./node_modules/webpack/buildin/amd-define.js\") // present with an AMD loader\n);\n\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/lib/xorwow.js?"); - -/***/ }), - -/***/ "./node_modules/seedrandom/seedrandom.js": -/*!***********************************************!*\ - !*** ./node_modules/seedrandom/seedrandom.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*\nCopyright 2019 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (global, pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\n\nvar width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ( true && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = __webpack_require__(/*! crypto */ 0);\n } catch (ex) {}\n} else if (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return seedrandom; }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n} else {}\n\n\n// End anonymous scope, and pass initial values.\n})(\n // global: `self` in browsers (including strict mode and web workers),\n // otherwise `this` in Node and other environments\n (typeof self !== 'undefined') ? self : this,\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n\n\n//# sourceURL=webpack://diglettk/./node_modules/seedrandom/seedrandom.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/CellArray/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/CellArray/index.js ***! - \********************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction extractCellSizes(cellArray) {\n var currentIdx = 0;\n return cellArray.filter(function (value, index) {\n if (index === currentIdx) {\n currentIdx += value + 1;\n return true;\n }\n\n return false;\n });\n}\n\nfunction getNumberOfCells(cellArray) {\n return extractCellSizes(cellArray).length;\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n extractCellSizes: extractCellSizes,\n getNumberOfCells: getNumberOfCells\n}; // ----------------------------------------------------------------------------\n// vtkCellArray methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCellArray(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCellArray');\n\n publicAPI.getNumberOfCells = function (recompute) {\n if (model.numberOfCells !== undefined && !recompute) {\n return model.numberOfCells;\n }\n\n model.cellSizes = extractCellSizes(model.values);\n model.numberOfCells = model.cellSizes.length;\n return model.numberOfCells;\n };\n\n publicAPI.getCellSizes = function (recompute) {\n if (model.cellSizes !== undefined && !recompute) {\n return model.cellSizes;\n }\n\n model.cellSizes = extractCellSizes(model.values);\n return model.cellSizes;\n };\n\n var superSetData = publicAPI.setData;\n\n publicAPI.setData = function (typedArray) {\n superSetData(typedArray, 1);\n model.numberOfCells = undefined;\n model.cellSizes = undefined;\n };\n /**\n * Returns the point indexes at the given location as a subarray.\n */\n\n\n publicAPI.getCell = function (loc) {\n var cellLoc = loc;\n var numberOfPoints = model.values[cellLoc++];\n return model.values.subarray(cellLoc, cellLoc + numberOfPoints);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nfunction defaultValues(initialValues) {\n return _objectSpread({\n empty: true,\n numberOfComponents: 1,\n dataType: vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__[\"VtkDataTypes\"].UNSIGNED_INT\n }, initialValues);\n} // ----------------------------------------------------------------------------\n\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, defaultValues(initialValues));\n vtkCellArray(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkCellArray'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/CellArray/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js ***! - \************************************************************************/ -/*! exports provided: DataTypeByteSize, VtkDataTypes, DefaultDataType, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DataTypeByteSize\", function() { return DataTypeByteSize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VtkDataTypes\", function() { return VtkDataTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DefaultDataType\", function() { return DefaultDataType; });\nvar DataTypeByteSize = {\n Int8Array: 1,\n Uint8Array: 1,\n Uint8ClampedArray: 1,\n Int16Array: 2,\n Uint16Array: 2,\n Int32Array: 4,\n Uint32Array: 4,\n Float32Array: 4,\n Float64Array: 8\n};\nvar VtkDataTypes = {\n VOID: '',\n // not sure to know what that should be\n CHAR: 'Int8Array',\n SIGNED_CHAR: 'Int8Array',\n UNSIGNED_CHAR: 'Uint8Array',\n SHORT: 'Int16Array',\n UNSIGNED_SHORT: 'Uint16Array',\n INT: 'Int32Array',\n UNSIGNED_INT: 'Uint32Array',\n FLOAT: 'Float32Array',\n DOUBLE: 'Float64Array'\n};\nvar DefaultDataType = VtkDataTypes.FLOAT;\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n DefaultDataType: DefaultDataType,\n DataTypeByteSize: DataTypeByteSize,\n VtkDataTypes: VtkDataTypes\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js ***! - \********************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\nvar DefaultDataType = vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].DefaultDataType;\nvar TUPLE_HOLDER = []; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction createRangeHelper() {\n var min = Number.MAX_VALUE;\n var max = -Number.MAX_VALUE;\n var count = 0;\n var sum = 0;\n return {\n add: function add(value) {\n if (min > value) {\n min = value;\n }\n\n if (max < value) {\n max = value;\n }\n\n count++;\n sum += value;\n },\n get: function get() {\n return {\n min: min,\n max: max,\n count: count,\n sum: sum,\n mean: sum / count\n };\n },\n getRange: function getRange() {\n return {\n min: min,\n max: max\n };\n }\n };\n}\n\nfunction computeRange(values) {\n var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var numberOfComponents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var helper = createRangeHelper();\n var size = values.length;\n var value = 0;\n\n if (component < 0 && numberOfComponents > 1) {\n // Compute magnitude\n for (var i = 0; i < size; i += numberOfComponents) {\n value = 0;\n\n for (var j = 0; j < numberOfComponents; j++) {\n value += values[i + j] * values[i + j];\n }\n\n value = Math.pow(value, 0.5);\n helper.add(value);\n }\n\n return helper.getRange();\n }\n\n var offset = component < 0 ? 0 : component;\n\n for (var _i = offset; _i < size; _i += numberOfComponents) {\n helper.add(values[_i]);\n }\n\n return helper.getRange();\n}\n\nfunction ensureRangeSize(rangeArray) {\n var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var ranges = rangeArray || []; // Pad ranges with null value to get the\n\n while (ranges.length <= size) {\n ranges.push(null);\n }\n\n return ranges;\n}\n\nfunction getDataType(typedArray) {\n // Expects toString() to return \"[object ...Array]\"\n return Object.prototype.toString.call(typedArray).slice(8, -1);\n}\n\nfunction getMaxNorm(normArray) {\n var numComps = normArray.getNumberOfComponents();\n var maxNorm = 0.0;\n\n for (var i = 0; i < normArray.getNumberOfTuples(); ++i) {\n var norm = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"norm\"](normArray.getTuple(i), numComps);\n\n if (norm > maxNorm) {\n maxNorm = norm;\n }\n }\n\n return maxNorm;\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n computeRange: computeRange,\n createRangeHelper: createRangeHelper,\n getDataType: getDataType,\n getMaxNorm: getMaxNorm\n}; // ----------------------------------------------------------------------------\n// vtkDataArray methods\n// ----------------------------------------------------------------------------\n\nfunction vtkDataArray(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkDataArray');\n\n function dataChange() {\n model.ranges = null;\n publicAPI.modified();\n }\n\n publicAPI.getElementComponentSize = function () {\n return model.values.BYTES_PER_ELEMENT;\n }; // Description:\n // Return the data component at the location specified by tupleIdx and\n // compIdx.\n\n\n publicAPI.getComponent = function (tupleIdx) {\n var compIdx = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return model.values[tupleIdx * model.numberOfComponents + compIdx];\n }; // Description:\n // Set the data component at the location specified by tupleIdx and compIdx\n // to value.\n // Note that i is less than NumberOfTuples and j is less than\n // NumberOfComponents. Make sure enough memory has been allocated\n // (use SetNumberOfTuples() and SetNumberOfComponents()).\n\n\n publicAPI.setComponent = function (tupleIdx, compIdx, value) {\n if (value !== model.values[tupleIdx * model.numberOfComponents + compIdx]) {\n model.values[tupleIdx * model.numberOfComponents + compIdx] = value;\n dataChange();\n }\n };\n\n publicAPI.getData = function () {\n return model.values;\n };\n\n publicAPI.getRange = function () {\n var componentIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;\n var rangeIdx = componentIndex < 0 ? model.numberOfComponents : componentIndex;\n var range = null;\n\n if (!model.ranges) {\n model.ranges = ensureRangeSize(model.ranges, model.numberOfComponents);\n }\n\n range = model.ranges[rangeIdx];\n\n if (range) {\n model.rangeTuple[0] = range.min;\n model.rangeTuple[1] = range.max;\n return model.rangeTuple;\n } // Need to compute ranges...\n\n\n range = computeRange(model.values, componentIndex, model.numberOfComponents);\n model.ranges[rangeIdx] = range;\n model.rangeTuple[0] = range.min;\n model.rangeTuple[1] = range.max;\n return model.rangeTuple;\n };\n\n publicAPI.setRange = function (rangeValue, componentIndex) {\n if (!model.ranges) {\n model.ranges = ensureRangeSize(model.ranges, model.numberOfComponents);\n }\n\n var range = {\n min: rangeValue.min,\n max: rangeValue.max\n };\n model.ranges[componentIndex] = range;\n model.rangeTuple[0] = range.min;\n model.rangeTuple[1] = range.max;\n return model.rangeTuple;\n };\n\n publicAPI.setTuple = function (idx, tuple) {\n var offset = idx * model.numberOfComponents;\n\n for (var i = 0; i < model.numberOfComponents; i++) {\n model.values[offset + i] = tuple[i];\n }\n };\n\n publicAPI.getTuple = function (idx) {\n var tupleToFill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TUPLE_HOLDER;\n var numberOfComponents = model.numberOfComponents || 1;\n\n if (tupleToFill.length !== numberOfComponents) {\n tupleToFill.length = numberOfComponents;\n }\n\n var offset = idx * numberOfComponents; // Check most common component sizes first\n // to avoid doing a for loop if possible\n\n if (numberOfComponents === 1) {\n tupleToFill[0] = model.values[offset];\n } else if (numberOfComponents === 2) {\n tupleToFill[0] = model.values[offset];\n tupleToFill[1] = model.values[offset + 1];\n } else if (numberOfComponents === 3) {\n tupleToFill[0] = model.values[offset];\n tupleToFill[1] = model.values[offset + 1];\n tupleToFill[2] = model.values[offset + 2];\n } else if (numberOfComponents === 4) {\n tupleToFill[0] = model.values[offset];\n tupleToFill[1] = model.values[offset + 1];\n tupleToFill[2] = model.values[offset + 2];\n tupleToFill[3] = model.values[offset + 3];\n } else {\n for (var i = 0; i < numberOfComponents; i++) {\n tupleToFill[i] = model.values[offset + i];\n }\n }\n\n return tupleToFill;\n };\n\n publicAPI.getTupleLocation = function () {\n var idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n return idx * model.numberOfComponents;\n };\n\n publicAPI.getNumberOfComponents = function () {\n return model.numberOfComponents;\n };\n\n publicAPI.getNumberOfValues = function () {\n return model.values.length;\n };\n\n publicAPI.getNumberOfTuples = function () {\n return model.values.length / model.numberOfComponents;\n };\n\n publicAPI.getDataType = function () {\n return model.dataType;\n };\n /* eslint-disable no-use-before-define */\n\n\n publicAPI.newClone = function () {\n return newInstance({\n empty: true,\n name: model.name,\n dataType: model.dataType,\n numberOfComponents: model.numberOfComponents\n });\n };\n /* eslint-enable no-use-before-define */\n\n\n publicAPI.getName = function () {\n if (!model.name) {\n publicAPI.modified();\n model.name = \"vtkDataArray\".concat(publicAPI.getMTime());\n }\n\n return model.name;\n };\n\n publicAPI.setData = function (typedArray, numberOfComponents) {\n model.values = typedArray;\n model.size = typedArray.length;\n model.dataType = getDataType(typedArray);\n\n if (numberOfComponents) {\n model.numberOfComponents = numberOfComponents;\n }\n\n if (model.size % model.numberOfComponents !== 0) {\n model.numberOfComponents = 1;\n }\n\n dataChange();\n }; // Override serialization support\n\n\n publicAPI.getState = function () {\n var jsonArchive = _objectSpread(_objectSpread({}, model), {}, {\n vtkClass: publicAPI.getClassName()\n }); // Convert typed array to regular array\n\n\n jsonArchive.values = Array.from(jsonArchive.values);\n delete jsonArchive.buffer; // Clean any empty data\n\n Object.keys(jsonArchive).forEach(function (keyName) {\n if (!jsonArchive[keyName]) {\n delete jsonArchive[keyName];\n }\n }); // Sort resulting object by key name\n\n var sortedObj = {};\n Object.keys(jsonArchive).sort().forEach(function (name) {\n sortedObj[name] = jsonArchive[name];\n }); // Remove mtime\n\n if (sortedObj.mtime) {\n delete sortedObj.mtime;\n }\n\n return sortedObj;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n name: '',\n numberOfComponents: 1,\n size: 0,\n dataType: DefaultDataType,\n rangeTuple: [0, 0] // values: null,\n // ranges: null,\n\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n\n if (!model.empty && !model.values && !model.size) {\n throw new TypeError('Cannot create vtkDataArray object without: size > 0, values');\n }\n\n if (!model.values) {\n model.values = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newTypedArray\"](model.dataType, model.size);\n } else if (Array.isArray(model.values)) {\n model.values = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newTypedArrayFrom\"](model.dataType, model.values);\n }\n\n if (model.values) {\n model.size = model.values.length;\n model.dataType = getDataType(model.values);\n } // Object methods\n\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"set\"](publicAPI, model, ['name', 'numberOfComponents']); // Object specific methods\n\n vtkDataArray(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkDataArray'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread(_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC), vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/LookupTable/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/LookupTable/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_ScalarsToColors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/ScalarsToColors */ \"./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/ScalarsToColors/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n// Add module-level functions or api that you want to expose statically via\n// the next section...\n// ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\nvar BELOW_RANGE_COLOR_INDEX = 0;\nvar ABOVE_RANGE_COLOR_INDEX = 1;\nvar NAN_COLOR_INDEX = 2; // ----------------------------------------------------------------------------\n// vtkMyClass methods\n// ----------------------------------------------------------------------------\n\nfunction vtkLookupTable(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkLookupTable'); //----------------------------------------------------------------------------\n // Description:\n // Return true if all of the values defining the mapping have an opacity\n // equal to 1. Default implementation return true.\n\n publicAPI.isOpaque = function () {\n if (model.opaqueFlagBuildTime.getMTime() < publicAPI.getMTime()) {\n var opaque = true;\n\n if (model.nanColor[3] < 1.0) {\n opaque = 0;\n }\n\n if (model.useBelowRangeColor && model.belowRangeColor[3] < 1.0) {\n opaque = 0;\n }\n\n if (model.useAboveRangeColor && model.aboveRangeColor[3] < 1.0) {\n opaque = 0;\n }\n\n for (var i = 3; i < model.table.length && opaque; i += 4) {\n if (model.table[i] < 255) {\n opaque = false;\n }\n }\n\n model.opaqueFlag = opaque;\n model.opaqueFlagBuildTime.modified();\n }\n\n return model.opaqueFlag;\n };\n\n publicAPI.usingLogScale = function () {\n return false;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfAvailableColors = function () {\n return model.table.length;\n }; //----------------------------------------------------------------------------\n // Apply shift/scale to the scalar value v and return the index.\n\n\n publicAPI.linearIndexLookup = function (v, p) {\n var dIndex = 0;\n\n if (v < p.range[0]) {\n dIndex = p.maxIndex + BELOW_RANGE_COLOR_INDEX + 1.5;\n } else if (v > p.range[1]) {\n dIndex = p.maxIndex + ABOVE_RANGE_COLOR_INDEX + 1.5;\n } else {\n dIndex = (v + p.shift) * p.scale; // This conditional is needed because when v is very close to\n // p.Range[1], it may map above p.MaxIndex in the linear mapping\n // above.\n\n dIndex = dIndex < p.maxIndex ? dIndex : p.maxIndex;\n }\n\n return Math.floor(dIndex);\n };\n\n publicAPI.linearLookup = function (v, table, p) {\n var index = 0;\n\n if (vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"isNan\"](v)) {\n index = Math.floor(p.maxIndex + 1.5 + NAN_COLOR_INDEX);\n } else {\n index = publicAPI.linearIndexLookup(v, p);\n }\n\n var offset = 4 * index;\n return [table[offset], table[offset + 1], table[offset + 2], table[offset + 3]];\n };\n\n publicAPI.indexedLookupFunction = function (v, table, p) {\n var index = publicAPI.getAnnotatedValueIndexInternal(v);\n\n if (index === -1) {\n index = model.numberOfColors + NAN_COLOR_INDEX;\n }\n\n var offset = 4 * index;\n return [table[offset], table[offset + 1], table[offset + 2], table[offset + 3]];\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.lookupShiftAndScale = function (range, p) {\n p.shift = -range[0];\n p.scale = Number.MAX_VALUE;\n\n if (range[1] > range[0]) {\n p.scale = (p.maxIndex + 1) / (range[1] - range[0]);\n }\n }; // Public API methods\n\n\n publicAPI.mapScalarsThroughTable = function (input, output, outFormat, inputOffset) {\n var lookupFunc = publicAPI.linearLookup;\n\n if (model.indexedLookup) {\n lookupFunc = publicAPI.indexedLookupFunction;\n }\n\n var trange = publicAPI.getMappingRange();\n var p = {\n maxIndex: publicAPI.getNumberOfColors() - 1,\n range: trange,\n shift: 0.0,\n scale: 0.0\n };\n publicAPI.lookupShiftAndScale(trange, p);\n var alpha = publicAPI.getAlpha();\n var length = input.getNumberOfTuples();\n var inIncr = input.getNumberOfComponents();\n var outputV = output.getData();\n var inputV = input.getData();\n\n if (alpha >= 1.0) {\n if (outFormat === vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_3__[\"ScalarMappingTarget\"].RGBA) {\n for (var i = 0; i < length; i++) {\n var cptr = lookupFunc(inputV[i * inIncr + inputOffset], model.table, p);\n outputV[i * 4] = cptr[0];\n outputV[i * 4 + 1] = cptr[1];\n outputV[i * 4 + 2] = cptr[2];\n outputV[i * 4 + 3] = cptr[3];\n }\n }\n } else {\n /* eslint-disable no-lonely-if */\n if (outFormat === vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_3__[\"ScalarMappingTarget\"].RGBA) {\n for (var _i = 0; _i < length; _i++) {\n var _cptr = lookupFunc(inputV[_i * inIncr + inputOffset], model.table, p);\n\n outputV[_i * 4] = _cptr[0];\n outputV[_i * 4 + 1] = _cptr[1];\n outputV[_i * 4 + 2] = _cptr[2];\n outputV[_i * 4 + 3] = Math.floor(_cptr[3] * alpha + 0.5);\n }\n }\n } // alpha blending\n\n };\n\n publicAPI.forceBuild = function () {\n var hinc = 0.0;\n var sinc = 0.0;\n var vinc = 0.0;\n var ainc = 0.0;\n var maxIndex = model.numberOfColors - 1;\n\n if (maxIndex) {\n hinc = (model.hueRange[1] - model.hueRange[0]) / maxIndex;\n sinc = (model.saturationRange[1] - model.saturationRange[0]) / maxIndex;\n vinc = (model.valueRange[1] - model.valueRange[0]) / maxIndex;\n ainc = (model.alphaRange[1] - model.alphaRange[0]) / maxIndex;\n }\n\n var hsv = [];\n var rgba = [];\n\n for (var i = 0; i <= maxIndex; i++) {\n hsv[0] = model.hueRange[0] + i * hinc;\n hsv[1] = model.saturationRange[0] + i * sinc;\n hsv[2] = model.valueRange[0] + i * vinc;\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"hsv2rgb\"](hsv, rgba);\n rgba[3] = model.alphaRange[0] + i * ainc; // case VTK_RAMP_LINEAR:\n\n model.table[i * 4] = rgba[0] * 255.0 + 0.5;\n model.table[i * 4 + 1] = rgba[1] * 255.0 + 0.5;\n model.table[i * 4 + 2] = rgba[2] * 255.0 + 0.5;\n model.table[i * 4 + 3] = rgba[3] * 255.0 + 0.5;\n }\n\n publicAPI.buildSpecialColors();\n model.buildTime.modified();\n };\n\n publicAPI.setTable = function (table) {\n if (table.getNumberOfComponents() !== 4) {\n vtkErrorMacro('Expected 4 components for RGBA colors');\n return;\n }\n\n if (table.getDataType() !== vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__[\"VtkDataTypes\"].UNSIGNED_CHAR) {\n vtkErrorMacro('Expected unsigned char values for RGBA colors');\n return;\n }\n\n model.numberOfColors = table.getNumberOfTuples();\n var data = table.getData();\n\n for (var i = 0; i < data.length; i++) {\n model.table[i] = data[i];\n }\n\n publicAPI.buildSpecialColors();\n model.insertTime.modified();\n publicAPI.modified();\n };\n\n publicAPI.buildSpecialColors = function () {\n // Add \"special\" colors (NaN, below range, above range) to table here.\n var numberOfColors = model.numberOfColors;\n var tptr = model.table;\n var base = (numberOfColors + BELOW_RANGE_COLOR_INDEX) * 4; // Below range color\n\n if (model.useBelowRangeColor || numberOfColors === 0) {\n tptr[base] = model.belowRangeColor[0] * 255.0 + 0.5;\n tptr[base + 1] = model.belowRangeColor[1] * 255.0 + 0.5;\n tptr[base + 2] = model.belowRangeColor[2] * 255.0 + 0.5;\n tptr[base + 3] = model.belowRangeColor[3] * 255.0 + 0.5;\n } else {\n // Duplicate the first color in the table.\n tptr[base] = tptr[0];\n tptr[base + 1] = tptr[1];\n tptr[base + 2] = tptr[2];\n tptr[base + 3] = tptr[3];\n } // Above range color\n\n\n base = (numberOfColors + ABOVE_RANGE_COLOR_INDEX) * 4;\n\n if (model.useAboveRangeColor || numberOfColors === 0) {\n tptr[base] = model.aboveRangeColor[0] * 255.0 + 0.5;\n tptr[base + 1] = model.aboveRangeColor[1] * 255.0 + 0.5;\n tptr[base + 2] = model.aboveRangeColor[2] * 255.0 + 0.5;\n tptr[base + 3] = model.aboveRangeColor[3] * 255.0 + 0.5;\n } else {\n // Duplicate the last color in the table.\n tptr[base] = tptr[4 * (numberOfColors - 1) + 0];\n tptr[base + 1] = tptr[4 * (numberOfColors - 1) + 1];\n tptr[base + 2] = tptr[4 * (numberOfColors - 1) + 2];\n tptr[base + 3] = tptr[4 * (numberOfColors - 1) + 3];\n } // Always use NanColor\n\n\n base = (numberOfColors + NAN_COLOR_INDEX) * 4;\n tptr[base] = model.nanColor[0] * 255.0 + 0.5;\n tptr[base + 1] = model.nanColor[1] * 255.0 + 0.5;\n tptr[base + 2] = model.nanColor[2] * 255.0 + 0.5;\n tptr[base + 3] = model.nanColor[3] * 255.0 + 0.5;\n };\n\n publicAPI.build = function () {\n if (model.table.length < 1 || publicAPI.getMTime() > model.buildTime.getMTime() && model.insertTime.getMTime() <= model.buildTime.getMTime()) {\n publicAPI.forceBuild();\n }\n };\n\n if (model.table.length > 0) {\n // ensure insertTime is more recently modified than buildTime if\n // a table is provided via the constructor\n model.insertTime.modified();\n }\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n numberOfColors: 256,\n // table: null,\n hueRange: [0.0, 0.66667],\n saturationRange: [1.0, 1.0],\n valueRange: [1.0, 1.0],\n alphaRange: [1.0, 1.0],\n nanColor: [0.5, 0.0, 0.0, 1.0],\n belowRangeColor: [0.0, 0.0, 0.0, 1.0],\n aboveRangeColor: [1.0, 1.0, 1.0, 1.0],\n useAboveRangeColor: false,\n useBelowRangeColor: false,\n alpha: 1.0 // buildTime: null,\n // opaqueFlagBuildTime: null,\n // insertTime: null,\n\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Common_Core_ScalarsToColors__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues); // Internal objects initialization\n\n if (!model.table) {\n model.table = [];\n }\n\n model.buildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.buildTime);\n model.opaqueFlagBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.opaqueFlagBuildTime, {\n mtime: 0\n });\n model.insertTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.insertTime, {\n mtime: 0\n }); // Create get-only macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['buildTime']); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['numberOfColors', 'useAboveRangeColor', 'useBelowRangeColor']); // Create set macros for array (needs to know size)\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setArray(publicAPI, model, ['alphaRange', 'hueRange', 'saturationRange', 'valueRange'], 2);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setArray(publicAPI, model, ['nanColor', 'belowRangeColor', 'aboveRangeColor'], 4); // Create get macros for array\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['hueRange', 'saturationRange', 'valueRange', 'alphaRange', 'nanColor', 'belowRangeColor', 'aboveRangeColor']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkLookupTable(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkLookupTable'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/LookupTable/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/Math/index.js": -/*!***************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/Math/index.js ***! - \***************************************************************/ -/*! exports provided: Pi, radiansFromDegrees, degreesFromRadians, round, floor, ceil, min, max, arrayMin, arrayMax, arrayRange, ceilLog2, factorial, nearestPowerOfTwo, isPowerOfTwo, binomial, beginCombination, nextCombination, randomSeed, getSeed, random, gaussian, add, subtract, multiplyScalar, multiplyScalar2D, multiplyAccumulate, multiplyAccumulate2D, dot, outer, cross, norm, normalize, perpendiculars, projectVector, dot2D, projectVector2D, distance2BetweenPoints, angleBetweenVectors, signedAngleBetweenVectors, gaussianAmplitude, gaussianWeight, outer2D, norm2D, normalize2D, determinant2x2, LUFactor3x3, LUSolve3x3, linearSolve3x3, multiply3x3_vect3, multiply3x3_mat3, multiplyMatrix, transpose3x3, invert3x3, identity3x3, determinant3x3, quaternionToMatrix3x3, areEquals, areMatricesEqual, roundNumber, roundVector, jacobiN, matrix3x3ToQuaternion, multiplyQuaternion, orthogonalize3x3, diagonalize3x3, singularValueDecomposition3x3, luFactorLinearSystem, luSolveLinearSystem, solveLinearSystem, invertMatrix, estimateMatrixCondition, jacobi, solveHomogeneousLeastSquares, solveLeastSquares, hex2float, rgb2hsv, hsv2rgb, lab2xyz, xyz2lab, xyz2rgb, rgb2xyz, rgb2lab, lab2rgb, uninitializeBounds, areBoundsInitialized, computeBoundsFromPoints, clampValue, clampVector, clampAndNormalizeValue, getScalarTypeFittingRange, getAdjustedScalarRange, extentIsWithinOtherExtent, boundsIsWithinOtherBounds, pointIsWithinBounds, solve3PointCircle, inf, negInf, isInf, isFinite, isNaN, isNan, createUninitializedBounds, getMajorAxisIndex, floatToHex2, floatRGB2HexCode, float2CssRGBA, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Pi\", function() { return Pi; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"radiansFromDegrees\", function() { return radiansFromDegrees; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"degreesFromRadians\", function() { return degreesFromRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arrayMin\", function() { return arrayMin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arrayMax\", function() { return arrayMax; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arrayRange\", function() { return arrayRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceilLog2\", function() { return ceilLog2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"factorial\", function() { return factorial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"nearestPowerOfTwo\", function() { return nearestPowerOfTwo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPowerOfTwo\", function() { return isPowerOfTwo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"binomial\", function() { return binomial; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"beginCombination\", function() { return beginCombination; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"nextCombination\", function() { return nextCombination; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"randomSeed\", function() { return randomSeed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSeed\", function() { return getSeed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gaussian\", function() { return gaussian; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar2D\", function() { return multiplyScalar2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyAccumulate\", function() { return multiplyAccumulate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyAccumulate2D\", function() { return multiplyAccumulate2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"outer\", function() { return outer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"norm\", function() { return norm; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perpendiculars\", function() { return perpendiculars; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"projectVector\", function() { return projectVector; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot2D\", function() { return dot2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"projectVector2D\", function() { return projectVector2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance2BetweenPoints\", function() { return distance2BetweenPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angleBetweenVectors\", function() { return angleBetweenVectors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"signedAngleBetweenVectors\", function() { return signedAngleBetweenVectors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gaussianAmplitude\", function() { return gaussianAmplitude; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gaussianWeight\", function() { return gaussianWeight; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"outer2D\", function() { return outer2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"norm2D\", function() { return norm2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize2D\", function() { return normalize2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant2x2\", function() { return determinant2x2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LUFactor3x3\", function() { return LUFactor3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LUSolve3x3\", function() { return LUSolve3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"linearSolve3x3\", function() { return linearSolve3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply3x3_vect3\", function() { return multiply3x3_vect3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply3x3_mat3\", function() { return multiply3x3_mat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyMatrix\", function() { return multiplyMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose3x3\", function() { return transpose3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert3x3\", function() { return invert3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity3x3\", function() { return identity3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant3x3\", function() { return determinant3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"quaternionToMatrix3x3\", function() { return quaternionToMatrix3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"areEquals\", function() { return areEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"areMatricesEqual\", function() { return areMatricesEqual; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"roundNumber\", function() { return roundNumber; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"roundVector\", function() { return roundVector; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"jacobiN\", function() { return jacobiN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"matrix3x3ToQuaternion\", function() { return matrix3x3ToQuaternion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyQuaternion\", function() { return multiplyQuaternion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"orthogonalize3x3\", function() { return orthogonalize3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"diagonalize3x3\", function() { return diagonalize3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"singularValueDecomposition3x3\", function() { return singularValueDecomposition3x3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"luFactorLinearSystem\", function() { return luFactorLinearSystem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"luSolveLinearSystem\", function() { return luSolveLinearSystem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"solveLinearSystem\", function() { return solveLinearSystem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invertMatrix\", function() { return invertMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"estimateMatrixCondition\", function() { return estimateMatrixCondition; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"jacobi\", function() { return jacobi; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"solveHomogeneousLeastSquares\", function() { return solveHomogeneousLeastSquares; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"solveLeastSquares\", function() { return solveLeastSquares; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hex2float\", function() { return hex2float; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgb2hsv\", function() { return rgb2hsv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hsv2rgb\", function() { return hsv2rgb; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lab2xyz\", function() { return lab2xyz; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"xyz2lab\", function() { return xyz2lab; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"xyz2rgb\", function() { return xyz2rgb; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgb2xyz\", function() { return rgb2xyz; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgb2lab\", function() { return rgb2lab; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lab2rgb\", function() { return lab2rgb; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"uninitializeBounds\", function() { return uninitializeBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"areBoundsInitialized\", function() { return areBoundsInitialized; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computeBoundsFromPoints\", function() { return computeBoundsFromPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clampValue\", function() { return clampValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clampVector\", function() { return clampVector; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clampAndNormalizeValue\", function() { return clampAndNormalizeValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScalarTypeFittingRange\", function() { return getScalarTypeFittingRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAdjustedScalarRange\", function() { return getAdjustedScalarRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extentIsWithinOtherExtent\", function() { return extentIsWithinOtherExtent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"boundsIsWithinOtherBounds\", function() { return boundsIsWithinOtherBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pointIsWithinBounds\", function() { return pointIsWithinBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"solve3PointCircle\", function() { return solve3PointCircle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inf\", function() { return inf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negInf\", function() { return negInf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isInf\", function() { return isInf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFinite\", function() { return isFinite; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNaN\", function() { return isNaN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNan\", function() { return isNan; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createUninitializedBounds\", function() { return createUninitializedBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMajorAxisIndex\", function() { return getMajorAxisIndex; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floatToHex2\", function() { return floatToHex2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floatRGB2HexCode\", function() { return floatRGB2HexCode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"float2CssRGBA\", function() { return float2CssRGBA; });\n/* harmony import */ var seedrandom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! seedrandom */ \"./node_modules/seedrandom/index.js\");\n/* harmony import */ var seedrandom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(seedrandom__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkErrorMacro,\n vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkWarningMacro; // ----------------------------------------------------------------------------\n\n/* eslint-disable camelcase */\n\n/* eslint-disable no-cond-assign */\n\n/* eslint-disable no-bitwise */\n\n/* eslint-disable no-multi-assign */\n// ----------------------------------------------------------------------------\n\nvar randomSeedValue = 0;\nvar VTK_MAX_ROTATIONS = 20;\nvar VTK_SMALL_NUMBER = 1.0e-12;\n\nfunction notImplemented(method) {\n return function () {\n return vtkErrorMacro(\"vtkMath::\".concat(method, \" - NOT IMPLEMENTED\"));\n };\n}\n\nfunction vtkSwapVectors3(v1, v2) {\n for (var i = 0; i < 3; i++) {\n var tmp = v1[i];\n v1[i] = v2[i];\n v2[i] = tmp;\n }\n}\n\nfunction createArray() {\n var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3;\n var array = [];\n\n while (array.length < size) {\n array.push(0);\n }\n\n return array;\n} // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\n\nvar Pi = function Pi() {\n return Math.PI;\n};\nfunction radiansFromDegrees(deg) {\n return deg / 180 * Math.PI;\n}\nfunction degreesFromRadians(rad) {\n return rad * 180 / Math.PI;\n}\nvar round = Math.round,\n floor = Math.floor,\n ceil = Math.ceil,\n min = Math.min,\n max = Math.max;\n\nfunction arrayMin(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var stride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var minValue = Infinity;\n\n for (var i = offset, len = arr.length; i < len; i += stride) {\n if (arr[i] < minValue) {\n minValue = arr[i];\n }\n }\n\n return minValue;\n}\nfunction arrayMax(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var stride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var maxValue = -Infinity;\n\n for (var i = offset, len = arr.length; i < len; i += stride) {\n if (maxValue < arr[i]) {\n maxValue = arr[i];\n }\n }\n\n return maxValue;\n}\nfunction arrayRange(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var stride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var minValue = Infinity;\n var maxValue = -Infinity;\n\n for (var i = offset, len = arr.length; i < len; i += stride) {\n if (arr[i] < minValue) {\n minValue = arr[i];\n }\n\n if (maxValue < arr[i]) {\n maxValue = arr[i];\n }\n }\n\n return [minValue, maxValue];\n}\nvar ceilLog2 = notImplemented('ceilLog2');\nvar factorial = notImplemented('factorial');\nfunction nearestPowerOfTwo(xi) {\n var v = 1;\n\n while (v < xi) {\n v *= 2;\n }\n\n return v;\n}\nfunction isPowerOfTwo(x) {\n return x === nearestPowerOfTwo(x);\n}\nfunction binomial(m, n) {\n var r = 1;\n\n for (var i = 1; i <= n; ++i) {\n r *= (m - i + 1) / i;\n }\n\n return Math.floor(r);\n}\nfunction beginCombination(m, n) {\n if (m < n) {\n return 0;\n }\n\n var r = createArray(n);\n\n for (var i = 0; i < n; ++i) {\n r[i] = i;\n }\n\n return r;\n}\nfunction nextCombination(m, n, r) {\n var status = 0;\n\n for (var i = n - 1; i >= 0; --i) {\n if (r[i] < m - n + i) {\n var j = r[i] + 1;\n\n while (i < n) {\n r[i++] = j++;\n }\n\n status = 1;\n break;\n }\n }\n\n return status;\n}\nfunction randomSeed(seed) {\n seedrandom__WEBPACK_IMPORTED_MODULE_0___default()(\"\".concat(seed), {\n global: true\n });\n randomSeedValue = seed;\n}\nfunction getSeed() {\n return randomSeedValue;\n}\nfunction random() {\n var minValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var maxValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var delta = maxValue - minValue;\n return minValue + delta * Math.random();\n}\nvar gaussian = notImplemented('gaussian'); // Vect3 operations\n\nfunction add(a, b, out) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\nfunction subtract(a, b, out) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\nfunction multiplyScalar(vec, scalar) {\n vec[0] *= scalar;\n vec[1] *= scalar;\n vec[2] *= scalar;\n return vec;\n}\nfunction multiplyScalar2D(vec, scalar) {\n vec[0] *= scalar;\n vec[1] *= scalar;\n return vec;\n}\nfunction multiplyAccumulate(a, b, scalar, out) {\n out[0] = a[0] + b[0] * scalar;\n out[1] = a[1] + b[1] * scalar;\n out[2] = a[2] + b[2] * scalar;\n return out;\n}\nfunction multiplyAccumulate2D(a, b, scalar, out) {\n out[0] = a[0] + b[0] * scalar;\n out[1] = a[1] + b[1] * scalar;\n return out;\n}\nfunction dot(x, y) {\n return x[0] * y[0] + x[1] * y[1] + x[2] * y[2];\n}\nfunction outer(x, y, out_3x3) {\n for (var i = 0; i < 3; i++) {\n for (var j = 0; j < 3; j++) {\n out_3x3[i][j] = x[i] * y[j];\n }\n }\n}\nfunction cross(x, y, out) {\n var Zx = x[1] * y[2] - x[2] * y[1];\n var Zy = x[2] * y[0] - x[0] * y[2];\n var Zz = x[0] * y[1] - x[1] * y[0];\n out[0] = Zx;\n out[1] = Zy;\n out[2] = Zz;\n return out;\n}\nfunction norm(x) {\n var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;\n\n switch (n) {\n case 1:\n return Math.abs(x);\n\n case 2:\n return Math.sqrt(x[0] * x[0] + x[1] * x[1]);\n\n case 3:\n return Math.sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]);\n\n default:\n {\n var sum = 0;\n\n for (var i = 0; i < n; i++) {\n sum += x[i] * x[i];\n }\n\n return Math.sqrt(sum);\n }\n }\n}\nfunction normalize(x) {\n var den = norm(x);\n\n if (den !== 0.0) {\n x[0] /= den;\n x[1] /= den;\n x[2] /= den;\n }\n\n return den;\n}\nfunction perpendiculars(x, y, z, theta) {\n var x2 = x[0] * x[0];\n var y2 = x[1] * x[1];\n var z2 = x[2] * x[2];\n var r = Math.sqrt(x2 + y2 + z2);\n var dx;\n var dy;\n var dz; // transpose the vector to avoid divide-by-zero error\n\n if (x2 > y2 && x2 > z2) {\n dx = 0;\n dy = 1;\n dz = 2;\n } else if (y2 > z2) {\n dx = 1;\n dy = 2;\n dz = 0;\n } else {\n dx = 2;\n dy = 0;\n dz = 1;\n }\n\n var a = x[dx] / r;\n var b = x[dy] / r;\n var c = x[dz] / r;\n var tmp = Math.sqrt(a * a + c * c);\n\n if (theta !== 0) {\n var sintheta = Math.sin(theta);\n var costheta = Math.cos(theta);\n\n if (y) {\n y[dx] = (c * costheta - a * b * sintheta) / tmp;\n y[dy] = sintheta * tmp;\n y[dz] = (-(a * costheta) - b * c * sintheta) / tmp;\n }\n\n if (z) {\n z[dx] = (-(c * sintheta) - a * b * costheta) / tmp;\n z[dy] = costheta * tmp;\n z[dz] = (a * sintheta - b * c * costheta) / tmp;\n }\n } else {\n if (y) {\n y[dx] = c / tmp;\n y[dy] = 0;\n y[dz] = -a / tmp;\n }\n\n if (z) {\n z[dx] = -a * b / tmp;\n z[dy] = tmp;\n z[dz] = -b * c / tmp;\n }\n }\n}\nfunction projectVector(a, b, projection) {\n var bSquared = dot(b, b);\n\n if (bSquared === 0) {\n projection[0] = 0;\n projection[1] = 0;\n projection[2] = 0;\n return false;\n }\n\n var scale = dot(a, b) / bSquared;\n\n for (var i = 0; i < 3; i++) {\n projection[i] = b[i];\n }\n\n multiplyScalar(projection, scale);\n return true;\n}\nfunction dot2D(x, y) {\n return x[0] * y[0] + x[1] * y[1];\n}\nfunction projectVector2D(a, b, projection) {\n var bSquared = dot2D(b, b);\n\n if (bSquared === 0) {\n projection[0] = 0;\n projection[1] = 0;\n return false;\n }\n\n var scale = dot2D(a, b) / bSquared;\n\n for (var i = 0; i < 2; i++) {\n projection[i] = b[i];\n }\n\n multiplyScalar2D(projection, scale);\n return true;\n}\nfunction distance2BetweenPoints(x, y) {\n return (x[0] - y[0]) * (x[0] - y[0]) + (x[1] - y[1]) * (x[1] - y[1]) + (x[2] - y[2]) * (x[2] - y[2]);\n}\nfunction angleBetweenVectors(v1, v2) {\n var crossVect = [0, 0, 0];\n cross(v1, v2, crossVect);\n return Math.atan2(norm(crossVect), dot(v1, v2));\n}\nfunction signedAngleBetweenVectors(v1, v2, vN) {\n var crossVect = [0, 0, 0];\n cross(v1, v2, crossVect);\n var angle = Math.atan2(norm(crossVect), dot(v1, v2));\n return dot(crossVect, vN) >= 0 ? angle : -angle;\n}\nfunction gaussianAmplitude(mean, variance, position) {\n var distanceFromMean = Math.abs(mean - position);\n return 1 / Math.sqrt(2 * Math.PI * variance) * Math.exp(-Math.pow(distanceFromMean, 2) / (2 * variance));\n}\nfunction gaussianWeight(mean, variance, position) {\n var distanceFromMean = Math.abs(mean - position);\n return Math.exp(-Math.pow(distanceFromMean, 2) / (2 * variance));\n}\nfunction outer2D(x, y, out_2x2) {\n for (var i = 0; i < 2; i++) {\n for (var j = 0; j < 2; j++) {\n out_2x2[i][j] = x[i] * y[j];\n }\n }\n}\nfunction norm2D(x2D) {\n return Math.sqrt(x2D[0] * x2D[0] + x2D[1] * x2D[1]);\n}\nfunction normalize2D(x) {\n var den = norm2D(x);\n\n if (den !== 0.0) {\n x[0] /= den;\n x[1] /= den;\n }\n\n return den;\n}\nfunction determinant2x2() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (args.length === 2) {\n return args[0][0] * args[1][1] - args[1][0] * args[0][1];\n }\n\n if (args.length === 4) {\n return args[0] * args[3] - args[1] * args[2];\n }\n\n return Number.NaN;\n}\nfunction LUFactor3x3(mat_3x3, index_3) {\n var maxI;\n var tmp;\n var largest;\n var scale = [0, 0, 0]; // Loop over rows to get implicit scaling information\n\n for (var i = 0; i < 3; i++) {\n largest = Math.abs(mat_3x3[i][0]);\n\n if ((tmp = Math.abs(mat_3x3[i][1])) > largest) {\n largest = tmp;\n }\n\n if ((tmp = Math.abs(mat_3x3[i][2])) > largest) {\n largest = tmp;\n }\n\n scale[i] = 1 / largest;\n } // Loop over all columns using Crout's method\n // first column\n\n\n largest = scale[0] * Math.abs(mat_3x3[0][0]);\n maxI = 0;\n\n if ((tmp = scale[1] * Math.abs(mat_3x3[1][0])) >= largest) {\n largest = tmp;\n maxI = 1;\n }\n\n if ((tmp = scale[2] * Math.abs(mat_3x3[2][0])) >= largest) {\n maxI = 2;\n }\n\n if (maxI !== 0) {\n vtkSwapVectors3(mat_3x3[maxI], mat_3x3[0]);\n scale[maxI] = scale[0];\n }\n\n index_3[0] = maxI;\n mat_3x3[1][0] /= mat_3x3[0][0];\n mat_3x3[2][0] /= mat_3x3[0][0]; // second column\n\n mat_3x3[1][1] -= mat_3x3[1][0] * mat_3x3[0][1];\n mat_3x3[2][1] -= mat_3x3[2][0] * mat_3x3[0][1];\n largest = scale[1] * Math.abs(mat_3x3[1][1]);\n maxI = 1;\n\n if ((tmp = scale[2] * Math.abs(mat_3x3[2][1])) >= largest) {\n maxI = 2;\n vtkSwapVectors3(mat_3x3[2], mat_3x3[1]);\n scale[2] = scale[1];\n }\n\n index_3[1] = maxI;\n mat_3x3[2][1] /= mat_3x3[1][1]; // third column\n\n mat_3x3[1][2] -= mat_3x3[1][0] * mat_3x3[0][2];\n mat_3x3[2][2] -= mat_3x3[2][0] * mat_3x3[0][2] + mat_3x3[2][1] * mat_3x3[1][2];\n index_3[2] = 2;\n}\nfunction LUSolve3x3(mat_3x3, index_3, x_3) {\n // forward substitution\n var sum = x_3[index_3[0]];\n x_3[index_3[0]] = x_3[0];\n x_3[0] = sum;\n sum = x_3[index_3[1]];\n x_3[index_3[1]] = x_3[1];\n x_3[1] = sum - mat_3x3[1][0] * x_3[0];\n sum = x_3[index_3[2]];\n x_3[index_3[2]] = x_3[2];\n x_3[2] = sum - mat_3x3[2][0] * x_3[0] - mat_3x3[2][1] * x_3[1]; // back substitution\n\n x_3[2] /= mat_3x3[2][2];\n x_3[1] = (x_3[1] - mat_3x3[1][2] * x_3[2]) / mat_3x3[1][1];\n x_3[0] = (x_3[0] - mat_3x3[0][1] * x_3[1] - mat_3x3[0][2] * x_3[2]) / mat_3x3[0][0];\n}\nfunction linearSolve3x3(mat_3x3, x_3, y_3) {\n var a1 = mat_3x3[0][0];\n var b1 = mat_3x3[0][1];\n var c1 = mat_3x3[0][2];\n var a2 = mat_3x3[1][0];\n var b2 = mat_3x3[1][1];\n var c2 = mat_3x3[1][2];\n var a3 = mat_3x3[2][0];\n var b3 = mat_3x3[2][1];\n var c3 = mat_3x3[2][2]; // Compute the adjoint\n\n var d1 = +determinant2x2(b2, b3, c2, c3);\n var d2 = -determinant2x2(a2, a3, c2, c3);\n var d3 = +determinant2x2(a2, a3, b2, b3);\n var e1 = -determinant2x2(b1, b3, c1, c3);\n var e2 = +determinant2x2(a1, a3, c1, c3);\n var e3 = -determinant2x2(a1, a3, b1, b3);\n var f1 = +determinant2x2(b1, b2, c1, c2);\n var f2 = -determinant2x2(a1, a2, c1, c2);\n var f3 = +determinant2x2(a1, a2, b1, b2); // Compute the determinant\n\n var det = a1 * d1 + b1 * d2 + c1 * d3; // Multiply by the adjoint\n\n var v1 = d1 * x_3[0] + e1 * x_3[1] + f1 * x_3[2];\n var v2 = d2 * x_3[0] + e2 * x_3[1] + f2 * x_3[2];\n var v3 = d3 * x_3[0] + e3 * x_3[1] + f3 * x_3[2]; // Divide by the determinant\n\n y_3[0] = v1 / det;\n y_3[1] = v2 / det;\n y_3[2] = v3 / det;\n}\nfunction multiply3x3_vect3(mat_3x3, in_3, out_3) {\n var x = mat_3x3[0][0] * in_3[0] + mat_3x3[0][1] * in_3[1] + mat_3x3[0][2] * in_3[2];\n var y = mat_3x3[1][0] * in_3[0] + mat_3x3[1][1] * in_3[1] + mat_3x3[1][2] * in_3[2];\n var z = mat_3x3[2][0] * in_3[0] + mat_3x3[2][1] * in_3[1] + mat_3x3[2][2] * in_3[2];\n out_3[0] = x;\n out_3[1] = y;\n out_3[2] = z;\n}\nfunction multiply3x3_mat3(a_3x3, b_3x3, out_3x3) {\n var tmp = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\n\n for (var i = 0; i < 3; i++) {\n tmp[0][i] = a_3x3[0][0] * b_3x3[0][i] + a_3x3[0][1] * b_3x3[1][i] + a_3x3[0][2] * b_3x3[2][i];\n tmp[1][i] = a_3x3[1][0] * b_3x3[0][i] + a_3x3[1][1] * b_3x3[1][i] + a_3x3[1][2] * b_3x3[2][i];\n tmp[2][i] = a_3x3[2][0] * b_3x3[0][i] + a_3x3[2][1] * b_3x3[1][i] + a_3x3[2][2] * b_3x3[2][i];\n }\n\n for (var j = 0; j < 3; j++) {\n out_3x3[j][0] = tmp[j][0];\n out_3x3[j][1] = tmp[j][1];\n out_3x3[j][2] = tmp[j][2];\n }\n}\nfunction multiplyMatrix(a, b, rowA, colA, rowB, colB, out_rowXcol) {\n // we need colA == rowB\n if (colA !== rowB) {\n vtkErrorMacro('Number of columns of A must match number of rows of B.');\n } // output matrix is rowA*colB\n // output row\n\n\n for (var i = 0; i < rowA; i++) {\n // output col\n for (var j = 0; j < colB; j++) {\n out_rowXcol[i][j] = 0; // sum for this point\n\n for (var k = 0; k < colA; k++) {\n out_rowXcol[i][j] += a[i][k] * b[k][j];\n }\n }\n }\n}\nfunction transpose3x3(in_3x3, outT_3x3) {\n var tmp;\n tmp = in_3x3[1][0];\n outT_3x3[1][0] = in_3x3[0][1];\n outT_3x3[0][1] = tmp;\n tmp = in_3x3[2][0];\n outT_3x3[2][0] = in_3x3[0][2];\n outT_3x3[0][2] = tmp;\n tmp = in_3x3[2][1];\n outT_3x3[2][1] = in_3x3[1][2];\n outT_3x3[1][2] = tmp;\n outT_3x3[0][0] = in_3x3[0][0];\n outT_3x3[1][1] = in_3x3[1][1];\n outT_3x3[2][2] = in_3x3[2][2];\n}\nfunction invert3x3(in_3x3, outI_3x3) {\n var a1 = in_3x3[0][0];\n var b1 = in_3x3[0][1];\n var c1 = in_3x3[0][2];\n var a2 = in_3x3[1][0];\n var b2 = in_3x3[1][1];\n var c2 = in_3x3[1][2];\n var a3 = in_3x3[2][0];\n var b3 = in_3x3[2][1];\n var c3 = in_3x3[2][2]; // Compute the adjoint\n\n var d1 = +determinant2x2(b2, b3, c2, c3);\n var d2 = -determinant2x2(a2, a3, c2, c3);\n var d3 = +determinant2x2(a2, a3, b2, b3);\n var e1 = -determinant2x2(b1, b3, c1, c3);\n var e2 = +determinant2x2(a1, a3, c1, c3);\n var e3 = -determinant2x2(a1, a3, b1, b3);\n var f1 = +determinant2x2(b1, b2, c1, c2);\n var f2 = -determinant2x2(a1, a2, c1, c2);\n var f3 = +determinant2x2(a1, a2, b1, b2); // Divide by the determinant\n\n var det = a1 * d1 + b1 * d2 + c1 * d3;\n outI_3x3[0][0] = d1 / det;\n outI_3x3[1][0] = d2 / det;\n outI_3x3[2][0] = d3 / det;\n outI_3x3[0][1] = e1 / det;\n outI_3x3[1][1] = e2 / det;\n outI_3x3[2][1] = e3 / det;\n outI_3x3[0][2] = f1 / det;\n outI_3x3[1][2] = f2 / det;\n outI_3x3[2][2] = f3 / det;\n}\nfunction identity3x3(mat_3x3) {\n for (var i = 0; i < 3; i++) {\n mat_3x3[i][0] = mat_3x3[i][1] = mat_3x3[i][2] = 0;\n mat_3x3[i][i] = 1;\n }\n}\nfunction determinant3x3(mat_3x3) {\n return mat_3x3[0][0] * mat_3x3[1][1] * mat_3x3[2][2] + mat_3x3[1][0] * mat_3x3[2][1] * mat_3x3[0][2] + mat_3x3[2][0] * mat_3x3[0][1] * mat_3x3[1][2] - mat_3x3[0][0] * mat_3x3[2][1] * mat_3x3[1][2] - mat_3x3[1][0] * mat_3x3[0][1] * mat_3x3[2][2] - mat_3x3[2][0] * mat_3x3[1][1] * mat_3x3[0][2];\n}\nfunction quaternionToMatrix3x3(quat_4, mat_3x3) {\n var ww = quat_4[0] * quat_4[0];\n var wx = quat_4[0] * quat_4[1];\n var wy = quat_4[0] * quat_4[2];\n var wz = quat_4[0] * quat_4[3];\n var xx = quat_4[1] * quat_4[1];\n var yy = quat_4[2] * quat_4[2];\n var zz = quat_4[3] * quat_4[3];\n var xy = quat_4[1] * quat_4[2];\n var xz = quat_4[1] * quat_4[3];\n var yz = quat_4[2] * quat_4[3];\n var rr = xx + yy + zz; // normalization factor, just in case quaternion was not normalized\n\n var f = 1 / (ww + rr);\n var s = (ww - rr) * f;\n f *= 2;\n mat_3x3[0][0] = xx * f + s;\n mat_3x3[1][0] = (xy + wz) * f;\n mat_3x3[2][0] = (xz - wy) * f;\n mat_3x3[0][1] = (xy - wz) * f;\n mat_3x3[1][1] = yy * f + s;\n mat_3x3[2][1] = (yz + wx) * f;\n mat_3x3[0][2] = (xz + wy) * f;\n mat_3x3[1][2] = (yz - wx) * f;\n mat_3x3[2][2] = zz * f + s;\n}\n/**\n * Returns true if elements of both arrays are equals.\n * @param {Array} a an array of numbers (vector, point, matrix...)\n * @param {Array} b an array of numbers (vector, point, matrix...)\n * @param {Number} eps tolerance\n */\n\nfunction areEquals(a, b) {\n var eps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-6;\n\n if (a.length !== b.length) {\n return false;\n }\n\n function isEqual(element, index) {\n return Math.abs(element - b[index]) <= eps;\n }\n\n return a.every(isEqual);\n}\nvar areMatricesEqual = areEquals;\nfunction roundNumber(num) {\n var digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (!\"\".concat(num).includes('e')) {\n return +\"\".concat(Math.round(\"\".concat(num, \"e+\").concat(digits)), \"e-\").concat(digits);\n }\n\n var arr = \"\".concat(num).split('e');\n var sig = '';\n\n if (+arr[1] + digits > 0) {\n sig = '+';\n }\n\n return +\"\".concat(Math.round(\"\".concat(+arr[0], \"e\").concat(sig).concat(+arr[1] + digits)), \"e-\").concat(digits);\n}\nfunction roundVector(vector) {\n var out = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var digits = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n out[0] = roundNumber(vector[0], digits);\n out[1] = roundNumber(vector[1], digits);\n out[2] = roundNumber(vector[2], digits);\n return out;\n}\nfunction jacobiN(a, n, w, v) {\n var i;\n var j;\n var k;\n var iq;\n var ip;\n var numPos;\n var tresh;\n var theta;\n var t;\n var tau;\n var sm;\n var s;\n var h;\n var g;\n var c;\n var tmp;\n var b = createArray(n);\n var z = createArray(n);\n\n var vtkROTATE = function vtkROTATE(aa, ii, jj, kk, ll) {\n g = aa[ii][jj];\n h = aa[kk][ll];\n aa[ii][jj] = g - s * (h + g * tau);\n aa[kk][ll] = h + s * (g - h * tau);\n }; // initialize\n\n\n for (ip = 0; ip < n; ip++) {\n for (iq = 0; iq < n; iq++) {\n v[ip][iq] = 0.0;\n }\n\n v[ip][ip] = 1.0;\n }\n\n for (ip = 0; ip < n; ip++) {\n b[ip] = w[ip] = a[ip][ip];\n z[ip] = 0.0;\n } // begin rotation sequence\n\n\n for (i = 0; i < VTK_MAX_ROTATIONS; i++) {\n sm = 0.0;\n\n for (ip = 0; ip < n - 1; ip++) {\n for (iq = ip + 1; iq < n; iq++) {\n sm += Math.abs(a[ip][iq]);\n }\n }\n\n if (sm === 0.0) {\n break;\n } // first 3 sweeps\n\n\n if (i < 3) {\n tresh = 0.2 * sm / (n * n);\n } else {\n tresh = 0.0;\n }\n\n for (ip = 0; ip < n - 1; ip++) {\n for (iq = ip + 1; iq < n; iq++) {\n g = 100.0 * Math.abs(a[ip][iq]); // after 4 sweeps\n\n if (i > 3 && Math.abs(w[ip]) + g === Math.abs(w[ip]) && Math.abs(w[iq]) + g === Math.abs(w[iq])) {\n a[ip][iq] = 0.0;\n } else if (Math.abs(a[ip][iq]) > tresh) {\n h = w[iq] - w[ip];\n\n if (Math.abs(h) + g === Math.abs(h)) {\n t = a[ip][iq] / h;\n } else {\n theta = 0.5 * h / a[ip][iq];\n t = 1.0 / (Math.abs(theta) + Math.sqrt(1.0 + theta * theta));\n\n if (theta < 0.0) {\n t = -t;\n }\n }\n\n c = 1.0 / Math.sqrt(1 + t * t);\n s = t * c;\n tau = s / (1.0 + c);\n h = t * a[ip][iq];\n z[ip] -= h;\n z[iq] += h;\n w[ip] -= h;\n w[iq] += h;\n a[ip][iq] = 0.0; // ip already shifted left by 1 unit\n\n for (j = 0; j <= ip - 1; j++) {\n vtkROTATE(a, j, ip, j, iq);\n } // ip and iq already shifted left by 1 unit\n\n\n for (j = ip + 1; j <= iq - 1; j++) {\n vtkROTATE(a, ip, j, j, iq);\n } // iq already shifted left by 1 unit\n\n\n for (j = iq + 1; j < n; j++) {\n vtkROTATE(a, ip, j, iq, j);\n }\n\n for (j = 0; j < n; j++) {\n vtkROTATE(v, j, ip, j, iq);\n }\n }\n }\n }\n\n for (ip = 0; ip < n; ip++) {\n b[ip] += z[ip];\n w[ip] = b[ip];\n z[ip] = 0.0;\n }\n } // this is NEVER called\n\n\n if (i >= VTK_MAX_ROTATIONS) {\n vtkWarningMacro('vtkMath::Jacobi: Error extracting eigenfunctions');\n return 0;\n } // sort eigenfunctions: these changes do not affect accuracy\n\n\n for (j = 0; j < n - 1; j++) {\n // boundary incorrect\n k = j;\n tmp = w[k];\n\n for (i = j + 1; i < n; i++) {\n // boundary incorrect, shifted already\n if (w[i] >= tmp) {\n // why exchange if same?\n k = i;\n tmp = w[k];\n }\n }\n\n if (k !== j) {\n w[k] = w[j];\n w[j] = tmp;\n\n for (i = 0; i < n; i++) {\n tmp = v[i][j];\n v[i][j] = v[i][k];\n v[i][k] = tmp;\n }\n }\n } // ensure eigenvector consistency (i.e., Jacobi can compute vectors that\n // are negative of one another (.707,.707,0) and (-.707,-.707,0). This can\n // reek havoc in hyperstreamline/other stuff. We will select the most\n // positive eigenvector.\n\n\n var ceil_half_n = (n >> 1) + (n & 1);\n\n for (j = 0; j < n; j++) {\n for (numPos = 0, i = 0; i < n; i++) {\n if (v[i][j] >= 0.0) {\n numPos++;\n }\n } // if ( numPos < ceil(double(n)/double(2.0)) )\n\n\n if (numPos < ceil_half_n) {\n for (i = 0; i < n; i++) {\n v[i][j] *= -1.0;\n }\n }\n }\n\n return 1;\n}\nfunction matrix3x3ToQuaternion(mat_3x3, quat_4) {\n var tmp = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]; // on-diagonal elements\n\n tmp[0][0] = mat_3x3[0][0] + mat_3x3[1][1] + mat_3x3[2][2];\n tmp[1][1] = mat_3x3[0][0] - mat_3x3[1][1] - mat_3x3[2][2];\n tmp[2][2] = -mat_3x3[0][0] + mat_3x3[1][1] - mat_3x3[2][2];\n tmp[3][3] = -mat_3x3[0][0] - mat_3x3[1][1] + mat_3x3[2][2]; // off-diagonal elements\n\n tmp[0][1] = tmp[1][0] = mat_3x3[2][1] - mat_3x3[1][2];\n tmp[0][2] = tmp[2][0] = mat_3x3[0][2] - mat_3x3[2][0];\n tmp[0][3] = tmp[3][0] = mat_3x3[1][0] - mat_3x3[0][1];\n tmp[1][2] = tmp[2][1] = mat_3x3[1][0] + mat_3x3[0][1];\n tmp[1][3] = tmp[3][1] = mat_3x3[0][2] + mat_3x3[2][0];\n tmp[2][3] = tmp[3][2] = mat_3x3[2][1] + mat_3x3[1][2];\n var eigenvectors = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]];\n var eigenvalues = [0, 0, 0, 0]; // convert into format that JacobiN can use,\n // then use Jacobi to find eigenvalues and eigenvectors\n\n var NTemp = [0, 0, 0, 0];\n var eigenvectorsTemp = [0, 0, 0, 0];\n\n for (var i = 0; i < 4; i++) {\n NTemp[i] = tmp[i];\n eigenvectorsTemp[i] = eigenvectors[i];\n }\n\n jacobiN(NTemp, 4, eigenvalues, eigenvectorsTemp); // the first eigenvector is the one we want\n\n quat_4[0] = eigenvectors[0][0];\n quat_4[1] = eigenvectors[1][0];\n quat_4[2] = eigenvectors[2][0];\n quat_4[3] = eigenvectors[3][0];\n}\nfunction multiplyQuaternion(quat_1, quat_2, quat_out) {\n var ww = quat_1[0] * quat_2[0];\n var wx = quat_1[0] * quat_2[1];\n var wy = quat_1[0] * quat_2[2];\n var wz = quat_1[0] * quat_2[3];\n var xw = quat_1[1] * quat_2[0];\n var xx = quat_1[1] * quat_2[1];\n var xy = quat_1[1] * quat_2[2];\n var xz = quat_1[1] * quat_2[3];\n var yw = quat_1[2] * quat_2[0];\n var yx = quat_1[2] * quat_2[1];\n var yy = quat_1[2] * quat_2[2];\n var yz = quat_1[2] * quat_2[3];\n var zw = quat_1[3] * quat_2[0];\n var zx = quat_1[3] * quat_2[1];\n var zy = quat_1[3] * quat_2[2];\n var zz = quat_1[3] * quat_2[3];\n quat_out[0] = ww - xx - yy - zz;\n quat_out[1] = wx + xw + yz - zy;\n quat_out[2] = wy - xz + yw + zx;\n quat_out[3] = wz + xy - yx + zw;\n}\nfunction orthogonalize3x3(a_3x3, out_3x3) {\n // copy the matrix\n for (var i = 0; i < 3; i++) {\n out_3x3[0][i] = a_3x3[0][i];\n out_3x3[1][i] = a_3x3[1][i];\n out_3x3[2][i] = a_3x3[2][i];\n } // Pivot the matrix to improve accuracy\n\n\n var scale = createArray(3);\n var index = createArray(3);\n var largest; // Loop over rows to get implicit scaling information\n\n for (var _i = 0; _i < 3; _i++) {\n var _x = Math.abs(out_3x3[_i][0]);\n\n var _x2 = Math.abs(out_3x3[_i][1]);\n\n var _x3 = Math.abs(out_3x3[_i][2]);\n\n largest = _x2 > _x ? _x2 : _x;\n largest = _x3 > largest ? _x3 : largest;\n scale[_i] = 1;\n\n if (largest !== 0) {\n scale[_i] /= largest;\n }\n } // first column\n\n\n var x1 = Math.abs(out_3x3[0][0]) * scale[0];\n var x2 = Math.abs(out_3x3[1][0]) * scale[1];\n var x3 = Math.abs(out_3x3[2][0]) * scale[2];\n index[0] = 0;\n largest = x1;\n\n if (x2 >= largest) {\n largest = x2;\n index[0] = 1;\n }\n\n if (x3 >= largest) {\n index[0] = 2;\n }\n\n if (index[0] !== 0) {\n vtkSwapVectors3(out_3x3[index[0]], out_3x3[0]);\n scale[index[0]] = scale[0];\n } // second column\n\n\n var y2 = Math.abs(out_3x3[1][1]) * scale[1];\n var y3 = Math.abs(out_3x3[2][1]) * scale[2];\n index[1] = 1;\n largest = y2;\n\n if (y3 >= largest) {\n index[1] = 2;\n vtkSwapVectors3(out_3x3[2], out_3x3[1]);\n } // third column\n\n\n index[2] = 2; // A quaternion can only describe a pure rotation, not\n // a rotation with a flip, therefore the flip must be\n // removed before the matrix is converted to a quaternion.\n\n var flip = 0;\n\n if (determinant3x3(out_3x3) < 0) {\n flip = 1;\n\n for (var _i2 = 0; _i2 < 3; _i2++) {\n out_3x3[0][_i2] = -out_3x3[0][_i2];\n out_3x3[1][_i2] = -out_3x3[1][_i2];\n out_3x3[2][_i2] = -out_3x3[2][_i2];\n }\n } // Do orthogonalization using a quaternion intermediate\n // (this, essentially, does the orthogonalization via\n // diagonalization of an appropriately constructed symmetric\n // 4x4 matrix rather than by doing SVD of the 3x3 matrix)\n\n\n var quat = createArray(4);\n matrix3x3ToQuaternion(out_3x3, quat);\n quaternionToMatrix3x3(quat, out_3x3); // Put the flip back into the orthogonalized matrix.\n\n if (flip) {\n for (var _i3 = 0; _i3 < 3; _i3++) {\n out_3x3[0][_i3] = -out_3x3[0][_i3];\n out_3x3[1][_i3] = -out_3x3[1][_i3];\n out_3x3[2][_i3] = -out_3x3[2][_i3];\n }\n } // Undo the pivoting\n\n\n if (index[1] !== 1) {\n vtkSwapVectors3(out_3x3[index[1]], out_3x3[1]);\n }\n\n if (index[0] !== 0) {\n vtkSwapVectors3(out_3x3[index[0]], out_3x3[0]);\n }\n}\nfunction diagonalize3x3(a_3x3, w_3, v_3x3) {\n var i;\n var j;\n var k;\n var maxI;\n var tmp;\n var maxVal; // do the matrix[3][3] to **matrix conversion for Jacobi\n\n var C = [createArray(3), createArray(3), createArray(3)];\n var ATemp = createArray(3);\n var VTemp = createArray(3);\n\n for (i = 0; i < 3; i++) {\n C[i][0] = a_3x3[i][0];\n C[i][1] = a_3x3[i][1];\n C[i][2] = a_3x3[i][2];\n ATemp[i] = C[i];\n VTemp[i] = v_3x3[i];\n } // diagonalize using Jacobi\n\n\n jacobiN(ATemp, 3, w_3, VTemp); // if all the eigenvalues are the same, return identity matrix\n\n if (w_3[0] === w_3[1] && w_3[0] === w_3[2]) {\n identity3x3(v_3x3);\n return;\n } // transpose temporarily, it makes it easier to sort the eigenvectors\n\n\n transpose3x3(v_3x3, v_3x3); // if two eigenvalues are the same, re-orthogonalize to optimally line\n // up the eigenvectors with the x, y, and z axes\n\n for (i = 0; i < 3; i++) {\n // two eigenvalues are the same\n if (w_3[(i + 1) % 3] === w_3[(i + 2) % 3]) {\n // find maximum element of the independent eigenvector\n maxVal = Math.abs(v_3x3[i][0]);\n maxI = 0;\n\n for (j = 1; j < 3; j++) {\n if (maxVal < (tmp = Math.abs(v_3x3[i][j]))) {\n maxVal = tmp;\n maxI = j;\n }\n } // swap the eigenvector into its proper position\n\n\n if (maxI !== i) {\n tmp = w_3[maxI];\n w_3[maxI] = w_3[i];\n w_3[i] = tmp;\n vtkSwapVectors3(v_3x3[i], v_3x3[maxI]);\n } // maximum element of eigenvector should be positive\n\n\n if (v_3x3[maxI][maxI] < 0) {\n v_3x3[maxI][0] = -v_3x3[maxI][0];\n v_3x3[maxI][1] = -v_3x3[maxI][1];\n v_3x3[maxI][2] = -v_3x3[maxI][2];\n } // re-orthogonalize the other two eigenvectors\n\n\n j = (maxI + 1) % 3;\n k = (maxI + 2) % 3;\n v_3x3[j][0] = 0.0;\n v_3x3[j][1] = 0.0;\n v_3x3[j][2] = 0.0;\n v_3x3[j][j] = 1.0;\n cross(v_3x3[maxI], v_3x3[j], v_3x3[k]);\n normalize(v_3x3[k]);\n cross(v_3x3[k], v_3x3[maxI], v_3x3[j]); // transpose vectors back to columns\n\n transpose3x3(v_3x3, v_3x3);\n return;\n }\n } // the three eigenvalues are different, just sort the eigenvectors\n // to align them with the x, y, and z axes\n // find the vector with the largest x element, make that vector\n // the first vector\n\n\n maxVal = Math.abs(v_3x3[0][0]);\n maxI = 0;\n\n for (i = 1; i < 3; i++) {\n if (maxVal < (tmp = Math.abs(v_3x3[i][0]))) {\n maxVal = tmp;\n maxI = i;\n }\n } // swap eigenvalue and eigenvector\n\n\n if (maxI !== 0) {\n tmp = w_3[maxI];\n w_3[maxI] = w_3[0];\n w_3[0] = tmp;\n vtkSwapVectors3(v_3x3[maxI], v_3x3[0]);\n } // do the same for the y element\n\n\n if (Math.abs(v_3x3[1][1]) < Math.abs(v_3x3[2][1])) {\n tmp = w_3[2];\n w_3[2] = w_3[1];\n w_3[1] = tmp;\n vtkSwapVectors3(v_3x3[2], v_3x3[1]);\n } // ensure that the sign of the eigenvectors is correct\n\n\n for (i = 0; i < 2; i++) {\n if (v_3x3[i][i] < 0) {\n v_3x3[i][0] = -v_3x3[i][0];\n v_3x3[i][1] = -v_3x3[i][1];\n v_3x3[i][2] = -v_3x3[i][2];\n }\n } // set sign of final eigenvector to ensure that determinant is positive\n\n\n if (determinant3x3(v_3x3) < 0) {\n v_3x3[2][0] = -v_3x3[2][0];\n v_3x3[2][1] = -v_3x3[2][1];\n v_3x3[2][2] = -v_3x3[2][2];\n } // transpose the eigenvectors back again\n\n\n transpose3x3(v_3x3, v_3x3);\n}\nfunction singularValueDecomposition3x3(a_3x3, u_3x3, w_3, vT_3x3) {\n var i;\n var B = [createArray(3), createArray(3), createArray(3)]; // copy so that A can be used for U or VT without risk\n\n for (i = 0; i < 3; i++) {\n B[0][i] = a_3x3[0][i];\n B[1][i] = a_3x3[1][i];\n B[2][i] = a_3x3[2][i];\n } // temporarily flip if determinant is negative\n\n\n var d = determinant3x3(B);\n\n if (d < 0) {\n for (i = 0; i < 3; i++) {\n B[0][i] = -B[0][i];\n B[1][i] = -B[1][i];\n B[2][i] = -B[2][i];\n }\n } // orthogonalize, diagonalize, etc.\n\n\n orthogonalize3x3(B, u_3x3);\n transpose3x3(B, B);\n multiply3x3_mat3(B, u_3x3, vT_3x3);\n diagonalize3x3(vT_3x3, w_3, vT_3x3);\n multiply3x3_mat3(u_3x3, vT_3x3, u_3x3);\n transpose3x3(vT_3x3, vT_3x3); // re-create the flip\n\n if (d < 0) {\n w_3[0] = -w_3[0];\n w_3[1] = -w_3[1];\n w_3[2] = -w_3[2];\n }\n}\nfunction luFactorLinearSystem(A, index, size) {\n var i;\n var j;\n var k;\n var largest;\n var maxI = 0;\n var sum;\n var temp1;\n var temp2;\n var scale = createArray(size); //\n // Loop over rows to get implicit scaling information\n //\n\n for (i = 0; i < size; i++) {\n for (largest = 0.0, j = 0; j < size; j++) {\n if ((temp2 = Math.abs(A[i][j])) > largest) {\n largest = temp2;\n }\n }\n\n if (largest === 0.0) {\n vtkWarningMacro('Unable to factor linear system');\n return 0;\n }\n\n scale[i] = 1.0 / largest;\n } //\n // Loop over all columns using Crout's method\n //\n\n\n for (j = 0; j < size; j++) {\n for (i = 0; i < j; i++) {\n sum = A[i][j];\n\n for (k = 0; k < i; k++) {\n sum -= A[i][k] * A[k][j];\n }\n\n A[i][j] = sum;\n } //\n // Begin search for largest pivot element\n //\n\n\n for (largest = 0.0, i = j; i < size; i++) {\n sum = A[i][j];\n\n for (k = 0; k < j; k++) {\n sum -= A[i][k] * A[k][j];\n }\n\n A[i][j] = sum;\n\n if ((temp1 = scale[i] * Math.abs(sum)) >= largest) {\n largest = temp1;\n maxI = i;\n }\n } //\n // Check for row interchange\n //\n\n\n if (j !== maxI) {\n for (k = 0; k < size; k++) {\n temp1 = A[maxI][k];\n A[maxI][k] = A[j][k];\n A[j][k] = temp1;\n }\n\n scale[maxI] = scale[j];\n } //\n // Divide by pivot element and perform elimination\n //\n\n\n index[j] = maxI;\n\n if (Math.abs(A[j][j]) <= VTK_SMALL_NUMBER) {\n vtkWarningMacro('Unable to factor linear system');\n return 0;\n }\n\n if (j !== size - 1) {\n temp1 = 1.0 / A[j][j];\n\n for (i = j + 1; i < size; i++) {\n A[i][j] *= temp1;\n }\n }\n }\n\n return 1;\n}\nfunction luSolveLinearSystem(A, index, x, size) {\n var i;\n var j;\n var ii;\n var idx;\n var sum; //\n // Proceed with forward and backsubstitution for L and U\n // matrices. First, forward substitution.\n //\n\n for (ii = -1, i = 0; i < size; i++) {\n idx = index[i];\n sum = x[idx];\n x[idx] = x[i];\n\n if (ii >= 0) {\n for (j = ii; j <= i - 1; j++) {\n sum -= A[i][j] * x[j];\n }\n } else if (sum !== 0.0) {\n ii = i;\n }\n\n x[i] = sum;\n } //\n // Now, back substitution\n //\n\n\n for (i = size - 1; i >= 0; i--) {\n sum = x[i];\n\n for (j = i + 1; j < size; j++) {\n sum -= A[i][j] * x[j];\n }\n\n x[i] = sum / A[i][i];\n }\n}\nfunction solveLinearSystem(A, x, size) {\n // if we solving something simple, just solve it\n if (size === 2) {\n var y = createArray(2);\n var det = determinant2x2(A[0][0], A[0][1], A[1][0], A[1][1]);\n\n if (det === 0.0) {\n // Unable to solve linear system\n return 0;\n }\n\n y[0] = (A[1][1] * x[0] - A[0][1] * x[1]) / det;\n y[1] = (-(A[1][0] * x[0]) + A[0][0] * x[1]) / det;\n x[0] = y[0];\n x[1] = y[1];\n return 1;\n }\n\n if (size === 1) {\n if (A[0][0] === 0.0) {\n // Unable to solve linear system\n return 0;\n }\n\n x[0] /= A[0][0];\n return 1;\n } //\n // System of equations is not trivial, use Crout's method\n //\n // Check on allocation of working vectors\n\n\n var index = createArray(size); // Factor and solve matrix\n\n if (luFactorLinearSystem(A, index, size) === 0) {\n return 0;\n }\n\n luSolveLinearSystem(A, index, x, size);\n return 1;\n}\nfunction invertMatrix(A, AI, size) {\n var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n var column = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;\n var tmp1Size = index || createArray(size);\n var tmp2Size = column || createArray(size); // Factor matrix; then begin solving for inverse one column at a time.\n // Note: tmp1Size returned value is used later, tmp2Size is just working\n // memory whose values are not used in LUSolveLinearSystem\n\n if (luFactorLinearSystem(A, tmp1Size, size, tmp2Size) === 0) {\n return 0;\n }\n\n for (var j = 0; j < size; j++) {\n for (var i = 0; i < size; i++) {\n tmp2Size[i] = 0.0;\n }\n\n tmp2Size[j] = 1.0;\n luSolveLinearSystem(A, tmp1Size, tmp2Size, size);\n\n for (var _i4 = 0; _i4 < size; _i4++) {\n AI[_i4][j] = tmp2Size[_i4];\n }\n }\n\n return 1;\n}\nfunction estimateMatrixCondition(A, size) {\n var minValue = +Number.MAX_VALUE;\n var maxValue = -Number.MAX_VALUE; // find the maximum value\n\n for (var i = 0; i < size; i++) {\n for (var j = i; j < size; j++) {\n if (Math.abs(A[i][j]) > max) {\n maxValue = Math.abs(A[i][j]);\n }\n }\n } // find the minimum diagonal value\n\n\n for (var _i5 = 0; _i5 < size; _i5++) {\n if (Math.abs(A[_i5][_i5]) < min) {\n minValue = Math.abs(A[_i5][_i5]);\n }\n }\n\n if (minValue === 0.0) {\n return Number.MAX_VALUE;\n }\n\n return maxValue / minValue;\n}\nfunction jacobi(a_3x3, w, v) {\n return jacobiN(a_3x3, 3, w, v);\n}\nfunction solveHomogeneousLeastSquares(numberOfSamples, xt, xOrder, mt) {\n // check dimensional consistency\n if (numberOfSamples < xOrder) {\n vtkWarningMacro('Insufficient number of samples. Underdetermined.');\n return 0;\n }\n\n var i;\n var j;\n var k; // set up intermediate variables\n // Allocate matrix to hold X times transpose of X\n\n var XXt = createArray(xOrder); // size x by x\n // Allocate the array of eigenvalues and eigenvectors\n\n var eigenvals = createArray(xOrder);\n var eigenvecs = createArray(xOrder); // Clear the upper triangular region (and btw, allocate the eigenvecs as well)\n\n for (i = 0; i < xOrder; i++) {\n eigenvecs[i] = createArray(xOrder);\n XXt[i] = createArray(xOrder);\n\n for (j = 0; j < xOrder; j++) {\n XXt[i][j] = 0.0;\n }\n } // Calculate XXt upper half only, due to symmetry\n\n\n for (k = 0; k < numberOfSamples; k++) {\n for (i = 0; i < xOrder; i++) {\n for (j = i; j < xOrder; j++) {\n XXt[i][j] += xt[k][i] * xt[k][j];\n }\n }\n } // now fill in the lower half of the XXt matrix\n\n\n for (i = 0; i < xOrder; i++) {\n for (j = 0; j < i; j++) {\n XXt[i][j] = XXt[j][i];\n }\n } // Compute the eigenvectors and eigenvalues\n\n\n jacobiN(XXt, xOrder, eigenvals, eigenvecs); // Smallest eigenval is at the end of the list (xOrder-1), and solution is\n // corresponding eigenvec.\n\n for (i = 0; i < xOrder; i++) {\n mt[i][0] = eigenvecs[i][xOrder - 1];\n }\n\n return 1;\n}\nfunction solveLeastSquares(numberOfSamples, xt, xOrder, yt, yOrder, mt) {\n var checkHomogeneous = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;\n\n // check dimensional consistency\n if (numberOfSamples < xOrder || numberOfSamples < yOrder) {\n vtkWarningMacro('Insufficient number of samples. Underdetermined.');\n return 0;\n }\n\n var homogenFlags = createArray(yOrder);\n var allHomogeneous = 1;\n var hmt;\n var homogRC = 0;\n var i;\n var j;\n var k;\n var someHomogeneous = 0; // Ok, first init some flags check and see if all the systems are homogeneous\n\n if (checkHomogeneous) {\n // If Y' is zero, it's a homogeneous system and can't be solved via\n // the pseudoinverse method. Detect this case, warn the user, and\n // invoke SolveHomogeneousLeastSquares instead. Note that it doesn't\n // really make much sense for yOrder to be greater than one in this case,\n // since that's just yOrder occurrences of a 0 vector on the RHS, but\n // we allow it anyway. N\n // Initialize homogeneous flags on a per-right-hand-side basis\n for (j = 0; j < yOrder; j++) {\n homogenFlags[j] = 1;\n }\n\n for (i = 0; i < numberOfSamples; i++) {\n for (j = 0; j < yOrder; j++) {\n if (Math.abs(yt[i][j]) > VTK_SMALL_NUMBER) {\n allHomogeneous = 0;\n homogenFlags[j] = 0;\n }\n }\n } // If we've got one system, and it's homogeneous, do it and bail out quickly.\n\n\n if (allHomogeneous && yOrder === 1) {\n vtkWarningMacro('Detected homogeneous system (Y=0), calling SolveHomogeneousLeastSquares()');\n return solveHomogeneousLeastSquares(numberOfSamples, xt, xOrder, mt);\n } // Ok, we've got more than one system of equations.\n // Figure out if we need to calculate the homogeneous equation solution for\n // any of them.\n\n\n if (allHomogeneous) {\n someHomogeneous = 1;\n } else {\n for (j = 0; j < yOrder; j++) {\n if (homogenFlags[j]) {\n someHomogeneous = 1;\n }\n }\n }\n } // If necessary, solve the homogeneous problem\n\n\n if (someHomogeneous) {\n // hmt is the homogeneous equation version of mt, the general solution.\n hmt = createArray(xOrder);\n\n for (j = 0; j < xOrder; j++) {\n // Only allocate 1 here, not yOrder, because here we're going to solve\n // just the one homogeneous equation subset of the entire problem\n hmt[j] = [0];\n } // Ok, solve the homogeneous problem\n\n\n homogRC = solveHomogeneousLeastSquares(numberOfSamples, xt, xOrder, hmt);\n } // set up intermediate variables\n\n\n var XXt = createArray(xOrder); // size x by x\n\n var XXtI = createArray(xOrder); // size x by x\n\n var XYt = createArray(xOrder); // size x by y\n\n for (i = 0; i < xOrder; i++) {\n XXt[i] = createArray(xOrder);\n XXtI[i] = createArray(xOrder);\n\n for (j = 0; j < xOrder; j++) {\n XXt[i][j] = 0.0;\n XXtI[i][j] = 0.0;\n }\n\n XYt[i] = createArray(yOrder);\n\n for (j = 0; j < yOrder; j++) {\n XYt[i][j] = 0.0;\n }\n } // first find the pseudoinverse matrix\n\n\n for (k = 0; k < numberOfSamples; k++) {\n for (i = 0; i < xOrder; i++) {\n // first calculate the XXt matrix, only do the upper half (symmetrical)\n for (j = i; j < xOrder; j++) {\n XXt[i][j] += xt[k][i] * xt[k][j];\n } // now calculate the XYt matrix\n\n\n for (j = 0; j < yOrder; j++) {\n XYt[i][j] += xt[k][i] * yt[k][j];\n }\n }\n } // now fill in the lower half of the XXt matrix\n\n\n for (i = 0; i < xOrder; i++) {\n for (j = 0; j < i; j++) {\n XXt[i][j] = XXt[j][i];\n }\n }\n\n var successFlag = invertMatrix(XXt, XXtI, xOrder); // next get the inverse of XXt\n\n if (successFlag) {\n for (i = 0; i < xOrder; i++) {\n for (j = 0; j < yOrder; j++) {\n mt[i][j] = 0.0;\n\n for (k = 0; k < xOrder; k++) {\n mt[i][j] += XXtI[i][k] * XYt[k][j];\n }\n }\n }\n } // Fix up any of the solutions that correspond to the homogeneous equation\n // problem.\n\n\n if (someHomogeneous) {\n for (j = 0; j < yOrder; j++) {\n if (homogenFlags[j]) {\n // Fix this one\n for (i = 0; i < xOrder; i++) {\n mt[i][j] = hmt[i][0];\n }\n }\n }\n }\n\n if (someHomogeneous) {\n return homogRC && successFlag;\n }\n\n return successFlag;\n}\nfunction hex2float(hexStr) {\n var outFloatArray = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0.5, 1];\n\n switch (hexStr.length) {\n case 3:\n // abc => #aabbcc\n outFloatArray[0] = parseInt(hexStr[0], 16) * 17 / 255;\n outFloatArray[1] = parseInt(hexStr[1], 16) * 17 / 255;\n outFloatArray[2] = parseInt(hexStr[2], 16) * 17 / 255;\n return outFloatArray;\n\n case 4:\n // #abc => #aabbcc\n outFloatArray[0] = parseInt(hexStr[1], 16) * 17 / 255;\n outFloatArray[1] = parseInt(hexStr[2], 16) * 17 / 255;\n outFloatArray[2] = parseInt(hexStr[3], 16) * 17 / 255;\n return outFloatArray;\n\n case 6:\n // ab01df => #ab01df\n outFloatArray[0] = parseInt(hexStr.substr(0, 2), 16) / 255;\n outFloatArray[1] = parseInt(hexStr.substr(2, 2), 16) / 255;\n outFloatArray[2] = parseInt(hexStr.substr(4, 2), 16) / 255;\n return outFloatArray;\n\n case 7:\n // #ab01df\n outFloatArray[0] = parseInt(hexStr.substr(1, 2), 16) / 255;\n outFloatArray[1] = parseInt(hexStr.substr(3, 2), 16) / 255;\n outFloatArray[2] = parseInt(hexStr.substr(5, 2), 16) / 255;\n return outFloatArray;\n\n case 9:\n // #ab01df00\n outFloatArray[0] = parseInt(hexStr.substr(1, 2), 16) / 255;\n outFloatArray[1] = parseInt(hexStr.substr(3, 2), 16) / 255;\n outFloatArray[2] = parseInt(hexStr.substr(5, 2), 16) / 255;\n outFloatArray[3] = parseInt(hexStr.substr(7, 2), 16) / 255;\n return outFloatArray;\n\n default:\n return outFloatArray;\n }\n}\nfunction rgb2hsv(rgb, hsv) {\n var h;\n var s;\n\n var _rgb = _slicedToArray(rgb, 3),\n r = _rgb[0],\n g = _rgb[1],\n b = _rgb[2];\n\n var onethird = 1.0 / 3.0;\n var onesixth = 1.0 / 6.0;\n var twothird = 2.0 / 3.0;\n var cmax = r;\n var cmin = r;\n\n if (g > cmax) {\n cmax = g;\n } else if (g < cmin) {\n cmin = g;\n }\n\n if (b > cmax) {\n cmax = b;\n } else if (b < cmin) {\n cmin = b;\n }\n\n var v = cmax;\n\n if (v > 0.0) {\n s = (cmax - cmin) / cmax;\n } else {\n s = 0.0;\n }\n\n if (s > 0) {\n if (r === cmax) {\n h = onesixth * (g - b) / (cmax - cmin);\n } else if (g === cmax) {\n h = onethird + onesixth * (b - r) / (cmax - cmin);\n } else {\n h = twothird + onesixth * (r - g) / (cmax - cmin);\n }\n\n if (h < 0.0) {\n h += 1.0;\n }\n } else {\n h = 0.0;\n } // Set the values back to the array\n\n\n hsv[0] = h;\n hsv[1] = s;\n hsv[2] = v;\n}\nfunction hsv2rgb(hsv, rgb) {\n var _hsv = _slicedToArray(hsv, 3),\n h = _hsv[0],\n s = _hsv[1],\n v = _hsv[2];\n\n var onethird = 1.0 / 3.0;\n var onesixth = 1.0 / 6.0;\n var twothird = 2.0 / 3.0;\n var fivesixth = 5.0 / 6.0;\n var r;\n var g;\n var b; // compute RGB from HSV\n\n if (h > onesixth && h <= onethird) {\n // green/red\n g = 1.0;\n r = (onethird - h) / onesixth;\n b = 0.0;\n } else if (h > onethird && h <= 0.5) {\n // green/blue\n g = 1.0;\n b = (h - onethird) / onesixth;\n r = 0.0;\n } else if (h > 0.5 && h <= twothird) {\n // blue/green\n b = 1.0;\n g = (twothird - h) / onesixth;\n r = 0.0;\n } else if (h > twothird && h <= fivesixth) {\n // blue/red\n b = 1.0;\n r = (h - twothird) / onesixth;\n g = 0.0;\n } else if (h > fivesixth && h <= 1.0) {\n // red/blue\n r = 1.0;\n b = (1.0 - h) / onesixth;\n g = 0.0;\n } else {\n // red/green\n r = 1.0;\n g = h / onesixth;\n b = 0.0;\n } // add Saturation to the equation.\n\n\n r = s * r + (1.0 - s);\n g = s * g + (1.0 - s);\n b = s * b + (1.0 - s);\n r *= v;\n g *= v;\n b *= v; // Assign back to the array\n\n rgb[0] = r;\n rgb[1] = g;\n rgb[2] = b;\n}\nfunction lab2xyz(lab, xyz) {\n // LAB to XYZ\n var _lab = _slicedToArray(lab, 3),\n L = _lab[0],\n a = _lab[1],\n b = _lab[2];\n\n var var_Y = (L + 16) / 116;\n var var_X = a / 500 + var_Y;\n var var_Z = var_Y - b / 200;\n\n if (Math.pow(var_Y, 3) > 0.008856) {\n var_Y = Math.pow(var_Y, 3);\n } else {\n var_Y = (var_Y - 16.0 / 116.0) / 7.787;\n }\n\n if (Math.pow(var_X, 3) > 0.008856) {\n var_X = Math.pow(var_X, 3);\n } else {\n var_X = (var_X - 16.0 / 116.0) / 7.787;\n }\n\n if (Math.pow(var_Z, 3) > 0.008856) {\n var_Z = Math.pow(var_Z, 3);\n } else {\n var_Z = (var_Z - 16.0 / 116.0) / 7.787;\n }\n\n var ref_X = 0.9505;\n var ref_Y = 1.0;\n var ref_Z = 1.089;\n xyz[0] = ref_X * var_X; // ref_X = 0.9505 Observer= 2 deg Illuminant= D65\n\n xyz[1] = ref_Y * var_Y; // ref_Y = 1.000\n\n xyz[2] = ref_Z * var_Z; // ref_Z = 1.089\n}\nfunction xyz2lab(xyz, lab) {\n var _xyz = _slicedToArray(xyz, 3),\n x = _xyz[0],\n y = _xyz[1],\n z = _xyz[2];\n\n var ref_X = 0.9505;\n var ref_Y = 1.0;\n var ref_Z = 1.089;\n var var_X = x / ref_X; // ref_X = 0.9505 Observer= 2 deg, Illuminant= D65\n\n var var_Y = y / ref_Y; // ref_Y = 1.000\n\n var var_Z = z / ref_Z; // ref_Z = 1.089\n\n if (var_X > 0.008856) var_X = Math.pow(var_X, 1.0 / 3.0);else var_X = 7.787 * var_X + 16.0 / 116.0;\n if (var_Y > 0.008856) var_Y = Math.pow(var_Y, 1.0 / 3.0);else var_Y = 7.787 * var_Y + 16.0 / 116.0;\n if (var_Z > 0.008856) var_Z = Math.pow(var_Z, 1.0 / 3.0);else var_Z = 7.787 * var_Z + 16.0 / 116.0;\n lab[0] = 116 * var_Y - 16;\n lab[1] = 500 * (var_X - var_Y);\n lab[2] = 200 * (var_Y - var_Z);\n}\nfunction xyz2rgb(xyz, rgb) {\n var _xyz2 = _slicedToArray(xyz, 3),\n x = _xyz2[0],\n y = _xyz2[1],\n z = _xyz2[2];\n\n var r = x * 3.2406 + y * -1.5372 + z * -0.4986;\n var g = x * -0.9689 + y * 1.8758 + z * 0.0415;\n var b = x * 0.0557 + y * -0.204 + z * 1.057; // The following performs a \"gamma correction\" specified by the sRGB color\n // space. sRGB is defined by a canonical definition of a display monitor and\n // has been standardized by the International Electrotechnical Commission (IEC\n // 61966-2-1). The nonlinearity of the correction is designed to make the\n // colors more perceptually uniform. This color space has been adopted by\n // several applications including Adobe Photoshop and Microsoft Windows color\n // management. OpenGL is agnostic on its RGB color space, but it is reasonable\n // to assume it is close to this one.\n\n if (r > 0.0031308) r = 1.055 * Math.pow(r, 1 / 2.4) - 0.055;else r *= 12.92;\n if (g > 0.0031308) g = 1.055 * Math.pow(g, 1 / 2.4) - 0.055;else g *= 12.92;\n if (b > 0.0031308) b = 1.055 * Math.pow(b, 1 / 2.4) - 0.055;else b *= 12.92; // Clip colors. ideally we would do something that is perceptually closest\n // (since we can see colors outside of the display gamut), but this seems to\n // work well enough.\n\n var maxVal = r;\n if (maxVal < g) maxVal = g;\n if (maxVal < b) maxVal = b;\n\n if (maxVal > 1.0) {\n r /= maxVal;\n g /= maxVal;\n b /= maxVal;\n }\n\n if (r < 0) r = 0;\n if (g < 0) g = 0;\n if (b < 0) b = 0; // Push values back to array\n\n rgb[0] = r;\n rgb[1] = g;\n rgb[2] = b;\n}\nfunction rgb2xyz(rgb, xyz) {\n var _rgb2 = _slicedToArray(rgb, 3),\n r = _rgb2[0],\n g = _rgb2[1],\n b = _rgb2[2]; // The following performs a \"gamma correction\" specified by the sRGB color\n // space. sRGB is defined by a canonical definition of a display monitor and\n // has been standardized by the International Electrotechnical Commission (IEC\n // 61966-2-1). The nonlinearity of the correction is designed to make the\n // colors more perceptually uniform. This color space has been adopted by\n // several applications including Adobe Photoshop and Microsoft Windows color\n // management. OpenGL is agnostic on its RGB color space, but it is reasonable\n // to assume it is close to this one.\n\n\n if (r > 0.04045) r = Math.pow((r + 0.055) / 1.055, 2.4);else r /= 12.92;\n if (g > 0.04045) g = Math.pow((g + 0.055) / 1.055, 2.4);else g /= 12.92;\n if (b > 0.04045) b = Math.pow((b + 0.055) / 1.055, 2.4);else b /= 12.92; // Observer. = 2 deg, Illuminant = D65\n\n xyz[0] = r * 0.4124 + g * 0.3576 + b * 0.1805;\n xyz[1] = r * 0.2126 + g * 0.7152 + b * 0.0722;\n xyz[2] = r * 0.0193 + g * 0.1192 + b * 0.9505;\n}\nfunction rgb2lab(rgb, lab) {\n var xyz = [0, 0, 0];\n rgb2xyz(rgb, xyz);\n xyz2lab(xyz, lab);\n}\nfunction lab2rgb(lab, rgb) {\n var xyz = [0, 0, 0];\n lab2xyz(lab, xyz);\n xyz2rgb(xyz, rgb);\n}\nfunction uninitializeBounds(bounds) {\n bounds[0] = 1.0;\n bounds[1] = -1.0;\n bounds[2] = 1.0;\n bounds[3] = -1.0;\n bounds[4] = 1.0;\n bounds[5] = -1.0;\n}\nfunction areBoundsInitialized(bounds) {\n return !(bounds[1] - bounds[0] < 0.0);\n}\nfunction computeBoundsFromPoints(point1, point2, bounds) {\n bounds[0] = Math.min(point1[0], point2[0]);\n bounds[1] = Math.max(point1[0], point2[0]);\n bounds[2] = Math.min(point1[1], point2[1]);\n bounds[3] = Math.max(point1[1], point2[1]);\n bounds[4] = Math.min(point1[2], point2[2]);\n bounds[5] = Math.max(point1[2], point2[2]);\n}\nfunction clampValue(value, minValue, maxValue) {\n if (value < minValue) {\n return minValue;\n }\n\n if (value > maxValue) {\n return maxValue;\n }\n\n return value;\n}\nfunction clampVector(vector, minVector, maxVector) {\n var out = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];\n out[0] = clampValue(vector[0], minVector[0], maxVector[0]);\n out[1] = clampValue(vector[1], minVector[1], maxVector[1]);\n out[2] = clampValue(vector[2], minVector[2], maxVector[2]);\n return out;\n}\nfunction clampAndNormalizeValue(value, range) {\n var result = 0;\n\n if (range[0] !== range[1]) {\n // clamp\n if (value < range[0]) {\n result = range[0];\n } else if (value > range[1]) {\n result = range[1];\n } else {\n result = value;\n } // normalize\n\n\n result = (result - range[0]) / (range[1] - range[0]);\n }\n\n return result;\n}\nvar getScalarTypeFittingRange = notImplemented('GetScalarTypeFittingRange');\nvar getAdjustedScalarRange = notImplemented('GetAdjustedScalarRange');\nfunction extentIsWithinOtherExtent(extent1, extent2) {\n if (!extent1 || !extent2) {\n return 0;\n }\n\n for (var i = 0; i < 6; i += 2) {\n if (extent1[i] < extent2[i] || extent1[i] > extent2[i + 1] || extent1[i + 1] < extent2[i] || extent1[i + 1] > extent2[i + 1]) {\n return 0;\n }\n }\n\n return 1;\n}\nfunction boundsIsWithinOtherBounds(bounds1_6, bounds2_6, delta_3) {\n if (!bounds1_6 || !bounds2_6) {\n return 0;\n }\n\n for (var i = 0; i < 6; i += 2) {\n if (bounds1_6[i] + delta_3[i / 2] < bounds2_6[i] || bounds1_6[i] - delta_3[i / 2] > bounds2_6[i + 1] || bounds1_6[i + 1] + delta_3[i / 2] < bounds2_6[i] || bounds1_6[i + 1] - delta_3[i / 2] > bounds2_6[i + 1]) {\n return 0;\n }\n }\n\n return 1;\n}\nfunction pointIsWithinBounds(point_3, bounds_6, delta_3) {\n if (!point_3 || !bounds_6 || !delta_3) {\n return 0;\n }\n\n for (var i = 0; i < 3; i++) {\n if (point_3[i] + delta_3[i] < bounds_6[2 * i] || point_3[i] - delta_3[i] > bounds_6[2 * i + 1]) {\n return 0;\n }\n }\n\n return 1;\n}\nfunction solve3PointCircle(p1, p2, p3, center) {\n var v21 = createArray(3);\n var v32 = createArray(3);\n var v13 = createArray(3);\n var v12 = createArray(3);\n var v23 = createArray(3);\n var v31 = createArray(3);\n\n for (var i = 0; i < 3; ++i) {\n v21[i] = p1[i] - p2[i];\n v32[i] = p2[i] - p3[i];\n v13[i] = p3[i] - p1[i];\n v12[i] = -v21[i];\n v23[i] = -v32[i];\n v31[i] = -v13[i];\n }\n\n var norm12 = norm(v12);\n var norm23 = norm(v23);\n var norm13 = norm(v13);\n var crossv21v32 = createArray(3);\n cross(v21, v32, crossv21v32);\n var normCross = norm(crossv21v32);\n var radius = norm12 * norm23 * norm13 / (2 * normCross);\n var normCross22 = 2 * normCross * normCross;\n var alpha = norm23 * norm23 * dot(v21, v31) / normCross22;\n var beta = norm13 * norm13 * dot(v12, v32) / normCross22;\n var gamma = norm12 * norm12 * dot(v13, v23) / normCross22;\n\n for (var _i6 = 0; _i6 < 3; ++_i6) {\n center[_i6] = alpha * p1[_i6] + beta * p2[_i6] + gamma * p3[_i6];\n }\n\n return radius;\n}\nvar inf = Infinity;\nvar negInf = -Infinity;\nvar isInf = function isInf(value) {\n return !Number.isFinite(value);\n};\nvar isFinite = Number.isFinite,\n isNaN = Number.isNaN;\n\nvar isNan = isNaN; // JavaScript - add-on ----------------------\n\nfunction createUninitializedBounds() {\n return [].concat([Number.MAX_VALUE, -Number.MAX_VALUE, // X\n Number.MAX_VALUE, -Number.MAX_VALUE, // Y\n Number.MAX_VALUE, -Number.MAX_VALUE // Z\n ]);\n}\nfunction getMajorAxisIndex(vector) {\n var maxValue = -1;\n var axisIndex = -1;\n\n for (var i = 0; i < vector.length; i++) {\n var value = Math.abs(vector[i]);\n\n if (value > maxValue) {\n axisIndex = i;\n maxValue = value;\n }\n }\n\n return axisIndex;\n}\nfunction floatToHex2(value) {\n var integer = Math.floor(value * 255);\n\n if (integer > 15) {\n return integer.toString(16);\n }\n\n return \"0\".concat(integer.toString(16));\n}\nfunction floatRGB2HexCode(rgbArray) {\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#';\n return \"\".concat(prefix).concat(rgbArray.map(floatToHex2).join(''));\n}\n\nfunction floatToChar(f) {\n return Math.round(f * 255);\n}\n\nfunction float2CssRGBA(rgbArray) {\n if (rgbArray.length === 3) {\n return \"rgb(\".concat(rgbArray.map(floatToChar).join(', '), \")\");\n }\n\n return \"rgba(\".concat(floatToChar(rgbArray[0] || 0), \", \").concat(floatToChar(rgbArray[1] || 0), \", \").concat(floatToChar(rgbArray[2] || 0), \", \").concat(rgbArray[3] || 0, \")\");\n} // ----------------------------------------------------------------------------\n// Only Static API\n// ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n Pi: Pi,\n radiansFromDegrees: radiansFromDegrees,\n degreesFromRadians: degreesFromRadians,\n round: round,\n floor: floor,\n ceil: ceil,\n ceilLog2: ceilLog2,\n min: min,\n max: max,\n arrayMin: arrayMin,\n arrayMax: arrayMax,\n arrayRange: arrayRange,\n isPowerOfTwo: isPowerOfTwo,\n nearestPowerOfTwo: nearestPowerOfTwo,\n factorial: factorial,\n binomial: binomial,\n beginCombination: beginCombination,\n nextCombination: nextCombination,\n randomSeed: randomSeed,\n getSeed: getSeed,\n random: random,\n gaussian: gaussian,\n add: add,\n subtract: subtract,\n multiplyScalar: multiplyScalar,\n multiplyScalar2D: multiplyScalar2D,\n multiplyAccumulate: multiplyAccumulate,\n multiplyAccumulate2D: multiplyAccumulate2D,\n dot: dot,\n outer: outer,\n cross: cross,\n norm: norm,\n normalize: normalize,\n perpendiculars: perpendiculars,\n projectVector: projectVector,\n projectVector2D: projectVector2D,\n distance2BetweenPoints: distance2BetweenPoints,\n angleBetweenVectors: angleBetweenVectors,\n gaussianAmplitude: gaussianAmplitude,\n gaussianWeight: gaussianWeight,\n dot2D: dot2D,\n outer2D: outer2D,\n norm2D: norm2D,\n normalize2D: normalize2D,\n determinant2x2: determinant2x2,\n LUFactor3x3: LUFactor3x3,\n LUSolve3x3: LUSolve3x3,\n linearSolve3x3: linearSolve3x3,\n multiply3x3_vect3: multiply3x3_vect3,\n multiply3x3_mat3: multiply3x3_mat3,\n multiplyMatrix: multiplyMatrix,\n transpose3x3: transpose3x3,\n invert3x3: invert3x3,\n identity3x3: identity3x3,\n determinant3x3: determinant3x3,\n quaternionToMatrix3x3: quaternionToMatrix3x3,\n areEquals: areEquals,\n areMatricesEqual: areMatricesEqual,\n roundNumber: roundNumber,\n roundVector: roundVector,\n matrix3x3ToQuaternion: matrix3x3ToQuaternion,\n multiplyQuaternion: multiplyQuaternion,\n orthogonalize3x3: orthogonalize3x3,\n diagonalize3x3: diagonalize3x3,\n singularValueDecomposition3x3: singularValueDecomposition3x3,\n solveLinearSystem: solveLinearSystem,\n invertMatrix: invertMatrix,\n luFactorLinearSystem: luFactorLinearSystem,\n luSolveLinearSystem: luSolveLinearSystem,\n estimateMatrixCondition: estimateMatrixCondition,\n jacobi: jacobi,\n jacobiN: jacobiN,\n solveHomogeneousLeastSquares: solveHomogeneousLeastSquares,\n solveLeastSquares: solveLeastSquares,\n hex2float: hex2float,\n rgb2hsv: rgb2hsv,\n hsv2rgb: hsv2rgb,\n lab2xyz: lab2xyz,\n xyz2lab: xyz2lab,\n xyz2rgb: xyz2rgb,\n rgb2xyz: rgb2xyz,\n rgb2lab: rgb2lab,\n lab2rgb: lab2rgb,\n uninitializeBounds: uninitializeBounds,\n areBoundsInitialized: areBoundsInitialized,\n computeBoundsFromPoints: computeBoundsFromPoints,\n clampValue: clampValue,\n clampVector: clampVector,\n clampAndNormalizeValue: clampAndNormalizeValue,\n getScalarTypeFittingRange: getScalarTypeFittingRange,\n getAdjustedScalarRange: getAdjustedScalarRange,\n extentIsWithinOtherExtent: extentIsWithinOtherExtent,\n boundsIsWithinOtherBounds: boundsIsWithinOtherBounds,\n pointIsWithinBounds: pointIsWithinBounds,\n solve3PointCircle: solve3PointCircle,\n inf: inf,\n negInf: negInf,\n isInf: isInf,\n isNan: isNaN,\n isNaN: isNaN,\n isFinite: isFinite,\n // JS add-on\n createUninitializedBounds: createUninitializedBounds,\n getMajorAxisIndex: getMajorAxisIndex,\n floatToHex2: floatToHex2,\n floatRGB2HexCode: floatRGB2HexCode,\n float2CssRGBA: float2CssRGBA\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/Math/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js ***! - \************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n // eslint-disable-next-line import/no-cycle\n\n\n\nvar NoOp = function NoOp(v) {\n return v;\n};\n\nvar IDENTITY = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\nvar EPSILON = 1e-6;\n\nvar Transform = /*#__PURE__*/function () {\n function Transform() {\n var useDegree = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n _classCallCheck(this, Transform);\n\n this.matrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n this.tmp = new Float64Array(3);\n this.angleConv = useDegree ? gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"glMatrix\"].toRadian : NoOp;\n }\n\n _createClass(Transform, [{\n key: \"rotateFromDirections\",\n value: function rotateFromDirections(originDirection, targetDirection) {\n var src = new Float64Array(3);\n var dst = new Float64Array(3);\n var transf = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(src, originDirection[0], originDirection[1], originDirection[2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(dst, targetDirection[0], targetDirection[1], targetDirection[2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].normalize(src, src);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].normalize(dst, dst);\n var cosAlpha = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].dot(src, dst);\n\n if (cosAlpha >= 1) {\n return this;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].cross(this.tmp, src, dst);\n\n if (gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].length(this.tmp) < EPSILON) {\n // cross product is 0, so pick arbitrary axis perpendicular\n // to originDirection.\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].cross(this.tmp, [1, 0, 0], originDirection);\n\n if (gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].length(this.tmp) < EPSILON) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].cross(this.tmp, [0, 1, 0], originDirection);\n }\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].fromRotation(transf, Math.acos(cosAlpha), this.tmp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(this.matrix, this.matrix, transf);\n return this;\n }\n }, {\n key: \"rotate\",\n value: function rotate(angle, axis) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set.apply(gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"], [this.tmp].concat(_toConsumableArray(axis)));\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].normalize(this.tmp, this.tmp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(this.matrix, this.matrix, this.angleConv(angle), this.tmp);\n return this;\n }\n }, {\n key: \"rotateX\",\n value: function rotateX(angle) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateX(this.matrix, this.matrix, this.angleConv(angle));\n return this;\n }\n }, {\n key: \"rotateY\",\n value: function rotateY(angle) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateY(this.matrix, this.matrix, this.angleConv(angle));\n return this;\n }\n }, {\n key: \"rotateZ\",\n value: function rotateZ(angle) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateZ(this.matrix, this.matrix, this.angleConv(angle));\n return this;\n }\n }, {\n key: \"translate\",\n value: function translate(x, y, z) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(this.tmp, x, y, z);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(this.matrix, this.matrix, this.tmp);\n return this;\n }\n }, {\n key: \"scale\",\n value: function scale(sx, sy, sz) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(this.tmp, sx, sy, sz);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].scale(this.matrix, this.matrix, this.tmp);\n return this;\n }\n }, {\n key: \"multiply\",\n value: function multiply(mat4x4) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(this.matrix, this.matrix, mat4x4);\n return this;\n }\n }, {\n key: \"identity\",\n value: function identity() {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(this.matrix);\n return this;\n } //-----------\n\n }, {\n key: \"apply\",\n value: function apply(typedArray) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var nbIterations = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;\n\n if (Object(vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"areMatricesEqual\"])(IDENTITY, this.matrix)) {\n // Make sure we can chain apply...\n return this;\n }\n\n var size = nbIterations === -1 ? typedArray.length : offset + nbIterations * 3;\n\n for (var i = offset; i < size; i += 3) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(this.tmp, typedArray[i], typedArray[i + 1], typedArray[i + 2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(this.tmp, this.tmp, this.matrix);\n typedArray[i] = this.tmp[0];\n typedArray[i + 1] = this.tmp[1];\n typedArray[i + 2] = this.tmp[2];\n } // Make sure we can chain apply...\n\n\n return this;\n }\n }, {\n key: \"getMatrix\",\n value: function getMatrix() {\n return this.matrix;\n }\n }, {\n key: \"setMatrix\",\n value: function setMatrix(mat4x4) {\n if (!!mat4x4 && mat4x4.length === 16) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(this.matrix, mat4x4);\n }\n\n return this;\n }\n }]);\n\n return Transform;\n}();\n\nfunction buildFromDegree() {\n return new Transform(true);\n}\n\nfunction buildFromRadian() {\n return new Transform(false);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n buildFromDegree: buildFromDegree,\n buildFromRadian: buildFromRadian\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/Points/index.js": -/*!*****************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/Points/index.js ***! - \*****************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\nvar INVALID_BOUNDS = [1, -1, 1, -1, 1, -1]; // ----------------------------------------------------------------------------\n// vtkPoints methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPoints(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPoints'); // Forwarding methods\n\n publicAPI.getNumberOfPoints = publicAPI.getNumberOfTuples;\n\n publicAPI.setNumberOfPoints = function (nbPoints) {\n var dimension = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;\n\n if (publicAPI.getNumberOfPoints() !== nbPoints) {\n model.size = nbPoints * dimension;\n model.values = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newTypedArray(model.dataType, model.size);\n publicAPI.setNumberOfComponents(dimension);\n publicAPI.modified();\n }\n };\n\n publicAPI.setPoint = function (idx) {\n var offset = idx * model.numberOfComponents;\n\n for (var i = 0; i < model.numberOfComponents; i++) {\n model.values[offset + i] = i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1];\n }\n };\n\n publicAPI.getPoint = publicAPI.getTuple;\n\n publicAPI.getBounds = function () {\n if (publicAPI.getNumberOfComponents() === 3) {\n var _xRange = publicAPI.getRange(0);\n\n model.bounds[0] = _xRange[0];\n model.bounds[1] = _xRange[1];\n\n var _yRange = publicAPI.getRange(1);\n\n model.bounds[2] = _yRange[0];\n model.bounds[3] = _yRange[1];\n var zRange = publicAPI.getRange(2);\n model.bounds[4] = zRange[0];\n model.bounds[5] = zRange[1];\n return model.bounds;\n }\n\n if (publicAPI.getNumberOfComponents() !== 2) {\n vtkErrorMacro(\"getBounds called on an array with components of\\n \".concat(publicAPI.getNumberOfComponents()));\n return INVALID_BOUNDS;\n }\n\n var xRange = publicAPI.getRange(0);\n model.bounds[0] = xRange[0];\n model.bounds[1] = xRange[1];\n var yRange = publicAPI.getRange(1);\n model.bounds[2] = yRange[0];\n model.bounds[3] = yRange[1];\n model.bounds[4] = 0;\n model.bounds[5] = 0;\n return model.bounds;\n }; // Trigger the computation of bounds\n\n\n publicAPI.computeBounds = publicAPI.getBounds; // Initialize\n\n publicAPI.setNumberOfComponents(model.numberOfComponents < 2 ? 3 : model.numberOfComponents);\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n empty: true,\n numberOfComponents: 3,\n dataType: vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__[\"VtkDataTypes\"].FLOAT,\n bounds: [1, -1, 1, -1, 1, -1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtkPoints(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPoints'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/Points/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/Constants.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/Constants.js ***! - \******************************************************************************/ -/*! exports provided: VectorMode, ScalarMappingTarget, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VectorMode\", function() { return VectorMode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ScalarMappingTarget\", function() { return ScalarMappingTarget; });\nvar VectorMode = {\n MAGNITUDE: 0,\n COMPONENT: 1,\n RGBCOLORS: 2\n};\nvar ScalarMappingTarget = {\n LUMINANCE: 1,\n LUMINANCE_ALPHA: 2,\n RGB: 3,\n RGBA: 4\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n VectorMode: VectorMode,\n ScalarMappingTarget: ScalarMappingTarget\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/index.js ***! - \**************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/ScalarsToColors/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n // Need to go inside Constants otherwise dependency loop\n\nvar ScalarMappingTarget = vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ScalarMappingTarget,\n VectorMode = vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].VectorMode;\nvar VtkDataTypes = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"].VtkDataTypes;\nvar ColorMode = vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ColorMode;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n// Add module-level functions or api that you want to expose statically via\n// the next section...\n// ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\nfunction intColorToUChar(c) {\n return c;\n}\n\nfunction floatColorToUChar(c) {\n return Math.floor(c * 255.0 + 0.5);\n} // ----------------------------------------------------------------------------\n// vtkScalarsToColors methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkScalarsToColors(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkScalarsToColors');\n\n publicAPI.setVectorModeToMagnitude = function () {\n return publicAPI.setVectorMode(VectorMode.MAGNITUDE);\n };\n\n publicAPI.setVectorModeToComponent = function () {\n return publicAPI.setVectorMode(VectorMode.COMPONENT);\n };\n\n publicAPI.setVectorModeToRGBColors = function () {\n return publicAPI.setVectorMode(VectorMode.RGBCOLORS);\n };\n\n publicAPI.build = function () {};\n\n publicAPI.isOpaque = function () {\n return true;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.setAnnotations = function (values, annotations) {\n if (values && !annotations || !values && annotations) {\n return;\n }\n\n if (values && annotations && values.length !== annotations.length) {\n vtkErrorMacro('Values and annotations do not have the same number of tuples so ignoring');\n return;\n }\n\n model.annotationArray = [];\n\n if (annotations && values) {\n var num = annotations.length;\n\n for (var i = 0; i < num; i++) {\n model.annotationArray.push({\n value: values[i],\n annotation: String(annotations[i])\n });\n }\n }\n\n publicAPI.updateAnnotatedValueMap();\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.setAnnotation = function (value, annotation) {\n var i = publicAPI.checkForAnnotatedValue(value);\n var modified = false;\n\n if (i >= 0) {\n if (model.annotationArray[i].annotation !== annotation) {\n model.annotationArray[i].annotation = annotation;\n modified = true;\n }\n } else {\n model.annotationArray.push({\n value: value,\n annotation: annotation\n });\n i = model.annotationArray.length - 1;\n modified = true;\n }\n\n if (modified) {\n publicAPI.updateAnnotatedValueMap();\n publicAPI.modified();\n }\n\n return i;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfAnnotatedValues = function () {\n return model.annotationArray.length;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getAnnotatedValue = function (idx) {\n if (idx < 0 || idx >= model.annotationArray.length) {\n return null;\n }\n\n return model.annotationArray[idx].value;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getAnnotation = function (idx) {\n if (model.annotationArray[idx] === undefined) {\n return null;\n }\n\n return model.annotationArray[idx].annotation;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getAnnotatedValueIndex = function (val) {\n return model.annotationArray.length ? publicAPI.checkForAnnotatedValue(val) : -1;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.removeAnnotation = function (value) {\n var i = publicAPI.checkForAnnotatedValue(value);\n var needToRemove = i >= 0;\n\n if (needToRemove) {\n model.annotationArray.splice(i, 1);\n publicAPI.updateAnnotatedValueMap();\n publicAPI.modified();\n }\n\n return needToRemove;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.resetAnnotations = function () {\n model.annotationArray = [];\n model.annotatedValueMap = [];\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getAnnotationColor = function (val, rgba) {\n if (model.indexedLookup) {\n var i = publicAPI.getAnnotatedValueIndex(val);\n publicAPI.getIndexedColor(i, rgba);\n } else {\n publicAPI.getColor(parseFloat(val), rgba);\n rgba[3] = 1.0;\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.checkForAnnotatedValue = function (value) {\n return publicAPI.getAnnotatedValueIndexInternal(value);\n }; //----------------------------------------------------------------------------\n // An unsafe version of vtkScalarsToColors::CheckForAnnotatedValue for\n // internal use (no pointer checks performed)\n\n\n publicAPI.getAnnotatedValueIndexInternal = function (value) {\n if (model.annotatedValueMap[value] !== undefined) {\n var na = model.annotationArray.length;\n return model.annotatedValueMap[value] % na;\n } // Treat as a NaN\n\n\n return -1;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getIndexedColor = function (val, rgba) {\n rgba[0] = 0.0;\n rgba[1] = 0.0;\n rgba[2] = 0.0;\n rgba[3] = 0.0;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.updateAnnotatedValueMap = function () {\n model.annotatedValueMap = [];\n var na = model.annotationArray.length;\n\n for (var i = 0; i < na; i++) {\n model.annotatedValueMap[model.annotationArray[i].value] = i;\n }\n }; // Description:\n // Internal methods that map a data array into a 4-component,\n // unsigned char RGBA array. The color mode determines the behavior\n // of mapping. If ColorMode.DEFAULT is set, then unsigned char\n // data arrays are treated as colors (and converted to RGBA if\n // necessary); If ColorMode.DIRECT_SCALARS is set, then all arrays\n // are treated as colors (integer types are clamped in the range 0-255,\n // floating point arrays are clamped in the range 0.0-1.0. Note 'char' does\n // not have enough values to represent a color so mapping this type is\n // considered an error);\n // otherwise, the data is mapped through this instance\n // of ScalarsToColors. The component argument is used for data\n // arrays with more than one component; it indicates which component\n // to use to do the blending. When the component argument is -1,\n // then the this object uses its own selected technique to change a\n // vector into a scalar to map.\n\n\n publicAPI.mapScalars = function (scalars, colorMode, componentIn) {\n var numberOfComponents = scalars.getNumberOfComponents();\n var newColors = null; // map scalars through lookup table only if needed\n\n if (colorMode === ColorMode.DEFAULT && scalars.getDataType() === VtkDataTypes.UNSIGNED_CHAR || colorMode === ColorMode.DIRECT_SCALARS && scalars) {\n newColors = publicAPI.convertToRGBA(scalars, numberOfComponents, scalars.getNumberOfTuples());\n } else {\n var newscalars = {\n type: 'vtkDataArray',\n name: 'temp',\n numberOfComponents: 4,\n dataType: VtkDataTypes.UNSIGNED_CHAR\n };\n var s = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newTypedArray(newscalars.dataType, 4 * scalars.getNumberOfTuples());\n newscalars.values = s;\n newscalars.size = s.length;\n newColors = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(newscalars);\n var component = componentIn; // If mapper did not specify a component, use the VectorMode\n\n if (component < 0 && numberOfComponents > 1) {\n publicAPI.mapVectorsThroughTable(scalars, newColors, ScalarMappingTarget.RGBA, -1, -1);\n } else {\n if (component < 0) {\n component = 0;\n }\n\n if (component >= numberOfComponents) {\n component = numberOfComponents - 1;\n } // Map the scalars to colors\n\n\n publicAPI.mapScalarsThroughTable(scalars, newColors, ScalarMappingTarget.RGBA, component);\n }\n }\n\n return newColors;\n };\n\n publicAPI.mapVectorsToMagnitude = function (input, output, compsToUse) {\n var length = input.getNumberOfTuples();\n var inIncr = input.getNumberOfComponents();\n var outputV = output.getData();\n var inputV = input.getData();\n\n for (var i = 0; i < length; i++) {\n var sum = 0.0;\n\n for (var j = 0; j < compsToUse; j++) {\n sum += inputV[i * inIncr + j] * inputV[i * inIncr + j];\n }\n\n outputV[i] = Math.sqrt(sum);\n }\n }; //----------------------------------------------------------------------------\n // Map a set of vector values through the table\n\n\n publicAPI.mapVectorsThroughTable = function (input, output, outputFormat, vectorComponentIn, vectorSizeIn) {\n var vectorMode = publicAPI.getVectorMode();\n var vectorSize = vectorSizeIn;\n var vectorComponent = vectorComponentIn;\n var inComponents = input.getNumberOfComponents();\n\n if (vectorMode === VectorMode.COMPONENT) {\n // make sure vectorComponent is within allowed range\n if (vectorComponent === -1) {\n // if set to -1, use default value provided by table\n vectorComponent = publicAPI.getVectorComponent();\n }\n\n if (vectorComponent < 0) {\n vectorComponent = 0;\n }\n\n if (vectorComponent >= inComponents) {\n vectorComponent = inComponents - 1;\n }\n } else {\n // make sure vectorSize is within allowed range\n if (vectorSize === -1) {\n // if set to -1, use default value provided by table\n vectorSize = publicAPI.getVectorSize();\n }\n\n if (vectorSize <= 0) {\n vectorComponent = 0;\n vectorSize = inComponents;\n } else {\n if (vectorComponent < 0) {\n vectorComponent = 0;\n }\n\n if (vectorComponent >= inComponents) {\n vectorComponent = inComponents - 1;\n }\n\n if (vectorComponent + vectorSize > inComponents) {\n vectorSize = inComponents - vectorComponent;\n }\n }\n\n if (vectorMode === VectorMode.MAGNITUDE && (inComponents === 1 || vectorSize === 1)) {\n vectorMode = VectorMode.COMPONENT;\n }\n } // increment input pointer to the first component to map\n\n\n var inputOffset = 0;\n\n if (vectorComponent > 0) {\n inputOffset = vectorComponent;\n } // map according to the current vector mode\n\n\n switch (vectorMode) {\n case VectorMode.COMPONENT:\n {\n publicAPI.mapScalarsThroughTable(input, output, outputFormat, inputOffset);\n break;\n }\n\n default:\n case VectorMode.MAGNITUDE:\n {\n var magValues = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance({\n numberOfComponents: 1,\n values: new Float32Array(input.getNumberOfTuples())\n });\n publicAPI.mapVectorsToMagnitude(input, magValues, vectorSize);\n publicAPI.mapScalarsThroughTable(magValues, output, outputFormat, 0);\n break;\n }\n\n case VectorMode.RGBCOLORS:\n {\n // publicAPI.mapColorsToColors(\n // input, output, inComponents, vectorSize,\n // outputFormat);\n break;\n }\n }\n };\n\n publicAPI.luminanceToRGBA = function (newColors, colors, alpha, convtFun) {\n var a = convtFun(alpha);\n var values = colors.getData();\n var newValues = newColors.getData();\n var size = values.length;\n var component = 0;\n var tuple = 1;\n var count = 0;\n\n for (var i = component; i < size; i += tuple) {\n var l = convtFun(values[i]);\n newValues[count * 4] = l;\n newValues[count * 4 + 1] = l;\n newValues[count * 4 + 2] = l;\n newValues[count * 4 + 3] = a;\n count++;\n }\n };\n\n publicAPI.luminanceAlphaToRGBA = function (newColors, colors, alpha, convtFun) {\n var values = colors.getData();\n var newValues = newColors.getData();\n var size = values.length;\n var component = 0;\n var tuple = 2;\n var count = 0;\n\n for (var i = component; i < size; i += tuple) {\n var l = convtFun(values[i]);\n newValues[count] = l;\n newValues[count + 1] = l;\n newValues[count + 2] = l;\n newValues[count + 3] = convtFun(values[i + 1]) * alpha;\n count += 4;\n }\n };\n\n publicAPI.rGBToRGBA = function (newColors, colors, alpha, convtFun) {\n var a = floatColorToUChar(alpha);\n var values = colors.getData();\n var newValues = newColors.getData();\n var size = values.length;\n var component = 0;\n var tuple = 3;\n var count = 0;\n\n for (var i = component; i < size; i += tuple) {\n newValues[count * 4] = convtFun(values[i]);\n newValues[count * 4 + 1] = convtFun(values[i + 1]);\n newValues[count * 4 + 2] = convtFun(values[i + 2]);\n newValues[count * 4 + 3] = a;\n count++;\n }\n };\n\n publicAPI.rGBAToRGBA = function (newColors, colors, alpha, convtFun) {\n var values = colors.getData();\n var newValues = newColors.getData();\n var size = values.length;\n var component = 0;\n var tuple = 4;\n var count = 0;\n\n for (var i = component; i < size; i += tuple) {\n newValues[count * 4] = convtFun(values[i]);\n newValues[count * 4 + 1] = convtFun(values[i + 1]);\n newValues[count * 4 + 2] = convtFun(values[i + 2]);\n newValues[count * 4 + 3] = convtFun(values[i + 3]) * alpha;\n count++;\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.convertToRGBA = function (colors, numComp, numTuples) {\n var alpha = model.alpha;\n\n if (numComp === 4 && alpha >= 1.0 && colors.getDataType() === VtkDataTypes.UNSIGNED_CHAR) {\n return colors;\n }\n\n var newColors = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance({\n numberOfComponents: 4,\n empty: true,\n size: 4 * numTuples,\n dataType: VtkDataTypes.UNSIGNED_CHAR\n });\n\n if (numTuples <= 0) {\n return newColors;\n }\n\n alpha = alpha > 0 ? alpha : 0;\n alpha = alpha < 1 ? alpha : 1;\n var convtFun = intColorToUChar;\n\n if (colors.getDataType() === VtkDataTypes.FLOAT || colors.getDataType() === VtkDataTypes.DOUBLE) {\n convtFun = floatColorToUChar;\n }\n\n switch (numComp) {\n case 1:\n publicAPI.luminanceToRGBA(newColors, colors, alpha, convtFun);\n break;\n\n case 2:\n publicAPI.luminanceAlphaToRGBA(newColors, colors, convtFun);\n break;\n\n case 3:\n publicAPI.rGBToRGBA(newColors, colors, alpha, convtFun);\n break;\n\n case 4:\n publicAPI.rGBAToRGBA(newColors, colors, alpha, convtFun);\n break;\n\n default:\n vtkErrorMacro('Cannot convert colors');\n return null;\n }\n\n return newColors;\n };\n\n publicAPI.usingLogScale = function () {\n return false;\n };\n\n publicAPI.getNumberOfAvailableColors = function () {\n return 256 * 256 * 256;\n };\n\n publicAPI.setRange = function (min, max) {\n return publicAPI.setMappingRange(min, max);\n };\n\n publicAPI.getRange = function (min, max) {\n return publicAPI.getMappingRange();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n alpha: 1.0,\n vectorComponent: 0,\n vectorSize: -1,\n vectorMode: VectorMode.COMPONENT,\n mappingRange: null,\n annotationArray: null,\n annotatedValueMap: null,\n indexedLookup: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.mappingRange = [0, 255];\n model.annotationArray = [];\n model.annotatedValueMap = []; // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['vectorSize', 'vectorComponent', 'vectorMode', 'alpha', 'indexedLookup']); // Create set macros for array (needs to know size)\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setArray(publicAPI, model, ['mappingRange'], 2); // Create get macros for array\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['mappingRange']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkScalarsToColors(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkScalarsToColors'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js ***! - \***************************************************************************/ -/*! exports provided: equals, isValid, setBounds, reset, addPoint, addBounds, setMinPoint, setMaxPoint, inflate, scale, getCenter, getLength, getLengths, getXRange, getYRange, getZRange, getMaxLength, getDiagonalLength, getMinPoint, getMaxPoint, getCorners, computeCornerPoints, computeScale3, computeLocalBounds, intersectBox, intersectPlane, intersect, intersects, containsPoint, contains, cutWithPlane, STATIC, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return _equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isValid\", function() { return _isValid; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setBounds\", function() { return _setBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reset\", function() { return _reset; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addPoint\", function() { return _addPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addBounds\", function() { return _addBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setMinPoint\", function() { return _setMinPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setMaxPoint\", function() { return _setMaxPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inflate\", function() { return _inflate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return _scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCenter\", function() { return _getCenter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLength\", function() { return _getLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLengths\", function() { return _getLengths; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getXRange\", function() { return _getXRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getYRange\", function() { return _getYRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getZRange\", function() { return _getZRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMaxLength\", function() { return _getMaxLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDiagonalLength\", function() { return _getDiagonalLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMinPoint\", function() { return _getMinPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMaxPoint\", function() { return _getMaxPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCorners\", function() { return _getCorners; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computeCornerPoints\", function() { return _computeCornerPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computeScale3\", function() { return _computeScale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computeLocalBounds\", function() { return _computeLocalBounds; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intersectBox\", function() { return _intersectBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intersectPlane\", function() { return _intersectPlane; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intersect\", function() { return _intersect; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intersects\", function() { return _intersects; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"containsPoint\", function() { return _containsPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"contains\", function() { return contains; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cutWithPlane\", function() { return _cutWithPlane; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Plane */ \"./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\nvar INIT_BOUNDS = [Number.MAX_VALUE, -Number.MAX_VALUE, // X\nNumber.MAX_VALUE, -Number.MAX_VALUE, // Y\nNumber.MAX_VALUE, -Number.MAX_VALUE // Z\n]; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction _equals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n\n\n\nfunction _isValid(bounds) {\n return bounds[0] <= bounds[1] && bounds[2] <= bounds[3] && bounds[4] <= bounds[5];\n}\n\n\n\nfunction _setBounds(bounds, otherBounds) {\n bounds[0] = otherBounds[0];\n bounds[1] = otherBounds[1];\n bounds[2] = otherBounds[2];\n bounds[3] = otherBounds[3];\n bounds[4] = otherBounds[4];\n bounds[5] = otherBounds[5];\n return bounds;\n}\n\n\n\nfunction _reset(bounds) {\n return _setBounds(bounds, INIT_BOUNDS);\n}\n\n\n\nfunction _addPoint(bounds) {\n var _bounds = _slicedToArray(bounds, 6),\n xMin = _bounds[0],\n xMax = _bounds[1],\n yMin = _bounds[2],\n yMax = _bounds[3],\n zMin = _bounds[4],\n zMax = _bounds[5];\n\n bounds[0] = xMin < (arguments.length <= 1 ? undefined : arguments[1]) ? xMin : arguments.length <= 1 ? undefined : arguments[1];\n bounds[1] = xMax > (arguments.length <= 1 ? undefined : arguments[1]) ? xMax : arguments.length <= 1 ? undefined : arguments[1];\n bounds[2] = yMin < (arguments.length <= 2 ? undefined : arguments[2]) ? yMin : arguments.length <= 2 ? undefined : arguments[2];\n bounds[3] = yMax > (arguments.length <= 2 ? undefined : arguments[2]) ? yMax : arguments.length <= 2 ? undefined : arguments[2];\n bounds[4] = zMin < (arguments.length <= 3 ? undefined : arguments[3]) ? zMin : arguments.length <= 3 ? undefined : arguments[3];\n bounds[5] = zMax > (arguments.length <= 3 ? undefined : arguments[3]) ? zMax : arguments.length <= 3 ? undefined : arguments[3];\n}\n\n\n\nfunction _addBounds(bounds, xMin, xMax, yMin, yMax, zMin, zMax) {\n var _bounds2 = _slicedToArray(bounds, 6),\n _xMin = _bounds2[0],\n _xMax = _bounds2[1],\n _yMin = _bounds2[2],\n _yMax = _bounds2[3],\n _zMin = _bounds2[4],\n _zMax = _bounds2[5];\n\n if (zMax === undefined) {\n bounds[0] = Math.min(xMin[0], _xMin);\n bounds[1] = Math.max(xMin[1], _xMax);\n bounds[2] = Math.min(xMin[2], _yMin);\n bounds[3] = Math.max(xMin[3], _yMax);\n bounds[4] = Math.min(xMin[4], _zMin);\n bounds[5] = Math.max(xMin[5], _zMax);\n } else {\n bounds[0] = Math.min(xMin, _xMin);\n bounds[1] = Math.max(xMax, _xMax);\n bounds[2] = Math.min(yMin, _yMin);\n bounds[3] = Math.max(yMax, _yMax);\n bounds[4] = Math.min(zMin, _zMin);\n bounds[5] = Math.max(zMax, _zMax);\n }\n}\n\n\n\nfunction _setMinPoint(bounds, x, y, z) {\n var _bounds3 = _slicedToArray(bounds, 6),\n xMin = _bounds3[0],\n xMax = _bounds3[1],\n yMin = _bounds3[2],\n yMax = _bounds3[3],\n zMin = _bounds3[4],\n zMax = _bounds3[5];\n\n bounds[0] = x;\n bounds[1] = x > xMax ? x : xMax;\n bounds[2] = y;\n bounds[3] = y > yMax ? y : yMax;\n bounds[4] = z;\n bounds[5] = z > zMax ? z : zMax;\n return xMin !== x || yMin !== y || zMin !== z;\n}\n\n\n\nfunction _setMaxPoint(bounds, x, y, z) {\n var _bounds4 = _slicedToArray(bounds, 6),\n xMin = _bounds4[0],\n xMax = _bounds4[1],\n yMin = _bounds4[2],\n yMax = _bounds4[3],\n zMin = _bounds4[4],\n zMax = _bounds4[5];\n\n bounds[0] = x < xMin ? x : xMin;\n bounds[1] = x;\n bounds[2] = y < yMin ? y : yMin;\n bounds[3] = y;\n bounds[4] = z < zMin ? z : zMin;\n bounds[5] = z;\n return xMax !== x || yMax !== y || zMax !== z;\n}\n\n\n\nfunction _inflate(bounds, delta) {\n bounds[0] -= delta;\n bounds[1] += delta;\n bounds[2] -= delta;\n bounds[3] += delta;\n bounds[4] -= delta;\n bounds[5] += delta;\n}\n\n\n\nfunction _scale(bounds, sx, sy, sz) {\n if (!_isValid(bounds)) {\n return false;\n }\n\n if (sx >= 0.0) {\n bounds[0] *= sx;\n bounds[1] *= sx;\n } else {\n bounds[0] = sx * bounds[1];\n bounds[1] = sx * bounds[0];\n }\n\n if (sy >= 0.0) {\n bounds[2] *= sy;\n bounds[3] *= sy;\n } else {\n bounds[2] = sy * bounds[3];\n bounds[3] = sy * bounds[2];\n }\n\n if (sz >= 0.0) {\n bounds[4] *= sz;\n bounds[5] *= sz;\n } else {\n bounds[4] = sz * bounds[5];\n bounds[5] = sz * bounds[4];\n }\n\n return true;\n}\n\n\n\nfunction _getCenter(bounds) {\n return [0.5 * (bounds[0] + bounds[1]), 0.5 * (bounds[2] + bounds[3]), 0.5 * (bounds[4] + bounds[5])];\n}\n\n\n\nfunction _getLength(bounds, index) {\n return bounds[index * 2 + 1] - bounds[index * 2];\n}\n\n\n\nfunction _getLengths(bounds) {\n return [_getLength(bounds, 0), _getLength(bounds, 1), _getLength(bounds, 2)];\n}\n\n\n\nfunction _getXRange(bounds) {\n return bounds.slice(0, 2);\n}\n\n\n\nfunction _getYRange(bounds) {\n return bounds.slice(2, 4);\n}\n\n\n\nfunction _getZRange(bounds) {\n return bounds.slice(4, 6);\n}\n\n\n\nfunction _getMaxLength(bounds) {\n var l = _getLengths(bounds);\n\n if (l[0] > l[1]) {\n if (l[0] > l[2]) {\n return l[0];\n }\n\n return l[2];\n }\n\n if (l[1] > l[2]) {\n return l[1];\n }\n\n return l[2];\n}\n\n\n\nfunction _getDiagonalLength(bounds) {\n if (_isValid(bounds)) {\n var l = _getLengths(bounds);\n\n return Math.sqrt(l[0] * l[0] + l[1] * l[1] + l[2] * l[2]);\n }\n\n return null;\n}\n\n\n\nfunction _getMinPoint(bounds) {\n return [bounds[0], bounds[2], bounds[4]];\n}\n\n\n\nfunction _getMaxPoint(bounds) {\n return [bounds[1], bounds[3], bounds[5]];\n}\n\n\n\nfunction oppositeSign(a, b) {\n return a <= 0 && b >= 0 || a >= 0 && b <= 0;\n}\n\nfunction _getCorners(bounds, corners) {\n var count = 0;\n\n for (var ix = 0; ix < 2; ix++) {\n for (var iy = 2; iy < 4; iy++) {\n for (var iz = 4; iz < 6; iz++) {\n corners[count] = [bounds[ix], bounds[iy], bounds[iz]];\n count++;\n }\n }\n }\n} // Computes the two corners with minimal and miximal coordinates\n\n\n\n\nfunction _computeCornerPoints(bounds, point1, point2) {\n point1[0] = bounds[0];\n point1[1] = bounds[2];\n point1[2] = bounds[4];\n point2[0] = bounds[1];\n point2[1] = bounds[3];\n point2[2] = bounds[5];\n}\n\n\n\nfunction _computeScale(bounds) {\n var scale3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n var center = _getCenter(bounds);\n\n scale3[0] = bounds[1] - center[0];\n scale3[1] = bounds[3] - center[1];\n scale3[2] = bounds[5] - center[2];\n return scale3;\n}\n/**\n * Compute local bounds.\n * Not as fast as vtkPoints.getBounds() if u, v, w form a natural basis.\n * @param {vtkPoints} points\n * @param {array} u first vector\n * @param {array} v second vector\n * @param {array} w third vector\n */\n\n\n\n\nfunction _computeLocalBounds(points, u, v, w) {\n var bounds = [].concat(INIT_BOUNDS);\n var pointsData = points.getData();\n\n for (var i = 0; i < pointsData.length; i += 3) {\n var point = [pointsData[i], pointsData[i + 1], pointsData[i + 2]];\n var du = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](point, u);\n bounds[0] = Math.min(du, bounds[0]);\n bounds[1] = Math.max(du, bounds[1]);\n var dv = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](point, v);\n bounds[2] = Math.min(dv, bounds[2]);\n bounds[3] = Math.max(dv, bounds[3]);\n var dw = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](point, w);\n bounds[4] = Math.min(dw, bounds[4]);\n bounds[5] = Math.max(dw, bounds[5]);\n }\n\n return bounds;\n} // The method returns a non-zero value if the bounding box is hit.\n// Origin[3] starts the ray, dir[3] is the vector components of the ray in the x-y-z\n// directions, coord[3] is the location of hit, and t is the parametric\n// coordinate along line. (Notes: the intersection ray dir[3] is NOT\n// normalized. Valid intersections will only occur between 0<=t<=1.)\n\n\n\n\nfunction _intersectBox(bounds, origin, dir, coord, tolerance) {\n var inside = true;\n var quadrant = [];\n var whichPlane = 0;\n var maxT = [];\n var candidatePlane = [0.0, 0.0, 0.0];\n var RIGHT = 0;\n var LEFT = 1;\n var MIDDLE = 2; // First find closest planes\n\n for (var i = 0; i < 3; i++) {\n if (origin[i] < bounds[2 * i]) {\n quadrant[i] = LEFT;\n candidatePlane[i] = bounds[2 * i];\n inside = false;\n } else if (origin[i] > bounds[2 * i + 1]) {\n quadrant[i] = RIGHT;\n candidatePlane[i] = bounds[2 * i + 1];\n inside = false;\n } else {\n quadrant[i] = MIDDLE;\n }\n } // Check whether origin of ray is inside bbox\n\n\n if (inside) {\n coord[0] = origin[0];\n coord[1] = origin[1];\n coord[2] = origin[2];\n tolerance[0] = 0;\n return 1;\n } // Calculate parametric distance to plane\n\n\n for (var _i2 = 0; _i2 < 3; _i2++) {\n if (quadrant[_i2] !== MIDDLE && dir[_i2] !== 0.0) {\n maxT[_i2] = (candidatePlane[_i2] - origin[_i2]) / dir[_i2];\n } else {\n maxT[_i2] = -1.0;\n }\n } // Find the largest parametric value of intersection\n\n\n for (var _i3 = 0; _i3 < 3; _i3++) {\n if (maxT[whichPlane] < maxT[_i3]) {\n whichPlane = _i3;\n }\n } // Check for valie intersection along line\n\n\n if (maxT[whichPlane] > 1.0 || maxT[whichPlane] < 0.0) {\n return 0;\n }\n\n tolerance[0] = maxT[whichPlane]; // Intersection point along line is okay. Check bbox.\n\n for (var _i4 = 0; _i4 < 3; _i4++) {\n if (whichPlane !== _i4) {\n coord[_i4] = origin[_i4] + maxT[whichPlane] * dir[_i4];\n\n if (coord[_i4] < bounds[2 * _i4] || coord[_i4] > bounds[2 * _i4 + 1]) {\n return 0;\n }\n } else {\n coord[_i4] = candidatePlane[_i4];\n }\n }\n\n return 1;\n} // Plane intersection with box\n// The plane is infinite in extent and defined by an origin and normal.The function indicates\n// whether the plane intersects, not the particulars of intersection points and such\n// The function returns non-zero if the plane and box intersect; zero otherwise.\n\n\n\n\nfunction _intersectPlane(bounds, origin, normal) {\n var p = [];\n var d = 0;\n var sign = 1;\n var firstOne = 1; // Evaluate the eight points. If there is a sign change, there is an intersection\n\n for (var z = 4; z <= 5; ++z) {\n p[2] = bounds[z];\n\n for (var y = 2; y <= 3; ++y) {\n p[1] = bounds[y];\n\n for (var x = 0; x <= 1; ++x) {\n p[0] = bounds[x];\n d = vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_1__[\"default\"].evaluate(normal, origin, p);\n\n if (firstOne) {\n sign = d >= 0 ? 1 : -1;\n firstOne = 0;\n }\n\n if (d === 0.0 || sign > 0 && d < 0.0 || sign < 0 && d > 0.0) {\n return 1;\n }\n }\n }\n }\n\n return 0; // no intersection\n}\n\n\n\nfunction _intersect(bounds, bBounds) {\n if (!(_isValid(bounds) && _isValid(bBounds))) {\n return false;\n }\n\n var newBounds = [0, 0, 0, 0, 0, 0];\n var intersection;\n\n for (var i = 0; i < 3; i++) {\n intersection = false;\n\n if (bBounds[i * 2] >= bounds[i * 2] && bBounds[i * 2] <= bounds[i * 2 + 1]) {\n intersection = true;\n newBounds[i * 2] = bBounds[i * 2];\n } else if (bounds[i * 2] >= bBounds[i * 2] && bounds[i * 2] <= bBounds[i * 2 + 1]) {\n intersection = true;\n newBounds[i * 2] = bounds[i * 2];\n }\n\n if (bBounds[i * 2 + 1] >= bounds[i * 2] && bBounds[i * 2 + 1] <= bounds[i * 2 + 1]) {\n intersection = true;\n newBounds[i * 2 + 1] = bBounds[2 * i + 1];\n } else if (bounds[i * 2 + 1] >= bBounds[i * 2] && bounds[i * 2 + 1] <= bBounds[i * 2 + 1]) {\n intersection = true;\n newBounds[i * 2 + 1] = bounds[i * 2 + 1];\n }\n\n if (!intersection) {\n return false;\n }\n } // OK they did intersect - set the box to be the result\n\n\n bounds[0] = newBounds[0];\n bounds[1] = newBounds[1];\n bounds[2] = newBounds[2];\n bounds[3] = newBounds[3];\n bounds[4] = newBounds[4];\n bounds[5] = newBounds[5];\n return true;\n}\n\n\n\nfunction _intersects(bounds, bBounds) {\n if (!(_isValid(bounds) && _isValid(bBounds))) {\n return false;\n }\n /* eslint-disable no-continue */\n\n\n for (var i = 0; i < 3; i++) {\n if (bBounds[i * 2] >= bounds[i * 2] && bBounds[i * 2] <= bounds[i * 2 + 1]) {\n continue;\n } else if (bounds[i * 2] >= bBounds[i * 2] && bounds[i * 2] <= bBounds[i * 2 + 1]) {\n continue;\n }\n\n if (bBounds[i * 2 + 1] >= bounds[i * 2] && bBounds[i * 2 + 1] <= bounds[i * 2 + 1]) {\n continue;\n } else if (bounds[i * 2 + 1] >= bBounds[i * 2] && bounds[i * 2 + 1] <= bBounds[i * 2 + 1]) {\n continue;\n }\n\n return false;\n }\n /* eslint-enable no-continue */\n\n\n return true;\n}\n\n\n\nfunction _containsPoint(bounds, x, y, z) {\n if (x < bounds[0] || x > bounds[1]) {\n return false;\n }\n\n if (y < bounds[2] || y > bounds[3]) {\n return false;\n }\n\n if (z < bounds[4] || z > bounds[5]) {\n return false;\n }\n\n return true;\n}\n\n\nfunction contains(bounds, otherBounds) {\n // if either box is not valid or they don't intersect\n if (!_intersects(bounds, otherBounds)) {\n return false;\n }\n\n if (!_containsPoint.apply(void 0, [bounds].concat(_toConsumableArray(_getMinPoint(otherBounds))))) {\n return false;\n }\n\n if (!_containsPoint.apply(void 0, [bounds].concat(_toConsumableArray(_getMaxPoint(otherBounds))))) {\n return false;\n }\n\n return true;\n}\n/**\n * Returns true if plane intersects bounding box.\n * If so, the box is cut by the plane\n * @param {array} origin\n * @param {array} normal\n */\n\nfunction _cutWithPlane(bounds, origin, normal) {\n // Index[0..2] represents the order of traversing the corners of a cube\n // in (x,y,z), (y,x,z) and (z,x,y) ordering, respectively\n var index = [[0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 4, 5, 2, 3, 6, 7], [0, 2, 4, 6, 1, 3, 5, 7]]; // stores the signed distance to a plane\n\n var d = [0, 0, 0, 0, 0, 0, 0, 0];\n var idx = 0;\n\n for (var ix = 0; ix < 2; ix++) {\n for (var iy = 2; iy < 4; iy++) {\n for (var iz = 4; iz < 6; iz++) {\n var x = [bounds[ix], bounds[iy], bounds[iz]];\n d[idx++] = vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_1__[\"default\"].evaluate(normal, origin, x);\n }\n }\n }\n\n var dir = 2;\n\n while (dir--) {\n // in each direction, we test if the vertices of two orthogonal faces\n // are on either side of the plane\n if (oppositeSign(d[index[dir][0]], d[index[dir][4]]) && oppositeSign(d[index[dir][1]], d[index[dir][5]]) && oppositeSign(d[index[dir][2]], d[index[dir][6]]) && oppositeSign(d[index[dir][3]], d[index[dir][7]])) {\n break;\n }\n }\n\n if (dir < 0) {\n return false;\n }\n\n var sign = Math.sign(normal[dir]);\n var size = Math.abs((bounds[dir * 2 + 1] - bounds[dir * 2]) * normal[dir]);\n var t = sign > 0 ? 1 : 0;\n /* eslint-disable no-continue */\n\n for (var i = 0; i < 4; i++) {\n if (size === 0) {\n continue; // shouldn't happen\n }\n\n var ti = Math.abs(d[index[dir][i]]) / size;\n\n if (sign > 0 && ti < t) {\n t = ti;\n }\n\n if (sign < 0 && ti > t) {\n t = ti;\n }\n }\n /* eslint-enable no-continue */\n\n\n var bound = (1.0 - t) * bounds[dir * 2] + t * bounds[dir * 2 + 1];\n\n if (sign > 0) {\n bounds[dir * 2] = bound;\n } else {\n bounds[dir * 2 + 1] = bound;\n }\n\n return true;\n} // ----------------------------------------------------------------------------\n// Light Weight class\n// ----------------------------------------------------------------------------\n\n\n\n\nvar BoundingBox = /*#__PURE__*/function () {\n function BoundingBox(refBounds) {\n _classCallCheck(this, BoundingBox);\n\n this.bounds = refBounds;\n\n if (!this.bounds) {\n this.bounds = new Float64Array(6);\n\n _setBounds(this.bounds, INIT_BOUNDS);\n }\n }\n\n _createClass(BoundingBox, [{\n key: \"getBounds\",\n value: function getBounds() {\n return this.bounds;\n }\n }, {\n key: \"equals\",\n value: function equals(otherBounds) {\n return _equals(this.bounds, otherBounds);\n }\n }, {\n key: \"isValid\",\n value: function isValid() {\n return _isValid(this.bounds);\n }\n }, {\n key: \"setBounds\",\n value: function setBounds(otherBounds) {\n return _setBounds(this.bounds, otherBounds);\n }\n }, {\n key: \"reset\",\n value: function reset() {\n return _reset(this.bounds);\n }\n }, {\n key: \"addPoint\",\n value: function addPoint() {\n for (var _len = arguments.length, xyz = new Array(_len), _key = 0; _key < _len; _key++) {\n xyz[_key] = arguments[_key];\n }\n\n return _addPoint(this.bounds, xyz);\n }\n }, {\n key: \"addBounds\",\n value: function addBounds(xMin, xMax, yMin, yMax, zMin, zMax) {\n return _addBounds(this.bounds, xMin, xMax, yMin, yMax, zMin, zMax);\n }\n }, {\n key: \"setMinPoint\",\n value: function setMinPoint(x, y, z) {\n return _setMinPoint(this.bounds, x, y, z);\n }\n }, {\n key: \"setMaxPoint\",\n value: function setMaxPoint(x, y, z) {\n return _setMaxPoint(this.bounds, x, y, z);\n }\n }, {\n key: \"inflate\",\n value: function inflate(delta) {\n return _inflate(this.bounds, delta);\n }\n }, {\n key: \"scale\",\n value: function scale(sx, sy, sz) {\n return _scale(this.bounds, sx, sy, sz);\n }\n }, {\n key: \"getCenter\",\n value: function getCenter() {\n return _getCenter(this.bounds);\n }\n }, {\n key: \"getLength\",\n value: function getLength(index) {\n return _getLength(this.bounds, index);\n }\n }, {\n key: \"getLengths\",\n value: function getLengths() {\n return _getLengths(this.bounds);\n }\n }, {\n key: \"getMaxLength\",\n value: function getMaxLength() {\n return _getMaxLength(this.bounds);\n }\n }, {\n key: \"getDiagonalLength\",\n value: function getDiagonalLength() {\n return _getDiagonalLength(this.bounds);\n }\n }, {\n key: \"getMinPoint\",\n value: function getMinPoint() {\n return _getMinPoint(this.bounds);\n }\n }, {\n key: \"getMaxPoint\",\n value: function getMaxPoint() {\n return _getMaxPoint(this.bounds);\n }\n }, {\n key: \"getXRange\",\n value: function getXRange() {\n return _getXRange(this.bounds);\n }\n }, {\n key: \"getYRange\",\n value: function getYRange() {\n return _getYRange(this.bounds);\n }\n }, {\n key: \"getZRange\",\n value: function getZRange() {\n return _getZRange(this.bounds);\n }\n }, {\n key: \"getCorners\",\n value: function getCorners(corners) {\n return _getCorners(this.bounds, corners);\n }\n }, {\n key: \"computeCornerPoints\",\n value: function computeCornerPoints(point1, point2) {\n return _computeCornerPoints(this.bounds, point1, point2);\n }\n }, {\n key: \"computeLocalBounds\",\n value: function computeLocalBounds(u, v, w) {\n return _computeLocalBounds(this.bounds, u, v, w);\n }\n }, {\n key: \"computeScale3\",\n value: function computeScale3(scale3) {\n return _computeScale(this.bounds, scale3);\n }\n }, {\n key: \"cutWithPlane\",\n value: function cutWithPlane(origin, normal) {\n return _cutWithPlane(this.bounds, origin, normal);\n }\n }, {\n key: \"intersectBox\",\n value: function intersectBox(origin, dir, coord, tolerance) {\n return _intersectBox(this.bounds, origin, dir, coord, tolerance);\n }\n }, {\n key: \"intersectPlane\",\n value: function intersectPlane(origin, normal) {\n return _intersectPlane(this.bounds, origin, normal);\n }\n }, {\n key: \"intersect\",\n value: function intersect(otherBounds) {\n return _intersect(this.bounds, otherBounds);\n }\n }, {\n key: \"intersects\",\n value: function intersects(otherBounds) {\n return _intersects(this.bounds, otherBounds);\n }\n }, {\n key: \"containsPoint\",\n value: function containsPoint(x, y, z) {\n return _containsPoint(this.bounds, x, y, z);\n }\n }, {\n key: \"contains\",\n value: function contains(otherBounds) {\n return _intersects(this.bounds, otherBounds);\n }\n }]);\n\n return BoundingBox;\n}();\n\nfunction newInstance(initialValues) {\n var bounds = initialValues && initialValues.bounds;\n return new BoundingBox(bounds);\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n equals: _equals,\n isValid: _isValid,\n setBounds: _setBounds,\n reset: _reset,\n addPoint: _addPoint,\n addBounds: _addBounds,\n setMinPoint: _setMinPoint,\n setMaxPoint: _setMaxPoint,\n inflate: _inflate,\n scale: _scale,\n getCenter: _getCenter,\n getLength: _getLength,\n getLengths: _getLengths,\n getMaxLength: _getMaxLength,\n getDiagonalLength: _getDiagonalLength,\n getMinPoint: _getMinPoint,\n getMaxPoint: _getMaxPoint,\n getXRange: _getXRange,\n getYRange: _getYRange,\n getZRange: _getZRange,\n getCorners: _getCorners,\n computeCornerPoints: _computeCornerPoints,\n computeLocalBounds: _computeLocalBounds,\n computeScale3: _computeScale,\n cutWithPlane: _cutWithPlane,\n intersectBox: _intersectBox,\n intersectPlane: _intersectPlane,\n intersect: _intersect,\n intersects: _intersects,\n containsPoint: _containsPoint,\n contains: contains,\n INIT_BOUNDS: INIT_BOUNDS\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/Cell/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/Cell/index.js ***! - \********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Points__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Points */ \"./node_modules/vtk.js/Sources/Common/Core/Points/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkCell methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCell(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCell');\n\n publicAPI.initialize = function (points) {\n var pointIdsList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (!pointIdsList) {\n model.points = points;\n model.pointsIds = new Array(points.getNumberOfPoints());\n\n for (var i = points.getNumberOfPoints() - 1; i >= 0; --i) {\n model.pointsIds[i] = i;\n }\n } else {\n model.pointsIds = pointIdsList;\n var triangleData = model.points.getData();\n\n if (triangleData.length !== 3 * model.pointsIds.length) {\n triangleData = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newTypedArray(points.getDataType(), 3 * model.pointsIds.length);\n }\n\n var pointsData = points.getData();\n model.pointsIds.forEach(function (pointId, index) {\n // const start = 3 * pointId;\n // pointsData.set(p.subarray(start, start + 3), 3 * index);\n var pointOffset = 3 * pointId;\n var trianglePointOffset = 3 * index;\n triangleData[trianglePointOffset] = pointsData[pointOffset];\n triangleData[++trianglePointOffset] = pointsData[++pointOffset];\n triangleData[++trianglePointOffset] = pointsData[++pointOffset];\n });\n model.points.setData(triangleData);\n }\n };\n\n publicAPI.getBounds = function () {\n var nbPoints = model.points.getNumberOfPoints();\n var x = [];\n\n if (nbPoints) {\n model.points.getPoint(0, x);\n model.bounds[0] = x[0];\n model.bounds[1] = x[0];\n model.bounds[2] = x[1];\n model.bounds[3] = x[1];\n model.bounds[4] = x[2];\n model.bounds[5] = x[2];\n\n for (var i = 1; i < nbPoints; i++) {\n model.points.getPoint(i, x);\n model.bounds[0] = x[0] < model.bounds[0] ? x[0] : model.bounds[0];\n model.bounds[1] = x[0] > model.bounds[1] ? x[0] : model.bounds[1];\n model.bounds[2] = x[1] < model.bounds[2] ? x[1] : model.bounds[2];\n model.bounds[3] = x[1] > model.bounds[3] ? x[1] : model.bounds[3];\n model.bounds[4] = x[2] < model.bounds[4] ? x[2] : model.bounds[4];\n model.bounds[5] = x[2] > model.bounds[5] ? x[2] : model.bounds[5];\n }\n } else {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"uninitializeBounds\"](model.bounds);\n }\n\n return model.bounds;\n };\n\n publicAPI.getLength2 = function () {\n publicAPI.getBounds();\n var length = 0.0;\n var diff = 0;\n\n for (var i = 0; i < 3; i++) {\n diff = model.bounds[2 * i + 1] - model.bounds[2 * i];\n length += diff * diff;\n }\n\n return length;\n };\n\n publicAPI.getParametricDistance = function (pcoords) {\n var pDist;\n var pDistMax = 0.0;\n\n for (var i = 0; i < 3; i++) {\n if (pcoords[i] < 0.0) {\n pDist = -pcoords[i];\n } else if (pcoords[i] > 1.0) {\n pDist = pcoords[i] - 1.0;\n } else {\n // inside the cell in the parametric direction\n pDist = 0.0;\n }\n\n if (pDist > pDistMax) {\n pDistMax = pDist;\n }\n }\n\n return pDistMax;\n };\n\n publicAPI.getNumberOfPoints = function () {\n return model.points.getNumberOfPoints();\n };\n\n publicAPI.deepCopy = function (cell) {\n cell.initialize(model.points, model.pointsIds);\n };\n\n publicAPI.getCellDimension = function () {}; // virtual\n\n\n publicAPI.intersectWithLine = function (p1, p2, tol, t, x, pcoords, subId) {}; // virtual\n\n\n publicAPI.evaluatePosition = function (x, closestPoint, subId, pcoords, dist2, weights) {}; // virtual\n\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bounds: [-1, -1, -1, -1, -1, -1],\n pointsIds: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n\n if (!model.points) {\n model.points = vtk_js_Sources_Common_Core_Points__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['points', 'pointsIds']);\n vtkCell(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkCell'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/Cell/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/CellLinks/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/CellLinks/index.js ***! - \*************************************************************************/ -/*! exports provided: InitLink, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InitLink\", function() { return InitLink; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Cell */ \"./node_modules/vtk.js/Sources/Common/DataModel/Cell/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nvar InitLink = {\n ncells: 0,\n cells: null\n};\n\nfunction resize(model, sz) {\n var newSize = sz;\n\n if (sz >= model.array.length) {\n newSize += model.array.length;\n }\n\n while (newSize > model.array.length) {\n model.array.push({\n ncells: 0,\n cells: null\n });\n }\n\n model.array.length = newSize;\n} // ----------------------------------------------------------------------------\n// vtkCellLinks methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkCellLinks(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCellLinks');\n /**\n * Build the link list array. All subclasses of vtkAbstractCellLinks\n * must support this method.\n */\n\n publicAPI.buildLinks = function (data) {\n var numPts = data.getPoints().getNumberOfPoints();\n var numCells = data.getNumberOfCells(); // fill out lists with number of references to cells\n\n var linkLoc = new Uint32Array(numPts); // Use fast path if polydata\n\n if (data.isA('vtkPolyData')) {\n // traverse data to determine number of uses of each point\n for (var cellId = 0; cellId < numCells; ++cellId) {\n var _data$getCellPoints = data.getCellPoints(cellId),\n cellPointIds = _data$getCellPoints.cellPointIds;\n\n cellPointIds.forEach(function (cellPointId) {\n publicAPI.incrementLinkCount(cellPointId);\n });\n } // now allocate storage for the links\n\n\n publicAPI.allocateLinks(numPts);\n model.maxId = numPts - 1;\n\n var _loop = function _loop(_cellId) {\n var _data$getCellPoints2 = data.getCellPoints(_cellId),\n cellPointIds = _data$getCellPoints2.cellPointIds;\n\n cellPointIds.forEach(function (cellPointId) {\n publicAPI.insertCellReference(cellPointId, linkLoc[cellPointId]++, _cellId);\n });\n };\n\n for (var _cellId = 0; _cellId < numCells; ++_cellId) {\n _loop(_cellId);\n }\n } // any other type of dataset\n else {\n // traverse data to determine number of uses of each point\n for (var _cellId2 = 0; _cellId2 < numCells; _cellId2++) {\n // TODO: Currently not supported: const cell = data.getCell(cellId);\n var cell = vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n cell.getPointsIds().forEach(function (cellPointId) {\n publicAPI.incrementLinkCount(cellPointId);\n });\n } // now allocate storage for the links\n\n\n publicAPI.allocateLinks(numPts);\n model.maxId = numPts - 1;\n\n var _loop2 = function _loop2(_cellId3) {\n // TODO: Currently not supported: const cell = data.getCell(cellId);\n var cell = vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n cell.getPointsIds().forEach(function (cellPointId) {\n publicAPI.insertCellReference(cellPointId, linkLoc[cellPointId]++, _cellId3);\n });\n };\n\n for (var _cellId3 = 0; _cellId3 < numCells; ++_cellId3) {\n _loop2(_cellId3);\n }\n } // end else\n\n };\n /**\n * Build the link list array with a provided connectivity array.\n */\n // publicAPI.buildLinks = (data, connectivity) => {};\n\n /**\n * Allocate the specified number of links (i.e., number of points) that\n * will be built.\n */\n\n\n publicAPI.allocate = function (numLinks) {\n var ext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n model.array = Array(numLinks).fill().map(function () {\n return {\n ncells: 0,\n cells: null\n };\n });\n model.extend = ext;\n model.maxId = -1;\n };\n\n publicAPI.initialize = function () {\n model.array = null;\n };\n /**\n * Get a link structure given a point id.\n */\n\n\n publicAPI.getLink = function (ptId) {\n return model.array[ptId];\n };\n /**\n * Get the number of cells using the point specified by ptId.\n */\n\n\n publicAPI.getNcells = function (ptId) {\n return model.array[ptId].ncells;\n };\n /**\n * Return a list of cell ids using the point.\n */\n\n\n publicAPI.getCells = function (ptId) {\n return model.array[ptId].cells;\n };\n /**\n * Insert a new point into the cell-links data structure. The size parameter\n * is the initial size of the list.\n */\n\n\n publicAPI.insertNextPoint = function (numLinks) {\n model.array.push({\n ncells: numLinks,\n cells: Array(numLinks)\n });\n ++model.maxId;\n };\n /**\n * Insert a cell id into the list of cells (at the end) using the cell id\n * provided. (Make sure to extend the link list (if necessary) using the\n * method resizeCellList().)\n */\n\n\n publicAPI.insertNextCellReference = function (ptId, cellId) {\n model.array[ptId].cells[model.array[ptId].ncells++] = cellId;\n };\n /**\n * Delete point (and storage) by destroying links to using cells.\n */\n\n\n publicAPI.deletePoint = function (ptId) {\n model.array[ptId].ncells = 0;\n model.array[ptId].cells = null;\n };\n /**\n * Delete the reference to the cell (cellId) from the point (ptId). This\n * removes the reference to the cellId from the cell list, but does not\n * resize the list (recover memory with resizeCellList(), if necessary).\n */\n\n\n publicAPI.removeCellReference = function (cellId, ptId) {\n model.array[ptId].cells = model.array[ptId].cells.filter(function (cell) {\n return cell !== cellId;\n });\n model.array[ptId].ncells = model.array[ptId].cells.length;\n };\n /**\n * Add the reference to the cell (cellId) from the point (ptId). This\n * adds a reference to the cellId from the cell list, but does not resize\n * the list (extend memory with resizeCellList(), if necessary).\n */\n\n\n publicAPI.addCellReference = function (cellId, ptId) {\n model.array[ptId].cells[model.array[ptId].ncells++] = cellId;\n };\n /**\n * Change the length of a point's link list (i.e., list of cells using a\n * point) by the size specified.\n */\n\n\n publicAPI.resizeCellList = function (ptId, size) {\n model.array[ptId].cells.length = size;\n };\n /**\n * Reclaim any unused memory.\n */\n\n\n publicAPI.squeeze = function () {\n resize(model, model.maxId + 1);\n };\n /**\n * Reset to a state of no entries without freeing the memory.\n */\n\n\n publicAPI.reset = function () {\n model.maxId = -1;\n };\n /**\n * Standard DeepCopy method. Since this object contains no reference\n * to other objects, there is no ShallowCopy.\n */\n\n\n publicAPI.deepCopy = function (src) {\n model.array = _toConsumableArray(src.array);\n model.extend = src.extend;\n model.maxId = src.maxId;\n };\n /**\n * Increment the count of the number of cells using the point.\n */\n\n\n publicAPI.incrementLinkCount = function (ptId) {\n ++model.array[ptId].ncells;\n };\n\n publicAPI.allocateLinks = function (n) {\n for (var i = 0; i < n; ++i) {\n model.array[i].cells = new Array(model.array[i].ncells);\n }\n };\n /**\n * Insert a cell id into the list of cells using the point.\n */\n\n\n publicAPI.insertCellReference = function (ptId, pos, cellId) {\n model.array[ptId].cells[pos] = cellId;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n array: null,\n // pointer to data\n maxId: 0,\n // maximum index inserted thus far\n extend: 0 // grow array by this point\n\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtkCellLinks(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkCellLinks'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/CellLinks/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/Constants.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/Constants.js ***! - \*****************************************************************************/ -/*! exports provided: CellType, CellTypesStrings, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CellType\", function() { return CellType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CellTypesStrings\", function() { return CellTypesStrings; });\nvar CellType = {\n // Linear cells\n VTK_EMPTY_CELL: 0,\n VTK_VERTEX: 1,\n VTK_POLY_VERTEX: 2,\n VTK_LINE: 3,\n VTK_POLY_LINE: 4,\n VTK_TRIANGLE: 5,\n VTK_TRIANGLE_STRIP: 6,\n VTK_POLYGON: 7,\n VTK_PIXEL: 8,\n VTK_QUAD: 9,\n VTK_TETRA: 10,\n VTK_VOXEL: 11,\n VTK_HEXAHEDRON: 12,\n VTK_WEDGE: 13,\n VTK_PYRAMID: 14,\n VTK_PENTAGONAL_PRISM: 15,\n VTK_HEXAGONAL_PRISM: 16,\n // Quadratic, isoparametric cells\n VTK_QUADRATIC_EDGE: 21,\n VTK_QUADRATIC_TRIANGLE: 22,\n VTK_QUADRATIC_QUAD: 23,\n VTK_QUADRATIC_POLYGON: 36,\n VTK_QUADRATIC_TETRA: 24,\n VTK_QUADRATIC_HEXAHEDRON: 25,\n VTK_QUADRATIC_WEDGE: 26,\n VTK_QUADRATIC_PYRAMID: 27,\n VTK_BIQUADRATIC_QUAD: 28,\n VTK_TRIQUADRATIC_HEXAHEDRON: 29,\n VTK_QUADRATIC_LINEAR_QUAD: 30,\n VTK_QUADRATIC_LINEAR_WEDGE: 31,\n VTK_BIQUADRATIC_QUADRATIC_WEDGE: 32,\n VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON: 33,\n VTK_BIQUADRATIC_TRIANGLE: 34,\n // Cubic, isoparametric cell\n VTK_CUBIC_LINE: 35,\n // Special class of cells formed by convex group of points\n VTK_CONVEX_POINT_SET: 41,\n // Polyhedron cell (consisting of polygonal faces)\n VTK_POLYHEDRON: 42,\n // Higher order cells in parametric form\n VTK_PARAMETRIC_CURVE: 51,\n VTK_PARAMETRIC_SURFACE: 52,\n VTK_PARAMETRIC_TRI_SURFACE: 53,\n VTK_PARAMETRIC_QUAD_SURFACE: 54,\n VTK_PARAMETRIC_TETRA_REGION: 55,\n VTK_PARAMETRIC_HEX_REGION: 56,\n // Higher order cells\n VTK_HIGHER_ORDER_EDGE: 60,\n VTK_HIGHER_ORDER_TRIANGLE: 61,\n VTK_HIGHER_ORDER_QUAD: 62,\n VTK_HIGHER_ORDER_POLYGON: 63,\n VTK_HIGHER_ORDER_TETRAHEDRON: 64,\n VTK_HIGHER_ORDER_WEDGE: 65,\n VTK_HIGHER_ORDER_PYRAMID: 66,\n VTK_HIGHER_ORDER_HEXAHEDRON: 67,\n // Arbitrary order Lagrange elements (formulated separated from generic higher order cells)\n VTK_LAGRANGE_CURVE: 68,\n VTK_LAGRANGE_TRIANGLE: 69,\n VTK_LAGRANGE_QUADRILATERAL: 70,\n VTK_LAGRANGE_TETRAHEDRON: 71,\n VTK_LAGRANGE_HEXAHEDRON: 72,\n VTK_LAGRANGE_WEDGE: 73,\n VTK_LAGRANGE_PYRAMID: 74,\n VTK_NUMBER_OF_CELL_TYPES: 75\n}; // This list should contain the cell class names in\n// the same order as in CellType.\n\nvar CellTypesStrings = ['vtkEmptyCell', 'vtkVertex', 'vtkPolyVertex', 'vtkLine', 'vtkPolyLine', 'vtkTriangle', 'vtkTriangleStrip', 'vtkPolygon', 'vtkPixel', 'vtkQuad', 'vtkTetra', 'vtkVoxel', 'vtkHexahedron', 'vtkWedge', 'vtkPyramid', 'vtkPentagonalPrism', 'vtkHexagonalPrism', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'vtkQuadraticEdge', 'vtkQuadraticTriangle', 'vtkQuadraticQuad', 'vtkQuadraticTetra', 'vtkQuadraticHexahedron', 'vtkQuadraticWedge', 'vtkQuadraticPyramid', 'vtkBiQuadraticQuad', 'vtkTriQuadraticHexahedron', 'vtkQuadraticLinearQuad', 'vtkQuadraticLinearWedge', 'vtkBiQuadraticQuadraticWedge', 'vtkBiQuadraticQuadraticHexahedron', 'vtkBiQuadraticTriangle', 'vtkCubicLine', 'vtkQuadraticPolygon', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'vtkConvexPointSet', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'vtkParametricCurve', 'vtkParametricSurface', 'vtkParametricTriSurface', 'vtkParametricQuadSurface', 'vtkParametricTetraRegion', 'vtkParametricHexRegion', 'UnknownClass', 'UnknownClass', 'UnknownClass', 'vtkHigherOrderEdge', 'vtkHigherOrderTriangle', 'vtkHigherOrderQuad', 'vtkHigherOrderPolygon', 'vtkHigherOrderTetrahedron', 'vtkHigherOrderWedge', 'vtkHigherOrderPyramid', 'vtkHigherOrderHexahedron'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n CellType: CellType,\n CellTypesStrings: CellTypesStrings\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/index.js ***! - \*************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/CellTypes/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\n/**\n * Given an int (as defined in vtkCellType.h) identifier for a class\n * return it's classname.\n */\n\nfunction getClassNameFromTypeId(typeId) {\n return typeId < vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellTypesStrings\"].length ? vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellTypesStrings\"][typeId] : 'UnknownClass';\n}\n/**\n * Given a data object classname, return it's int identified (as\n * defined in vtkCellType.h)\n */\n\n\nfunction getTypeIdFromClassName(cellTypeString) {\n return vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellTypesStrings\"].findIndex(cellTypeString);\n}\n/**\n * This convenience method is a fast check to determine if a cell type\n * represents a linear or nonlinear cell. This is generally much more\n * efficient than getting the appropriate vtkCell and checking its IsLinear\n * method.\n */\n\n\nfunction isLinear(type) {\n return type < vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellType\"].VTK_QUADRATIC_EDGE || type === vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellType\"].VTK_CONVEX_POINT_SET || type === vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellType\"].VTK_POLYHEDRON;\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n getClassNameFromTypeId: getClassNameFromTypeId,\n getTypeIdFromClassName: getTypeIdFromClassName,\n isLinear: isLinear\n}; // ----------------------------------------------------------------------------\n// vtkCellTypes methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCellTypes(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCellTypes');\n /**\n * Allocate memory for this array. Delete old storage only if necessary.\n */\n\n publicAPI.allocate = function () {\n var sz = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 512;\n var ext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n model.size = sz > 0 ? sz : 1;\n model.extend = ext > 0 ? ext : 1;\n model.maxId = -1;\n model.typeArray = new Uint8Array(sz);\n model.locationArray = new Uint32Array(sz);\n };\n /**\n * Add a cell at specified id.\n */\n\n\n publicAPI.insertCell = function (cellId, type, loc) {\n model.typeArray[cellId] = type;\n model.locationArray[cellId] = loc;\n\n if (cellId > model.maxId) {\n model.maxId = cellId;\n }\n };\n /**\n * Add a cell to the object in the next available slot.\n */\n\n\n publicAPI.insertNextCell = function (type, loc) {\n publicAPI.insertCell(++model.maxId, type, loc);\n return model.maxId;\n };\n /**\n * Specify a group of cell types. This version is provided to maintain\n * backwards compatibility and does a copy of the cellLocations\n */\n\n\n publicAPI.setCellTypes = function (ncells, cellTypes, cellLocations) {\n model.size = ncells;\n model.typeArray = cellTypes;\n model.locationArray = cellLocations;\n model.maxId = ncells - 1;\n };\n /**\n * Return the location of the cell in the associated vtkCellArray.\n */\n\n\n publicAPI.getCellLocation = function (cellId) {\n return model.locationArray[cellId];\n };\n /**\n * Delete cell by setting to nullptr cell type.\n */\n\n\n publicAPI.deleteCell = function (cellId) {\n model.typeArray[cellId] = vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_1__[\"CellType\"].VTK_EMPTY_CELL;\n };\n /**\n * Return the number of types in the list.\n */\n\n\n publicAPI.getNumberOfTypes = function () {\n return model.maxId + 1;\n };\n /**\n * Return true if type specified is contained in list; false otherwise.\n */\n\n\n publicAPI.isType = function (type) {\n var numTypes = publicAPI.getNumberOfTypes();\n\n for (var i = 0; i < numTypes; ++i) {\n if (type === publicAPI.getCellType(i)) {\n return true;\n }\n }\n\n return false;\n };\n /**\n * Add the type specified to the end of the list. Range checking is performed.\n */\n\n\n publicAPI.insertNextType = function (type) {\n return publicAPI.insertNextCell(type, -1);\n };\n /**\n * Return the type of cell.\n */\n\n\n publicAPI.getCellType = function (cellId) {\n return model.typeArray[cellId];\n };\n /**\n * Reclaim any extra memory.\n */\n // TODO: publicAPI.squeeze = () => {};\n\n /**\n * Initialize object without releasing memory.\n */\n\n\n publicAPI.reset = function () {\n model.maxId = -1;\n };\n /**\n * Standard DeepCopy method. Since this object contains no reference\n * to other objects, there is no ShallowCopy.\n */\n\n\n publicAPI.deepCopy = function (src) {\n publicAPI.allocate(src.getSize(), src.getExtend());\n model.typeArray.set(src.getTypeArray());\n model.locationArray.set(src.getLocationArray());\n model.maxId = src.getMaxId();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n // typeArray: null, // pointer to types array\n // locationArray: null; // pointer to array of offsets\n size: 0,\n // allocated size of data\n maxId: -1,\n // maximum index inserted thus far\n extend: 1000 // grow array by this point\n\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['size', 'maxId', 'extend']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['typeArray', 'locationArray']);\n vtkCellTypes(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkCellTypes'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/DataSet/Constants.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/DataSet/Constants.js ***! - \***************************************************************************/ -/*! exports provided: FieldDataTypes, FieldAssociations, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FieldDataTypes\", function() { return FieldDataTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FieldAssociations\", function() { return FieldAssociations; });\n// Specify how data arrays can be used by data objects\nvar FieldDataTypes = {\n UNIFORM: 0,\n // data that does not vary over points/cells/etc.\n DATA_OBJECT_FIELD: 0,\n // to match VTK\n COORDINATE: 1,\n // data that specifies the location of each point\n POINT_DATA: 1,\n // to match VTK\n POINT: 2,\n // data defined at each point, but that does not specify the point location\n POINT_FIELD_DATA: 2,\n // to match VTK\n CELL: 3,\n // data defined at each cell, but that does not specify the cell\n CELL_FIELD_DATA: 3,\n // to match VTK\n VERTEX: 4,\n // data defined at each graph vertex, but that does not specify the graph vertex\n VERTEX_FIELD_DATA: 4,\n // to match VTK\n EDGE: 5,\n // data defined at each graph edge, but that does not specify the graph edge\n EDGE_FIELD_DATA: 5,\n // to match VTK\n ROW: 6,\n // data specifying a table row\n ROW_DATA: 6 // to match VTK\n\n};\nvar FieldAssociations = {\n FIELD_ASSOCIATION_POINTS: 0,\n FIELD_ASSOCIATION_CELLS: 1,\n FIELD_ASSOCIATION_NONE: 2,\n FIELD_ASSOCIATION_POINTS_THEN_CELLS: 3,\n FIELD_ASSOCIATION_VERTICES: 4,\n FIELD_ASSOCIATION_EDGES: 5,\n FIELD_ASSOCIATION_ROWS: 6,\n NUMBER_OF_ASSOCIATIONS: 7\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n FieldDataTypes: FieldDataTypes,\n FieldAssociations: FieldAssociations\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/DataSet/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js ***! - \***********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/vtk */ \"./node_modules/vtk.js/Sources/vtk.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSetAttributes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSetAttributes */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSet_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSet/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSet/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n // import vtkBoundingBox from '../BoundingBox';\n// import * as vtkMath from '../../Core/Math';\n//\n// function getBounds(dataset) {\n// if (dataset.bounds) {\n// return dataset.bounds;\n// }\n// if (dataset.type && dataset[dataset.type]) {\n// const ds = dataset[dataset.type];\n// if (ds.bounds) {\n// return ds.bounds;\n// }\n// if (ds.Points && ds.Points.bounds) {\n// return ds.Points.bounds;\n// }\n// if (ds.Points && ds.Points.values) {\n// const array = ds.Points.values;\n// const bbox = [...vtkBoundingBox.INIT_BOUNDS];\n// const size = array.length;\n// const delta = ds.Points.numberOfComponents ? ds.Points.numberOfComponents : 3;\n// for (let idx = 0; idx < size; idx += delta) {\n// vtkBoundingBox.addPoint(bbox, array[idx * delta], array[(idx * delta) + 1], array[(idx * delta) + 2]);\n// }\n// ds.Points.bounds = bbox;\n// return ds.Points.bounds;\n// }\n// }\n// return vtkMath.createUninitializedBounds();\n// }\n// ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nvar DATASET_FIELDS = ['pointData', 'cellData', 'fieldData']; // ----------------------------------------------------------------------------\n// vtkDataSet methods\n// ----------------------------------------------------------------------------\n\nfunction vtkDataSet(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkDataSet'); // Add dataset attributes\n\n DATASET_FIELDS.forEach(function (fieldName) {\n if (!model[fieldName]) {\n model[fieldName] = vtk_js_Sources_Common_DataModel_DataSetAttributes__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n } else {\n model[fieldName] = Object(vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(model[fieldName]);\n }\n });\n var superShallowCopy = publicAPI.shallowCopy;\n\n publicAPI.shallowCopy = function (other) {\n var debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n superShallowCopy(other, debug);\n DATASET_FIELDS.forEach(function (fieldName) {\n model[fieldName] = vtk_js_Sources_Common_DataModel_DataSetAttributes__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model[fieldName].shallowCopy(other.getReferenceByName(fieldName));\n });\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {// pointData: null,\n // cellData: null,\n // fieldData: null,\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, DATASET_FIELDS); // Object specific methods\n\n vtkDataSet(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkDataSet'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Common_DataModel_DataSet_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/Constants.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/Constants.js ***! - \*************************************************************************************/ -/*! exports provided: AttributeTypes, AttributeLimitTypes, CellGhostTypes, PointGhostTypes, AttributeCopyOperations, ghostArrayName, DesiredOutputPrecision, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AttributeTypes\", function() { return AttributeTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AttributeLimitTypes\", function() { return AttributeLimitTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CellGhostTypes\", function() { return CellGhostTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PointGhostTypes\", function() { return PointGhostTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AttributeCopyOperations\", function() { return AttributeCopyOperations; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ghostArrayName\", function() { return ghostArrayName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DesiredOutputPrecision\", function() { return DesiredOutputPrecision; });\nvar AttributeTypes = {\n SCALARS: 0,\n VECTORS: 1,\n NORMALS: 2,\n TCOORDS: 3,\n TENSORS: 4,\n GLOBALIDS: 5,\n PEDIGREEIDS: 6,\n EDGEFLAG: 7,\n NUM_ATTRIBUTES: 8\n};\nvar AttributeLimitTypes = {\n MAX: 0,\n EXACT: 1,\n NOLIMIT: 2\n};\nvar CellGhostTypes = {\n DUPLICATECELL: 1,\n // the cell is present on multiple processors\n HIGHCONNECTIVITYCELL: 2,\n // the cell has more neighbors than in a regular mesh\n LOWCONNECTIVITYCELL: 4,\n // the cell has less neighbors than in a regular mesh\n REFINEDCELL: 8,\n // other cells are present that refines it.\n EXTERIORCELL: 16,\n // the cell is on the exterior of the data set\n HIDDENCELL: 32 // the cell is needed to maintain connectivity, but the data values should be ignored.\n\n};\nvar PointGhostTypes = {\n DUPLICATEPOINT: 1,\n // the cell is present on multiple processors\n HIDDENPOINT: 2 // the point is needed to maintain connectivity, but the data values should be ignored.\n\n};\nvar AttributeCopyOperations = {\n COPYTUPLE: 0,\n INTERPOLATE: 1,\n PASSDATA: 2,\n ALLCOPY: 3 // all of the above\n\n};\nvar ghostArrayName = 'vtkGhostType';\nvar DesiredOutputPrecision = {\n DEFAULT: 0,\n // use the point type that does not truncate any data\n SINGLE: 1,\n // use Float32Array\n DOUBLE: 2 // use Float64Array\n\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n AttributeCopyOperations: AttributeCopyOperations,\n AttributeLimitTypes: AttributeLimitTypes,\n AttributeTypes: AttributeTypes,\n CellGhostTypes: CellGhostTypes,\n DesiredOutputPrecision: DesiredOutputPrecision,\n PointGhostTypes: PointGhostTypes,\n ghostArrayName: ghostArrayName\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/FieldData.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/FieldData.js ***! - \*************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/vtk */ \"./node_modules/vtk.js/Sources/vtk.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkFieldData methods\n// ----------------------------------------------------------------------------\n\nfunction vtkFieldData(publicAPI, model) {\n model.classHierarchy.push('vtkFieldData');\n var superGetState = publicAPI.getState; // Decode serialized data if any\n\n if (model.arrays) {\n model.arrays = model.arrays.map(function (item) {\n return {\n data: Object(vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(item.data)\n };\n });\n }\n\n publicAPI.initialize = function () {\n publicAPI.initializeFields();\n publicAPI.copyAllOn();\n publicAPI.clearFieldFlags();\n };\n\n publicAPI.initializeFields = function () {\n model.arrays = [];\n model.copyFieldFlags = {};\n publicAPI.modified();\n };\n\n publicAPI.copyStructure = function (other) {\n publicAPI.initializeFields();\n model.copyFieldFlags = other.getCopyFieldFlags().map(function (x) {\n return x;\n }); // Deep-copy\n\n model.arrays = other.arrays().map(function (x) {\n return {\n array: x\n };\n }); // Deep-copy\n // TODO: Copy array information objects (once we support information objects)\n };\n\n publicAPI.getNumberOfArrays = function () {\n return model.arrays.length;\n };\n\n publicAPI.getNumberOfActiveArrays = function () {\n return model.arrays.length;\n };\n\n publicAPI.addArray = function (arr) {\n model.arrays = [].concat(model.arrays, {\n data: arr\n });\n return model.arrays.length - 1;\n };\n\n publicAPI.removeAllArrays = function () {\n model.arrays = [];\n };\n\n publicAPI.removeArray = function (arrayName) {\n model.arrays = model.arrays.filter(function (entry) {\n return arrayName !== entry.data.getName();\n });\n };\n\n publicAPI.removeArrayByIndex = function (arrayIdx) {\n model.arrays = model.arrays.filter(function (entry, idx) {\n return idx !== arrayIdx;\n });\n };\n\n publicAPI.getArrays = function () {\n return model.arrays.map(function (entry) {\n return entry.data;\n });\n };\n\n publicAPI.getArray = function (arraySpec) {\n return typeof arraySpec === 'number' ? publicAPI.getArrayByIndex(arraySpec) : publicAPI.getArrayByName(arraySpec);\n };\n\n publicAPI.getArrayByName = function (arrayName) {\n return model.arrays.reduce(function (a, b, i) {\n return b.data.getName() === arrayName ? b.data : a;\n }, null);\n };\n\n publicAPI.getArrayWithIndex = function (arrayName) {\n return model.arrays.reduce(function (a, b, i) {\n return b.data && b.data.getName() === arrayName ? {\n array: b.data,\n index: i\n } : a;\n }, {\n array: null,\n index: -1\n });\n };\n\n publicAPI.getArrayByIndex = function (idx) {\n return idx >= 0 && idx < model.arrays.length ? model.arrays[idx].data : null;\n };\n\n publicAPI.hasArray = function (arrayName) {\n return publicAPI.getArrayWithIndex(arrayName).index >= 0;\n };\n\n publicAPI.getArrayName = function (idx) {\n var arr = model.arrays[idx];\n return arr ? arr.data.getName() : '';\n };\n\n publicAPI.getCopyFieldFlags = function () {\n return model.copyFieldFlags;\n };\n\n publicAPI.getFlag = function (arrayName) {\n return model.copyFieldFlags[arrayName];\n };\n\n publicAPI.passData = function (other) {\n var fromId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;\n var toId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;\n other.getArrays().forEach(function (arr) {\n var copyFlag = publicAPI.getFlag(arr.getName());\n\n if (copyFlag !== false && !(model.doCopyAllOff && copyFlag !== true) && arr) {\n var destArr = publicAPI.getArrayByName(arr.getName());\n\n if (!destArr) {\n if (fromId < 0 || fromId > arr.getNumberOfTuples()) {\n publicAPI.addArray(arr);\n } else {\n var ncomps = arr.getNumberOfComponents();\n var newSize = arr.getNumberOfValues();\n var tId = toId > -1 ? toId : fromId;\n\n if (newSize < tId * ncomps) {\n newSize = (tId + 1) * ncomps;\n }\n\n destArr = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n name: arr.getName(),\n dataType: arr.getDataType(),\n numberOfComponents: arr.getNumberOfComponents(),\n size: newSize\n });\n destArr.setTuple(tId, arr.getTuple(fromId));\n publicAPI.addArray(destArr);\n }\n } else if (arr.getNumberOfComponents() === destArr.getNumberOfComponents()) {\n if (fromId > -1 && fromId < arr.getNumberOfTuples()) {\n var _tId = toId > -1 ? toId : fromId;\n\n destArr.setTuple(_tId, arr.getTuple(fromId));\n } else {\n // if fromId and not provided, just copy all (or as much possible)\n // of arr to destArr.\n for (var i = 0; i < arr.getNumberOfTuples(); ++i) {\n destArr.setTuple(i, arr.getTuple(i));\n }\n }\n }\n }\n });\n };\n\n publicAPI.copyFieldOn = function (arrayName) {\n model.copyFieldFlags[arrayName] = true;\n };\n\n publicAPI.copyFieldOff = function (arrayName) {\n model.copyFieldFlags[arrayName] = false;\n };\n\n publicAPI.copyAllOn = function () {\n if (!model.doCopyAllOn || model.doCopyAllOff) {\n model.doCopyAllOn = true;\n model.doCopyAllOff = false;\n publicAPI.modified();\n }\n };\n\n publicAPI.copyAllOff = function () {\n if (model.doCopyAllOn || !model.doCopyAllOff) {\n model.doCopyAllOn = false;\n model.doCopyAllOff = true;\n publicAPI.modified();\n }\n };\n\n publicAPI.clearFieldFlags = function () {\n model.copyFieldFlags = {};\n };\n\n publicAPI.deepCopy = function (other) {\n model.arrays = other.getArrays().map(function (arr) {\n var arrNew = arr.newClone();\n arrNew.deepCopy(arr);\n return {\n data: arrNew\n };\n });\n };\n\n publicAPI.copyFlags = function (other) {\n return other.getCopyFieldFlags().map(function (x) {\n return x;\n });\n }; // TODO: publicAPI.squeeze = () => model.arrays.forEach(entry => entry.data.squeeze());\n\n\n publicAPI.reset = function () {\n return model.arrays.forEach(function (entry) {\n return entry.data.reset();\n });\n }; // TODO: getActualMemorySize\n\n\n publicAPI.getMTime = function () {\n return model.arrays.reduce(function (a, b) {\n return b.data.getMTime() > a ? b.data.getMTime() : a;\n }, model.mtime);\n }; // TODO: publicAPI.getField = (ids, other) => { copy ids from other into this model's arrays }\n // TODO: publicAPI.getArrayContainingComponent = (component) => ...\n\n\n publicAPI.getNumberOfComponents = function () {\n return model.arrays.reduce(function (a, b) {\n return a + b.data.getNumberOfComponents();\n }, 0);\n };\n\n publicAPI.getNumberOfTuples = function () {\n return model.arrays.length > 0 ? model.arrays[0].getNumberOfTuples() : 0;\n };\n\n publicAPI.getState = function () {\n var result = superGetState();\n result.arrays = model.arrays.map(function (item) {\n return {\n data: item.data.getState()\n };\n });\n return result;\n };\n}\n\nvar DEFAULT_VALUES = {\n arrays: [],\n copyFieldFlags: [],\n // fields not to copy\n doCopyAllOn: true,\n doCopyAllOff: false\n};\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(publicAPI, model);\n vtkFieldData(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkFieldData'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/FieldData.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/index.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/index.js ***! - \*********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSetAttributes_FieldData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSetAttributes/FieldData */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/FieldData.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSetAttributes_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSetAttributes/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\nvar AttributeTypes = vtk_js_Sources_Common_DataModel_DataSetAttributes_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].AttributeTypes,\n AttributeCopyOperations = vtk_js_Sources_Common_DataModel_DataSetAttributes_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].AttributeCopyOperations;\nvar vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkWarningMacro; // ----------------------------------------------------------------------------\n// vtkDataSetAttributes methods\n// ----------------------------------------------------------------------------\n\nfunction vtkDataSetAttributes(publicAPI, model) {\n var attrTypes = ['Scalars', 'Vectors', 'Normals', 'TCoords', 'Tensors', 'GlobalIds', 'PedigreeIds'];\n\n function cleanAttributeType(attType) {\n // Given an integer or string, convert the result to one of the\n // strings in the \"attrTypes\" array above or null (if\n // no match is found)\n var cleanAttType = attrTypes.find(function (ee) {\n return AttributeTypes[ee.toUpperCase()] === attType || typeof attType !== 'number' && ee.toLowerCase() === attType.toLowerCase();\n });\n\n if (typeof cleanAttType === 'undefined') {\n cleanAttType = null;\n }\n\n return cleanAttType;\n } // Set our className\n\n\n model.classHierarchy.push('vtkDataSetAttributes');\n\n publicAPI.checkNumberOfComponents = function (x) {\n return true;\n }; // TODO\n\n\n publicAPI.setAttribute = function (arr, uncleanAttType) {\n var attType = cleanAttributeType(uncleanAttType);\n\n if (arr && attType.toUpperCase() === 'PEDIGREEIDS' && !arr.isA('vtkDataArray')) {\n vtkWarningMacro(\"Cannot set attribute \".concat(attType, \". The attribute must be a vtkDataArray.\"));\n return -1;\n }\n\n if (arr && !publicAPI.checkNumberOfComponents(arr, attType)) {\n vtkWarningMacro(\"Cannot set attribute \".concat(attType, \". Incorrect number of components.\"));\n return -1;\n }\n\n var currentAttribute = model[\"active\".concat(attType)];\n\n if (currentAttribute >= 0 && currentAttribute < model.arrays.length) {\n if (model.arrays[currentAttribute] === arr) {\n return currentAttribute;\n }\n\n publicAPI.removeArrayByIndex(currentAttribute);\n }\n\n if (arr) {\n currentAttribute = publicAPI.addArray(arr);\n model[\"active\".concat(attType)] = currentAttribute;\n } else {\n model[\"active\".concat(attType)] = -1;\n }\n\n publicAPI.modified();\n return model[\"active\".concat(attType)];\n };\n\n publicAPI.setActiveAttributeByName = function (arrayName, attType) {\n return publicAPI.setActiveAttributeByIndex(publicAPI.getArrayWithIndex(arrayName).index, attType);\n };\n\n publicAPI.setActiveAttributeByIndex = function (arrayIdx, uncleanAttType) {\n var attType = cleanAttributeType(uncleanAttType);\n\n if (arrayIdx >= 0 && arrayIdx < model.arrays.length) {\n if (attType.toUpperCase() !== 'PEDIGREEIDS') {\n var arr = publicAPI.getArrayByIndex(arrayIdx);\n\n if (!arr.isA('vtkDataArray')) {\n vtkWarningMacro(\"Cannot set attribute \".concat(attType, \". Only vtkDataArray subclasses can be set as active attributes.\"));\n return -1;\n }\n\n if (!publicAPI.checkNumberOfComponents(arr, attType)) {\n vtkWarningMacro(\"Cannot set attribute \".concat(attType, \". Incorrect number of components.\"));\n return -1;\n }\n }\n\n model[\"active\".concat(attType)] = arrayIdx;\n publicAPI.modified();\n return arrayIdx;\n }\n\n if (arrayIdx === -1) {\n model[\"active\".concat(attType)] = arrayIdx;\n publicAPI.modified();\n }\n\n return -1;\n };\n\n publicAPI.getActiveAttribute = function (attType) {\n // Given an integer enum value or a string (with random capitalization),\n // find the matching string in attrTypes.\n var cleanAttType = cleanAttributeType(attType);\n return publicAPI[\"get\".concat(cleanAttType)]();\n }; // Override to allow proper handling of active attributes\n\n\n publicAPI.removeAllArrays = function () {\n model.arrays = [];\n attrTypes.forEach(function (attType) {\n model[\"active\".concat(attType)] = -1;\n });\n }; // Override to allow proper handling of active attributes\n\n\n publicAPI.removeArray = function (arrayName) {\n model.arrays = model.arrays.filter(function (entry, idx) {\n if (arrayName === entry.data.getName()) {\n // Found the array to remove, but is it an active attribute?\n attrTypes.forEach(function (attType) {\n if (idx === model[\"active\".concat(attType)]) {\n model[\"active\".concat(attType)] = -1;\n }\n });\n return false;\n }\n\n return true;\n });\n }; // Override to allow proper handling of active attributes\n\n\n publicAPI.removeArrayByIndex = function (arrayIdx) {\n model.arrays = model.arrays.filter(function (entry, idx) {\n return idx !== arrayIdx;\n });\n attrTypes.forEach(function (attType) {\n if (arrayIdx === model[\"active\".concat(attType)]) {\n model[\"active\".concat(attType)] = -1;\n }\n });\n };\n\n attrTypes.forEach(function (value) {\n var activeVal = \"active\".concat(value);\n\n publicAPI[\"get\".concat(value)] = function () {\n return publicAPI.getArrayByIndex(model[activeVal]);\n };\n\n publicAPI[\"set\".concat(value)] = function (da) {\n return publicAPI.setAttribute(da, value);\n };\n\n publicAPI[\"setActive\".concat(value)] = function (arrayName) {\n return publicAPI.setActiveAttributeByIndex(publicAPI.getArrayWithIndex(arrayName).index, value);\n };\n\n publicAPI[\"copy\".concat(value, \"Off\")] = function () {\n var attType = value.toUpperCase();\n model.copyAttributeFlags[AttributeCopyOperations.PASSDATA][AttributeTypes[attType]] = false;\n };\n });\n\n publicAPI.initializeAttributeCopyFlags = function () {\n // Default to copying all attributes in every circumstance:\n model.copyAttributeFlags = [];\n Object.keys(AttributeCopyOperations).filter(function (op) {\n return op !== 'ALLCOPY';\n }).forEach(function (attCopyOp) {\n model.copyAttributeFlags[AttributeCopyOperations[attCopyOp]] = Object.keys(AttributeTypes).filter(function (ty) {\n return ty !== 'NUM_ATTRIBUTES';\n }).reduce(function (a, b) {\n a[AttributeTypes[b]] = true;\n return a;\n }, []);\n }); // Override some operations where we don't want to copy:\n\n model.copyAttributeFlags[AttributeCopyOperations.COPYTUPLE][AttributeTypes.GLOBALIDS] = false;\n model.copyAttributeFlags[AttributeCopyOperations.INTERPOLATE][AttributeTypes.GLOBALIDS] = false;\n model.copyAttributeFlags[AttributeCopyOperations.COPYTUPLE][AttributeTypes.PEDIGREEIDS] = false;\n };\n\n publicAPI.initialize = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.initialize, publicAPI.initializeAttributeCopyFlags); // Process dataArrays if any\n\n if (model.dataArrays && Object.keys(model.dataArrays).length) {\n Object.keys(model.dataArrays).forEach(function (name) {\n if (!model.dataArrays[name].ref && model.dataArrays[name].type === 'vtkDataArray') {\n publicAPI.addArray(vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance(model.dataArrays[name]));\n }\n });\n }\n\n var superShallowCopy = publicAPI.shallowCopy;\n\n publicAPI.shallowCopy = function (other, debug) {\n superShallowCopy(other, debug);\n model.arrays = other.getArrays().map(function (arr) {\n var arrNew = arr.newClone();\n arrNew.shallowCopy(arr, debug);\n return {\n data: arrNew\n };\n });\n };\n\n publicAPI.initializeAttributeCopyFlags();\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n activeScalars: -1,\n activeVectors: -1,\n activeTensors: -1,\n activeNormals: -1,\n activeTCoords: -1,\n activeGlobalIds: -1,\n activePedigreeIds: -1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_Common_DataModel_DataSetAttributes_FieldData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['activeScalars', 'activeNormals', 'activeTCoords', 'activeVectors', 'activeTensors', 'activeGlobalIds', 'activePedigreeIds']);\n\n if (!model.arrays) {\n model.arrays = {};\n } // Object specific methods\n\n\n vtkDataSetAttributes(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkDataSetAttributes'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Common_DataModel_DataSetAttributes_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/DataSetAttributes/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/ImageData/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/ImageData/index.js ***! - \*************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSet */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_StructuredData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/StructuredData */ \"./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/StructuredData/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/Constants.js\");\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkImageData methods\n// ----------------------------------------------------------------------------\n\nfunction vtkImageData(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkImageData');\n\n publicAPI.setExtent = function () {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return false;\n }\n\n for (var _len = arguments.length, inExtent = new Array(_len), _key = 0; _key < _len; _key++) {\n inExtent[_key] = arguments[_key];\n }\n\n var extentArray = inExtent.length === 1 ? inExtent[0] : inExtent;\n\n if (extentArray.length !== 6) {\n return false;\n }\n\n var changeDetected = false;\n model.extent.forEach(function (item, index) {\n if (item !== extentArray[index]) {\n if (changeDetected) {\n return;\n }\n\n changeDetected = true;\n }\n });\n\n if (changeDetected) {\n model.extent = extentArray.slice();\n model.dataDescription = vtk_js_Sources_Common_DataModel_StructuredData__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getDataDescriptionFromExtent(model.extent);\n publicAPI.modified();\n }\n\n return changeDetected;\n };\n\n publicAPI.setDimensions = function () {\n var i;\n var j;\n var k;\n\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n\n if (arguments.length === 1) {\n var array = arguments.length <= 0 ? undefined : arguments[0];\n i = array[0];\n j = array[1];\n k = array[2];\n } else if (arguments.length === 3) {\n i = arguments.length <= 0 ? undefined : arguments[0];\n j = arguments.length <= 1 ? undefined : arguments[1];\n k = arguments.length <= 2 ? undefined : arguments[2];\n } else {\n vtkErrorMacro('Bad dimension specification');\n return;\n }\n\n publicAPI.setExtent(0, i - 1, 0, j - 1, 0, k - 1);\n };\n\n publicAPI.getDimensions = function () {\n return [model.extent[1] - model.extent[0] + 1, model.extent[3] - model.extent[2] + 1, model.extent[5] - model.extent[4] + 1];\n };\n\n publicAPI.getNumberOfCells = function () {\n var dims = publicAPI.getDimensions();\n var nCells = 1;\n\n for (var i = 0; i < 3; i++) {\n if (dims[i] === 0) {\n return 0;\n }\n\n if (dims[i] > 1) {\n nCells *= dims[i] - 1;\n }\n }\n\n return nCells;\n };\n\n publicAPI.getNumberOfPoints = function () {\n var dims = publicAPI.getDimensions();\n return dims[0] * dims[1] * dims[2];\n };\n\n publicAPI.getPoint = function (index) {\n var dims = publicAPI.getDimensions();\n\n if (dims[0] === 0 || dims[1] === 0 || dims[2] === 0) {\n vtkErrorMacro('Requesting a point from an empty image.');\n return null;\n }\n\n var ijk = new Float64Array(3);\n\n switch (model.dataDescription) {\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].EMPTY:\n return null;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].SINGLE_POINT:\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].X_LINE:\n ijk[0] = index;\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].Y_LINE:\n ijk[1] = index;\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].Z_LINE:\n ijk[2] = index;\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].XY_PLANE:\n ijk[0] = index % dims[0];\n ijk[1] = index / dims[0];\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].YZ_PLANE:\n ijk[1] = index % dims[1];\n ijk[2] = index / dims[1];\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].XZ_PLANE:\n ijk[0] = index % dims[0];\n ijk[2] = index / dims[0];\n break;\n\n case vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].XYZ_GRID:\n ijk[0] = index % dims[0];\n ijk[1] = index / dims[0] % dims[1];\n ijk[2] = index / (dims[0] * dims[1]);\n break;\n\n default:\n vtkErrorMacro('Invalid dataDescription');\n break;\n }\n\n var coords = [0, 0, 0];\n publicAPI.indexToWorld(ijk, coords);\n return coords;\n }; // vtkCell *GetCell(vtkIdType cellId) VTK_OVERRIDE;\n // void GetCell(vtkIdType cellId, vtkGenericCell *cell) VTK_OVERRIDE;\n // void GetCellBounds(vtkIdType cellId, double bounds[6]) VTK_OVERRIDE;\n // virtual vtkIdType FindPoint(double x, double y, double z)\n // {\n // return this->vtkDataSet::FindPoint(x, y, z);\n // }\n // vtkIdType FindPoint(double x[3]) VTK_OVERRIDE;\n // vtkIdType FindCell(\n // double x[3], vtkCell *cell, vtkIdType cellId, double tol2,\n // int& subId, double pcoords[3], double *weights) VTK_OVERRIDE;\n // vtkIdType FindCell(\n // double x[3], vtkCell *cell, vtkGenericCell *gencell,\n // vtkIdType cellId, double tol2, int& subId,\n // double pcoords[3], double *weights) VTK_OVERRIDE;\n // vtkCell *FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId,\n // double tol2, int& subId, double pcoords[3],\n // double *weights) VTK_OVERRIDE;\n // int GetCellType(vtkIdType cellId) VTK_OVERRIDE;\n // void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) VTK_OVERRIDE\n // {vtkStructuredData::GetCellPoints(cellId,ptIds,this->DataDescription,\n // this->GetDimensions());}\n // void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) VTK_OVERRIDE\n // {vtkStructuredData::GetPointCells(ptId,cellIds,this->GetDimensions());}\n // void ComputeBounds() VTK_OVERRIDE;\n // int GetMaxCellSize() VTK_OVERRIDE {return 8;}; //voxel is the largest\n\n\n publicAPI.getBounds = function () {\n return publicAPI.extentToBounds(model.extent);\n };\n\n publicAPI.extentToBounds = function (ex) {\n // prettier-ignore\n var corners = [ex[0], ex[2], ex[4], ex[1], ex[2], ex[4], ex[0], ex[3], ex[4], ex[1], ex[3], ex[4], ex[0], ex[2], ex[5], ex[1], ex[2], ex[5], ex[0], ex[3], ex[5], ex[1], ex[3], ex[5]];\n var idx = new Float64Array([corners[0], corners[1], corners[2]]);\n var vout = new Float64Array(3);\n publicAPI.indexToWorld(idx, vout);\n var bounds = [vout[0], vout[0], vout[1], vout[1], vout[2], vout[2]];\n\n for (var i = 3; i < 24; i += 3) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].set(idx, corners[i], corners[i + 1], corners[i + 2]);\n publicAPI.indexToWorld(idx, vout);\n\n if (vout[0] < bounds[0]) {\n bounds[0] = vout[0];\n }\n\n if (vout[1] < bounds[2]) {\n bounds[2] = vout[1];\n }\n\n if (vout[2] < bounds[4]) {\n bounds[4] = vout[2];\n }\n\n if (vout[0] > bounds[1]) {\n bounds[1] = vout[0];\n }\n\n if (vout[1] > bounds[3]) {\n bounds[3] = vout[1];\n }\n\n if (vout[2] > bounds[5]) {\n bounds[5] = vout[2];\n }\n }\n\n return bounds;\n }; // Internal, shouldn't need to call this manually.\n\n\n publicAPI.computeTransforms = function () {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].fromTranslation(model.indexToWorld, model.origin);\n model.indexToWorld[0] = model.direction[0];\n model.indexToWorld[1] = model.direction[1];\n model.indexToWorld[2] = model.direction[2];\n model.indexToWorld[4] = model.direction[3];\n model.indexToWorld[5] = model.direction[4];\n model.indexToWorld[6] = model.direction[5];\n model.indexToWorld[8] = model.direction[6];\n model.indexToWorld[9] = model.direction[7];\n model.indexToWorld[10] = model.direction[8];\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].scale(model.indexToWorld, model.indexToWorld, model.spacing);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].invert(model.worldToIndex, model.indexToWorld);\n }; //\n // The direction matrix is a 3x3 basis for the I, J, K axes\n // of the image. The rows of the matrix correspond to the\n // axes directions in world coordinates. Direction must\n // form an orthonormal basis, results are undefined if\n // it is not.\n //\n\n\n publicAPI.setDirection = function () {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return false;\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var array = args; // allow an array passed as a single arg.\n\n if (array.length === 1 && (Array.isArray(array[0]) || array[0].constructor === Float32Array || array[0].constructor === Float64Array)) {\n array = array[0];\n }\n\n if (array.length !== 9) {\n throw new RangeError('Invalid number of values for array setter');\n }\n\n var changeDetected = false;\n model.direction.forEach(function (item, index) {\n if (item !== array[index]) {\n if (changeDetected) {\n return;\n }\n\n changeDetected = true;\n }\n });\n\n if (changeDetected) {\n for (var i = 0; i < 9; ++i) {\n model.direction[i] = array[i];\n }\n\n publicAPI.modified();\n }\n\n return true;\n };\n\n publicAPI.indexToWorld = function (ain) {\n var aout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(aout, ain, model.indexToWorld);\n return aout;\n };\n\n publicAPI.indexToWorldVec3 = publicAPI.indexToWorld;\n\n publicAPI.worldToIndex = function (ain) {\n var aout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(aout, ain, model.worldToIndex);\n return aout;\n };\n\n publicAPI.worldToIndexVec3 = publicAPI.worldToIndex;\n\n publicAPI.indexToWorldBounds = function (bin) {\n var bout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var in1 = [0, 0, 0];\n var in2 = [0, 0, 0];\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].computeCornerPoints(bin, in1, in2);\n var out1 = [0, 0, 0];\n var out2 = [0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(out1, in1, model.indexToWorld);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(out2, in2, model.indexToWorld);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"computeBoundsFromPoints\"](out1, out2, bout);\n return bout;\n };\n\n publicAPI.worldToIndexBounds = function (bin) {\n var bout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var in1 = [0, 0, 0];\n var in2 = [0, 0, 0];\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].computeCornerPoints(bin, in1, in2);\n var out1 = [0, 0, 0];\n var out2 = [0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(out1, in1, model.worldToIndex);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(out2, in2, model.worldToIndex);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"computeBoundsFromPoints\"](out1, out2, bout);\n return bout;\n }; // Make sure the transform is correct\n\n\n publicAPI.onModified(publicAPI.computeTransforms);\n publicAPI.computeTransforms();\n\n publicAPI.getCenter = function () {\n var bounds = publicAPI.getBounds();\n var center = [];\n\n for (var i = 0; i < 3; i++) {\n center[i] = (bounds[2 * i + 1] + bounds[2 * i]) / 2;\n }\n\n return center;\n };\n\n publicAPI.computeHistogram = function (worldBounds) {\n var voxelFunc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var bounds = [0, 0, 0, 0, 0, 0];\n publicAPI.worldToIndexBounds(worldBounds, bounds);\n var point1 = [0, 0, 0];\n var point2 = [0, 0, 0];\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].computeCornerPoints(bounds, point1, point2);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"roundVector\"](point1, point1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"roundVector\"](point2, point2);\n var dimensions = publicAPI.getDimensions();\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"clampVector\"](point1, [0, 0, 0], [dimensions[0] - 1, dimensions[1] - 1, dimensions[2] - 1], point1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"clampVector\"](point2, [0, 0, 0], [dimensions[0] - 1, dimensions[1] - 1, dimensions[2] - 1], point2);\n var yStride = dimensions[0];\n var zStride = dimensions[0] * dimensions[1];\n var pixels = publicAPI.getPointData().getScalars().getData();\n var maximum = -Infinity;\n var minimum = Infinity;\n var sumOfSquares = 0;\n var isum = 0;\n var inum = 0;\n\n for (var z = point1[2]; z <= point2[2]; z++) {\n for (var y = point1[1]; y <= point2[1]; y++) {\n var index = point1[0] + y * yStride + z * zStride;\n\n for (var x = point1[0]; x <= point2[0]; x++) {\n if (!voxelFunc || voxelFunc([x, y, z], bounds)) {\n var pixel = pixels[index];\n if (pixel > maximum) maximum = pixel;\n if (pixel < minimum) minimum = pixel;\n sumOfSquares += pixel * pixel;\n isum += pixel;\n inum += 1;\n }\n\n ++index;\n }\n }\n }\n\n var average = inum > 0 ? isum / inum : 0;\n var variance = sumOfSquares - average * average;\n var sigma = Math.sqrt(variance);\n return {\n minimum: minimum,\n maximum: maximum,\n average: average,\n variance: variance,\n sigma: sigma\n };\n }; // TODO: use the unimplemented `vtkDataSetAttributes` for scalar length, that is currently also a TODO (GetNumberOfComponents).\n // Scalar data could be tuples for color information?\n\n\n publicAPI.computeIncrements = function (extent) {\n var numberOfComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var increments = [];\n var incr = numberOfComponents; // Calculate array increment offsets\n // similar to c++ vtkImageData::ComputeIncrements\n\n for (var idx = 0; idx < 3; ++idx) {\n increments[idx] = incr;\n incr *= extent[idx * 2 + 1] - extent[idx * 2] + 1;\n }\n\n return increments;\n };\n /**\n * @param {Number[]} index the localized `[i,j,k]` pixel array position. Float values will be rounded.\n * @return {Number} the corresponding flattened index in the scalar array\n */\n\n\n publicAPI.computeOffsetIndex = function (_ref) {\n var _ref2 = _slicedToArray(_ref, 3),\n i = _ref2[0],\n j = _ref2[1],\n k = _ref2[2];\n\n var extent = publicAPI.getExtent();\n var numberOfComponents = publicAPI.getPointData().getScalars().getNumberOfComponents();\n var increments = publicAPI.computeIncrements(extent, numberOfComponents); // Use the array increments to find the pixel index\n // similar to c++ vtkImageData::GetArrayPointer\n // Math.floor to catch \"practically 0\" e^-15 scenarios.\n\n return Math.floor((Math.round(i) - extent[0]) * increments[0] + (Math.round(j) - extent[2]) * increments[1] + (Math.round(k) - extent[4]) * increments[2]);\n };\n /**\n * @param {Number[]} xyz the [x,y,z] Array in world coordinates\n * @return {Number|NaN} the corresponding pixel's index in the scalar array\n */\n\n\n publicAPI.getOffsetIndexFromWorld = function (xyz) {\n var extent = publicAPI.getExtent();\n var index = publicAPI.worldToIndex(xyz); // Confirm indexed i,j,k coords are within the bounds of the volume\n\n for (var idx = 0; idx < 3; ++idx) {\n if (index[idx] < extent[idx * 2] || index[idx] > extent[idx * 2 + 1]) {\n vtkErrorMacro(\"GetScalarPointer: Pixel \".concat(index, \" is not in memory. Current extent = \").concat(extent));\n return NaN;\n }\n } // Assumed the index here is within 0 <-> scalarData.length, but doesn't hurt to check upstream\n\n\n return publicAPI.computeOffsetIndex(index);\n };\n /**\n * @param {Number[]} xyz the [x,y,z] Array in world coordinates\n * @param {Number?} comp the scalar component index for multi-component scalars\n * @return {Number|NaN} the corresponding pixel's scalar value\n */\n\n\n publicAPI.getScalarValueFromWorld = function (xyz) {\n var comp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var numberOfComponents = publicAPI.getPointData().getScalars().getNumberOfComponents();\n\n if (comp < 0 || comp >= numberOfComponents) {\n vtkErrorMacro(\"GetScalarPointer: Scalar Component \".concat(comp, \" is not within bounds. Current Scalar numberOfComponents: \").concat(numberOfComponents));\n return NaN;\n }\n\n var offsetIndex = publicAPI.getOffsetIndexFromWorld(xyz);\n\n if (Number.isNaN(offsetIndex)) {\n // VTK Error Macro will have been tripped already, no need to do it again,\n return offsetIndex;\n }\n\n return publicAPI.getPointData().getScalars().getComponent(offsetIndex, comp);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n direction: null,\n // a mat3\n indexToWorld: null,\n // a mat4\n worldToIndex: null,\n // a mat4\n spacing: [1.0, 1.0, 1.0],\n origin: [0.0, 0.0, 0.0],\n extent: [0, -1, 0, -1, 0, -1],\n dataDescription: vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_5__[\"StructuredType\"].EMPTY\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues);\n\n if (!model.direction) {\n model.direction = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat3\"].identity(new Float64Array(9));\n } else if (Array.isArray(model.direction)) {\n model.direction = new Float64Array(model.direction.slice(0, 9));\n }\n\n model.indexToWorld = new Float64Array(16);\n model.worldToIndex = new Float64Array(16); // Set/Get methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['direction', 'indexToWorld', 'worldToIndex']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['origin', 'spacing'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['extent'], 6); // Object specific methods\n\n vtkImageData(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkImageData'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/ImageData/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/Line/Constants.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/Line/Constants.js ***! - \************************************************************************/ -/*! exports provided: IntersectionState, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IntersectionState\", function() { return IntersectionState; });\nvar IntersectionState = {\n NO_INTERSECTION: 0,\n YES_INTERSECTION: 1,\n ON_LINE: 2\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n IntersectionState: IntersectionState\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/Line/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/Line/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/Line/index.js ***! - \********************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Line_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Line/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/Line/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Cell */ \"./node_modules/vtk.js/Sources/Common/DataModel/Cell/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\nvar IntersectionState = vtk_js_Sources_Common_DataModel_Line_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].IntersectionState; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction distanceToLine(x, p1, p2) {\n var closestPoint = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n var outObj = {\n t: Number.MIN_VALUE,\n distance: 0\n };\n var p21 = [];\n var closest; // Determine appropriate vector\n\n p21[0] = p2[0] - p1[0];\n p21[1] = p2[1] - p1[1];\n p21[2] = p2[2] - p1[2]; // Get parametric location\n\n var num = p21[0] * (x[0] - p1[0]) + p21[1] * (x[1] - p1[1]) + p21[2] * (x[2] - p1[2]);\n var denom = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](p21, p21); // trying to avoid an expensive fabs\n\n var tolerance = 1e-5 * num;\n\n if (denom !== 0.0) {\n outObj.t = num / denom;\n }\n\n if (tolerance < 0.0) {\n tolerance = -tolerance;\n }\n\n if (-tolerance < denom && denom < tolerance) {\n closest = p1;\n } else if (denom <= 0.0 || outObj.t < 0.0) {\n // If parametric coordinate is within 0<=p<=1, then the point is closest to\n // the line. Otherwise, it's closest to a point at the end of the line.\n closest = p1;\n } else if (outObj.t > 1.0) {\n closest = p2;\n } else {\n closest = p21;\n p21[0] = p1[0] + outObj.t * p21[0];\n p21[1] = p1[1] + outObj.t * p21[1];\n p21[2] = p1[2] + outObj.t * p21[2];\n }\n\n if (closestPoint) {\n closestPoint[0] = closest[0];\n closestPoint[1] = closest[1];\n closestPoint[2] = closest[2];\n }\n\n outObj.distance = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"distance2BetweenPoints\"](closest, x);\n return outObj;\n}\n\nfunction intersection(a1, a2, b1, b2, u, v) {\n var a21 = [];\n var b21 = [];\n var b1a1 = [];\n u[0] = 0.0;\n v[0] = 0.0; // Determine line vectors.\n\n a21[0] = a2[0] - a1[0];\n a21[1] = a2[1] - a1[1];\n a21[2] = a2[2] - a1[2];\n b21[0] = b2[0] - b1[0];\n b21[1] = b2[1] - b1[1];\n b21[2] = b2[2] - b1[2];\n b1a1[0] = b1[0] - a1[0];\n b1a1[1] = b1[1] - a1[1];\n b1a1[2] = b1[2] - a1[2]; // Compute the system (least squares) matrix.\n\n var A = [];\n A[0] = [vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](a21, a21), -vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](a21, b21)];\n A[1] = [A[0][1], vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](b21, b21)]; // Compute the least squares system constant term.\n\n var c = [];\n c[0] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](a21, b1a1);\n c[1] = -vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](b21, b1a1); // Solve the system of equations\n\n if (vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"solveLinearSystem\"](A, c, 2) === 0) {\n // The lines are colinear. Therefore, one of the four endpoints is the\n // point of closest approach\n var minDist = Number.MAX_VALUE;\n var p = [a1, a2, b1, b2];\n var l1 = [b1, b1, a1, a1];\n var l2 = [b2, b2, a2, a2];\n var uv1 = [v[0], v[0], u[0], u[0]];\n var uv2 = [u[0], u[0], v[0], v[0]];\n var obj;\n\n for (var i = 0; i < 4; i++) {\n obj = distanceToLine(p[i], l1[i], l2[i]);\n\n if (obj.distance < minDist) {\n minDist = obj.distance;\n uv1[i] = obj.t;\n uv2[i] = i % 2;\n }\n }\n\n return IntersectionState.ON_LINE;\n }\n\n u[0] = c[0];\n v[0] = c[1]; // Check parametric coordinates for intersection.\n\n if (u[0] >= 0.0 && u[0] <= 1.0 && v[0] >= 0.0 && v[0] <= 1.0) {\n return IntersectionState.YES_INTERSECTION;\n }\n\n return IntersectionState.NO_INTERSECTION;\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n distanceToLine: distanceToLine,\n intersection: intersection\n}; // ----------------------------------------------------------------------------\n// vtkLine methods\n// ----------------------------------------------------------------------------\n\nfunction vtkLine(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkLine');\n\n function isBetweenPoints(t) {\n return t >= 0.0 && t <= 1.0;\n }\n\n publicAPI.getCellDimension = function () {\n return 1;\n };\n\n publicAPI.intersectWithLine = function (p1, p2, tol, x, pcoords) {\n var outObj = {\n intersect: 0,\n t: Number.MAX_VALUE,\n subId: 0,\n betweenPoints: null\n };\n pcoords[1] = 0.0;\n pcoords[2] = 0.0;\n var projXYZ = [];\n var a1 = [];\n var a2 = [];\n model.points.getPoint(0, a1);\n model.points.getPoint(1, a2);\n var u = [];\n var v = [];\n var intersect = intersection(p1, p2, a1, a2, u, v);\n outObj.t = u[0];\n outObj.betweenPoints = isBetweenPoints(outObj.t);\n pcoords[0] = v[0];\n\n if (intersect === IntersectionState.YES_INTERSECTION) {\n // make sure we are within tolerance\n for (var i = 0; i < 3; i++) {\n x[i] = a1[i] + pcoords[0] * (a2[i] - a1[i]);\n projXYZ[i] = p1[i] + outObj.t * (p2[i] - p1[i]);\n }\n\n if (vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"distance2BetweenPoints\"](x, projXYZ) <= tol * tol) {\n outObj.intersect = 1;\n return outObj;\n }\n } else {\n var outDistance; // check to see if it lies within tolerance\n // one of the parametric coords must be outside 0-1\n\n if (outObj.t < 0.0) {\n outDistance = distanceToLine(p1, a1, a2, x);\n\n if (outDistance.distance <= tol * tol) {\n outObj.t = 0.0;\n outObj.intersect = 1;\n outObj.betweenPoints = true; // Intersection is near p1\n\n return outObj;\n }\n\n return outObj;\n }\n\n if (outObj.t > 1.0) {\n outDistance = distanceToLine(p2, a1, a2, x);\n\n if (outDistance.distance <= tol * tol) {\n outObj.t = 1.0;\n outObj.intersect = 1;\n outObj.betweenPoints = true; // Intersection is near p2\n\n return outObj;\n }\n\n return outObj;\n }\n\n if (pcoords[0] < 0.0) {\n pcoords[0] = 0.0;\n outDistance = distanceToLine(a1, p1, p2, x);\n outObj.t = outDistance.t;\n\n if (outDistance.distance <= tol * tol) {\n outObj.intersect = 1;\n return outObj;\n }\n\n return outObj;\n }\n\n if (pcoords[0] > 1.0) {\n pcoords[0] = 1.0;\n outDistance = distanceToLine(a2, p1, p2, x);\n outObj.t = outDistance.t;\n\n if (outDistance.distance <= tol * tol) {\n outObj.intersect = 1;\n return outObj;\n }\n\n return outObj;\n }\n }\n\n return outObj;\n };\n\n publicAPI.evaluatePosition = function (x, closestPoint, subId, pcoords, dist2, weights) {}; // virtual\n\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtkLine(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkLine'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread(_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC), vtk_js_Sources_Common_DataModel_Line_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/Line/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/PiecewiseFunction/index.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/PiecewiseFunction/index.js ***! - \*********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkPiecewiseFunction methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPiecewiseFunction(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPiecewiseFunction'); // Return the number of points which specify this function\n\n publicAPI.getSize = function () {\n return model.nodes.length;\n }; // Return the type of function stored in object:\n // Function Types:\n // 0 : Constant (No change in slope between end points)\n // 1 : NonDecreasing (Always increasing or zero slope)\n // 2 : NonIncreasing (Always decreasing or zero slope)\n // 3 : Varied (Contains both decreasing and increasing slopes)\n // 4 : Unknown (Error condition)\n //\n\n\n publicAPI.getType = function () {\n var value;\n var prevValue = 0.0;\n var functionType = 0;\n\n if (model.nodes.length > 0) {\n prevValue = model.nodes[0].y;\n }\n\n for (var i = 1; i < model.nodes.length; i++) {\n value = model.nodes[i].y; // Do not change the function type if equal\n\n if (value !== prevValue) {\n if (value > prevValue) {\n switch (functionType) {\n case 0:\n case 1:\n functionType = 1; // NonDecreasing\n\n break;\n\n default:\n case 2:\n functionType = 3; // Varied\n\n break;\n }\n } else {\n // value < prev_value\n switch (functionType) {\n case 0:\n case 2:\n functionType = 2; // NonIncreasing\n\n break;\n\n default:\n case 1:\n functionType = 3; // Varied\n\n break;\n }\n }\n }\n\n prevValue = value; // Exit loop if we find a Varied function\n\n if (functionType === 3) {\n break;\n }\n }\n\n switch (functionType) {\n case 0:\n return 'Constant';\n\n case 1:\n return 'NonDecreasing';\n\n case 2:\n return 'NonIncreasing';\n\n default:\n case 3:\n return 'Varied';\n }\n }; // Since we no longer store the data in an array, we must\n // copy out of the vector into an array. No modified check -\n // could be added if performance is a problem\n\n\n publicAPI.getDataPointer = function () {\n var size = model.nodes.length;\n model.function = null;\n\n if (size > 0) {\n model.function = [];\n\n for (var i = 0; i < size; i++) {\n model.function[2 * i] = model.nodes[i].x;\n model.function[2 * i + 1] = model.nodes[i].y;\n }\n }\n\n return model.function;\n }; // Returns the first point location which starts a non-zero segment of the\n // function. Note that the value at this point may be zero.\n\n\n publicAPI.getFirstNonZeroValue = function () {\n // Check if no points specified\n if (model.nodes.length === 0) {\n return 0;\n }\n\n var allZero = 1;\n var x = 0.0;\n var i = 0;\n\n for (; i < model.nodes.length; i++) {\n if (model.nodes[i].y !== 0.0) {\n allZero = 0;\n break;\n }\n } // If every specified point has a zero value then return\n // a large value\n\n\n if (allZero) {\n x = Number.MAX_VALUE;\n } else if (i > 0) {\n // A point was found with a non-zero value\n // Return the value of the point that precedes this one\n x = model.nodes[i - 1].x;\n } else if (model.clamping) {\n // If this is the first point in the function, return its\n // value is clamping is off, otherwise VTK_DOUBLE_MIN if\n // clamping is on.\n x = -Number.MAX_VALUE;\n } else {\n x = model.nodes[0].x;\n }\n\n return x;\n }; // For a specified index value, get the node parameters\n\n\n publicAPI.getNodeValue = function (index, val) {\n var size = model.nodes.length;\n\n if (index < 0 || index >= size) {\n vtkErrorMacro('Index out of range!');\n return -1;\n }\n\n val[0] = model.nodes[index].x;\n val[1] = model.nodes[index].y;\n val[2] = model.nodes[index].midpoint;\n val[3] = model.nodes[index].sharpness;\n return 1;\n }; // For a specified index value, get the node parameters\n\n\n publicAPI.setNodeValue = function (index, val) {\n var size = model.nodes.length;\n\n if (index < 0 || index >= size) {\n vtkErrorMacro('Index out of range!');\n return -1;\n }\n\n var oldX = model.nodes[index].x;\n model.nodes[index].x = val[0];\n model.nodes[index].y = val[1];\n model.nodes[index].midpoint = val[2];\n model.nodes[index].sharpness = val[3];\n\n if (oldX !== val[0]) {\n // The point has been moved, the order of points or the range might have\n // been modified.\n publicAPI.sortAndUpdateRange(); // No need to call Modified() here because SortAndUpdateRange() has done it\n // already.\n } else {\n publicAPI.modified();\n }\n\n return 1;\n }; // Adds a point to the function. If a duplicate point is inserted\n // then the function value at that location is set to the new value.\n // This is the legacy version that assumes midpoint = 0.5 and\n // sharpness = 0.0\n\n\n publicAPI.addPoint = function (x, y) {\n return publicAPI.addPointLong(x, y, 0.5, 0.0);\n }; // Adds a point to the function and returns the array index of the point.\n\n\n publicAPI.addPointLong = function (x, y, midpoint, sharpness) {\n // Error check\n if (midpoint < 0.0 || midpoint > 1.0) {\n vtkErrorMacro('Midpoint outside range [0.0, 1.0]');\n return -1;\n }\n\n if (sharpness < 0.0 || sharpness > 1.0) {\n vtkErrorMacro('Sharpness outside range [0.0, 1.0]');\n return -1;\n } // remove any node already at this X location\n\n\n if (!model.allowDuplicateScalars) {\n publicAPI.removePoint(x);\n } // Create the new node\n\n\n var node = {\n x: x,\n y: y,\n midpoint: midpoint,\n sharpness: sharpness\n }; // Add it, then sort to get everything in order\n\n model.nodes.push(node);\n publicAPI.sortAndUpdateRange(); // Now find this node so we can return the index\n\n var i;\n\n for (i = 0; i < model.nodes.length; i++) {\n if (model.nodes[i].x === x) {\n break;\n }\n } // If we didn't find it, something went horribly wrong so\n // return -1\n\n\n if (i < model.nodes.length) {\n return i;\n }\n\n return -1;\n };\n\n publicAPI.setNodes = function (nodes) {\n if (model.nodes !== nodes) {\n model.nodes = nodes;\n publicAPI.sortAndUpdateRange();\n }\n }; // Sort the vector in increasing order, then fill in\n // the Range\n\n\n publicAPI.sortAndUpdateRange = function () {\n model.nodes.sort(function (a, b) {\n return a.x - b.x;\n });\n var modifiedInvoked = publicAPI.updateRange(); // If range is updated, Modified() has been called, don't call it again.\n\n if (!modifiedInvoked) {\n publicAPI.modified();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.updateRange = function () {\n var oldRange = model.range.slice();\n var size = model.nodes.length;\n\n if (size) {\n model.range[0] = model.nodes[0].x;\n model.range[1] = model.nodes[size - 1].x;\n } else {\n model.range[0] = 0;\n model.range[1] = 0;\n } // If the rage is the same, then no need to call Modified()\n\n\n if (oldRange[0] === model.range[0] && oldRange[1] === model.range[1]) {\n return false;\n }\n\n publicAPI.modified();\n return true;\n }; // Removes a point from the function. If no point is found then function\n // remains the same.\n\n\n publicAPI.removePoint = function (x) {\n // First find the node since we need to know its\n // index as our return value\n var i;\n\n for (i = 0; i < model.nodes.length; i++) {\n if (model.nodes[i].x === x) {\n break;\n }\n } // If the node doesn't exist, we return -1\n\n\n if (i >= model.nodes.length) {\n return -1;\n }\n\n var retVal = i; // If the first or last point has been removed, then we update the range\n // No need to sort here as the order of points hasn't changed.\n\n var modifiedInvoked = false;\n model.nodes.splice(i, 1);\n\n if (i === 0 || i === model.nodes.length) {\n modifiedInvoked = publicAPI.updateRange();\n }\n\n if (!modifiedInvoked) {\n publicAPI.modified();\n }\n\n return retVal;\n }; // Removes all points from the function.\n\n\n publicAPI.removeAllPoints = function () {\n model.nodes = [];\n publicAPI.sortAndUpdateRange();\n }; // Add in end points of line and remove any points between them\n // Legacy method with no way to specify midpoint and sharpness\n\n\n publicAPI.addSegment = function (x1, y1, x2, y2) {\n // First, find all points in this range and remove them\n publicAPI.sortAndUpdateRange();\n\n for (var i = 0; i < model.nodes.length;) {\n if (model.nodes[i].x >= x1 && model.nodes[i].x <= x2) {\n model.nodes.splice(i, 1);\n } else {\n i++;\n }\n } // Now add the points\n\n\n publicAPI.addPoint(x1, y1, 0.5, 0.0);\n publicAPI.addPoint(x2, y2, 0.5, 0.0);\n }; // Return the value of the function at a position\n\n\n publicAPI.getValue = function (x) {\n var table = [];\n publicAPI.getTable(x, x, 1, table);\n return table[0];\n }; // Remove all points outside the range, and make sure a point\n // exists at each end of the range. Used as a convenience method\n // for transfer function editors\n\n\n publicAPI.adjustRange = function (range) {\n if (range.length < 2) {\n return 0;\n }\n\n var functionRange = publicAPI.getRange(); // Make sure we have points at each end of the range\n\n if (functionRange[0] < range[0]) {\n publicAPI.addPoint(range[0], publicAPI.getValue(range[0]));\n } else {\n publicAPI.addPoint(range[0], publicAPI.getValue(functionRange[0]));\n }\n\n if (functionRange[1] > range[1]) {\n publicAPI.addPoint(range[1], publicAPI.getValue(range[1]));\n } else {\n publicAPI.addPoint(range[1], publicAPI.getValue(functionRange[1]));\n } // Remove all points out-of-range\n\n\n publicAPI.sortAndUpdateRange();\n\n for (var i = 0; i < model.nodes.length;) {\n if (model.nodes[i].x >= range[0] && model.nodes[i].x <= range[1]) {\n model.nodes.splice(i, 1);\n } else {\n ++i;\n }\n }\n\n publicAPI.sortAndUpdateRange();\n return 1;\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.estimateMinNumberOfSamples = function (x1, x2) {\n var d = publicAPI.findMinimumXDistance();\n return Math.ceil((x2 - x1) / d);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.findMinimumXDistance = function () {\n var size = model.nodes.length;\n\n if (size < 2) {\n return -1.0;\n }\n\n var distance = model.nodes[1].x - model.nodes[0].x;\n\n for (var i = 0; i < size - 1; i++) {\n var currentDist = model.nodes[i + 1].x - model.nodes[i].x;\n\n if (currentDist < distance) {\n distance = currentDist;\n }\n }\n\n return distance;\n }; // Returns a table of function values evaluated at regular intervals\n\n /* eslint-disable prefer-destructuring */\n\n /* eslint-disable no-continue */\n\n\n publicAPI.getTable = function (xStart, xEnd, size, table) {\n var stride = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;\n var i;\n var idx = 0;\n var numNodes = model.nodes.length; // Need to keep track of the last value so that\n // we can fill in table locations past this with\n // this value if Clamping is On.\n\n var lastValue = 0.0;\n\n if (numNodes !== 0) {\n lastValue = model.nodes[numNodes - 1].y;\n }\n\n var x = 0.0;\n var x1 = 0.0;\n var x2 = 0.0;\n var y1 = 0.0;\n var y2 = 0.0;\n var midpoint = 0.0;\n var sharpness = 0.0; // For each table entry\n\n for (i = 0; i < size; i++) {\n // Find our location in the table\n var tidx = stride * i; // Find our X location. If we are taking only 1 sample, make\n // it halfway between start and end (usually start and end will\n // be the same in this case)\n\n if (size > 1) {\n x = xStart + i / (size - 1.0) * (xEnd - xStart);\n } else {\n x = 0.5 * (xStart + xEnd);\n } // Do we need to move to the next node?\n\n\n while (idx < numNodes && x > model.nodes[idx].x) {\n idx++; // If we are at a valid point index, fill in\n // the value at this node, and the one before (the\n // two that surround our current sample location)\n // idx cannot be 0 since we just incremented it.\n\n if (idx < numNodes) {\n x1 = model.nodes[idx - 1].x;\n x2 = model.nodes[idx].x;\n y1 = model.nodes[idx - 1].y;\n y2 = model.nodes[idx].y; // We only need the previous midpoint and sharpness\n // since these control this region\n\n midpoint = model.nodes[idx - 1].midpoint;\n sharpness = model.nodes[idx - 1].sharpness; // Move midpoint away from extreme ends of range to avoid\n // degenerate math\n\n if (midpoint < 0.00001) {\n midpoint = 0.00001;\n }\n\n if (midpoint > 0.99999) {\n midpoint = 0.99999;\n }\n }\n } // Are we at the end? If so, just use the last value\n\n\n if (idx >= numNodes) {\n table[tidx] = model.clamping ? lastValue : 0.0;\n } else if (idx === 0) {\n // Are we before the first node? If so, duplicate this nodes values\n table[tidx] = model.clamping ? model.nodes[0].y : 0.0;\n } else {\n // Otherwise, we are between two nodes - interpolate\n // Our first attempt at a normalized location [0,1] -\n // we will be modifying this based on midpoint and\n // sharpness to get the curve shape we want and to have\n // it pass through (y1+y2)/2 at the midpoint.\n var s = (x - x1) / (x2 - x1); // Readjust based on the midpoint - linear adjustment\n\n if (s < midpoint) {\n s = 0.5 * s / midpoint;\n } else {\n s = 0.5 + 0.5 * (s - midpoint) / (1.0 - midpoint);\n } // override for sharpness > 0.99\n // In this case we just want piecewise constant\n\n\n if (sharpness > 0.99) {\n // Use the first value since we are below the midpoint\n if (s < 0.5) {\n table[tidx] = y1;\n continue;\n } else {\n // Use the second value at or above the midpoint\n table[tidx] = y2;\n continue;\n }\n } // Override for sharpness < 0.01\n // In this case we want piecewise linear\n\n\n if (sharpness < 0.01) {\n // Simple linear interpolation\n table[tidx] = (1 - s) * y1 + s * y2;\n continue;\n } // We have a sharpness between [0.01, 0.99] - we will\n // used a modified hermite curve interpolation where we\n // derive the slope based on the sharpness, and we compress\n // the curve non-linearly based on the sharpness\n // First, we will adjust our position based on sharpness in\n // order to make the curve sharper (closer to piecewise constant)\n\n\n if (s < 0.5) {\n s = 0.5 * Math.pow(s * 2, 1.0 + 10 * sharpness);\n } else if (s > 0.5) {\n s = 1.0 - 0.5 * Math.pow((1.0 - s) * 2, 1 + 10 * sharpness);\n } // Compute some coefficients we will need for the hermite curve\n\n\n var ss = s * s;\n var sss = ss * s;\n var h1 = 2 * sss - 3 * ss + 1;\n var h2 = -2 * sss + 3 * ss;\n var h3 = sss - 2 * ss + s;\n var h4 = sss - ss; // Use one slope for both end points\n\n var slope = y2 - y1;\n var t = (1.0 - sharpness) * slope; // Compute the value\n\n table[tidx] = h1 * y1 + h2 * y2 + h3 * t + h4 * t; // Final error check to make sure we don't go outside\n // the Y range\n\n var min = y1 < y2 ? y1 : y2;\n var max = y1 > y2 ? y1 : y2;\n table[tidx] = table[tidx] < min ? min : table[tidx];\n table[tidx] = table[tidx] > max ? max : table[tidx];\n }\n }\n };\n}\n/* eslint-enable prefer-destructuring */\n\n/* eslint-enable no-continue */\n// ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n // model.function = NULL;\n range: [0, 0],\n clamping: true,\n allowDuplicateScalars: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Internal objects initialization\n\n model.nodes = []; // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['allowDuplicateScalars', 'clamping']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setArray(publicAPI, model, ['range'], 2); // Create get macros for array\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['range']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkPiecewiseFunction(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPiecewiseFunction'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/PiecewiseFunction/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js ***! - \*********************************************************************/ -/*! exports provided: STATIC, vtkPlane, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkPlane\", function() { return vtkPlane; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar PLANE_TOLERANCE = 1.0e-6;\nvar COINCIDE = 'coincide';\nvar DISJOINT = 'disjoint'; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction evaluate(normal, origin, x) {\n return normal[0] * (x[0] - origin[0]) + normal[1] * (x[1] - origin[1]) + normal[2] * (x[2] - origin[2]);\n}\n\nfunction distanceToPlane(x, origin, normal) {\n var distance = normal[0] * (x[0] - origin[0]) + normal[1] * (x[1] - origin[1]) + normal[2] * (x[2] - origin[2]);\n return Math.abs(distance);\n}\n\nfunction projectPoint(x, origin, normal, xproj) {\n var xo = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](x, origin, xo);\n var t = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](normal, xo);\n xproj[0] = x[0] - t * normal[0];\n xproj[1] = x[1] - t * normal[1];\n xproj[2] = x[2] - t * normal[2];\n}\n\nfunction projectVector(v, normal, vproj) {\n var t = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](v, normal);\n var n2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](normal, normal);\n\n if (n2 === 0) {\n n2 = 1.0;\n }\n\n vproj[0] = v[0] - t * normal[0] / n2;\n vproj[1] = v[1] - t * normal[1] / n2;\n vproj[2] = v[2] - t * normal[2] / n2;\n return vproj;\n}\n\nfunction generalizedProjectPoint(x, origin, normal, xproj) {\n var xo = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](x, origin, xo);\n var t = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](normal, xo);\n var n2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](normal, normal);\n\n if (n2 !== 0) {\n xproj[0] = x[0] - t * normal[0] / n2;\n xproj[1] = x[1] - t * normal[1] / n2;\n xproj[2] = x[2] - t * normal[2] / n2;\n } else {\n xproj[0] = x[0];\n xproj[1] = x[1];\n xproj[2] = x[2];\n }\n}\n\nfunction intersectWithLine(p1, p2, origin, normal) {\n var outObj = {\n intersection: false,\n betweenPoints: false,\n t: Number.MAX_VALUE,\n x: []\n };\n var p21 = [];\n var p1Origin = []; // Compute line vector\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](p2, p1, p21);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](origin, p1, p1Origin); // Compute denominator. If ~0, line and plane are parallel.\n // const num = vtkMath.dot(normal, origin) - vtkMath.dot(normal, p1);\n\n var num = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](normal, p1Origin);\n var den = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](normal, p21); // If denominator with respect to numerator is \"zero\", then the line and\n // plane are considered parallel.\n\n var fabsden;\n var fabstolerance; // Trying to avoid an expensive call to fabs()\n\n if (den < 0.0) {\n fabsden = -den;\n } else {\n fabsden = den;\n }\n\n if (num < 0.0) {\n fabstolerance = -num * PLANE_TOLERANCE;\n } else {\n fabstolerance = num * PLANE_TOLERANCE;\n }\n\n if (fabsden <= fabstolerance) {\n return outObj;\n } // Where on the line between p1 and p2 is the intersection\n // If between 0 and 1, it is between the two points. If < 0 it's before p1, if > 1 it's after p2\n\n\n outObj.t = num / den;\n outObj.x[0] = p1[0] + outObj.t * p21[0];\n outObj.x[1] = p1[1] + outObj.t * p21[1];\n outObj.x[2] = p1[2] + outObj.t * p21[2];\n outObj.intersection = true;\n outObj.betweenPoints = outObj.t >= 0.0 && outObj.t <= 1.0;\n return outObj;\n}\n\nfunction intersectWithPlane(plane1Origin, plane1Normal, plane2Origin, plane2Normal) {\n var outObj = {\n intersection: false,\n l0: [],\n l1: [],\n error: null\n };\n var cross = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"cross\"](plane1Normal, plane2Normal, cross);\n var absCross = cross.map(function (n) {\n return Math.abs(n);\n }); // test if the two planes are parallel\n\n if (absCross[0] + absCross[1] + absCross[2] < PLANE_TOLERANCE) {\n // test if disjoint or coincide\n var v = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](plane1Origin, plane2Origin, v);\n\n if (vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](plane1Normal, v) === 0) {\n outObj.error = COINCIDE;\n } else {\n outObj.error = DISJOINT;\n }\n\n return outObj;\n } // Plane1 and Plane2 intersect in a line\n // first determine max abs coordinate of the cross product\n\n\n var maxc;\n\n if (absCross[0] > absCross[1] && absCross[0] > absCross[2]) {\n maxc = 'x';\n } else if (absCross[1] > absCross[2]) {\n maxc = 'y';\n } else {\n maxc = 'z';\n } // To get a point on the intersect line, zero the max coord, and solve for the other two\n\n\n var iP = []; // intersectionPoint\n // the constants in the 2 plane equations\n\n var d1 = -vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](plane1Normal, plane1Origin);\n var d2 = -vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"dot\"](plane2Normal, plane2Origin); // eslint-disable-next-line default-case\n\n switch (maxc) {\n case 'x':\n // intersect with x=0\n iP[0] = 0;\n iP[1] = (d2 * plane1Normal[2] - d1 * plane2Normal[2]) / cross[0];\n iP[2] = (d1 * plane2Normal[1] - d2 * plane1Normal[1]) / cross[0];\n break;\n\n case 'y':\n // intersect with y=0\n iP[0] = (d1 * plane2Normal[2] - d2 * plane1Normal[2]) / cross[1];\n iP[1] = 0;\n iP[2] = (d2 * plane1Normal[0] - d1 * plane2Normal[0]) / cross[1];\n break;\n\n case 'z':\n // intersect with z=0\n iP[0] = (d2 * plane1Normal[1] - d1 * plane2Normal[1]) / cross[2];\n iP[1] = (d1 * plane2Normal[0] - d2 * plane1Normal[0]) / cross[2];\n iP[2] = 0;\n break;\n }\n\n outObj.l0 = iP;\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"add\"](iP, cross, outObj.l1);\n outObj.intersection = true;\n return outObj;\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n evaluate: evaluate,\n distanceToPlane: distanceToPlane,\n projectPoint: projectPoint,\n projectVector: projectVector,\n generalizedProjectPoint: generalizedProjectPoint,\n intersectWithLine: intersectWithLine,\n intersectWithPlane: intersectWithPlane,\n DISJOINT: DISJOINT,\n COINCIDE: COINCIDE\n}; // ----------------------------------------------------------------------------\n// vtkPlane methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPlane(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPlane');\n\n publicAPI.distanceToPlane = function (x) {\n return distanceToPlane(x, model.origin, model.normal);\n };\n\n publicAPI.projectPoint = function (x, xproj) {\n projectPoint(x, model.origin, model.normal, xproj);\n };\n\n publicAPI.projectVector = function (v, vproj) {\n return projectVector(v, model.normal, vproj);\n };\n\n publicAPI.push = function (distance) {\n if (distance === 0.0) {\n return;\n }\n\n for (var i = 0; i < 3; i++) {\n model.origin[i] += distance * model.normal[i];\n }\n };\n\n publicAPI.generalizedProjectPoint = function (x, xproj) {\n generalizedProjectPoint(x, model.origin, model.normal, xproj);\n };\n\n publicAPI.evaluateFunction = function (x, y, z) {\n if (!Array.isArray(x)) {\n return model.normal[0] * (x - model.origin[0]) + model.normal[1] * (y - model.origin[1]) + model.normal[2] * (z - model.origin[2]);\n }\n\n return model.normal[0] * (x[0] - model.origin[0]) + model.normal[1] * (x[1] - model.origin[1]) + model.normal[2] * (x[2] - model.origin[2]);\n };\n\n publicAPI.evaluateGradient = function (xyz) {\n var retVal = [model.normal[0], model.normal[1], model.normal[2]];\n return retVal;\n };\n\n publicAPI.intersectWithLine = function (p1, p2) {\n return intersectWithLine(p1, p2, model.origin, model.normal);\n };\n\n publicAPI.intersectWithPlane = function (planeOrigin, planeNormal) {\n return intersectWithPlane(planeOrigin, planeNormal, model.origin, model.normal);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\nvar DEFAULT_VALUES = {\n normal: [0.0, 0.0, 1.0],\n origin: [0.0, 0.0, 0.0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGetArray(publicAPI, model, ['normal', 'origin'], 3);\n vtkPlane(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkPlane'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/PointSet/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/PointSet/index.js ***! - \************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/vtk */ \"./node_modules/vtk.js/Sources/vtk.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSet */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Points__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Points */ \"./node_modules/vtk.js/Sources/Common/Core/Points/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n// ----------------------------------------------------------------------------\n// vtkPointSet methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPointSet(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPointSet'); // Create empty points\n\n if (!model.points) {\n model.points = vtk_js_Sources_Common_Core_Points__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n } else {\n model.points = Object(vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(model.points);\n }\n\n publicAPI.getNumberOfPoints = function () {\n return model.points.getNumberOfPoints();\n };\n\n publicAPI.getBounds = function () {\n return model.points.getBounds();\n };\n\n publicAPI.computeBounds = function () {\n publicAPI.getBounds();\n };\n\n var superShallowCopy = publicAPI.shallowCopy;\n\n publicAPI.shallowCopy = function (other) {\n var debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n superShallowCopy(other, debug);\n model.points = vtk_js_Sources_Common_Core_Points__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.points.shallowCopy(other.getPoints());\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {// points: null,\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['points']); // Object specific methods\n\n vtkPointSet(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkPointSet'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/PointSet/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/PolyData/Constants.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/PolyData/Constants.js ***! - \****************************************************************************/ -/*! exports provided: POLYDATA_FIELDS, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"POLYDATA_FIELDS\", function() { return POLYDATA_FIELDS; });\nvar POLYDATA_FIELDS = ['verts', 'lines', 'polys', 'strips'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n POLYDATA_FIELDS: POLYDATA_FIELDS\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/PolyData/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js ***! - \************************************************************************/ -/*! exports provided: CELL_FACTORY, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CELL_FACTORY\", function() { return CELL_FACTORY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/vtk */ \"./node_modules/vtk.js/Sources/vtk.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_CellArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/CellArray */ \"./node_modules/vtk.js/Sources/Common/Core/CellArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_CellLinks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/CellLinks */ \"./node_modules/vtk.js/Sources/Common/DataModel/CellLinks/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_CellTypes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/CellTypes */ \"./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Line */ \"./node_modules/vtk.js/Sources/Common/DataModel/Line/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PointSet__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PointSet */ \"./node_modules/vtk.js/Sources/Common/DataModel/PointSet/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Triangle__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Triangle */ \"./node_modules/vtk.js/Sources/Common/DataModel/Triangle/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/CellTypes/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/CellTypes/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData_Constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/Constants.js\");\nvar _CELL_FACTORY;\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n\n\n\n\n\nvar vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkWarningMacro;\nvar CELL_FACTORY = (_CELL_FACTORY = {}, _defineProperty(_CELL_FACTORY, vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_LINE, vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_5__[\"default\"]), _defineProperty(_CELL_FACTORY, vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLY_LINE, vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_5__[\"default\"]), _defineProperty(_CELL_FACTORY, vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_TRIANGLE, vtk_js_Sources_Common_DataModel_Triangle__WEBPACK_IMPORTED_MODULE_7__[\"default\"]), _CELL_FACTORY); // ----------------------------------------------------------------------------\n// vtkPolyData methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPolyData(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPolyData');\n\n function camelize(str) {\n return str.replace(/(?:^\\w|[A-Z]|\\b\\w)/g, function (letter) {\n return letter.toUpperCase();\n }).replace(/\\s+/g, '');\n } // build empty cell arrays and set methods\n\n\n vtk_js_Sources_Common_DataModel_PolyData_Constants__WEBPACK_IMPORTED_MODULE_9__[\"POLYDATA_FIELDS\"].forEach(function (type) {\n publicAPI[\"getNumberOf\".concat(camelize(type))] = function () {\n return model[type].getNumberOfCells();\n };\n\n if (!model[type]) {\n model[type] = vtk_js_Sources_Common_Core_CellArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n } else {\n model[type] = Object(vtk_js_Sources_vtk__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(model[type]);\n }\n });\n\n publicAPI.getNumberOfCells = function () {\n return vtk_js_Sources_Common_DataModel_PolyData_Constants__WEBPACK_IMPORTED_MODULE_9__[\"POLYDATA_FIELDS\"].reduce(function (num, cellType) {\n return num + model[cellType].getNumberOfCells();\n }, 0);\n };\n\n var superShallowCopy = publicAPI.shallowCopy;\n\n publicAPI.shallowCopy = function (other) {\n var debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n superShallowCopy(other, debug);\n vtk_js_Sources_Common_DataModel_PolyData_Constants__WEBPACK_IMPORTED_MODULE_9__[\"POLYDATA_FIELDS\"].forEach(function (type) {\n model[type] = vtk_js_Sources_Common_Core_CellArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model[type].shallowCopy(other.getReferenceByName(type));\n });\n };\n\n publicAPI.buildCells = function () {\n // here are the number of cells we have\n var nVerts = publicAPI.getNumberOfVerts();\n var nLines = publicAPI.getNumberOfLines();\n var nPolys = publicAPI.getNumberOfPolys();\n var nStrips = publicAPI.getNumberOfStrips(); // pre-allocate the space we need\n\n var nCells = nVerts + nLines + nPolys + nStrips;\n var types = new Uint8Array(nCells);\n var pTypes = types;\n var locs = new Uint32Array(nCells);\n var pLocs = locs; // record locations and type of each cell.\n // verts\n\n if (nVerts) {\n var nextCellPts = 0;\n model.verts.getCellSizes().forEach(function (numCellPts, index) {\n pLocs[index] = nextCellPts;\n pTypes[index] = numCellPts > 1 ? vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLY_VERTEX : vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_VERTEX;\n nextCellPts += numCellPts + 1;\n });\n pLocs = pLocs.subarray(nVerts);\n pTypes = pTypes.subarray(nVerts);\n } // lines\n\n\n if (nLines) {\n var _nextCellPts = 0;\n model.lines.getCellSizes().forEach(function (numCellPts, index) {\n pLocs[index] = _nextCellPts;\n pTypes[index] = numCellPts > 2 ? vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLY_LINE : vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_LINE;\n\n if (numCellPts === 1) {\n vtkWarningMacro('Building VTK_LINE ', index, ' with only one point, but VTK_LINE needs at least two points. Check the input.');\n }\n\n _nextCellPts += numCellPts + 1;\n });\n pLocs = pLocs.subarray(nLines);\n pTypes = pTypes.subarray(nLines);\n } // polys\n\n\n if (nPolys) {\n var _nextCellPts2 = 0;\n model.polys.getCellSizes().forEach(function (numCellPts, index) {\n pLocs[index] = _nextCellPts2;\n\n switch (numCellPts) {\n case 3:\n pTypes[index] = vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_TRIANGLE;\n break;\n\n case 4:\n pTypes[index] = vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_QUAD;\n break;\n\n default:\n pTypes[index] = vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLYGON;\n break;\n }\n\n if (numCellPts < 3) {\n vtkWarningMacro('Building VTK_TRIANGLE ', index, ' with less than three points, but VTK_TRIANGLE needs at least three points. Check the input.');\n }\n\n _nextCellPts2 += numCellPts + 1;\n });\n pLocs += pLocs.subarray(nPolys);\n pTypes += pTypes.subarray(nPolys);\n } // strips\n\n\n if (nStrips) {\n var _nextCellPts3 = 0;\n pTypes.fill(vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_TRIANGLE_STRIP, 0, nStrips);\n model.strips.getCellSizes().forEach(function (numCellPts, index) {\n pLocs[index] = _nextCellPts3;\n _nextCellPts3 += numCellPts + 1;\n });\n } // set up the cell types data structure\n\n\n model.cells = vtk_js_Sources_Common_DataModel_CellTypes__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n model.cells.setCellTypes(nCells, types, locs);\n };\n /**\n * Create upward links from points to cells that use each point. Enables\n * topologically complex queries.\n */\n\n\n publicAPI.buildLinks = function () {\n var initialSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n if (model.cells === undefined) {\n publicAPI.buildCells();\n }\n\n model.links = vtk_js_Sources_Common_DataModel_CellLinks__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n\n if (initialSize > 0) {\n model.links.allocate(initialSize);\n } else {\n model.links.allocate(publicAPI.getPoints().getNumberOfPoints());\n }\n\n model.links.buildLinks(publicAPI);\n }; // Returns an object made of the cellType and a subarray `cellPointIds` of\n // the cell points.\n\n\n publicAPI.getCellPoints = function (cellId) {\n var cellType = model.cells.getCellType(cellId);\n var cells = null;\n\n switch (cellType) {\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_VERTEX:\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLY_VERTEX:\n cells = model.verts;\n break;\n\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_LINE:\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLY_LINE:\n cells = model.lines;\n break;\n\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_TRIANGLE:\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_QUAD:\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_POLYGON:\n cells = model.polys;\n break;\n\n case vtk_js_Sources_Common_DataModel_CellTypes_Constants__WEBPACK_IMPORTED_MODULE_8__[\"CellType\"].VTK_TRIANGLE_STRIP:\n cells = model.strips;\n break;\n\n default:\n cells = null;\n return {\n type: 0,\n cellPointIds: null\n };\n }\n\n var loc = model.cells.getCellLocation(cellId);\n var cellPointIds = cells.getCell(loc);\n return {\n cellType: cellType,\n cellPointIds: cellPointIds\n };\n };\n\n publicAPI.getPointCells = function (ptId) {\n return model.links.getCells(ptId);\n };\n\n publicAPI.getCellEdgeNeighbors = function (cellId, point1, point2) {\n var link1 = model.links.getLink(point1);\n var link2 = model.links.getLink(point2);\n return link1.cells.filter(function (cell) {\n return cell !== cellId && link2.cells.indexOf(cell) !== -1;\n });\n };\n /**\n * If you know the type of cell, you may provide it to improve performances.\n */\n\n\n publicAPI.getCell = function (cellId) {\n var cellHint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var cellInfo = publicAPI.getCellPoints(cellId);\n var cell = cellHint || CELL_FACTORY[cellInfo.cellType].newInstance();\n cell.initialize(publicAPI.getPoints(), cellInfo.cellPointIds);\n return cell;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {// verts: null,\n // lines: null,\n // polys: null,\n // strips: null,\n // cells: null,\n // links: null,\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Common_DataModel_PointSet__WEBPACK_IMPORTED_MODULE_6__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['cells', 'links']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['verts', 'lines', 'polys', 'strips']); // Object specific methods\n\n vtkPolyData(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPolyData'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/Constants.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/Constants.js ***! - \*********************************************************************************/ -/*! exports provided: SelectionContent, SelectionField, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SelectionContent\", function() { return SelectionContent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SelectionField\", function() { return SelectionField; });\n/**\n * The (primary) property that describes the content of a selection\n * node's data. Other auxiliary description properties follow.\n * GLOBALIDS means that the selection list contains values from the\n * vtkDataSetAttribute array of the same name.\n * PEDIGREEIDS means that the selection list contains values from the\n * vtkDataSetAttribute array of the same name.\n * VALUES means the the selection list contains values from an\n * arbitrary attribute array (ignores any globalids attribute)\n * INDICES means that the selection list contains indexes into the\n * cell or point arrays.\n * FRUSTUM means the set of points and cells inside a frustum\n * LOCATIONS means the set of points and cells near a set of positions\n * THRESHOLDS means the points and cells with values within a set of ranges\n * getContentType() returns -1 if the content type is not set.\n */\n// Specify how data arrays can be used by data objects\nvar SelectionContent = {\n GLOBALIDS: 0,\n PEDIGREEIDS: 1,\n VALUES: 2,\n INDICES: 3,\n FRUSTUM: 4,\n LOCATIONS: 5,\n THRESHOLDS: 6,\n BLOCKS: 7,\n QUERY: 8\n};\nvar SelectionField = {\n CELL: 0,\n POINT: 1,\n FIELD: 2,\n VERTEX: 3,\n EDGE: 4,\n ROW: 5\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n SelectionContent: SelectionContent,\n SelectionField: SelectionField\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/index.js ***! - \*****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_SelectionNode_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/SelectionNode/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n // ----------------------------------------------------------------------------\n// vtkSelectionNode methods\n// ----------------------------------------------------------------------------\n\nfunction vtkSelectionNode(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkSelectionNode');\n\n publicAPI.getBounds = function () {\n return model.points.getBounds();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n contentType: -1,\n fieldType: -1,\n properties: null,\n selectionList: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.properties = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['contentType', 'fieldType', 'properties', 'selectionList']); // Object specific methods\n\n vtkSelectionNode(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkSelectionNode'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Common_DataModel_SelectionNode_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/Constants.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/Constants.js ***! - \**********************************************************************************/ -/*! exports provided: StructuredType, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StructuredType\", function() { return StructuredType; });\nvar StructuredType = {\n UNCHANGED: 0,\n SINGLE_POINT: 1,\n X_LINE: 2,\n Y_LINE: 3,\n Z_LINE: 4,\n XY_PLANE: 5,\n YZ_PLANE: 6,\n XZ_PLANE: 7,\n XYZ_GRID: 8,\n EMPTY: 9\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n StructuredType: StructuredType\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/index.js ***! - \******************************************************************************/ -/*! exports provided: getDataDescriptionFromExtent, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDataDescriptionFromExtent\", function() { return getDataDescriptionFromExtent; });\n/* harmony import */ var vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/StructuredData/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\nvar StructuredType = vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].StructuredType;\nfunction getDataDescriptionFromExtent(inExt) {\n var dataDim = 0;\n\n for (var i = 0; i < 3; ++i) {\n if (inExt[i * 2] < inExt[i * 2 + 1]) {\n dataDim++;\n }\n }\n\n if (inExt[0] > inExt[1] || inExt[2] > inExt[3] || inExt[4] > inExt[5]) {\n return StructuredType.EMPTY;\n }\n\n if (dataDim === 3) {\n return StructuredType.XYZ_GRID;\n }\n\n if (dataDim === 2) {\n if (inExt[0] === inExt[1]) {\n return StructuredType.YZ_PLANE;\n }\n\n if (inExt[2] === inExt[3]) {\n return StructuredType.XZ_PLANE;\n }\n\n return StructuredType.XY_PLANE;\n }\n\n if (dataDim === 1) {\n if (inExt[0] < inExt[1]) {\n return StructuredType.X_LINE;\n }\n\n if (inExt[2] < inExt[3]) {\n return StructuredType.Y_LINE;\n }\n\n return StructuredType.Z_LINE;\n }\n\n return StructuredType.SINGLE_POINT;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n getDataDescriptionFromExtent: getDataDescriptionFromExtent\n}, vtk_js_Sources_Common_DataModel_StructuredData_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/StructuredData/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Common/DataModel/Triangle/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Common/DataModel/Triangle/index.js ***! - \************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Cell */ \"./node_modules/vtk.js/Sources/Common/DataModel/Cell/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Line */ \"./node_modules/vtk.js/Sources/Common/DataModel/Line/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Plane */ \"./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction computeNormalDirection(v1, v2, v3, n) {\n // order is important!!! maintain consistency with triangle vertex order\n var ax = v3[0] - v2[0];\n var ay = v3[1] - v2[1];\n var az = v3[2] - v2[2];\n var bx = v1[0] - v2[0];\n var by = v1[1] - v2[1];\n var bz = v1[2] - v2[2];\n n[0] = ay * bz - az * by;\n n[1] = az * bx - ax * bz;\n n[2] = ax * by - ay * bx;\n}\n\nfunction computeNormal(v1, v2, v3, n) {\n computeNormalDirection(v1, v2, v3, n);\n var length = Math.sqrt(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]);\n\n if (length !== 0.0) {\n n[0] /= length;\n n[1] /= length;\n n[2] /= length;\n }\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n computeNormalDirection: computeNormalDirection,\n computeNormal: computeNormal\n}; // ----------------------------------------------------------------------------\n// vtkTriangle methods\n// ----------------------------------------------------------------------------\n\nfunction vtkTriangle(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkTriangle');\n\n publicAPI.getCellDimension = function () {\n return 2;\n };\n\n publicAPI.intersectWithLine = function (p1, p2, tol, x, pcoords) {\n var outObj = {\n subId: 0,\n t: Number.MAX_VALUE,\n intersect: 0,\n betweenPoints: false\n };\n pcoords[2] = 0.0;\n var closestPoint = [];\n var tol2 = tol * tol; // Get normal for triangle\n\n var pt1 = [];\n var pt2 = [];\n var pt3 = [];\n model.points.getPoint(0, pt1);\n model.points.getPoint(1, pt2);\n model.points.getPoint(2, pt3);\n var n = [];\n var weights = [];\n computeNormal(pt1, pt2, pt3, n);\n\n if (n[0] !== 0 || n[1] !== 0 || n[2] !== 0) {\n // Intersect plane of triangle with line\n var plane = vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_4__[\"default\"].intersectWithLine(p1, p2, pt1, n);\n outObj.betweenPoints = plane.betweenPoints;\n outObj.t = plane.t;\n x[0] = plane.x[0];\n x[1] = plane.x[1];\n x[2] = plane.x[2];\n\n if (!plane.intersection) {\n pcoords[0] = 0.0;\n pcoords[1] = 0.0;\n outObj.intersect = 0;\n return outObj;\n } // Evaluate position\n\n\n var inside = publicAPI.evaluatePosition(x, closestPoint, pcoords, weights);\n\n if (inside.evaluation >= 0) {\n if (inside.dist2 <= tol2) {\n outObj.intersect = 1;\n return outObj;\n }\n\n outObj.intersect = inside.evaluation;\n return outObj;\n }\n } // Normals are null, so the triangle is degenerated and\n // we still need to check intersection between line and\n // the longest edge.\n\n\n var dist2Pt1Pt2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](pt1, pt2);\n var dist2Pt2Pt3 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](pt2, pt3);\n var dist2Pt3Pt1 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](pt3, pt1);\n\n if (!model.line) {\n model.line = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n }\n\n if (dist2Pt1Pt2 > dist2Pt2Pt3 && dist2Pt1Pt2 > dist2Pt3Pt1) {\n model.line.getPoints().setPoint(0, pt1);\n model.line.getPoints().setPoint(1, pt2);\n } else if (dist2Pt2Pt3 > dist2Pt3Pt1 && dist2Pt2Pt3 > dist2Pt1Pt2) {\n model.line.getPoints().setPoint(0, pt2);\n model.line.getPoints().setPoint(1, pt3);\n } else {\n model.line.getPoints().setPoint(0, pt3);\n model.line.getPoints().setPoint(1, pt1);\n }\n\n var intersectLine = model.line.intersectWithLine(p1, p2, tol, x, pcoords);\n outObj.betweenPoints = intersectLine.betweenPoints;\n outObj.t = intersectLine.t;\n\n if (intersectLine.intersect) {\n var pt3Pt1 = [];\n var pt3Pt2 = [];\n var pt3X = []; // Compute r and s manually, using dot and norm.\n\n for (var i = 0; i < 3; i++) {\n pt3Pt1[i] = pt1[i] - pt3[i];\n pt3Pt2[i] = pt2[i] - pt3[i];\n pt3X[i] = x[i] - pt3[i];\n }\n\n pcoords[0] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"dot\"](pt3X, pt3Pt1) / dist2Pt3Pt1;\n pcoords[1] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"dot\"](pt3X, pt3Pt2) / dist2Pt2Pt3;\n outObj.intersect = 1;\n return outObj;\n }\n\n pcoords[0] = 0.0;\n pcoords[1] = 0.0;\n outObj.intersect = 0;\n return outObj;\n };\n\n publicAPI.evaluatePosition = function (x, closestPoint, pcoords, weights) {\n // will return obj\n var outObj = {\n subId: 0,\n dist2: 0,\n evaluation: -1\n };\n var i;\n var j;\n var pt1 = [];\n var pt2 = [];\n var pt3 = [];\n var n = [];\n var fabsn;\n var rhs = [];\n var c1 = [];\n var c2 = [];\n var det = 0;\n var idx = 0;\n var indices = [];\n var dist2Point;\n var dist2Line1;\n var dist2Line2;\n var closest = [];\n var closestPoint1 = [];\n var closestPoint2 = [];\n var cp = [];\n outObj.subId = 0;\n pcoords[2] = 0.0; // Get normal for triangle, only the normal direction is needed, i.e. the\n // normal need not be normalized (unit length)\n //\n\n model.points.getPoint(1, pt1);\n model.points.getPoint(2, pt2);\n model.points.getPoint(0, pt3);\n computeNormalDirection(pt1, pt2, pt3, n); // Project point to plane\n\n vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_4__[\"default\"].generalizedProjectPoint(x, pt1, n, cp); // Construct matrices. Since we have over determined system, need to find\n // which 2 out of 3 equations to use to develop equations. (Any 2 should\n // work since we've projected point to plane.)\n\n var maxComponent = 0.0;\n\n for (i = 0; i < 3; i++) {\n // trying to avoid an expensive call to fabs()\n if (n[i] < 0) {\n fabsn = -n[i];\n } else {\n fabsn = n[i];\n }\n\n if (fabsn > maxComponent) {\n maxComponent = fabsn;\n idx = i;\n }\n }\n\n for (j = 0, i = 0; i < 3; i++) {\n if (i !== idx) {\n indices[j++] = i;\n }\n }\n\n for (i = 0; i < 2; i++) {\n rhs[i] = cp[indices[i]] - pt3[indices[i]];\n c1[i] = pt1[indices[i]] - pt3[indices[i]];\n c2[i] = pt2[indices[i]] - pt3[indices[i]];\n }\n\n det = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"determinant2x2\"](c1, c2);\n\n if (det === 0.0) {\n pcoords[0] = 0.0;\n pcoords[1] = 0.0;\n outObj.evaluation = -1;\n return outObj;\n }\n\n pcoords[0] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"determinant2x2\"](rhs, c2) / det;\n pcoords[1] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"determinant2x2\"](c1, rhs) / det; // Okay, now find closest point to element\n\n weights[0] = 1 - (pcoords[0] + pcoords[1]);\n weights[1] = pcoords[0];\n weights[2] = pcoords[1];\n\n if (weights[0] >= 0.0 && weights[0] <= 1.0 && weights[1] >= 0.0 && weights[1] <= 1.0 && weights[2] >= 0.0 && weights[2] <= 1.0) {\n // projection distance\n if (closestPoint) {\n outObj.dist2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](cp, x);\n closestPoint[0] = cp[0];\n closestPoint[1] = cp[1];\n closestPoint[2] = cp[2];\n }\n\n outObj.evaluation = 1;\n } else {\n var t;\n\n if (closestPoint) {\n if (weights[1] < 0.0 && weights[2] < 0.0) {\n dist2Point = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](x, pt3);\n dist2Line1 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt1, pt3, t, closestPoint1);\n dist2Line2 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt3, pt2, t, closestPoint2);\n\n if (dist2Point < dist2Line1) {\n outObj.dist2 = dist2Point;\n closest = pt3;\n } else {\n outObj.dist2 = dist2Line1;\n closest = closestPoint1;\n }\n\n if (dist2Line2 < outObj.dist2) {\n outObj.dist2 = dist2Line2;\n closest = closestPoint2;\n }\n\n for (i = 0; i < 3; i++) {\n closestPoint[i] = closest[i];\n }\n } else if (weights[2] < 0.0 && weights[0] < 0.0) {\n dist2Point = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](x, pt1);\n dist2Line1 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt1, pt3, t, closestPoint1);\n dist2Line2 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt1, pt2, t, closestPoint2);\n\n if (dist2Point < dist2Line1) {\n outObj.dist2 = dist2Point;\n closest = pt1;\n } else {\n outObj.dist2 = dist2Line1;\n closest = closestPoint1;\n }\n\n if (dist2Line2 < outObj.dist2) {\n outObj.dist2 = dist2Line2;\n closest = closestPoint2;\n }\n\n for (i = 0; i < 3; i++) {\n closestPoint[i] = closest[i];\n }\n } else if (weights[1] < 0.0 && weights[0] < 0.0) {\n dist2Point = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"distance2BetweenPoints\"](x, pt2);\n dist2Line1 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt2, pt3, t, closestPoint1);\n dist2Line2 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt1, pt2, t, closestPoint2);\n\n if (dist2Point < dist2Line1) {\n outObj.dist2 = dist2Point;\n closest = pt2;\n } else {\n outObj.dist2 = dist2Line1;\n closest = closestPoint1;\n }\n\n if (dist2Line2 < outObj.dist2) {\n outObj.dist2 = dist2Line2;\n closest = closestPoint2;\n }\n\n for (i = 0; i < 3; i++) {\n closestPoint[i] = closest[i];\n }\n } else if (weights[0] < 0.0) {\n var lineDistance = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt1, pt2, closestPoint);\n outObj.dist2 = lineDistance.distance;\n } else if (weights[1] < 0.0) {\n var _lineDistance = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt2, pt3, closestPoint);\n\n outObj.dist2 = _lineDistance.distance;\n } else if (weights[2] < 0.0) {\n var _lineDistance2 = vtk_js_Sources_Common_DataModel_Line__WEBPACK_IMPORTED_MODULE_3__[\"default\"].distanceToLine(x, pt1, pt3, closestPoint);\n\n outObj.dist2 = _lineDistance2.distance;\n }\n }\n\n outObj.evaluation = 0;\n }\n\n return outObj;\n };\n\n publicAPI.evaluateLocation = function (pcoords, x, weights) {\n var p0 = [];\n var p1 = [];\n var p2 = [];\n model.points.getPoint(0, p0);\n model.points.getPoint(1, p1);\n model.points.getPoint(2, p2);\n var u3 = 1.0 - pcoords[0] - pcoords[1];\n\n for (var i = 0; i < 3; i++) {\n x[i] = p0[i] * u3 + p1[i] * pcoords[0] + p2[i] * pcoords[1];\n }\n\n weights[0] = u3;\n weights[1] = pcoords[0];\n weights[2] = pcoords[1];\n };\n\n publicAPI.getParametricDistance = function (pcoords) {\n var pDist;\n var pDistMax = 0.0;\n var pc = [];\n pc[0] = pcoords[0];\n pc[1] = pcoords[1];\n pc[2] = 1.0 - pcoords[0] - pcoords[1];\n\n for (var i = 0; i < 3; i++) {\n if (pc[i] < 0.0) {\n pDist = -pc[i];\n } else if (pc[i] > 1.0) {\n pDist = pc[i] - 1.0;\n } else {\n // inside the cell in the parametric direction\n pDist = 0.0;\n }\n\n if (pDist > pDistMax) {\n pDistMax = pDist;\n }\n }\n\n return pDistMax;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Common_DataModel_Cell__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtkTriangle(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkTriangle'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Common/DataModel/Triangle/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Filters/General/ImageCropFilter/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Filters/General/ImageCropFilter/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/ImageData */ \"./node_modules/vtk.js/Sources/Common/DataModel/ImageData/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkImageCropFilter methods\n// ----------------------------------------------------------------------------\n\nfunction vtkImageCropFilter(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkImageCropFilter'); // --------------------------------------------------------------------------\n\n publicAPI.reset = function () {\n var data = publicAPI.getInputData();\n\n if (data) {\n publicAPI.setCroppingPlanes.apply(publicAPI, _toConsumableArray(data.getExtent()));\n }\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.requestData = function (inData, outData) {\n // implement requestData\n var input = inData[0];\n\n if (!input) {\n vtkErrorMacro('Invalid or missing input');\n return;\n }\n\n var scalars = input.getPointData().getScalars();\n\n if (!scalars) {\n vtkErrorMacro('No scalars from input');\n return;\n }\n\n var extent = input.getExtent();\n var cropped = model.croppingPlanes.length === 6 ? extent.map(function (e, i) {\n if (i % 2 === 0) {\n // min plane\n return Math.max(e, Math.round(model.croppingPlanes[i]));\n } // max plane\n\n\n return Math.min(e, Math.round(model.croppingPlanes[i]));\n }) : extent.slice();\n\n if (cropped[0] === extent[0] && cropped[1] === extent[1] && cropped[2] === extent[2] && cropped[3] === extent[3] && cropped[4] === extent[4] && cropped[5] === extent[5]) {\n var sameAsInput = vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n sameAsInput.shallowCopy(input); // Force new mtime\n\n outData[0] = sameAsInput;\n return;\n } // reorder if needed\n\n\n for (var i = 0; i < 3; ++i) {\n if (cropped[i * 2] > cropped[i * 2 + 1]) {\n var _ref = [cropped[i * 2 + 1], cropped[i * 2]];\n cropped[i * 2] = _ref[0];\n cropped[i * 2 + 1] = _ref[1];\n }\n } // restrict crop bounds based on extent bounds\n\n\n for (var _i = 0; _i < 6; _i += 2) {\n // min case\n cropped[_i] = Math.max(cropped[_i], extent[_i]); // max case\n\n cropped[_i + 1] = Math.min(cropped[_i + 1], extent[_i + 1]);\n }\n\n var numberOfComponents = scalars.getNumberOfComponents();\n var componentSize = (cropped[1] - cropped[0] + 1) * (cropped[3] - cropped[2] + 1) * (cropped[5] - cropped[4] + 1) * numberOfComponents;\n var scalarsData = scalars.getData();\n var dims = input.getDimensions();\n var jStride = numberOfComponents * dims[0];\n var kStride = numberOfComponents * dims[0] * dims[1];\n var beginOffset = (cropped[0] - extent[0]) * numberOfComponents;\n var stripSize = (cropped[1] - cropped[0] + 1) * numberOfComponents; // +1 because subarray end is exclusive\n // crop image\n\n var croppedArray = new scalarsData.constructor(componentSize);\n var index = 0;\n\n for (var k = cropped[4]; k <= cropped[5]; ++k) {\n for (var j = cropped[2]; j <= cropped[3]; ++j) {\n var begin = beginOffset + (j - extent[2]) * jStride + (k - extent[4]) * kStride;\n var end = begin + stripSize;\n var slice = scalarsData.subarray(begin, end);\n croppedArray.set(slice, index);\n index += slice.length;\n }\n }\n\n var outImage = vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance({\n extent: cropped,\n origin: input.getOrigin(),\n direction: input.getDirection(),\n spacing: input.getSpacing()\n });\n var croppedScalars = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n name: scalars.getName(),\n numberOfComponents: numberOfComponents,\n values: croppedArray\n });\n outImage.getPointData().setScalars(croppedScalars);\n outData[0] = outImage;\n };\n\n publicAPI.isResetAvailable = function () {\n if (model.croppingPlanes.length === 0) {\n return false;\n }\n\n var data = publicAPI.getInputData();\n\n if (data) {\n var originalExtent = data.getExtent();\n var findDifference = originalExtent.find(function (v, i) {\n return Math.abs(model.croppingPlanes[i] - v) > Number.EPSILON;\n });\n return findDifference !== undefined;\n }\n\n return false;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n croppingPlanes: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Make this a VTK object\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Also make it an algorithm with one input and one output\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].algo(publicAPI, model, 1, 1); // no orientation support yet\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['croppingPlanes'], 6); // Object specific methods\n\n vtkImageCropFilter(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkImageCropFilter'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Filters/General/ImageCropFilter/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Filters/Sources/PlaneSource/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Filters/Sources/PlaneSource/index.js ***! - \**************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/MatrixBuilder */ \"./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n\nvar vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkWarningMacro;\nvar EPSILON = 1e-6; // ----------------------------------------------------------------------------\n// vtkPlaneSource methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPlaneSource(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPlaneSource');\n\n publicAPI.requestData = function (inData, outData) {\n if (model.deleted) {\n return;\n }\n\n var dataset = outData[0]; // Check input\n\n var pointDataType = dataset ? dataset.getPoints().getDataType() : 'Float32Array';\n var pd = vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n var v10 = new Float32Array(3);\n var v20 = new Float32Array(3);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point1, model.origin, v10);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point2, model.origin, v20);\n\n if (!publicAPI.updatePlane(v10, v20)) {\n vtkWarningMacro('Bad plane definition');\n return;\n } // hand create a plane with special scalars\n\n\n var xres = model.xResolution;\n var yres = model.yResolution;\n var numPts = (xres + 1) * (yres + 1);\n var numPolys = xres * yres; // Points\n\n var points = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newTypedArray(pointDataType, numPts * 3);\n pd.getPoints().setData(points, 3); // Cells\n\n var polys = new Uint32Array(5 * numPolys);\n pd.getPolys().setData(polys, 1); // Normals\n\n var normalsData = new Float32Array(numPts * 3);\n var normals = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 3,\n values: normalsData,\n name: 'Normals'\n });\n pd.getPointData().setNormals(normals); // Texture coords\n\n var tcData = new Float32Array(numPts * 2);\n var tcoords = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 2,\n values: tcData,\n name: 'TextureCoordinates'\n });\n pd.getPointData().setTCoords(tcoords);\n var tc = new Float32Array(2);\n var idx = 0;\n\n for (var j = 0; j < yres + 1; j++) {\n tc[1] = j / yres;\n\n for (var i = 0; i < xres + 1; i++) {\n tc[0] = i / xres;\n points[idx * 3] = model.origin[0] + tc[0] * v10[0] + tc[1] * v20[0];\n points[idx * 3 + 1] = model.origin[1] + tc[0] * v10[1] + tc[1] * v20[1];\n points[idx * 3 + 2] = model.origin[2] + tc[0] * v10[2] + tc[1] * v20[2];\n tcData[idx * 2] = tc[0];\n tcData[idx * 2 + 1] = tc[1];\n normalsData[idx * 3] = model.normal[0];\n normalsData[idx * 3 + 1] = model.normal[1];\n normalsData[idx * 3 + 2] = model.normal[2];\n idx++;\n }\n } // Generate polygon connectivity\n //\n\n\n idx = 0;\n\n for (var _j = 0; _j < yres; _j++) {\n for (var _i = 0; _i < xres; _i++) {\n polys[idx * 5 + 0] = 4;\n polys[idx * 5 + 1] = _i + _j * (xres + 1);\n polys[idx * 5 + 2] = polys[idx * 5 + 1] + 1;\n polys[idx * 5 + 3] = polys[idx * 5 + 1] + xres + 2;\n polys[idx * 5 + 4] = polys[idx * 5 + 1] + xres + 1;\n idx++;\n }\n } // Update output\n\n\n outData[0] = pd;\n };\n\n publicAPI.setNormal = function () {\n var n = [];\n\n if (arguments.length === 1 || Array.isArray(arguments.length <= 0 ? undefined : arguments[0])) {\n n = _toConsumableArray(arguments.length <= 0 ? undefined : arguments[0]);\n } else if (arguments.length === 3) {\n n = [arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], arguments.length <= 2 ? undefined : arguments[2]];\n }\n\n if (vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"normalize\"](n) !== 0) {\n var dp = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](model.normal, n);\n var theta = 0;\n var rotationVector = [];\n\n if (dp < 1.0) {\n if (dp <= -1.0) {\n theta = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"radiansFromDegrees\"](180.0);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point1, model.origin, rotationVector);\n } else {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"cross\"](model.normal, n, rotationVector);\n theta = Math.acos(dp);\n }\n\n publicAPI.rotate(theta, rotationVector);\n }\n }\n };\n /**\n * Rotate plane around a given axis\n * @param {float} theta Angle (radian) to rotate about\n * @param {vec3} rotationAxis Axis to rotate around\n */\n\n\n publicAPI.rotate = function (angle, rotationAxis) {\n if (Math.abs(angle) < EPSILON) {\n return;\n } // Create rotation matrix\n\n\n var transform = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n var negCenter = [];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].negate(negCenter, model.center);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(transform, transform, model.center);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(transform, transform, angle, rotationAxis);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(transform, transform, negCenter);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(model.origin, model.origin, transform);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(model.point1, model.point1, transform);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(model.point2, model.point2, transform);\n vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_4__[\"default\"].buildFromRadian().rotate(angle, rotationAxis).apply(model.normal);\n publicAPI.modified();\n };\n\n publicAPI.setCenter = function () {\n var c = [];\n\n if (arguments.length === 1 || Array.isArray(arguments.length <= 0 ? undefined : arguments[0])) {\n c = _toConsumableArray(arguments.length <= 0 ? undefined : arguments[0]);\n } else if (arguments.length === 3) {\n c = [arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], arguments.length <= 2 ? undefined : arguments[2]];\n }\n\n if (!gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].exactEquals(c, model.center)) {\n var v1 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point1, model.origin, v1);\n var v2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point2, model.origin, v2);\n\n for (var i = 0; i < 3; i++) {\n model.center[i] = c[i];\n model.origin[i] = model.center[i] - 0.5 * (v1[i] + v2[i]);\n model.point1[i] = model.origin[i] + v1[i];\n model.point2[i] = model.origin[i] + v2[i];\n }\n\n publicAPI.modified();\n }\n };\n\n publicAPI.setPoint1 = function () {\n var point1 = [];\n\n if (arguments.length === 1 || Array.isArray(arguments.length <= 0 ? undefined : arguments[0])) {\n point1 = _toConsumableArray(arguments.length <= 0 ? undefined : arguments[0]);\n } else if (arguments.length === 3) {\n point1 = [arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], arguments.length <= 2 ? undefined : arguments[2]];\n }\n\n if (!gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].exactEquals(point1, model.point1)) {\n var v1 = [];\n var v2 = [];\n model.point1 = _toConsumableArray(point1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point1, model.origin, v1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point2, model.origin, v2); // set plane normal\n\n publicAPI.updatePlane(v1, v2);\n publicAPI.modified();\n }\n };\n\n publicAPI.setPoint2 = function () {\n var point2 = [];\n\n if (arguments.length === 1 || Array.isArray(arguments.length <= 0 ? undefined : arguments[0])) {\n point2 = _toConsumableArray(arguments.length <= 0 ? undefined : arguments[0]);\n } else if (arguments.length === 3) {\n point2 = [arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], arguments.length <= 2 ? undefined : arguments[2]];\n }\n\n if (!gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].exactEquals(point2, model.point2)) {\n var v1 = [];\n var v2 = [];\n model.point2 = _toConsumableArray(point2);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point1, model.origin, v1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"subtract\"](model.point2, model.origin, v2); // set plane normal\n\n publicAPI.updatePlane(v1, v2);\n publicAPI.modified();\n }\n };\n\n publicAPI.updatePlane = function (v1, v2) {\n // set plane center\n for (var i = 0; i < 3; i++) {\n model.center[i] = model.origin[i] + 0.5 * (v1[i] + v2[i]);\n } // set plane normal\n\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"cross\"](v1, v2, model.normal);\n return vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"normalize\"](model.normal) !== 0.0;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n xResolution: 10,\n yResolution: 10,\n origin: [0, 0, 0],\n point1: [1, 0, 0],\n point2: [0, 1, 0],\n pointType: 'Float32Array'\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n model.normal = [0, 0, 1];\n model.center = [0, 0, 0]; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['xResolution', 'yResolution']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGetArray(publicAPI, model, ['origin'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getArray(publicAPI, model, ['point1', 'point2', 'normal', 'center'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].algo(publicAPI, model, 0, 1);\n vtkPlaneSource(publicAPI, model);\n publicAPI.setPoint1(model.point1);\n publicAPI.setPoint2(model.point2);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkPlaneSource'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Filters/Sources/PlaneSource/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Filters/Sources/SphereSource/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Filters/Sources/SphereSource/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkSphereSource methods\n// ----------------------------------------------------------------------------\n\nfunction vtkSphereSource(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkSphereSource');\n\n publicAPI.requestData = function (inData, outData) {\n if (model.deleted) {\n return;\n }\n\n var dataset = outData[0];\n var pointDataType = dataset ? dataset.getPoints().getDataType() : 'Float32Array';\n dataset = vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(); // ----------------------------------------------------------------------\n\n var numPoles = 0; // Check data, determine increments, and convert to radians\n\n var thetaResolution = model.thetaResolution;\n var startTheta = model.startTheta < model.endTheta ? model.startTheta : model.endTheta;\n startTheta *= Math.PI / 180.0;\n var endTheta = model.endTheta > model.startTheta ? model.endTheta : model.startTheta;\n endTheta *= Math.PI / 180.0;\n var startPhi = model.startPhi < model.endPhi ? model.startPhi : model.endPhi;\n startPhi *= Math.PI / 180.0;\n var endPhi = model.endPhi > model.startPhi ? model.endPhi : model.startPhi;\n endPhi *= Math.PI / 180.0;\n\n if (Math.abs(startTheta - endTheta) < 2.0 * Math.PI) {\n ++thetaResolution;\n }\n\n var deltaTheta = (endTheta - startTheta) / model.thetaResolution;\n var jStart = model.startPhi <= 0.0 ? 1 : 0;\n var jEnd = model.phiResolution + (model.endPhi >= 180.0 ? -1 : 0);\n var numPts = model.phiResolution * thetaResolution + 2;\n var numPolys = model.phiResolution * 2 * model.thetaResolution; // Points\n\n var pointIdx = 0;\n var points = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newTypedArray(pointDataType, numPts * 3); // Normals\n\n var normals = new Float32Array(numPts * 3); // Cells\n\n var cellLocation = 0;\n var polys = new Uint32Array(numPolys * 5); // Create north pole if needed\n\n if (model.startPhi <= 0.0) {\n points[pointIdx * 3 + 0] = model.center[0];\n points[pointIdx * 3 + 1] = model.center[1];\n points[pointIdx * 3 + 2] = model.center[2] + model.radius;\n normals[pointIdx * 3 + 0] = 0;\n normals[pointIdx * 3 + 1] = 0;\n normals[pointIdx * 3 + 2] = 1;\n pointIdx++;\n numPoles++;\n } // Create south pole if needed\n\n\n if (model.endPhi >= 180.0) {\n points[pointIdx * 3 + 0] = model.center[0];\n points[pointIdx * 3 + 1] = model.center[1];\n points[pointIdx * 3 + 2] = model.center[2] - model.radius;\n normals[pointIdx * 3 + 0] = 0;\n normals[pointIdx * 3 + 1] = 0;\n normals[pointIdx * 3 + 2] = -1;\n pointIdx++;\n numPoles++;\n }\n\n var phiResolution = model.phiResolution - numPoles;\n var deltaPhi = (endPhi - startPhi) / (model.phiResolution - 1); // Create intermediate points\n\n for (var i = 0; i < thetaResolution; i++) {\n var theta = startTheta + i * deltaTheta;\n\n for (var j = jStart; j < jEnd; j++) {\n var phi = startPhi + j * deltaPhi;\n var radius = model.radius * Math.sin(phi);\n normals[pointIdx * 3 + 0] = radius * Math.cos(theta);\n normals[pointIdx * 3 + 1] = radius * Math.sin(theta);\n normals[pointIdx * 3 + 2] = model.radius * Math.cos(phi);\n points[pointIdx * 3 + 0] = normals[pointIdx * 3 + 0] + model.center[0];\n points[pointIdx * 3 + 1] = normals[pointIdx * 3 + 1] + model.center[1];\n points[pointIdx * 3 + 2] = normals[pointIdx * 3 + 2] + model.center[2];\n var norm = Math.sqrt(normals[pointIdx * 3 + 0] * normals[pointIdx * 3 + 0] + normals[pointIdx * 3 + 1] * normals[pointIdx * 3 + 1] + normals[pointIdx * 3 + 2] * normals[pointIdx * 3 + 2]);\n norm = norm === 0 ? 1 : norm;\n normals[pointIdx * 3 + 0] /= norm;\n normals[pointIdx * 3 + 1] /= norm;\n normals[pointIdx * 3 + 2] /= norm;\n pointIdx++;\n }\n } // Generate mesh connectivity\n\n\n var base = phiResolution * thetaResolution;\n\n if (Math.abs(startTheta - endTheta) < 2.0 * Math.PI) {\n --thetaResolution;\n } // around north pole\n\n\n if (model.startPhi <= 0.0) {\n for (var _i = 0; _i < thetaResolution; _i++) {\n polys[cellLocation++] = 3;\n polys[cellLocation++] = phiResolution * _i + numPoles;\n polys[cellLocation++] = phiResolution * (_i + 1) % base + numPoles;\n polys[cellLocation++] = 0;\n }\n } // around south pole\n\n\n if (model.endPhi >= 180.0) {\n var numOffset = phiResolution - 1 + numPoles;\n\n for (var _i2 = 0; _i2 < thetaResolution; _i2++) {\n polys[cellLocation++] = 3;\n polys[cellLocation++] = phiResolution * _i2 + numOffset;\n polys[cellLocation++] = numPoles - 1;\n polys[cellLocation++] = phiResolution * (_i2 + 1) % base + numOffset;\n }\n } // bands in-between poles\n\n\n for (var _i3 = 0; _i3 < thetaResolution; _i3++) {\n for (var _j = 0; _j < phiResolution - 1; _j++) {\n var a = phiResolution * _i3 + _j + numPoles;\n var b = a + 1;\n var c = (phiResolution * (_i3 + 1) + _j) % base + numPoles + 1;\n\n if (!model.latLongTessellation) {\n polys[cellLocation++] = 3;\n polys[cellLocation++] = a;\n polys[cellLocation++] = b;\n polys[cellLocation++] = c;\n polys[cellLocation++] = 3;\n polys[cellLocation++] = a;\n polys[cellLocation++] = c;\n polys[cellLocation++] = c - 1;\n } else {\n polys[cellLocation++] = 4;\n polys[cellLocation++] = a;\n polys[cellLocation++] = b;\n polys[cellLocation++] = c;\n polys[cellLocation++] = c - 1;\n }\n }\n } // Squeeze\n\n\n points = points.subarray(0, pointIdx * 3);\n dataset.getPoints().setData(points, 3);\n normals = normals.subarray(0, pointIdx * 3);\n var normalArray = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n name: 'Normals',\n values: normals,\n numberOfComponents: 3\n });\n dataset.getPointData().setNormals(normalArray);\n polys = polys.subarray(0, cellLocation);\n dataset.getPolys().setData(polys, 1); // Update output\n\n outData[0] = dataset;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n radius: 0.5,\n latLongTessellation: false,\n thetaResolution: 8,\n startTheta: 0.0,\n endTheta: 360.0,\n phiResolution: 8,\n startPhi: 0.0,\n endPhi: 180.0,\n center: [0, 0, 0],\n pointType: 'Float32Array'\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['radius', 'latLongTessellation', 'thetaResolution', 'startTheta', 'endTheta', 'phiResolution', 'startPhi', 'endPhi']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['center'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].algo(publicAPI, model, 0, 1);\n vtkSphereSource(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkSphereSource'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Filters/Sources/SphereSource/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator/index.js": -/*!**************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator/index.js ***! - \**************************************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkCompositeCameraManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCompositeCameraManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCompositeCameraManipulator'); //-------------------------------------------------------------------------\n\n publicAPI.computeDisplayCenter = function (iObserver, renderer) {\n var pt = iObserver.computeWorldToDisplay(renderer, model.center[0], model.center[1], model.center[2]);\n model.displayCenter[0] = pt[0];\n model.displayCenter[1] = pt[1];\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n center: [0, 0, 0],\n rotationFactor: 1,\n displayCenter: [0, 0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['rotationFactor']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['displayCenter'], 2);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['center'], 3); // Object specific methods\n\n vtkCompositeCameraManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js ***! - \*************************************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkCompositeMouseManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCompositeMouseManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCompositeMouseManipulator');\n\n publicAPI.startInteraction = function () {};\n\n publicAPI.endInteraction = function () {};\n\n publicAPI.onButtonDown = function (interactor, renderer, position) {};\n\n publicAPI.onButtonUp = function (interactor) {};\n\n publicAPI.onMouseMove = function (interactor, renderer, position) {};\n\n publicAPI.onStartScroll = function (interactor, renderer, delta) {};\n\n publicAPI.onScroll = function (interactor, renderer, delta) {};\n\n publicAPI.onEndScroll = function (interactor) {};\n\n publicAPI.isDragEnabled = function () {\n return model.dragEnabled;\n };\n\n publicAPI.isScrollEnabled = function () {\n return model.scrollEnabled;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n button: 1,\n shift: false,\n control: false,\n alt: false,\n dragEnabled: true,\n scrollEnabled: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['button', 'shift', 'control', 'alt']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].set(publicAPI, model, ['dragEnabled', 'scrollEnabled']); // Object specific methods\n\n vtkCompositeMouseManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js": -/*!**********************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js ***! - \**********************************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeCameraManipulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkMouseCameraTrackballPanManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkMouseCameraTrackballPanManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkMouseCameraTrackballPanManipulator');\n\n publicAPI.onButtonDown = function (interactor, renderer, position) {\n model.previousPosition = position;\n };\n\n publicAPI.onMouseMove = function (interactor, renderer, position) {\n if (!position) {\n return;\n }\n\n var pos = position;\n var lastPos = model.previousPosition;\n model.previousPosition = position;\n var camera = renderer.getActiveCamera();\n var camPos = camera.getPosition();\n var fp = camera.getFocalPoint();\n\n if (camera.getParallelProjection()) {\n camera.orthogonalizeViewUp();\n var up = camera.getViewUp();\n var vpn = camera.getViewPlaneNormal();\n var right = [0, 0, 0];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"cross\"](vpn, up, right); // These are different because y is flipped.\n\n var height = interactor.getView().getSize()[1];\n var dx = (pos.x - lastPos.x) / height;\n var dy = (lastPos.y - pos.y) / height;\n var scale = camera.getParallelScale();\n dx *= scale * 2.0;\n dy *= scale * 2.0;\n var tmp = right[0] * dx + up[0] * dy;\n camPos[0] += tmp;\n fp[0] += tmp;\n tmp = right[1] * dx + up[1] * dy;\n camPos[1] += tmp;\n fp[1] += tmp;\n tmp = right[2] * dx + up[2] * dy;\n camPos[2] += tmp;\n fp[2] += tmp;\n camera.setPosition(camPos[0], camPos[1], camPos[2]);\n camera.setFocalPoint(fp[0], fp[1], fp[2]);\n } else {\n var center = model.center;\n var style = interactor.getInteractorStyle();\n var focalDepth = style.computeWorldToDisplay(renderer, center[0], center[1], center[2])[2];\n var worldPoint = style.computeDisplayToWorld(renderer, pos.x, pos.y, focalDepth);\n var lastWorldPoint = style.computeDisplayToWorld(renderer, lastPos.x, lastPos.y, focalDepth);\n var newCamPos = [camPos[0] + (lastWorldPoint[0] - worldPoint[0]), camPos[1] + (lastWorldPoint[1] - worldPoint[1]), camPos[2] + (lastWorldPoint[2] - worldPoint[2])];\n var newFp = [fp[0] + (lastWorldPoint[0] - worldPoint[0]), fp[1] + (lastWorldPoint[1] - worldPoint[1]), fp[2] + (lastWorldPoint[2] - worldPoint[2])];\n camera.setPosition(newCamPos[0], newCamPos[1], newCamPos[2]);\n camera.setFocalPoint(newFp[0], newFp[1], newFp[2]);\n }\n\n renderer.resetCameraClippingRange();\n\n if (interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_Interaction_Manipulators_CompositeCameraManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues); // Object specific methods\n\n vtkMouseCameraTrackballPanManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkMouseCameraTrackballPanManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js": -/*!*************************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js ***! - \*************************************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeCameraManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n\n\n\n // ----------------------------------------------------------------------------\n// vtkMouseCameraTrackballRotateManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkMouseCameraTrackballRotateManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkMouseCameraTrackballRotateManipulator');\n var newCamPos = new Float64Array(3);\n var newFp = new Float64Array(3);\n var newViewUp = new Float64Array(3);\n var trans = new Float64Array(16);\n var v2 = new Float64Array(3);\n var centerNeg = new Float64Array(3);\n var direction = new Float64Array(3);\n\n publicAPI.onButtonDown = function (interactor, renderer, position) {\n model.previousPosition = position;\n };\n\n publicAPI.onMouseMove = function (interactor, renderer, position) {\n if (!position) {\n return;\n }\n\n var camera = renderer.getActiveCamera();\n var cameraPos = camera.getPosition();\n var cameraFp = camera.getFocalPoint();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(trans);\n var center = model.center,\n rotationFactor = model.rotationFactor; // Translate to center\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, center);\n var dx = model.previousPosition.x - position.x;\n var dy = model.previousPosition.y - position.y;\n var size = interactor.getView().getSize(); // Azimuth\n\n var viewUp = camera.getViewUp();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(trans, trans, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"radiansFromDegrees\"](360.0 * dx / size[0] * rotationFactor), viewUp); // Elevation\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"cross\"](camera.getDirectionOfProjection(), viewUp, v2);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(trans, trans, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"radiansFromDegrees\"](-360.0 * dy / size[1] * rotationFactor), v2); // Translate back\n\n centerNeg[0] = -center[0];\n centerNeg[1] = -center[1];\n centerNeg[2] = -center[2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, centerNeg); // Apply transformation to camera position, focal point, and view up\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newCamPos, cameraPos, trans);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newFp, cameraFp, trans);\n direction[0] = viewUp[0] + cameraPos[0];\n direction[1] = viewUp[1] + cameraPos[1];\n direction[2] = viewUp[2] + cameraPos[2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newViewUp, direction, trans);\n camera.setPosition(newCamPos[0], newCamPos[1], newCamPos[2]);\n camera.setFocalPoint(newFp[0], newFp[1], newFp[2]);\n camera.setViewUp(newViewUp[0] - newCamPos[0], newViewUp[1] - newCamPos[1], newViewUp[2] - newCamPos[2]);\n camera.orthogonalizeViewUp();\n renderer.resetCameraClippingRange();\n\n if (interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n\n model.previousPosition = position;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_Interaction_Manipulators_CompositeCameraManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues); // Object specific methods\n\n vtkMouseCameraTrackballRotateManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkMouseCameraTrackballRotateManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js": -/*!***********************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js ***! - \***********************************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeCameraManipulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeCameraManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkMouseCameraTrackballZoomManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkMouseCameraTrackballZoomManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkMouseCameraTrackballZoomManipulator');\n\n publicAPI.onButtonDown = function (interactor, renderer, position) {\n model.previousPosition = position;\n var size = interactor.getView().getSize();\n var camera = renderer.getActiveCamera();\n var direction = model.flipDirection ? -1 : 1;\n\n if (camera.getParallelProjection()) {\n model.zoomScale = 1.5 / size[1] * direction;\n } else {\n var range = camera.getClippingRange();\n model.zoomScale = 1.5 * (range[1] / size[1]) * direction;\n }\n };\n\n publicAPI.onMouseMove = function (interactor, renderer, position) {\n if (!position) {\n return;\n }\n\n var dy = model.previousPosition.y - position.y;\n var camera = renderer.getActiveCamera();\n\n if (camera.getParallelProjection()) {\n var k = dy * model.zoomScale;\n camera.setParallelScale((1.0 - k) * camera.getParallelScale());\n } else {\n var cameraPos = camera.getPosition();\n var cameraFp = camera.getFocalPoint();\n var norm = camera.getDirectionOfProjection();\n\n var _k = dy * model.zoomScale;\n\n var tmp = _k * norm[0];\n cameraPos[0] += tmp;\n cameraFp[0] += tmp;\n tmp = _k * norm[1];\n cameraPos[1] += tmp;\n cameraFp[1] += tmp;\n tmp = _k * norm[2];\n cameraPos[2] += tmp;\n cameraFp[2] += tmp;\n\n if (!camera.getFreezeFocalPoint()) {\n camera.setFocalPoint(cameraFp[0], cameraFp[1], cameraFp[2]);\n }\n\n camera.setPosition(cameraPos[0], cameraPos[1], cameraPos[2]);\n renderer.resetCameraClippingRange();\n }\n\n if (interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n\n model.previousPosition = position;\n };\n\n publicAPI.onScroll = function (interactor, renderer, delta) {\n if (!delta) {\n return;\n }\n\n var camera = renderer.getActiveCamera();\n var dyf = 1 - delta / 10;\n\n if (camera.getParallelProjection()) {\n camera.setParallelScale(camera.getParallelScale() / dyf);\n } else {\n camera.dolly(dyf);\n renderer.resetCameraClippingRange();\n }\n\n if (interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n zoomScale: 0.0,\n flipDirection: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_Interaction_Manipulators_CompositeCameraManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['flipDirection']); // Object specific methods\n\n vtkMouseCameraTrackballZoomManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkMouseCameraTrackballZoomManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js ***! - \*********************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/CompositeMouseManipulator/index.js\");\n\n // ----------------------------------------------------------------------------\n// vtkMouseRangeManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkMouseRangeManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkMouseRangeManipulator'); // Keep track of delta that is below the value\n // of one step to progressively increment it\n\n var incrementalDelta = new Map(); // Internal methods\n //-------------------------------------------------------------------------\n\n function scaleDeltaToRange(listener, normalizedDelta) {\n return normalizedDelta * ((listener.max - listener.min) / (listener.step + 1));\n } //-------------------------------------------------------------------------\n\n\n function processDelta(listener, delta) {\n var oldValue = listener.getValue(); // Apply scale and cached delta to current delta\n\n var newDelta = delta * listener.scale + incrementalDelta.get(listener);\n var value = oldValue + newDelta; // Compute new value based on step\n\n var difference = value - listener.min;\n var stepsToDifference = Math.round(difference / listener.step);\n value = listener.min + listener.step * stepsToDifference;\n value = Math.max(value, listener.min);\n value = Math.min(value, listener.max);\n\n if (value !== oldValue) {\n // Update value\n listener.setValue(value);\n incrementalDelta.set(listener, 0);\n } else if (value === listener.min && newDelta < 0 || value === listener.max && newDelta > 0) {\n // Do not allow incremental delta to go past range\n incrementalDelta.set(listener, 0);\n } else {\n // Store delta for the next iteration\n incrementalDelta.set(listener, newDelta);\n }\n } // Public API methods\n // min:number = minimum allowable value\n // max:number = maximum allowable value\n // step:number = value per step -- smaller = more steps over a given distance, larger = fewer steps over a given distance\n // getValue:fn = function that returns current value\n // setValue:fn = function to set value\n // scale:number = scale value is applied to mouse event to allow users accelerate or decelerate delta without emitting more events\n //-------------------------------------------------------------------------\n\n\n publicAPI.setHorizontalListener = function (min, max, step, getValue, setValue) {\n var scale = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;\n var getFn = Number.isFinite(getValue) ? function () {\n return getValue;\n } : getValue;\n model.horizontalListener = {\n min: min,\n max: max,\n step: step,\n getValue: getFn,\n setValue: setValue,\n scale: scale\n };\n incrementalDelta.set(model.horizontalListener, 0);\n publicAPI.modified();\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.setVerticalListener = function (min, max, step, getValue, setValue) {\n var scale = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;\n var getFn = Number.isFinite(getValue) ? function () {\n return getValue;\n } : getValue;\n model.verticalListener = {\n min: min,\n max: max,\n step: step,\n getValue: getFn,\n setValue: setValue,\n scale: scale\n };\n incrementalDelta.set(model.verticalListener, 0);\n publicAPI.modified();\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.setScrollListener = function (min, max, step, getValue, setValue) {\n var scale = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;\n var getFn = Number.isFinite(getValue) ? function () {\n return getValue;\n } : getValue;\n model.scrollListener = {\n min: min,\n max: max,\n step: step,\n getValue: getFn,\n setValue: setValue,\n scale: scale\n };\n incrementalDelta.set(model.scrollListener, 0);\n publicAPI.modified();\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeHorizontalListener = function () {\n if (model.verticalListener) {\n incrementalDelta.delete(model.verticalListener);\n delete model.verticalListener;\n publicAPI.modified();\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeVerticalListener = function () {\n if (model.horizontalListener) {\n incrementalDelta.delete(model.horizontalListener);\n delete model.horizontalListener;\n publicAPI.modified();\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeScrollListener = function () {\n if (model.scrollListener) {\n incrementalDelta.delete(model.scrollListener);\n delete model.scrollListener;\n publicAPI.modified();\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeAllListeners = function () {\n publicAPI.removeHorizontalListener();\n publicAPI.removeVerticalListener();\n publicAPI.removeScrollListener();\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.onButtonDown = function (interactor, renderer, position) {\n model.previousPosition = position;\n var glRenderWindow = interactor.getView(); // Ratio is the dom size vs renderwindow size\n\n var ratio = glRenderWindow.getContainerSize()[0] / glRenderWindow.getSize()[0]; // Get proper pixel range used by viewport in rw size space\n\n var size = glRenderWindow.getViewportSize(renderer); // rescale size to match mouse event position\n\n model.containerSize = size.map(function (v) {\n return v * ratio;\n });\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.onMouseMove = function (interactor, renderer, position) {\n if (!model.verticalListener && !model.horizontalListener) {\n return;\n }\n\n if (!position) {\n return;\n }\n\n if (model.horizontalListener) {\n var dxNorm = (position.x - model.previousPosition.x) / model.containerSize[0];\n var dx = scaleDeltaToRange(model.horizontalListener, dxNorm);\n processDelta(model.horizontalListener, dx);\n }\n\n if (model.verticalListener) {\n var dyNorm = (position.y - model.previousPosition.y) / model.containerSize[1];\n var dy = scaleDeltaToRange(model.verticalListener, dyNorm);\n processDelta(model.verticalListener, dy);\n }\n\n model.previousPosition = position;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.onScroll = function (interactor, renderer, delta) {\n if (!model.scrollListener || !delta) {\n return;\n }\n\n processDelta(model.scrollListener, delta * model.scrollListener.step);\n };\n\n publicAPI.onStartScroll = publicAPI.onScroll;\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n horizontalListener: null,\n verticalListener: null,\n scrollListener: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_Interaction_Manipulators_CompositeMouseManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object specific methods\n\n vtkMouseRangeManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkMouseRangeManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleManipulator/index.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleManipulator/index.js ***! - \*******************************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkDebugMacro;\nvar States = vtk_js_Sources_Rendering_Core_InteractorStyle__WEBPACK_IMPORTED_MODULE_1__[\"default\"].States; // ----------------------------------------------------------------------------\n// Event Types\n// ----------------------------------------------------------------------------\n\nvar START_INTERACTION_EVENT = {\n type: 'StartInteractionEvent'\n};\nvar INTERACTION_EVENT = {\n type: 'InteractionEvent'\n};\nvar END_INTERACTION_EVENT = {\n type: 'EndInteractionEvent'\n}; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction translateCamera(renderer, rwi, toX, toY, fromX, fromY) {\n var cam = renderer.getActiveCamera();\n var viewFocus = cam.getFocalPoint();\n viewFocus = rwi.getInteractorStyle().computeWorldToDisplay(renderer, viewFocus[0], viewFocus[1], viewFocus[2]);\n var focalDepth = viewFocus[2];\n var newPickPoint = rwi.getInteractorStyle().computeDisplayToWorld(renderer, toX, toY, focalDepth);\n var oldPickPoint = rwi.getInteractorStyle().computeDisplayToWorld(renderer, fromX, fromY, focalDepth); // camera motion is reversed\n\n var motionVector = [oldPickPoint[0] - newPickPoint[0], oldPickPoint[1] - newPickPoint[1], oldPickPoint[2] - newPickPoint[2]];\n viewFocus = cam.getFocalPoint();\n var viewPoint = cam.getPosition();\n cam.setFocalPoint(motionVector[0] + viewFocus[0], motionVector[1] + viewFocus[1], motionVector[2] + viewFocus[2]);\n cam.setPosition(motionVector[0] + viewPoint[0], motionVector[1] + viewPoint[1], motionVector[2] + viewPoint[2]);\n}\n\nfunction dollyToPosition(fact, position, renderer, rwi) {\n var cam = renderer.getActiveCamera();\n\n if (cam.getParallelProjection()) {\n // Zoom relatively to the cursor\n var aSize = rwi.getView().getSize();\n var w = aSize[0];\n var h = aSize[1];\n var x0 = w / 2;\n var y0 = h / 2;\n var x1 = position.x;\n var y1 = position.y;\n translateCamera(renderer, rwi, x0, y0, x1, y1);\n cam.setParallelScale(cam.getParallelScale() / fact);\n translateCamera(renderer, rwi, x1, y1, x0, y0);\n } else {\n // Zoom relatively to the cursor position\n // Move focal point to cursor position\n var viewFocus = cam.getFocalPoint();\n var norm = cam.getViewPlaneNormal();\n viewFocus = rwi.getInteractorStyle().computeWorldToDisplay(renderer, viewFocus[0], viewFocus[1], viewFocus[2]);\n var newFp = rwi.getInteractorStyle().computeDisplayToWorld(renderer, position.x, position.y, viewFocus[2]);\n cam.setFocalPoint(newFp[0], newFp[1], newFp[2]); // Move camera in/out along projection direction\n\n cam.dolly(fact);\n renderer.resetCameraClippingRange(); // Find new focal point\n\n var newCameraPos = cam.getPosition();\n viewFocus = cam.getFocalPoint();\n var newPoint = [0, 0, 0];\n var t = norm[0] * (viewFocus[0] - newCameraPos[0]) + norm[1] * (viewFocus[1] - newCameraPos[1]) + norm[2] * (viewFocus[2] - newCameraPos[2]);\n t /= Math.pow(norm[0], 2) + Math.pow(norm[1], 2) + Math.pow(norm[2], 2);\n newPoint[0] = newCameraPos[0] + norm[0] * t;\n newPoint[1] = newCameraPos[1] + norm[1] * t;\n newPoint[2] = newCameraPos[2] + norm[2] * t;\n cam.setFocalPoint(newPoint[0], newPoint[1], newPoint[2]);\n renderer.resetCameraClippingRange();\n }\n}\n\nfunction dollyByFactor(interactor, renderer, factor) {\n if (Number.isNaN(factor)) {\n return;\n }\n\n var camera = renderer.getActiveCamera();\n\n if (camera.getParallelProjection()) {\n camera.setParallelScale(camera.getParallelScale() / factor);\n } else {\n camera.dolly(factor);\n renderer.resetCameraClippingRange();\n }\n\n if (interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n dollyToPosition: dollyToPosition,\n translateCamera: translateCamera,\n dollyByFactor: dollyByFactor\n}; // ----------------------------------------------------------------------------\n// vtkInteractorStyleManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyleManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkInteractorStyleManipulator');\n model.mouseManipulators = [];\n model.keyboardManipulators = [];\n model.vrManipulators = [];\n model.gestureManipulators = [];\n model.currentManipulator = null;\n model.currentWheelManipulator = null;\n model.centerOfRotation = [0, 0, 0];\n model.rotationFactor = 1; //-------------------------------------------------------------------------\n\n publicAPI.removeAllManipulators = function () {\n publicAPI.removeAllMouseManipulators();\n publicAPI.removeAllKeyboardManipulators();\n publicAPI.removeAllVRManipulators();\n publicAPI.removeAllGestureManipulators();\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeAllMouseManipulators = function () {\n model.mouseManipulators = [];\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeAllKeyboardManipulators = function () {\n model.keyboardManipulators = [];\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeAllVRManipulators = function () {\n model.vrManipulators = [];\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeAllGestureManipulators = function () {\n model.gestureManipulators = [];\n }; //-------------------------------------------------------------------------\n\n\n var removeManipulator = function removeManipulator(manipulator, list) {\n var index = list.indexOf(manipulator);\n\n if (index === -1) {\n return false;\n }\n\n list.splice(index, 1);\n publicAPI.modified();\n return true;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeMouseManipulator = function (manipulator) {\n return removeManipulator(manipulator, model.mouseManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeKeyboardManipulator = function (manipulator) {\n return removeManipulator(manipulator, model.keyboardManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeVRManipulator = function (manipulator) {\n return removeManipulator(manipulator, model.vrManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.removeGestureManipulator = function (manipulator) {\n return removeManipulator(manipulator, model.gestureManipulators);\n }; //-------------------------------------------------------------------------\n\n\n var addManipulator = function addManipulator(manipulator, list) {\n var index = list.indexOf(manipulator);\n\n if (index !== -1) {\n return false;\n }\n\n list.push(manipulator);\n publicAPI.modified();\n return true;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.addMouseManipulator = function (manipulator) {\n return addManipulator(manipulator, model.mouseManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.addKeyboardManipulator = function (manipulator) {\n return addManipulator(manipulator, model.keyboardManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.addVRManipulator = function (manipulator) {\n return addManipulator(manipulator, model.vrManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.addGestureManipulator = function (manipulator) {\n return addManipulator(manipulator, model.gestureManipulators);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfMouseManipulators = function () {\n return model.mouseManipulators.length;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfKeyboardManipulators = function () {\n return model.keyboardManipulators.length;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfVRManipulators = function () {\n return model.vrManipulators.length;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfGestureManipulators = function () {\n return model.gestureManipulators.length;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.resetCurrentManipulator = function () {\n model.currentManipulator = null;\n model.currentWheelManipulator = null;\n }; //-------------------------------------------------------------------------\n // Mouse\n //-------------------------------------------------------------------------\n\n\n publicAPI.handleLeftButtonPress = function (callData) {\n model.previousPosition = callData.position;\n publicAPI.onButtonDown(1, callData);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleMiddleButtonPress = function (callData) {\n model.previousPosition = callData.position;\n publicAPI.onButtonDown(2, callData);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleRightButtonPress = function (callData) {\n model.previousPosition = callData.position;\n publicAPI.onButtonDown(3, callData);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleButton3D = function (ed) {\n if (!ed) {\n return;\n } // Look for a matching 3D camera interactor.\n\n\n model.currentManipulator = publicAPI.findVRManipulator(ed.device, ed.input, ed.pressed);\n\n if (model.currentManipulator) {\n model.currentManipulator.onButton3D(publicAPI, ed.pokedRenderer, model.state, ed.device, ed.input, ed.pressed);\n\n if (ed.pressed) {\n publicAPI.startCameraPose();\n } else {\n publicAPI.endCameraPose();\n }\n } else {\n vtkDebugMacro('No manipulator found');\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleMove3D = function (ed) {\n if (model.currentManipulator && model.state === States.IS_CAMERA_POSE) {\n model.currentManipulator.onMove3D(publicAPI, ed.pokedRenderer, model.state, ed);\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.onButtonDown = function (button, callData) {\n // Must not be processing an interaction to start another.\n if (model.currentManipulator) {\n return;\n } // Look for a matching camera interactor.\n\n\n model.currentManipulator = publicAPI.findMouseManipulator(button, callData.shiftKey, callData.controlKey, callData.altKey);\n\n if (model.currentManipulator) {\n if (model.currentManipulator.setCenter) {\n model.currentManipulator.setCenter(model.centerOfRotation);\n }\n\n if (model.currentManipulator.setRotationFactor) {\n model.currentManipulator.setRotationFactor(model.rotationFactor);\n }\n\n model.currentManipulator.startInteraction();\n model.currentManipulator.onButtonDown(model.interactor, callData.pokedRenderer, callData.position);\n model.interactor.requestAnimation(publicAPI.onButtonDown);\n publicAPI.invokeStartInteractionEvent(START_INTERACTION_EVENT);\n } else {\n vtkDebugMacro('No manipulator found');\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.findMouseManipulator = function (button, shift, control, alt) {\n // Look for a matching camera manipulator\n var manipulator = null;\n var count = model.mouseManipulators.length;\n\n while (count--) {\n var manip = model.mouseManipulators[count];\n\n if (manip && manip.getButton() === button && manip.getShift() === shift && manip.getControl() === control && manip.getAlt() === alt && manip.isDragEnabled()) {\n manipulator = manip;\n }\n }\n\n return manipulator;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.findVRManipulator = function (device, input) {\n // Look for a matching camera manipulator\n var manipulator = null;\n var count = model.vrManipulators.length;\n\n while (count--) {\n var manip = model.vrManipulators[count];\n\n if (manip && manip.getDevice() === device && manip.getInput() === input) {\n manipulator = manip;\n }\n }\n\n return manipulator;\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleLeftButtonRelease = function () {\n publicAPI.onButtonUp(1);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleMiddleButtonRelease = function () {\n publicAPI.onButtonUp(2);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleRightButtonRelease = function () {\n publicAPI.onButtonUp(3);\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.onButtonUp = function (button) {\n if (!model.currentManipulator) {\n return;\n }\n\n if (model.currentManipulator.getButton && model.currentManipulator.getButton() === button) {\n model.currentManipulator.onButtonUp(model.interactor);\n model.currentManipulator.endInteraction();\n model.currentManipulator = null;\n model.interactor.cancelAnimation(publicAPI.onButtonDown);\n publicAPI.invokeEndInteractionEvent(END_INTERACTION_EVENT);\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleStartMouseWheel = function (callData) {\n // Must not be processing a wheel interaction to start another.\n if (model.currentWheelManipulator) {\n return;\n }\n\n var manipulator = null;\n var count = model.mouseManipulators.length;\n\n while (count--) {\n var manip = model.mouseManipulators[count];\n\n if (manip && manip.isScrollEnabled() && manip.getShift() === callData.shiftKey && manip.getControl() === callData.controlKey && manip.getAlt() === callData.altKey) {\n manipulator = manip;\n }\n }\n\n if (manipulator) {\n model.currentWheelManipulator = manipulator;\n model.currentWheelManipulator.onStartScroll(model.interactor, callData.pokedRenderer, callData.spinY);\n model.currentWheelManipulator.startInteraction();\n model.interactor.requestAnimation(publicAPI.handleStartMouseWheel);\n publicAPI.invokeStartInteractionEvent(START_INTERACTION_EVENT);\n } else {\n vtkDebugMacro('No manipulator found');\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleEndMouseWheel = function () {\n if (!model.currentWheelManipulator) {\n return;\n }\n\n if (model.currentWheelManipulator.onEndScroll) {\n model.currentWheelManipulator.onEndScroll(model.interactor);\n model.currentWheelManipulator.endInteraction();\n model.currentWheelManipulator = null;\n model.interactor.cancelAnimation(publicAPI.handleStartMouseWheel);\n publicAPI.invokeEndInteractionEvent(END_INTERACTION_EVENT);\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleMouseWheel = function (callData) {\n if (model.currentWheelManipulator && model.currentWheelManipulator.onScroll) {\n model.currentWheelManipulator.onScroll(model.interactor, callData.pokedRenderer, callData.spinY, model.cachedMousePosition);\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n }\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleMouseMove = function (callData) {\n model.cachedMousePosition = callData.position;\n\n if (model.currentManipulator && model.currentManipulator.onMouseMove) {\n model.currentManipulator.onMouseMove(model.interactor, callData.pokedRenderer, callData.position);\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n }\n }; //-------------------------------------------------------------------------\n // Keyboard\n //-------------------------------------------------------------------------\n\n\n publicAPI.handleKeyPress = function (callData) {\n model.keyboardManipulators.filter(function (m) {\n return m.onKeyPress;\n }).forEach(function (manipulator) {\n manipulator.onKeyPress(model.interactor, callData.pokedRenderer, callData.key);\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n });\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleKeyDown = function (callData) {\n model.keyboardManipulators.filter(function (m) {\n return m.onKeyDown;\n }).forEach(function (manipulator) {\n manipulator.onKeyDown(model.interactor, callData.pokedRenderer, callData.key);\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n });\n }; //-------------------------------------------------------------------------\n\n\n publicAPI.handleKeyUp = function (callData) {\n model.keyboardManipulators.filter(function (m) {\n return m.onKeyUp;\n }).forEach(function (manipulator) {\n manipulator.onKeyUp(model.interactor, callData.pokedRenderer, callData.key);\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n });\n }; //-------------------------------------------------------------------------\n // Gesture\n //-------------------------------------------------------------------------\n\n\n publicAPI.handleStartPinch = function (callData) {\n publicAPI.startDolly();\n var count = model.gestureManipulators.length;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isPinchEnabled()) {\n manipulator.onStartPinch(model.interactor, callData.scale);\n manipulator.startInteraction();\n }\n }\n\n model.interactor.requestAnimation(publicAPI.handleStartPinch);\n publicAPI.invokeStartInteractionEvent(START_INTERACTION_EVENT);\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndPinch = function () {\n publicAPI.endDolly();\n var count = model.gestureManipulators.length;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isPinchEnabled()) {\n manipulator.onEndPinch(model.interactor);\n manipulator.endInteraction();\n }\n }\n\n model.interactor.cancelAnimation(publicAPI.handleStartPinch);\n publicAPI.invokeEndInteractionEvent(END_INTERACTION_EVENT);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleStartRotate = function (callData) {\n publicAPI.startRotate();\n var count = model.gestureManipulators.length;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isRotateEnabled()) {\n manipulator.onStartRotate(model.interactor, callData.rotation);\n manipulator.startInteraction();\n }\n }\n\n model.interactor.requestAnimation(publicAPI.handleStartRotate);\n publicAPI.invokeStartInteractionEvent(START_INTERACTION_EVENT);\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndRotate = function () {\n publicAPI.endRotate();\n var count = model.gestureManipulators.length;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isRotateEnabled()) {\n manipulator.onEndRotate(model.interactor);\n manipulator.endInteraction();\n }\n }\n\n model.interactor.cancelAnimation(publicAPI.handleStartRotate);\n publicAPI.invokeEndInteractionEvent(END_INTERACTION_EVENT);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleStartPan = function (callData) {\n publicAPI.startPan();\n var count = model.gestureManipulators.length;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isPanEnabled()) {\n manipulator.onStartPan(model.interactor, callData.translation);\n manipulator.startInteraction();\n }\n }\n\n model.interactor.requestAnimation(publicAPI.handleStartPan);\n publicAPI.invokeStartInteractionEvent(START_INTERACTION_EVENT);\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndPan = function () {\n publicAPI.endPan();\n var count = model.gestureManipulators.length;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isPanEnabled()) {\n manipulator.onEndPan(model.interactor);\n manipulator.endInteraction();\n }\n }\n\n model.interactor.cancelAnimation(publicAPI.handleStartPan);\n publicAPI.invokeEndInteractionEvent(END_INTERACTION_EVENT);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handlePinch = function (callData) {\n var count = model.gestureManipulators.length;\n var actionCount = 0;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isPinchEnabled()) {\n manipulator.onPinch(model.interactor, callData.pokedRenderer, callData.scale);\n actionCount++;\n }\n }\n\n if (actionCount) {\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handlePan = function (callData) {\n var count = model.gestureManipulators.length;\n var actionCount = 0;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isPanEnabled()) {\n manipulator.onPan(model.interactor, callData.pokedRenderer, callData.translation);\n actionCount++;\n }\n }\n\n if (actionCount) {\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleRotate = function (callData) {\n var count = model.gestureManipulators.length;\n var actionCount = 0;\n\n while (count--) {\n var manipulator = model.gestureManipulators[count];\n\n if (manipulator && manipulator.isRotateEnabled()) {\n manipulator.onRotate(model.interactor, callData.pokedRenderer, callData.rotation);\n actionCount++;\n }\n }\n\n if (actionCount) {\n publicAPI.invokeInteractionEvent(INTERACTION_EVENT);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n cachedMousePosition: null,\n currentManipulator: null,\n currentWheelManipulator: null,\n // mouseManipulators: null,\n // keyboardManipulators: null,\n // vrManipulators: null,\n // gestureManipulators: null,\n centerOfRotation: [0, 0, 0],\n rotationFactor: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_InteractorStyle__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['rotationFactor']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['mouseManipulators', 'keyboardManipulators', 'vrManipulators', 'gestureManipulators']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['centerOfRotation'], 3); // Object specific methods\n\n vtkInteractorStyleManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkInteractorStyleManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleTrackballCamera/index.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleTrackballCamera/index.js ***! - \***********************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants.js\");\n\n\n\n\n\nvar States = vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].States;\n/* eslint-disable no-lonely-if */\n// ----------------------------------------------------------------------------\n// vtkInteractorStyleTrackballCamera methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyleTrackballCamera(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkInteractorStyleTrackballCamera'); // Public API methods\n\n publicAPI.handleMouseMove = function (callData) {\n var pos = callData.position;\n var renderer = callData.pokedRenderer;\n\n switch (model.state) {\n case States.IS_ROTATE:\n publicAPI.handleMouseRotate(renderer, pos);\n publicAPI.invokeInteractionEvent({\n type: 'InteractionEvent'\n });\n break;\n\n case States.IS_PAN:\n publicAPI.handleMousePan(renderer, pos);\n publicAPI.invokeInteractionEvent({\n type: 'InteractionEvent'\n });\n break;\n\n case States.IS_DOLLY:\n publicAPI.handleMouseDolly(renderer, pos);\n publicAPI.invokeInteractionEvent({\n type: 'InteractionEvent'\n });\n break;\n\n case States.IS_SPIN:\n publicAPI.handleMouseSpin(renderer, pos);\n publicAPI.invokeInteractionEvent({\n type: 'InteractionEvent'\n });\n break;\n\n default:\n break;\n }\n\n model.previousPosition = pos;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleButton3D = function (ed) {\n if (ed && ed.pressed && ed.device === vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_4__[\"Device\"].RightController && ed.input === vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_4__[\"Input\"].TrackPad) {\n publicAPI.startCameraPose();\n return;\n }\n\n if (ed && !ed.pressed && ed.device === vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_4__[\"Device\"].RightController && ed.input === vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_4__[\"Input\"].TrackPad && model.state === States.IS_CAMERA_POSE) {\n publicAPI.endCameraPose(); // return;\n }\n };\n\n publicAPI.handleMove3D = function (ed) {\n switch (model.state) {\n case States.IS_CAMERA_POSE:\n publicAPI.updateCameraPose(ed);\n break;\n\n default:\n }\n };\n\n publicAPI.updateCameraPose = function (ed) {\n // move the world in the direction of the\n // controller\n var camera = ed.pokedRenderer.getActiveCamera();\n var oldTrans = camera.getPhysicalTranslation(); // look at the y axis to determine how fast / what direction to move\n\n var speed = ed.gamepad.axes[1]; // 0.05 meters / frame movement\n\n var pscale = speed * 0.05 / camera.getPhysicalScale(); // convert orientation to world coordinate direction\n\n var dir = camera.physicalOrientationToWorldDirection(ed.orientation);\n camera.setPhysicalTranslation(oldTrans[0] + dir[0] * pscale, oldTrans[1] + dir[1] * pscale, oldTrans[2] + dir[2] * pscale);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleLeftButtonPress = function (callData) {\n var pos = callData.position;\n model.previousPosition = pos;\n\n if (callData.shiftKey) {\n if (callData.controlKey || callData.altKey) {\n publicAPI.startDolly();\n } else {\n publicAPI.startPan();\n }\n } else {\n if (callData.controlKey || callData.altKey) {\n publicAPI.startSpin();\n } else {\n publicAPI.startRotate();\n }\n }\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleLeftButtonRelease = function () {\n switch (model.state) {\n case States.IS_DOLLY:\n publicAPI.endDolly();\n break;\n\n case States.IS_PAN:\n publicAPI.endPan();\n break;\n\n case States.IS_SPIN:\n publicAPI.endSpin();\n break;\n\n case States.IS_ROTATE:\n publicAPI.endRotate();\n break;\n\n default:\n break;\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleStartMouseWheel = function (callData) {\n publicAPI.startDolly();\n publicAPI.handleMouseWheel(callData);\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndMouseWheel = function () {\n publicAPI.endDolly();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleStartPinch = function (callData) {\n model.previousScale = callData.scale;\n publicAPI.startDolly();\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndPinch = function () {\n publicAPI.endDolly();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleStartRotate = function (callData) {\n model.previousRotation = callData.rotation;\n publicAPI.startRotate();\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndRotate = function () {\n publicAPI.endRotate();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleStartPan = function (callData) {\n model.previousTranslation = callData.translation;\n publicAPI.startPan();\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleEndPan = function () {\n publicAPI.endPan();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handlePinch = function (callData) {\n publicAPI.dollyByFactor(callData.pokedRenderer, callData.scale / model.previousScale);\n model.previousScale = callData.scale;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handlePan = function (callData) {\n var camera = callData.pokedRenderer.getActiveCamera(); // Calculate the focal depth since we'll be using it a lot\n\n var viewFocus = camera.getFocalPoint();\n viewFocus = publicAPI.computeWorldToDisplay(callData.pokedRenderer, viewFocus[0], viewFocus[1], viewFocus[2]);\n var focalDepth = viewFocus[2];\n var trans = callData.translation;\n var lastTrans = model.previousTranslation;\n var newPickPoint = publicAPI.computeDisplayToWorld(callData.pokedRenderer, viewFocus[0] + trans[0] - lastTrans[0], viewFocus[1] + trans[1] - lastTrans[1], focalDepth); // Has to recalc old mouse point since the viewport has moved,\n // so can't move it outside the loop\n\n var oldPickPoint = publicAPI.computeDisplayToWorld(callData.pokedRenderer, viewFocus[0], viewFocus[1], focalDepth); // Camera motion is reversed\n\n var motionVector = [];\n motionVector[0] = oldPickPoint[0] - newPickPoint[0];\n motionVector[1] = oldPickPoint[1] - newPickPoint[1];\n motionVector[2] = oldPickPoint[2] - newPickPoint[2];\n viewFocus = camera.getFocalPoint();\n var viewPoint = camera.getPosition();\n camera.setFocalPoint(motionVector[0] + viewFocus[0], motionVector[1] + viewFocus[1], motionVector[2] + viewFocus[2]);\n camera.setPosition(motionVector[0] + viewPoint[0], motionVector[1] + viewPoint[1], motionVector[2] + viewPoint[2]);\n\n if (model.interactor.getLightFollowCamera()) {\n callData.pokedRenderer.updateLightsGeometryToFollowCamera();\n }\n\n camera.orthogonalizeViewUp();\n model.previousTranslation = callData.translation;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleRotate = function (callData) {\n var camera = callData.pokedRenderer.getActiveCamera();\n camera.roll(callData.rotation - model.previousRotation);\n camera.orthogonalizeViewUp();\n model.previousRotation = callData.rotation;\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleMouseRotate = function (renderer, position) {\n var rwi = model.interactor;\n var dx = position.x - model.previousPosition.x;\n var dy = position.y - model.previousPosition.y;\n var size = rwi.getView().getViewportSize(renderer);\n var deltaElevation = -0.1;\n var deltaAzimuth = -0.1;\n\n if (size[0] && size[1]) {\n deltaElevation = -20.0 / size[1];\n deltaAzimuth = -20.0 / size[0];\n }\n\n var rxf = dx * deltaAzimuth * model.motionFactor;\n var ryf = dy * deltaElevation * model.motionFactor;\n var camera = renderer.getActiveCamera();\n\n if (!Number.isNaN(rxf) && !Number.isNaN(ryf)) {\n camera.azimuth(rxf);\n camera.elevation(ryf);\n camera.orthogonalizeViewUp();\n }\n\n if (model.autoAdjustCameraClippingRange) {\n renderer.resetCameraClippingRange();\n }\n\n if (rwi.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleMouseSpin = function (renderer, position) {\n var rwi = model.interactor;\n var camera = renderer.getActiveCamera();\n var center = rwi.getView().getViewportCenter(renderer);\n var oldAngle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"degreesFromRadians\"](Math.atan2(model.previousPosition.y - center[1], model.previousPosition.x - center[0]));\n var newAngle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"degreesFromRadians\"](Math.atan2(position.y - center[1], position.x - center[0])) - oldAngle;\n\n if (!Number.isNaN(newAngle)) {\n camera.roll(newAngle);\n camera.orthogonalizeViewUp();\n }\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.handleMousePan = function (renderer, position) {\n var camera = renderer.getActiveCamera(); // Calculate the focal depth since we'll be using it a lot\n\n var viewFocus = camera.getFocalPoint();\n viewFocus = publicAPI.computeWorldToDisplay(renderer, viewFocus[0], viewFocus[1], viewFocus[2]);\n var focalDepth = viewFocus[2];\n var newPickPoint = publicAPI.computeDisplayToWorld(renderer, position.x, position.y, focalDepth); // Has to recalc old mouse point since the viewport has moved,\n // so can't move it outside the loop\n\n var oldPickPoint = publicAPI.computeDisplayToWorld(renderer, model.previousPosition.x, model.previousPosition.y, focalDepth); // Camera motion is reversed\n\n var motionVector = [];\n motionVector[0] = oldPickPoint[0] - newPickPoint[0];\n motionVector[1] = oldPickPoint[1] - newPickPoint[1];\n motionVector[2] = oldPickPoint[2] - newPickPoint[2];\n viewFocus = camera.getFocalPoint();\n var viewPoint = camera.getPosition();\n camera.setFocalPoint(motionVector[0] + viewFocus[0], motionVector[1] + viewFocus[1], motionVector[2] + viewFocus[2]);\n camera.setPosition(motionVector[0] + viewPoint[0], motionVector[1] + viewPoint[1], motionVector[2] + viewPoint[2]);\n\n if (model.interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleMouseDolly = function (renderer, position) {\n var dy = position.y - model.previousPosition.y;\n var rwi = model.interactor;\n var center = rwi.getView().getViewportCenter(renderer);\n var dyf = model.motionFactor * dy / center[1];\n publicAPI.dollyByFactor(renderer, Math.pow(1.1, dyf));\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.handleMouseWheel = function (callData) {\n var dyf = 1 - callData.spinY / 10; // divide by 10 to lower the zoom factor\n\n publicAPI.dollyByFactor(callData.pokedRenderer, dyf);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.dollyByFactor = function (renderer, factor) {\n if (Number.isNaN(factor)) {\n return;\n }\n\n var camera = renderer.getActiveCamera();\n\n if (camera.getParallelProjection()) {\n camera.setParallelScale(camera.getParallelScale() / factor);\n } else {\n camera.dolly(factor);\n\n if (model.autoAdjustCameraClippingRange) {\n renderer.resetCameraClippingRange();\n }\n }\n\n if (model.interactor.getLightFollowCamera()) {\n renderer.updateLightsGeometryToFollowCamera();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n motionFactor: 10.0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_InteractorStyle__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['motionFactor']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkInteractorStyleTrackballCamera(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkInteractorStyleTrackballCamera'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleTrackballCamera/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js": -/*!************************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js ***! - \************************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Worker_fn; });\n/* harmony import */ var _worker_loader_dist_runtime_inline_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../../worker-loader/dist/runtime/inline.js */ \"./node_modules/worker-loader/dist/runtime/inline.js\");\n/* harmony import */ var _worker_loader_dist_runtime_inline_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_worker_loader_dist_runtime_inline_js__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction Worker_fn() {\n return _worker_loader_dist_runtime_inline_js__WEBPACK_IMPORTED_MODULE_0___default()(\"/******/ (function(modules) { // webpackBootstrap\\n/******/ \\t// The module cache\\n/******/ \\tvar installedModules = {};\\n/******/\\n/******/ \\t// The require function\\n/******/ \\tfunction __webpack_require__(moduleId) {\\n/******/\\n/******/ \\t\\t// Check if module is in cache\\n/******/ \\t\\tif(installedModules[moduleId]) {\\n/******/ \\t\\t\\treturn installedModules[moduleId].exports;\\n/******/ \\t\\t}\\n/******/ \\t\\t// Create a new module (and put it into the cache)\\n/******/ \\t\\tvar module = installedModules[moduleId] = {\\n/******/ \\t\\t\\ti: moduleId,\\n/******/ \\t\\t\\tl: false,\\n/******/ \\t\\t\\texports: {}\\n/******/ \\t\\t};\\n/******/\\n/******/ \\t\\t// Execute the module function\\n/******/ \\t\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\n/******/\\n/******/ \\t\\t// Flag the module as loaded\\n/******/ \\t\\tmodule.l = true;\\n/******/\\n/******/ \\t\\t// Return the exports of the module\\n/******/ \\t\\treturn module.exports;\\n/******/ \\t}\\n/******/\\n/******/\\n/******/ \\t// expose the modules object (__webpack_modules__)\\n/******/ \\t__webpack_require__.m = modules;\\n/******/\\n/******/ \\t// expose the module cache\\n/******/ \\t__webpack_require__.c = installedModules;\\n/******/\\n/******/ \\t// define getter function for harmony exports\\n/******/ \\t__webpack_require__.d = function(exports, name, getter) {\\n/******/ \\t\\tif(!__webpack_require__.o(exports, name)) {\\n/******/ \\t\\t\\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\\n/******/ \\t\\t}\\n/******/ \\t};\\n/******/\\n/******/ \\t// define __esModule on exports\\n/******/ \\t__webpack_require__.r = function(exports) {\\n/******/ \\t\\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\\n/******/ \\t\\t\\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\\n/******/ \\t\\t}\\n/******/ \\t\\tObject.defineProperty(exports, '__esModule', { value: true });\\n/******/ \\t};\\n/******/\\n/******/ \\t// create a fake namespace object\\n/******/ \\t// mode & 1: value is a module id, require it\\n/******/ \\t// mode & 2: merge all properties of value into the ns\\n/******/ \\t// mode & 4: return value when already ns object\\n/******/ \\t// mode & 8|1: behave like require\\n/******/ \\t__webpack_require__.t = function(value, mode) {\\n/******/ \\t\\tif(mode & 1) value = __webpack_require__(value);\\n/******/ \\t\\tif(mode & 8) return value;\\n/******/ \\t\\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\\n/******/ \\t\\tvar ns = Object.create(null);\\n/******/ \\t\\t__webpack_require__.r(ns);\\n/******/ \\t\\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\\n/******/ \\t\\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\\n/******/ \\t\\treturn ns;\\n/******/ \\t};\\n/******/\\n/******/ \\t// getDefaultExport function for compatibility with non-harmony modules\\n/******/ \\t__webpack_require__.n = function(module) {\\n/******/ \\t\\tvar getter = module && module.__esModule ?\\n/******/ \\t\\t\\tfunction getDefault() { return module['default']; } :\\n/******/ \\t\\t\\tfunction getModuleExports() { return module; };\\n/******/ \\t\\t__webpack_require__.d(getter, 'a', getter);\\n/******/ \\t\\treturn getter;\\n/******/ \\t};\\n/******/\\n/******/ \\t// Object.prototype.hasOwnProperty.call\\n/******/ \\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\n/******/\\n/******/ \\t// __webpack_public_path__\\n/******/ \\t__webpack_require__.p = \\\"\\\";\\n/******/\\n/******/\\n/******/ \\t// Load entry module and return exports\\n/******/ \\treturn __webpack_require__(__webpack_require__.s = \\\"./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js\\\");\\n/******/ })\\n/************************************************************************/\\n/******/ ({\\n\\n/***/ \\\"./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js\\\":\\n/*!************************************************************************************************************!*\\\\\\n !*** ./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js ***!\\n \\\\************************************************************************************************************/\\n/*! no exports provided */\\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\\n\\n\\\"use strict\\\";\\neval(\\\"__webpack_require__.r(__webpack_exports__);\\\\n/* harmony import */ var webworker_promise_lib_register__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! webworker-promise/lib/register */ \\\\\\\"./node_modules/webworker-promise/lib/register.js\\\\\\\");\\\\n/* harmony import */ var webworker_promise_lib_register__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(webworker_promise_lib_register__WEBPACK_IMPORTED_MODULE_0__);\\\\n\\\\n\\\\n/* eslint-disable */\\\\n// prettier-ignore\\\\nwebworker_promise_lib_register__WEBPACK_IMPORTED_MODULE_0___default()(function (message, emit) {\\\\n var array = message.array;\\\\n var min = message.min;\\\\n var max = message.max;\\\\n\\\\n var offset = message.component || 0;\\\\n var step = message.numberOfComponents || 1;\\\\n\\\\n var numberOfBins = message.numberOfBins;\\\\n var delta = max - min;\\\\n var histogram = new Float32Array(numberOfBins);\\\\n histogram.fill(0);\\\\n var len = array.length;\\\\n for (var i = offset; i < len; i += step) {\\\\n var idx = Math.floor(\\\\n (numberOfBins - 1) * (Number(array[i]) - min) / delta\\\\n );\\\\n histogram[idx] += 1;\\\\n }\\\\n\\\\n return Promise.resolve(\\\\n new webworker_promise_lib_register__WEBPACK_IMPORTED_MODULE_0___default.a.TransferableResponse(histogram, [histogram.buffer])\\\\n );\\\\n});\\\\n\\\\n\\\\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js?\\\");\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/webworker-promise/lib/register.js\\\":\\n/*!********************************************************!*\\\\\\n !*** ./node_modules/webworker-promise/lib/register.js ***!\\n \\\\********************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\neval(\\\"\\\\n\\\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\\\\\"value\\\\\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\\\\n\\\\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\\\\\\\"value\\\\\\\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\\\\n\\\\nvar _typeof = typeof Symbol === \\\\\\\"function\\\\\\\" && typeof Symbol.iterator === \\\\\\\"symbol\\\\\\\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \\\\\\\"function\\\\\\\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \\\\\\\"symbol\\\\\\\" : typeof obj; };\\\\n\\\\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\\\\n\\\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\\\\\"Cannot call a class as a function\\\\\\\"); } }\\\\n\\\\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\\\\\\\"this hasn't been initialised - super() hasn't been called\\\\\\\"); } return call && (typeof call === \\\\\\\"object\\\\\\\" || typeof call === \\\\\\\"function\\\\\\\") ? call : self; }\\\\n\\\\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \\\\\\\"function\\\\\\\" && superClass !== null) { throw new TypeError(\\\\\\\"Super expression must either be null or a function, not \\\\\\\" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\\\\n\\\\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\\\\n\\\\nvar TinyEmitter = __webpack_require__(/*! ./tiny-emitter */ \\\\\\\"./node_modules/webworker-promise/lib/tiny-emitter.js\\\\\\\");\\\\n\\\\nvar MESSAGE_RESULT = 0;\\\\nvar MESSAGE_EVENT = 1;\\\\n\\\\nvar RESULT_ERROR = 0;\\\\nvar RESULT_SUCCESS = 1;\\\\n\\\\nvar DEFAULT_HANDLER = 'main';\\\\n\\\\nvar isPromise = function isPromise(o) {\\\\n return (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object' && typeof o.then === 'function' && typeof o.catch === 'function';\\\\n};\\\\n\\\\nfunction RegisterPromise(fn) {\\\\n var handlers = _defineProperty({}, DEFAULT_HANDLER, fn);\\\\n var sendPostMessage = self.postMessage.bind(self);\\\\n\\\\n var server = new (function (_TinyEmitter) {\\\\n _inherits(WorkerRegister, _TinyEmitter);\\\\n\\\\n function WorkerRegister() {\\\\n _classCallCheck(this, WorkerRegister);\\\\n\\\\n return _possibleConstructorReturn(this, (WorkerRegister.__proto__ || Object.getPrototypeOf(WorkerRegister)).apply(this, arguments));\\\\n }\\\\n\\\\n _createClass(WorkerRegister, [{\\\\n key: 'emit',\\\\n value: function emit(eventName) {\\\\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\\\\n args[_key - 1] = arguments[_key];\\\\n }\\\\n\\\\n sendPostMessage({ eventName: eventName, args: args });\\\\n return this;\\\\n }\\\\n }, {\\\\n key: 'emitLocally',\\\\n value: function emitLocally(eventName) {\\\\n var _get2;\\\\n\\\\n for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\\\\n args[_key2 - 1] = arguments[_key2];\\\\n }\\\\n\\\\n (_get2 = _get(WorkerRegister.prototype.__proto__ || Object.getPrototypeOf(WorkerRegister.prototype), 'emit', this)).call.apply(_get2, [this, eventName].concat(args));\\\\n }\\\\n }, {\\\\n key: 'operation',\\\\n value: function operation(name, handler) {\\\\n handlers[name] = handler;\\\\n return this;\\\\n }\\\\n }]);\\\\n\\\\n return WorkerRegister;\\\\n }(TinyEmitter))();\\\\n\\\\n var run = function run(messageId, payload, handlerName) {\\\\n\\\\n var onSuccess = function onSuccess(result) {\\\\n if (result && result instanceof TransferableResponse) {\\\\n sendResult(messageId, RESULT_SUCCESS, result.payload, result.transferable);\\\\n } else {\\\\n sendResult(messageId, RESULT_SUCCESS, result);\\\\n }\\\\n };\\\\n\\\\n var onError = function onError(e) {\\\\n sendResult(messageId, RESULT_ERROR, {\\\\n message: e.message,\\\\n stack: e.stack\\\\n });\\\\n };\\\\n\\\\n try {\\\\n var result = runFn(messageId, payload, handlerName);\\\\n if (isPromise(result)) {\\\\n result.then(onSuccess).catch(onError);\\\\n } else {\\\\n onSuccess(result);\\\\n }\\\\n } catch (e) {\\\\n onError(e);\\\\n }\\\\n };\\\\n\\\\n var runFn = function runFn(messageId, payload, handlerName) {\\\\n var handler = handlers[handlerName || DEFAULT_HANDLER];\\\\n if (!handler) throw new Error('Not found handler for this request');\\\\n\\\\n return handler(payload, sendEvent.bind(null, messageId));\\\\n };\\\\n\\\\n var sendResult = function sendResult(messageId, success, payload) {\\\\n var transferable = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];\\\\n\\\\n sendPostMessage([MESSAGE_RESULT, messageId, success, payload], transferable);\\\\n };\\\\n\\\\n var sendEvent = function sendEvent(messageId, eventName, payload) {\\\\n if (!eventName) throw new Error('eventName is required');\\\\n\\\\n if (typeof eventName !== 'string') throw new Error('eventName should be string');\\\\n\\\\n sendPostMessage([MESSAGE_EVENT, messageId, eventName, payload]);\\\\n };\\\\n\\\\n self.addEventListener('message', function (_ref) {\\\\n var data = _ref.data;\\\\n\\\\n if (Array.isArray(data)) {\\\\n run.apply(undefined, _toConsumableArray(data));\\\\n } else if (data && data.eventName) {\\\\n server.emitLocally.apply(server, [data.eventName].concat(_toConsumableArray(data.args)));\\\\n }\\\\n });\\\\n\\\\n return server;\\\\n}\\\\n\\\\nvar TransferableResponse = function TransferableResponse(payload, transferable) {\\\\n _classCallCheck(this, TransferableResponse);\\\\n\\\\n this.payload = payload;\\\\n this.transferable = transferable;\\\\n};\\\\n\\\\nmodule.exports = RegisterPromise;\\\\nmodule.exports.TransferableResponse = TransferableResponse;\\\\n\\\\n//# sourceURL=webpack://diglettk/./node_modules/webworker-promise/lib/register.js?\\\");\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/webworker-promise/lib/tiny-emitter.js\\\":\\n/*!************************************************************!*\\\\\\n !*** ./node_modules/webworker-promise/lib/tiny-emitter.js ***!\\n \\\\************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\neval(\\\"\\\\n\\\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\\\\\"value\\\\\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\\\\n\\\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\\\\\"Cannot call a class as a function\\\\\\\"); } }\\\\n\\\\nvar TinyEmitter = function () {\\\\n function TinyEmitter() {\\\\n _classCallCheck(this, TinyEmitter);\\\\n\\\\n Object.defineProperty(this, '__listeners', {\\\\n value: {},\\\\n enumerable: false,\\\\n writable: false\\\\n });\\\\n }\\\\n\\\\n _createClass(TinyEmitter, [{\\\\n key: 'emit',\\\\n value: function emit(eventName) {\\\\n if (!this.__listeners[eventName]) return this;\\\\n\\\\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\\\\n args[_key - 1] = arguments[_key];\\\\n }\\\\n\\\\n var _iteratorNormalCompletion = true;\\\\n var _didIteratorError = false;\\\\n var _iteratorError = undefined;\\\\n\\\\n try {\\\\n for (var _iterator = this.__listeners[eventName][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\\\\n var handler = _step.value;\\\\n\\\\n handler.apply(undefined, args);\\\\n }\\\\n } catch (err) {\\\\n _didIteratorError = true;\\\\n _iteratorError = err;\\\\n } finally {\\\\n try {\\\\n if (!_iteratorNormalCompletion && _iterator.return) {\\\\n _iterator.return();\\\\n }\\\\n } finally {\\\\n if (_didIteratorError) {\\\\n throw _iteratorError;\\\\n }\\\\n }\\\\n }\\\\n\\\\n return this;\\\\n }\\\\n }, {\\\\n key: 'once',\\\\n value: function once(eventName, handler) {\\\\n var _this = this;\\\\n\\\\n var once = function once() {\\\\n _this.off(eventName, once);\\\\n handler.apply(undefined, arguments);\\\\n };\\\\n\\\\n return this.on(eventName, once);\\\\n }\\\\n }, {\\\\n key: 'on',\\\\n value: function on(eventName, handler) {\\\\n if (!this.__listeners[eventName]) this.__listeners[eventName] = [];\\\\n\\\\n this.__listeners[eventName].push(handler);\\\\n\\\\n return this;\\\\n }\\\\n }, {\\\\n key: 'off',\\\\n value: function off(eventName, handler) {\\\\n if (handler) this.__listeners[eventName] = this.__listeners[eventName].filter(function (h) {\\\\n return h !== handler;\\\\n });else this.__listeners[eventName] = [];\\\\n\\\\n return this;\\\\n }\\\\n }]);\\\\n\\\\n return TinyEmitter;\\\\n}();\\\\n\\\\nmodule.exports = TinyEmitter;\\\\n\\\\n//# sourceURL=webpack://diglettk/./node_modules/webworker-promise/lib/tiny-emitter.js?\\\");\\n\\n/***/ })\\n\\n/******/ });\", \"Worker\", undefined, undefined);\n}\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/index.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/index.js ***! - \******************************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var webworker_promise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! webworker-promise */ \"./node_modules/webworker-promise/lib/index.js\");\n/* harmony import */ var webworker_promise__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(webworker_promise__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _ComputeHistogram_worker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ComputeHistogram.worker */ \"./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n/* eslint-disable no-continue */\n// ----------------------------------------------------------------------------\n// Global structures\n// ----------------------------------------------------------------------------\n\nvar MIN_GAUSSIAN_WIDTH = 0.001;\nvar ACTION_TO_CURSOR = {\n adjustPosition: '-webkit-grab',\n adjustHeight: 'row-resize',\n adjustBias: 'crosshair',\n adjustWidth: 'col-resize',\n adjustZoom: 'col-resize'\n};\nvar TOUCH_CLICK = []; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nvar ACTIONS = {\n adjustPosition: function adjustPosition(x, y, _ref) {\n var originalXY = _ref.originalXY,\n gaussian = _ref.gaussian,\n originalGaussian = _ref.originalGaussian;\n var xOffset = originalGaussian.position - originalXY[0];\n gaussian.position = x + xOffset;\n return true;\n },\n adjustHeight: function adjustHeight(x, y, _ref2) {\n var model = _ref2.model,\n gaussian = _ref2.gaussian;\n gaussian.height = 1 - y;\n gaussian.height = Math.min(1, Math.max(model.gaussianMinimumHeight, gaussian.height));\n return true;\n },\n adjustBias: function adjustBias(x, y, _ref3) {\n var originalXY = _ref3.originalXY,\n gaussian = _ref3.gaussian,\n originalGaussian = _ref3.originalGaussian;\n gaussian.xBias = originalGaussian.xBias - (originalXY[0] - x) / gaussian.height;\n gaussian.yBias = originalGaussian.yBias + 4 * (originalXY[1] - y) / gaussian.height; // Clamps\n\n gaussian.xBias = Math.max(-1, Math.min(1, gaussian.xBias));\n gaussian.yBias = Math.max(0, Math.min(2, gaussian.yBias));\n return true;\n },\n adjustWidth: function adjustWidth(x, y, _ref4) {\n var originalXY = _ref4.originalXY,\n gaussian = _ref4.gaussian,\n originalGaussian = _ref4.originalGaussian,\n gaussianSide = _ref4.gaussianSide;\n gaussian.width = gaussianSide < 0 ? originalGaussian.width - (originalXY[0] - x) : originalGaussian.width + (originalXY[0] - x);\n\n if (gaussian.width < MIN_GAUSSIAN_WIDTH) {\n gaussian.width = MIN_GAUSSIAN_WIDTH;\n }\n\n return true;\n },\n adjustZoom: function adjustZoom(x, y, _ref5) {\n var rangeZoom = _ref5.rangeZoom,\n publicAPI = _ref5.publicAPI;\n var delta = rangeZoom[1] - rangeZoom[0];\n var absNormX = (x - rangeZoom[0]) / delta;\n var minDelta = Math.abs(absNormX - rangeZoom[0]);\n var maxDelta = Math.abs(absNormX - rangeZoom[1]);\n var meanDelta = Math.abs(absNormX - 0.5 * (rangeZoom[0] + rangeZoom[1]));\n\n if (meanDelta < Math.min(minDelta, maxDelta)) {\n var halfDelta = delta * 0.5;\n rangeZoom[0] = Math.min(Math.max(absNormX - halfDelta, 0), rangeZoom[1] - 0.1);\n rangeZoom[1] = Math.max(Math.min(absNormX + halfDelta, 1), rangeZoom[0] + 0.1);\n } else if (minDelta < maxDelta) {\n rangeZoom[0] = Math.min(Math.max(absNormX, 0), rangeZoom[1] - 0.1);\n } else {\n rangeZoom[1] = Math.max(Math.min(absNormX, 1), rangeZoom[0] + 0.1);\n }\n\n publicAPI.invokeZoomChange(rangeZoom); // The opacity did not changed\n\n return false;\n }\n}; // ----------------------------------------------------------------------------\n\nfunction computeOpacities(gaussians) {\n var sampling = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 256;\n var opacities = [];\n\n while (opacities.length < sampling) {\n opacities.push(0);\n }\n\n var count = gaussians.length;\n\n while (count--) {\n var _gaussians$count = gaussians[count],\n position = _gaussians$count.position,\n height = _gaussians$count.height,\n width = _gaussians$count.width,\n xBias = _gaussians$count.xBias,\n yBias = _gaussians$count.yBias;\n\n for (var i = 0; i < sampling; i++) {\n var x = i / (sampling - 1); // clamp non-zero values to pos +/- width\n\n if (x > position + width || x < position - width) {\n if (opacities[i] < 0.0) {\n opacities[i] = 0.0;\n }\n\n continue;\n } // non-zero width\n\n\n var correctedWidth = width < MIN_GAUSSIAN_WIDTH ? MIN_GAUSSIAN_WIDTH : width; // translate the original x to a new x based on the xbias\n\n var x0 = 0;\n\n if (xBias === 0 || x === position + xBias) {\n x0 = x;\n } else if (x > position + xBias) {\n if (correctedWidth === xBias) {\n x0 = position;\n } else {\n x0 = position + (x - position - xBias) * (correctedWidth / (correctedWidth - xBias));\n }\n } else if (-correctedWidth === xBias) {\n // (x < pos+xBias)\n x0 = position;\n } else {\n x0 = position - (x - position - xBias) * (correctedWidth / (correctedWidth + xBias));\n } // center around 0 and normalize to -1,1\n\n\n var x1 = (x0 - position) / correctedWidth; // do a linear interpolation between:\n // a gaussian and a parabola if 0 < yBias <1\n // a parabola and a step function if 1 < yBias <2\n\n var h0a = Math.exp(-(4 * x1 * x1));\n var h0b = 1.0 - x1 * x1;\n var h0c = 1.0;\n var h1 = void 0;\n\n if (yBias < 1) {\n h1 = yBias * h0b + (1 - yBias) * h0a;\n } else {\n h1 = (2 - yBias) * h0b + (yBias - 1) * h0c;\n }\n\n var h2 = height * h1; // perform the MAX over different gaussians, not the sum\n\n if (h2 > opacities[i]) {\n opacities[i] = h2;\n }\n }\n }\n\n return opacities;\n} // ----------------------------------------------------------------------------\n\n\nfunction applyGaussianToPiecewiseFunction(gaussians, sampling, rangeToUse, piecewiseFunction) {\n var opacities = computeOpacities(gaussians, sampling);\n var nodes = [];\n var delta = (rangeToUse[1] - rangeToUse[0]) / (opacities.length - 1);\n var midpoint = 0.5;\n var sharpness = 0;\n\n for (var index = 0; index < opacities.length; index++) {\n var x = rangeToUse[0] + delta * index;\n var y = opacities[index];\n nodes.push({\n x: x,\n y: y,\n midpoint: midpoint,\n sharpness: sharpness\n });\n }\n\n piecewiseFunction.setNodes(nodes);\n} // ----------------------------------------------------------------------------\n\n\nfunction drawChart(ctx, area, values) {\n var style = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {\n lineWidth: 1,\n strokeStyle: '#000'\n };\n var verticalScale = area[3];\n var horizontalScale = area[2] / (values.length - 1);\n var fill = !!style.fillStyle;\n var offset = verticalScale + area[1];\n ctx.lineWidth = style.lineWidth;\n ctx.strokeStyle = style.strokeStyle;\n ctx.beginPath();\n ctx.moveTo(area[0], area[1] + area[3]);\n\n for (var index = 0; index < values.length; index++) {\n ctx.lineTo(area[0] + index * horizontalScale, Math.max(area[1], offset - values[index] * verticalScale));\n }\n\n if (fill) {\n ctx.fillStyle = style.fillStyle;\n ctx.lineTo(area[0] + area[2], area[1] + area[3]);\n\n if (style.clip) {\n ctx.clip();\n return;\n }\n\n ctx.fill();\n }\n\n ctx.stroke();\n} // ----------------------------------------------------------------------------\n\n\nfunction updateColorCanvas(colorTransferFunction, width, rangeToUse, canvas) {\n var workCanvas = canvas || document.createElement('canvas');\n workCanvas.setAttribute('width', width);\n workCanvas.setAttribute('height', 256);\n var ctx = workCanvas.getContext('2d');\n var rgba = colorTransferFunction.getUint8Table(rangeToUse[0], rangeToUse[1], width, 4);\n var pixelsArea = ctx.getImageData(0, 0, width, 256);\n\n for (var lineIdx = 0; lineIdx < 256; lineIdx++) {\n pixelsArea.data.set(rgba, lineIdx * 4 * width);\n }\n\n var nbValues = 256 * width * 4;\n var lineSize = width * 4;\n\n for (var i = 3; i < nbValues; i += 4) {\n pixelsArea.data[i] = 255 - Math.floor(i / lineSize);\n }\n\n ctx.putImageData(pixelsArea, 0, 0);\n return workCanvas;\n} // ----------------------------------------------------------------------------\n\n\nfunction updateColorCanvasFromImage(img, width, canvas) {\n var workCanvas = canvas || document.createElement('canvas');\n workCanvas.setAttribute('width', width);\n workCanvas.setAttribute('height', 256);\n var ctx = workCanvas.getContext('2d');\n ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, width, 256);\n return workCanvas;\n} // ----------------------------------------------------------------------------\n\n\nfunction normalizeCoordinates(x, y, subRectangeArea) {\n var zoomRange = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [0, 1];\n return [zoomRange[0] + (x - subRectangeArea[0]) / subRectangeArea[2] * (zoomRange[1] - zoomRange[0]), (y - subRectangeArea[1]) / subRectangeArea[3]];\n} // ----------------------------------------------------------------------------\n\n\nfunction findGaussian(x, gaussians) {\n var distances = gaussians.map(function (g) {\n return Math.abs(g.position - x);\n });\n var min = Math.min.apply(Math, _toConsumableArray(distances));\n return distances.indexOf(min);\n} // ----------------------------------------------------------------------------\n\n\nfunction createListener(callback) {\n var preventDefault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n return function (e) {\n var offsetX = e.offsetX,\n offsetY = e.offsetY;\n\n if (preventDefault) {\n e.preventDefault();\n }\n\n callback(offsetX, offsetY);\n };\n} // ----------------------------------------------------------------------------\n\n\nfunction createTouchClickListener() {\n var id = TOUCH_CLICK.length;\n\n for (var _len = arguments.length, callbacks = new Array(_len), _key = 0; _key < _len; _key++) {\n callbacks[_key] = arguments[_key];\n }\n\n TOUCH_CLICK.push({\n callbacks: callbacks,\n timeout: 0,\n deltaT: 200,\n count: 0,\n ready: false\n });\n return id;\n} // ----------------------------------------------------------------------------\n\n\nfunction processTouchClicks() {\n TOUCH_CLICK.filter(function (t) {\n return t.ready;\n }).forEach(function (touchHandle) {\n touchHandle.callbacks.forEach(function (callback) {\n if (callback.touches === touchHandle.touches && callback.clicks === touchHandle.count) {\n callback.action.apply(callback, _toConsumableArray(touchHandle.singleTouche));\n }\n }); // Clear state\n\n touchHandle.ts = 0;\n touchHandle.count = 0;\n touchHandle.touches = 0;\n touchHandle.ready = false;\n });\n} // ----------------------------------------------------------------------------\n\n\nfunction createTouchListener(id, callback) {\n var nbTouches = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var preventDefault = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n return function (e) {\n var targetBounds = e.target.getBoundingClientRect();\n var relativeTouches = Array.prototype.map.call(e.touches, function (t) {\n return [t.pageX - targetBounds.left, t.pageY - targetBounds.top];\n });\n var singleTouche = relativeTouches.reduce(function (a, b) {\n return [a[0] + b[0], a[1] + b[1]];\n }, [0, 0]).map(function (v) {\n return v / e.touches.length;\n });\n\n if (e.type === 'touchstart') {\n clearTimeout(TOUCH_CLICK[id].timeout);\n TOUCH_CLICK[id].ts = e.timeStamp;\n TOUCH_CLICK[id].singleTouche = singleTouche;\n TOUCH_CLICK[id].touches = e.touches.length;\n } else if (e.type === 'touchmove') {\n TOUCH_CLICK[id].ts = 0;\n TOUCH_CLICK[id].count = 0;\n TOUCH_CLICK[id].ready = false;\n } else if (e.type === 'touchend') {\n if (e.timeStamp - TOUCH_CLICK[id].ts < TOUCH_CLICK[id].deltaT) {\n TOUCH_CLICK[id].count += 1;\n TOUCH_CLICK[id].ready = true;\n\n if (preventDefault) {\n e.preventDefault();\n }\n\n TOUCH_CLICK[id].timeout = setTimeout(processTouchClicks, TOUCH_CLICK[id].deltaT);\n } else {\n TOUCH_CLICK[id].ready = false;\n }\n }\n\n if (e.touches.length === nbTouches) {\n callback.apply(void 0, _toConsumableArray(singleTouche));\n\n if (preventDefault) {\n e.preventDefault();\n }\n }\n };\n} // ----------------------------------------------------------------------------\n\n\nfunction listenerSelector(condition, ok, ko) {\n return function (e) {\n return condition() ? ok(e) : ko(e);\n };\n} // ----------------------------------------------------------------------------\n\n\nfunction rescaleArray(array, focusArea) {\n if (!focusArea) {\n return array;\n }\n\n var maxIdx = array.length - 1;\n var idxRange = focusArea.map(function (v) {\n return Math.round(v * maxIdx);\n });\n return array.slice(idxRange[0], idxRange[1] + 1);\n} // ----------------------------------------------------------------------------\n\n\nfunction rescaleValue(value, focusArea) {\n if (!focusArea) {\n return value;\n }\n\n return (value - focusArea[0]) / (focusArea[1] - focusArea[0]);\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n applyGaussianToPiecewiseFunction: applyGaussianToPiecewiseFunction,\n computeOpacities: computeOpacities,\n createListener: createListener,\n drawChart: drawChart,\n findGaussian: findGaussian,\n listenerSelector: listenerSelector,\n normalizeCoordinates: normalizeCoordinates\n}; // ----------------------------------------------------------------------------\n// vtkPiecewiseGaussianWidget methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPiecewiseGaussianWidget(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPiecewiseGaussianWidget');\n\n if (!model.canvas) {\n model.canvas = document.createElement('canvas');\n }\n\n publicAPI.setContainer = function (el) {\n if (model.container && model.container !== el) {\n model.container.removeChild(model.canvas);\n }\n\n if (model.container !== el) {\n model.container = el;\n\n if (model.container) {\n model.container.appendChild(model.canvas);\n }\n\n publicAPI.modified();\n }\n };\n\n publicAPI.setGaussians = function (gaussians) {\n if (model.gaussians === gaussians) {\n return;\n }\n\n model.gaussians = gaussians;\n model.opacities = computeOpacities(model.gaussians, model.piecewiseSize);\n publicAPI.invokeOpacityChange(publicAPI);\n publicAPI.modified();\n };\n\n publicAPI.addGaussian = function (position, height, width, xBias, yBias) {\n var nextIndex = model.gaussians.length;\n model.gaussians.push({\n position: position,\n height: height,\n width: width,\n xBias: xBias,\n yBias: yBias\n });\n model.opacities = computeOpacities(model.gaussians, model.piecewiseSize);\n publicAPI.invokeOpacityChange(publicAPI);\n publicAPI.modified();\n return nextIndex;\n };\n\n publicAPI.removeGaussian = function (index) {\n model.gaussians.splice(index, 1);\n model.opacities = computeOpacities(model.gaussians, model.piecewiseSize);\n publicAPI.invokeOpacityChange(publicAPI);\n publicAPI.modified();\n };\n\n publicAPI.setSize = function (width, height) {\n model.canvas.setAttribute('width', width);\n model.canvas.setAttribute('height', height);\n\n if (model.size[0] !== width || model.size[1] !== height) {\n model.size = [width, height];\n model.colorCanvasMTime = 0;\n publicAPI.modified();\n }\n };\n\n publicAPI.updateStyle = function (style) {\n model.style = _objectSpread(_objectSpread({}, model.style), style);\n publicAPI.modified();\n }; // Method used to compute and show data distribution in the background.\n // When an array with many components is used, you can provide additional\n // information to choose which component you want to extract the histogram\n // from.\n\n\n publicAPI.setDataArray = function (array) {\n var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref6$numberOfBinToCo = _ref6.numberOfBinToConsiders,\n numberOfBinToConsiders = _ref6$numberOfBinToCo === void 0 ? 1 : _ref6$numberOfBinToCo,\n _ref6$numberOfBinsToS = _ref6.numberOfBinsToSkip,\n numberOfBinsToSkip = _ref6$numberOfBinsToS === void 0 ? 1 : _ref6$numberOfBinsToS,\n _ref6$numberOfCompone = _ref6.numberOfComponents,\n numberOfComponents = _ref6$numberOfCompone === void 0 ? 1 : _ref6$numberOfCompone,\n _ref6$component = _ref6.component,\n component = _ref6$component === void 0 ? 0 : _ref6$component;\n\n model.histogram = null;\n model.histogramArray = array;\n model.dataRange = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"arrayRange\"](array, component, numberOfComponents);\n\n var _model$dataRange = _slicedToArray(model.dataRange, 2),\n min = _model$dataRange[0],\n max = _model$dataRange[1];\n\n var maxNumberOfWorkers = 4;\n var arrayStride = Math.floor(array.length / maxNumberOfWorkers) || 1;\n arrayStride += arrayStride % numberOfComponents;\n var arrayIndex = 0;\n var workerChunks = [];\n var workers = [];\n\n while (arrayIndex < array.length) {\n var worker = new _ComputeHistogram_worker__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n workers.push(worker);\n var workerPromise = new webworker_promise__WEBPACK_IMPORTED_MODULE_2___default.a(worker);\n var arrayStart = arrayIndex;\n var arrayEnd = Math.min(arrayIndex + arrayStride, array.length - 1);\n var subArray = new array.constructor(array.slice(arrayStart, arrayEnd + 1));\n workerChunks.push(workerPromise.postMessage({\n array: subArray,\n component: component,\n numberOfComponents: numberOfComponents,\n min: min,\n max: max,\n numberOfBins: model.numberOfBins\n }, [subArray.buffer]));\n arrayIndex += arrayStride;\n }\n\n Promise.all(workerChunks).then(function (subHistograms) {\n workers.forEach(function (worker) {\n return worker.terminate();\n });\n model.histogram = new Float32Array(model.numberOfBins);\n model.histogram.fill(0);\n subHistograms.forEach(function (subHistogram) {\n for (var i = 0, len = subHistogram.length; i < len; ++i) {\n model.histogram[i] += subHistogram[i];\n }\n }); // Smart Rescale Histogram\n\n var sampleSize = Math.min(numberOfBinToConsiders, model.histogram.length - numberOfBinsToSkip);\n var sortedArray = Array.from(model.histogram);\n sortedArray.sort(function (a, b) {\n return Number(a) - Number(b);\n });\n\n for (var i = 0; i < numberOfBinsToSkip; i++) {\n sortedArray.pop();\n }\n\n while (sortedArray.length > sampleSize) {\n sortedArray.shift();\n }\n\n var mean = sortedArray.reduce(function (a, b) {\n return a + b;\n }, 0) / sampleSize;\n\n for (var _i2 = 0, len = model.histogram.length; _i2 < len; ++_i2) {\n model.histogram[_i2] /= mean;\n }\n\n publicAPI.modified();\n setTimeout(publicAPI.render, 0);\n });\n publicAPI.modified();\n };\n\n publicAPI.onClick = function (x, y) {\n var _normalizeCoordinates = normalizeCoordinates(x, y, model.graphArea, model.enableRangeZoom ? model.rangeZoom : null),\n _normalizeCoordinates2 = _slicedToArray(_normalizeCoordinates, 2),\n xNormalized = _normalizeCoordinates2[0],\n yNormalized = _normalizeCoordinates2[1];\n\n if (xNormalized < 0 && model.style.iconSize > 1) {\n // Control buttons\n var delta = model.style.iconSize + model.style.padding;\n var offset = delta;\n var buttonIdx = 0;\n\n while (y > offset) {\n buttonIdx += 1;\n offset += delta;\n }\n\n switch (buttonIdx) {\n case 0:\n {\n var gaussianIdx = publicAPI.addGaussian(0, 1, 0.1, 0, 0);\n var gaussian = model.gaussians[gaussianIdx];\n\n var originalGaussian = _objectSpread({}, gaussian);\n\n var action = ACTIONS.adjustPosition;\n model.activeGaussian = gaussianIdx;\n model.selectedGaussian = gaussianIdx; // Fake active action\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setImmediate(function () {\n publicAPI.onDown(x, y);\n model.dragAction = {\n originalXY: [0, 0],\n action: action,\n gaussian: gaussian,\n originalGaussian: originalGaussian\n };\n });\n break;\n }\n\n case 1:\n {\n if (model.selectedGaussian !== -1) {\n publicAPI.removeGaussian(model.selectedGaussian);\n }\n\n break;\n }\n\n default:\n {\n model.selectedGaussian = -1;\n model.dragAction = null;\n }\n }\n } else if (xNormalized < 0 || xNormalized > 1 || yNormalized < 0 || yNormalized > 1) {\n model.selectedGaussian = -1;\n model.dragAction = null;\n } else {\n var newSelected = findGaussian(xNormalized, model.gaussians);\n\n if (newSelected !== model.selectedGaussian) {\n model.selectedGaussian = newSelected;\n publicAPI.modified();\n }\n }\n\n return true;\n };\n\n publicAPI.onHover = function (x, y) {\n // Determines the interaction region size for adjusting the Gaussian's\n // height.\n var tolerance = 20 / model.canvas.height;\n\n var _normalizeCoordinates3 = normalizeCoordinates(x, y, model.graphArea, model.enableRangeZoom ? model.rangeZoom : null),\n _normalizeCoordinates4 = _slicedToArray(_normalizeCoordinates3, 2),\n xNormalized = _normalizeCoordinates4[0],\n yNormalized = _normalizeCoordinates4[1];\n\n var _normalizeCoordinates5 = normalizeCoordinates(x, y, model.graphArea),\n _normalizeCoordinates6 = _slicedToArray(_normalizeCoordinates5, 1),\n xNormalizedAbs = _normalizeCoordinates6[0];\n\n var newActive = xNormalized < 0 ? model.selectedGaussian : findGaussian(xNormalized, model.gaussians);\n model.canvas.style.cursor = 'default';\n var gaussian = model.gaussians[newActive];\n\n if (model.enableRangeZoom && xNormalizedAbs >= 0 && y < model.graphArea[1] - 6 // circle radius\n ) {\n var thirdDelta = (model.rangeZoom[1] - model.rangeZoom[0]) / 3;\n\n if (xNormalizedAbs < model.rangeZoom[0] + thirdDelta || xNormalizedAbs > model.rangeZoom[1] - thirdDelta) {\n model.canvas.style.cursor = ACTION_TO_CURSOR.adjustZoom;\n } else {\n model.canvas.style.cursor = ACTION_TO_CURSOR.adjustPosition;\n }\n\n model.dragAction = {\n rangeZoom: model.rangeZoom,\n action: ACTIONS.adjustZoom\n };\n } else if (gaussian && xNormalizedAbs >= 0) {\n var invY = 1 - yNormalized;\n var actionName = null;\n\n if (invY > gaussian.height + tolerance) {\n actionName = 'adjustPosition';\n } else if (invY > gaussian.height - tolerance) {\n if (Math.abs(xNormalized - gaussian.position) < tolerance) {\n actionName = 'adjustHeight';\n } else {\n actionName = 'adjustPosition';\n }\n } else if (invY > gaussian.height * 0.5 + tolerance) {\n actionName = 'adjustPosition';\n } else if (invY > gaussian.height * 0.5 - tolerance) {\n if (Math.abs(xNormalized - gaussian.position) < tolerance) {\n actionName = 'adjustBias';\n } else {\n actionName = 'adjustPosition';\n }\n } else if (invY > tolerance) {\n actionName = 'adjustPosition';\n } else {\n actionName = 'adjustWidth';\n }\n\n model.canvas.style.cursor = ACTION_TO_CURSOR[actionName];\n var action = ACTIONS[actionName];\n\n var originalGaussian = _objectSpread({}, gaussian);\n\n model.dragAction = {\n originalXY: [xNormalized, yNormalized],\n action: action,\n gaussian: gaussian,\n originalGaussian: originalGaussian\n };\n }\n\n if (newActive !== model.activeGaussian) {\n model.activeGaussian = newActive;\n publicAPI.modified();\n }\n\n return true;\n };\n\n publicAPI.onDown = function (x, y) {\n if (!model.mouseIsDown) {\n publicAPI.invokeAnimation(true);\n }\n\n model.mouseIsDown = true;\n var xNormalized = normalizeCoordinates(x, y, model.graphArea, model.enableRangeZoom ? model.rangeZoom : null)[0];\n var newSelected = findGaussian(xNormalized, model.gaussians);\n model.gaussianSide = 0;\n var gaussian = model.gaussians[newSelected];\n\n if (gaussian) {\n model.gaussianSide = gaussian.position - xNormalized;\n }\n\n if (newSelected !== model.selectedGaussian && xNormalized > 0) {\n model.selectedGaussian = newSelected;\n publicAPI.modified();\n }\n\n return true;\n };\n\n publicAPI.onDrag = function (x, y) {\n if (model.dragAction) {\n var _normalizeCoordinates7 = normalizeCoordinates(x, y, model.graphArea, model.enableRangeZoom ? model.rangeZoom : null),\n _normalizeCoordinates8 = _slicedToArray(_normalizeCoordinates7, 2),\n xNormalized = _normalizeCoordinates8[0],\n yNormalized = _normalizeCoordinates8[1];\n\n var action = model.dragAction.action;\n\n if (action(xNormalized, yNormalized, _objectSpread({\n gaussianSide: model.gaussianSide,\n model: model,\n publicAPI: publicAPI\n }, model.dragAction))) {\n model.opacities = computeOpacities(model.gaussians, model.piecewiseSize);\n publicAPI.invokeOpacityChange(publicAPI, true);\n }\n\n publicAPI.modified();\n }\n\n return true;\n };\n\n publicAPI.onUp = function (x, y) {\n if (model.mouseIsDown) {\n publicAPI.invokeAnimation(false);\n }\n\n model.mouseIsDown = false;\n return true;\n };\n\n publicAPI.onLeave = function (x, y) {\n publicAPI.onUp(x, y);\n model.canvas.style.cursor = 'default';\n model.activeGaussian = -1;\n publicAPI.modified();\n return true;\n };\n\n publicAPI.onAddGaussian = function (x, y) {\n var _normalizeCoordinates9 = normalizeCoordinates(x, y, model.graphArea, model.enableRangeZoom ? model.rangeZoom : null),\n _normalizeCoordinates10 = _slicedToArray(_normalizeCoordinates9, 2),\n xNormalized = _normalizeCoordinates10[0],\n yNormalized = _normalizeCoordinates10[1];\n\n if (xNormalized >= 0) {\n publicAPI.addGaussian(xNormalized, 1 - yNormalized, 0.1, 0, 0);\n }\n\n return true;\n };\n\n publicAPI.onRemoveGaussian = function (x, y) {\n var xNormalized = normalizeCoordinates(x, y, model.graphArea, model.enableRangeZoom ? model.rangeZoom : null)[0];\n var newSelected = findGaussian(xNormalized, model.gaussians);\n\n if (xNormalized >= 0 && newSelected !== -1) {\n publicAPI.removeGaussian(newSelected);\n }\n\n return true;\n };\n\n publicAPI.bindMouseListeners = function () {\n if (!model.listeners) {\n var isDown = function isDown() {\n return !!model.mouseIsDown;\n };\n\n var touchId = createTouchClickListener({\n clicks: 1,\n touches: 1,\n action: publicAPI.onClick\n }, {\n clicks: 2,\n touches: 1,\n action: publicAPI.onAddGaussian\n }, {\n clicks: 2,\n touches: 2,\n action: publicAPI.onRemoveGaussian\n });\n model.listeners = {\n mousemove: listenerSelector(isDown, createListener(publicAPI.onDrag), createListener(publicAPI.onHover)),\n dblclick: createListener(publicAPI.onAddGaussian),\n contextmenu: createListener(publicAPI.onRemoveGaussian),\n click: createListener(publicAPI.onClick),\n mouseup: createListener(publicAPI.onUp),\n mousedown: createListener(publicAPI.onDown),\n mouseout: createListener(publicAPI.onLeave),\n touchstart: createTouchListener(touchId, vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.onHover, publicAPI.onDown)),\n touchmove: listenerSelector(isDown, createTouchListener(touchId, publicAPI.onDrag), createTouchListener(touchId, publicAPI.onHover)),\n touchend: createTouchListener(touchId, publicAPI.onUp, 0) // touchend have 0 touch event...\n\n };\n Object.keys(model.listeners).forEach(function (eventType) {\n model.canvas.addEventListener(eventType, model.listeners[eventType], false);\n });\n }\n };\n\n publicAPI.unbindMouseListeners = function () {\n if (model.listeners) {\n Object.keys(model.listeners).forEach(function (eventType) {\n model.canvas.removeEventListener(eventType, model.listeners[eventType]);\n });\n delete model.listeners;\n }\n };\n\n publicAPI.render = function () {\n var ctx = model.canvas.getContext('2d');\n ctx.imageSmoothingEnabled = true;\n\n var _model$size = _slicedToArray(model.size, 2),\n width = _model$size[0],\n height = _model$size[1];\n\n var offset = model.style.padding;\n var graphArea = [Math.floor(model.style.iconSize + offset), Math.floor(offset), Math.ceil(width - 2 * offset - model.style.iconSize), Math.ceil(height - 2 * offset)];\n var zoomControlHeight = model.style.zoomControlHeight;\n\n if (model.enableRangeZoom) {\n graphArea[1] += Math.floor(zoomControlHeight);\n graphArea[3] -= Math.floor(zoomControlHeight);\n }\n\n model.graphArea = graphArea; // Clear canvas\n\n ctx.clearRect(0, 0, width, height);\n ctx.lineJoin = 'round';\n ctx.fillStyle = model.style.backgroundColor;\n ctx.fillRect.apply(ctx, graphArea);\n\n if (model.style.iconSize > 1) {\n // Draw icons\n // +\n var halfSize = Math.round(model.style.iconSize / 2 - model.style.strokeWidth);\n var center = Math.round(halfSize + offset + model.style.strokeWidth);\n ctx.beginPath();\n ctx.lineWidth = model.style.buttonStrokeWidth;\n ctx.strokeStyle = model.style.buttonStrokeColor;\n ctx.arc(center - offset / 2, center, halfSize, 0, 2 * Math.PI, false);\n ctx.fillStyle = model.style.buttonFillColor;\n ctx.fill();\n ctx.stroke();\n ctx.moveTo(center - halfSize + model.style.strokeWidth + 2 - offset / 2, center);\n ctx.lineTo(center + halfSize - model.style.strokeWidth - 2 - offset / 2, center);\n ctx.stroke();\n ctx.moveTo(center - offset / 2, center - halfSize + model.style.strokeWidth + 2);\n ctx.lineTo(center - offset / 2, center + halfSize - model.style.strokeWidth - 2);\n ctx.stroke(); // -\n\n if (model.selectedGaussian === -1) {\n ctx.fillStyle = model.style.buttonDisableFillColor;\n ctx.lineWidth = model.style.buttonDisableStrokeWidth;\n ctx.strokeStyle = model.style.buttonDisableStrokeColor;\n } else {\n ctx.fillStyle = model.style.buttonFillColor;\n ctx.lineWidth = model.style.buttonStrokeWidth;\n ctx.strokeStyle = model.style.buttonStrokeColor;\n }\n\n ctx.beginPath();\n ctx.arc(center - offset / 2, center + offset / 2 + model.style.iconSize, halfSize, 0, 2 * Math.PI, false);\n ctx.fill();\n ctx.stroke();\n ctx.moveTo(center - halfSize + model.style.strokeWidth + 2 - offset / 2, center + offset / 2 + model.style.iconSize);\n ctx.lineTo(center + halfSize - model.style.strokeWidth - 2 - offset / 2, center + offset / 2 + model.style.iconSize);\n ctx.stroke();\n } // Draw histogram\n\n\n if (model.histogram) {\n drawChart(ctx, graphArea, rescaleArray(model.histogram, model.rangeZoom), {\n lineWidth: 1,\n strokeStyle: model.style.histogramColor,\n fillStyle: model.style.histogramColor\n });\n } // Draw gaussians\n\n\n drawChart(ctx, graphArea, rescaleArray(model.opacities, model.enableRangeZoom && model.rangeZoom), {\n lineWidth: model.style.strokeWidth,\n strokeStyle: model.style.strokeColor\n }); // Draw color function if any\n\n if (model.colorTransferFunction && model.colorTransferFunction.getSize()) {\n var rangeToUse = model.dataRange || model.colorTransferFunction.getMappingRange();\n\n if (!model.colorCanvas || model.colorCanvasMTime !== model.colorTransferFunction.getMTime()) {\n model.colorCanvasMTime = model.colorTransferFunction.getMTime();\n model.colorCanvas = updateColorCanvas(model.colorTransferFunction, graphArea[2], rangeToUse, model.colorCanvas);\n }\n\n ctx.save();\n drawChart(ctx, graphArea, rescaleArray(model.opacities, model.enableRangeZoom && model.rangeZoom), {\n lineWidth: 1,\n strokeStyle: 'rgba(0,0,0,0)',\n fillStyle: 'rgba(0,0,0,1)',\n clip: true\n }); // Draw the correct portion of the color BG image\n\n if (model.enableRangeZoom) {\n ctx.drawImage(model.colorCanvas, model.rangeZoom[0] * graphArea[2], 0, graphArea[2], graphArea[3], graphArea[0], graphArea[1], graphArea[2] / (model.rangeZoom[1] - model.rangeZoom[0]), graphArea[3]);\n } else {\n ctx.drawImage(model.colorCanvas, graphArea[0], graphArea[1]);\n }\n\n ctx.restore();\n } else if (model.backgroundImage) {\n model.colorCanvas = updateColorCanvasFromImage(model.backgroundImage, graphArea[2], model.colorCanvas);\n ctx.save();\n drawChart(ctx, graphArea, rescaleArray(model.opacities, model.enableRangeZoom && model.rangeZoom), {\n lineWidth: 1,\n strokeStyle: 'rgba(0,0,0,0)',\n fillStyle: 'rgba(0,0,0,1)',\n clip: true\n });\n ctx.drawImage(model.colorCanvas, graphArea[0], graphArea[1]);\n ctx.restore();\n } // Draw zoomed area\n\n\n if (model.enableRangeZoom) {\n ctx.fillStyle = model.style.zoomControlColor;\n ctx.beginPath();\n ctx.rect(graphArea[0] + model.rangeZoom[0] * graphArea[2], 0, (model.rangeZoom[1] - model.rangeZoom[0]) * graphArea[2], zoomControlHeight);\n ctx.fill();\n } // Draw active gaussian\n\n\n var activeGaussian = model.gaussians[model.activeGaussian] || model.gaussians[model.selectedGaussian];\n\n if (activeGaussian) {\n var activeOpacities = computeOpacities([activeGaussian], graphArea[2]);\n drawChart(ctx, graphArea, rescaleArray(activeOpacities, model.enableRangeZoom && model.rangeZoom), {\n lineWidth: model.style.activeStrokeWidth,\n strokeStyle: model.style.activeColor\n }); // Draw controls\n\n var xCenter = graphArea[0] + rescaleValue(activeGaussian.position, model.enableRangeZoom && model.rangeZoom) * graphArea[2];\n var yTop = graphArea[1] + (1 - activeGaussian.height) * graphArea[3];\n var yMiddle = graphArea[1] + (1 - 0.5 * activeGaussian.height) * graphArea[3];\n var yBottom = graphArea[1] + graphArea[3];\n var widthInPixel = activeGaussian.width * graphArea[2];\n\n if (model.enableRangeZoom) {\n widthInPixel /= model.rangeZoom[1] - model.rangeZoom[0];\n }\n\n ctx.lineWidth = model.style.handleWidth;\n ctx.strokeStyle = model.style.handleColor;\n ctx.fillStyle = model.style.backgroundColor;\n ctx.beginPath();\n ctx.moveTo(xCenter, graphArea[1] + (1 - activeGaussian.height) * graphArea[3]);\n ctx.lineTo(xCenter, graphArea[1] + graphArea[3]);\n ctx.stroke(); // Height\n\n ctx.beginPath();\n ctx.arc(xCenter, yTop, 6, 0, 2 * Math.PI);\n ctx.fill();\n ctx.stroke(); // Bias\n\n var radius = Math.min(widthInPixel * 0.1, activeGaussian.height * graphArea[3] * 0.2);\n ctx.beginPath();\n ctx.rect(xCenter - radius, yMiddle - radius, radius * 2, radius * 2);\n ctx.fill();\n ctx.stroke();\n ctx.beginPath(); // Width\n\n var sliderWidth = widthInPixel * 0.8;\n ctx.rect(xCenter - sliderWidth, yBottom - 5, 2 * sliderWidth, 10);\n ctx.fill();\n ctx.stroke();\n }\n };\n\n publicAPI.getOpacityNodes = function (dataRange) {\n var rangeToUse = dataRange || model.dataRange;\n var delta = (rangeToUse[1] - rangeToUse[0]) / (model.opacities.length - 1);\n var nodes = [];\n var midpoint = 0.5;\n var sharpness = 0;\n\n for (var index = 0; index < model.opacities.length; index++) {\n var x = rangeToUse[0] + delta * index;\n var y = model.opacities[index];\n nodes.push({\n x: x,\n y: y,\n midpoint: midpoint,\n sharpness: sharpness\n });\n }\n\n return nodes;\n };\n\n publicAPI.applyOpacity = function (piecewiseFunction, dataRange) {\n var nodes = publicAPI.getOpacityNodes(dataRange);\n piecewiseFunction.setNodes(nodes);\n };\n\n publicAPI.getOpacityRange = function (dataRange) {\n var rangeToUse = dataRange || model.dataRange;\n var delta = (rangeToUse[1] - rangeToUse[0]) / (model.opacities.length - 1);\n var minIndex = model.opacities.length - 1;\n var maxIndex = 0;\n\n for (var index = 0; index < model.opacities.length; index++) {\n if (model.opacities[index] > 0) {\n minIndex = Math.min(minIndex, index);\n }\n\n if (model.opacities[index] > 0) {\n maxIndex = Math.max(maxIndex, index);\n }\n }\n\n return [rangeToUse[0] + minIndex * delta, rangeToUse[0] + maxIndex * delta];\n };\n\n var enableZoom = publicAPI.setEnableRangeZoom;\n\n publicAPI.setEnableRangeZoom = function (v) {\n var change = enableZoom(v);\n\n if (change) {\n model.colorCanvasMTime = 0;\n model.rangeZoom = [0, 1];\n }\n\n return change;\n };\n\n var rangeZoom = publicAPI.setRangeZoom;\n\n publicAPI.setRangeZoom = function () {\n var change = rangeZoom.apply(void 0, arguments);\n\n if (change) {\n model.colorCanvasMTime = 0;\n }\n\n return change;\n }; // Trigger rendering for any modified event\n\n\n publicAPI.onModified(function () {\n return publicAPI.render();\n });\n publicAPI.setSize.apply(publicAPI, _toConsumableArray(model.size));\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n histogram: [],\n numberOfBins: 256,\n histogramArray: null,\n dataRange: [0, 1],\n gaussians: [],\n opacities: [],\n size: [600, 300],\n piecewiseSize: 256,\n colorCanvasMTime: 0,\n gaussianMinimumHeight: 0.05,\n style: {\n backgroundColor: 'rgba(255, 255, 255, 1)',\n histogramColor: 'rgba(200, 200, 200, 0.5)',\n strokeColor: 'rgb(0, 0, 0)',\n activeColor: 'rgb(0, 0, 150)',\n buttonDisableFillColor: 'rgba(255, 255, 255, 0.5)',\n buttonDisableStrokeColor: 'rgba(0, 0, 0, 0.5)',\n buttonStrokeColor: 'rgba(0, 0, 0, 1)',\n buttonFillColor: 'rgba(255, 255, 255, 1)',\n handleColor: 'rgb(0, 150, 0)',\n strokeWidth: 2,\n activeStrokeWidth: 3,\n buttonStrokeWidth: 1.5,\n handleWidth: 3,\n iconSize: 20,\n padding: 10,\n zoomControlHeight: 10,\n zoomControlColor: '#999'\n },\n activeGaussian: -1,\n selectedGaussian: -1,\n enableRangeZoom: true,\n rangeZoom: [0, 1] // normalized value\n\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['piecewiseSize', 'numberOfBins', 'colorTransferFunction', 'backgroundImage', 'enableRangeZoom', 'gaussianMinimumHeight']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['rangeZoom'], 2);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['size', 'canvas', 'gaussians']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'opacityChange');\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'animation');\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'zoomChange'); // Object specific methods\n\n vtkPiecewiseGaussianWidget(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPiecewiseGaussianWidget'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper/index.js ***! - \****************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkAbstractMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkAbstractMapper(publicAPI, model) {\n publicAPI.update = function () {\n publicAPI.getInputData();\n };\n\n publicAPI.addClippingPlane = function (plane) {\n if (plane.getClassName() !== 'vtkPlane') {\n return;\n }\n\n model.clippingPlanes.push(plane);\n };\n\n publicAPI.getNumberOfClippingPlanes = function () {\n return model.clippingPlanes.length;\n };\n\n publicAPI.removeAllClippingPlanes = function () {\n model.clippingPlanes.length = 0;\n };\n\n publicAPI.removeClippingPlane = function (i) {\n if (i < 0 || i >= 6) {\n return;\n }\n\n model.clippingPlanes.splice(i, 1);\n };\n\n publicAPI.getClippingPlanes = function () {\n return model.clippingPlanes;\n };\n\n publicAPI.setClippingPlanes = function (planes) {\n if (!planes) {\n return;\n }\n\n if (!Array.isArray(planes)) {\n publicAPI.addClippingPlane(planes);\n } else {\n var nbPlanes = planes.length;\n\n for (var i = 0; i < nbPlanes && i < 6; i++) {\n publicAPI.addClippingPlane(planes[i]);\n }\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n clippingPlanes: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].algo(publicAPI, model, 1, 0);\n\n if (!model.clippingPlanes) {\n model.clippingPlanes = [];\n }\n\n vtkAbstractMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper3D/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper3D/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_AbstractMapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/AbstractMapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkAbstractMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkAbstractMapper3D(publicAPI, model) {\n publicAPI.getBounds = function () {\n return 0;\n };\n\n publicAPI.getBounds = function (bounds) {\n publicAPI.getBounds();\n\n for (var i = 0; i < 6; i++) {\n bounds[i] = model.bounds[i];\n }\n };\n\n publicAPI.getCenter = function () {\n publicAPI.getBounds();\n\n for (var i = 0; i < 3; i++) {\n model.center[i] = (model.bounds[2 * i + 1] + model.bounds[2 * i]) / 2.0;\n }\n\n return model.center.slice();\n };\n\n publicAPI.getLength = function () {\n var diff = 0.0;\n var l = 0.0;\n publicAPI.getBounds();\n\n for (var i = 0; i < 3; i++) {\n diff = model.bounds[2 * i + 1] - model.bounds[2 * i];\n l += diff * diff;\n }\n\n return Math.sqrt(l);\n };\n\n publicAPI.getClippingPlaneInDataCoords = function (propMatrix, i, hnormal) {\n var clipPlanes = model.clippingPlanes;\n var mat = propMatrix;\n\n if (clipPlanes) {\n var n = clipPlanes.length;\n\n if (i >= 0 && i < n) {\n // Get the plane\n var plane = clipPlanes[i];\n var normal = plane.getNormal();\n var origin = plane.getOrigin(); // Compute the plane equation\n\n var v1 = normal[0];\n var v2 = normal[1];\n var v3 = normal[2];\n var v4 = -(v1 * origin[0] + v2 * origin[1] + v3 * origin[2]); // Transform normal from world to data coords\n\n hnormal[0] = v1 * mat[0] + v2 * mat[4] + v3 * mat[8] + v4 * mat[12];\n hnormal[1] = v1 * mat[1] + v2 * mat[5] + v3 * mat[9] + v4 * mat[13];\n hnormal[2] = v1 * mat[2] + v2 * mat[6] + v3 * mat[10] + v4 * mat[14];\n hnormal[3] = v1 * mat[3] + v2 * mat[7] + v3 * mat[11] + v4 * mat[15];\n return;\n }\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro(\"Clipping plane index \".concat(i, \" is out of range.\"));\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bounds: [1, -1, 1, -1, 1, -1],\n center: [0, 0, 0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_AbstractMapper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n\n if (!model.bounds) {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"uninitializeBounds\"](model.bounds);\n }\n\n if (!model.center) {\n model.center = [0.0, 0.0, 0.0];\n }\n\n vtkAbstractMapper3D(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper3D/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/AbstractPicker/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/AbstractPicker/index.js ***! - \****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkAbstractPicker methods\n// ----------------------------------------------------------------------------\n\nfunction vtkAbstractPicker(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkAbstractPicker');\n\n publicAPI.initialize = function () {\n model.renderer = null;\n model.selectionPoint[0] = 0.0;\n model.selectionPoint[1] = 0.0;\n model.selectionPoint[2] = 0.0;\n model.pickPosition[0] = 0.0;\n model.pickPosition[1] = 0.0;\n model.pickPosition[2] = 0.0;\n };\n\n publicAPI.initializePickList = function () {\n model.pickList = [];\n };\n\n publicAPI.addPickList = function (actor) {\n model.pickList.push(actor);\n };\n\n publicAPI.deletePickList = function (actor) {\n var i = model.pickList.indexOf(actor);\n\n if (i !== -1) {\n model.pickList.splice(i, 1);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n renderer: null,\n selectionPoint: [0.0, 0.0, 0.0],\n pickPosition: [0.0, 0.0, 0.0],\n pickFromList: 0,\n pickList: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['renderer']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['selectionPoint', 'pickPosition']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['pickFromList', 'pickList']);\n vtkAbstractPicker(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkAbstractPicker'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/AbstractPicker/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js": -/*!*******************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js ***! - \*******************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Prop3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Prop3D */ \"./node_modules/vtk.js/Sources/Rendering/Core/Prop3D/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkDebugMacro; // ----------------------------------------------------------------------------\n// vtkActor methods\n// ----------------------------------------------------------------------------\n\nfunction vtkActor(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkActor'); // Capture 'parentClass' api for internal use\n\n var superClass = _objectSpread({}, publicAPI);\n\n publicAPI.getActors = function () {\n return publicAPI;\n };\n\n publicAPI.getIsOpaque = function () {\n if (model.forceOpaque) {\n return true;\n }\n\n if (model.forceTranslucent) {\n return false;\n } // make sure we have a property\n\n\n if (!model.property) {\n // force creation of a property\n publicAPI.getProperty();\n }\n\n var isOpaque = model.property.getOpacity() >= 1.0; // are we using an opaque texture, if any?\n\n isOpaque = isOpaque && (!model.texture || !model.texture.isTranslucent()); // are we using an opaque scalar array, if any?\n\n isOpaque = isOpaque && (!model.mapper || model.mapper.getIsOpaque());\n return isOpaque;\n };\n\n publicAPI.hasTranslucentPolygonalGeometry = function () {\n if (model.mapper === null) {\n return false;\n } // make sure we have a property\n\n\n if (model.property === null) {\n // force creation of a property\n publicAPI.setProperty(publicAPI.makeProperty());\n } // is this actor opaque ?\n\n\n return !publicAPI.getIsOpaque();\n };\n\n publicAPI.makeProperty = vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance;\n\n publicAPI.getProperty = function () {\n if (model.property === null) {\n model.property = publicAPI.makeProperty();\n }\n\n return model.property;\n };\n\n publicAPI.getBounds = function () {\n if (model.mapper === null) {\n return model.bounds;\n } // Check for the special case when the mapper's bounds are unknown\n\n\n var bds = model.mapper.getBounds();\n\n if (!bds || bds.length !== 6) {\n return bds;\n } // Check for the special case when the actor is empty.\n\n\n if (bds[0] > bds[1]) {\n model.mapperBounds = bds.concat(); // copy the mapper's bounds\n\n model.bounds = [1, -1, 1, -1, 1, -1];\n model.boundsMTime.modified();\n return bds;\n } // Check if we have cached values for these bounds - we cache the\n // values returned by model.mapper.getBounds() and we store the time\n // of caching. If the values returned this time are different, or\n // the modified time of this class is newer than the cached time,\n // then we need to rebuild.\n\n\n if (!model.mapperBounds || bds[0] !== model.mapperBounds[0] || bds[1] !== model.mapperBounds[1] || bds[2] !== model.mapperBounds[2] || bds[3] !== model.mapperBounds[3] || bds[4] !== model.mapperBounds[4] || bds[5] !== model.mapperBounds[5] || publicAPI.getMTime() > model.boundsMTime.getMTime()) {\n vtkDebugMacro('Recomputing bounds...');\n model.mapperBounds = bds.concat(); // copy the mapper's bounds\n\n var bbox = [];\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getCorners(bds, bbox);\n publicAPI.computeMatrix();\n var tmp4 = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(tmp4, model.matrix);\n bbox.forEach(function (pt) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(pt, pt, tmp4);\n });\n /* eslint-disable no-multi-assign */\n\n model.bounds[0] = model.bounds[2] = model.bounds[4] = Number.MAX_VALUE;\n model.bounds[1] = model.bounds[3] = model.bounds[5] = -Number.MAX_VALUE;\n /* eslint-enable no-multi-assign */\n\n model.bounds = model.bounds.map(function (d, i) {\n return i % 2 === 0 ? bbox.reduce(function (a, b) {\n return a > b[i / 2] ? b[i / 2] : a;\n }, d) : bbox.reduce(function (a, b) {\n return a < b[(i - 1) / 2] ? b[(i - 1) / 2] : a;\n }, d);\n });\n model.boundsMTime.modified();\n }\n\n return model.bounds;\n };\n\n publicAPI.getMTime = function () {\n var mt = superClass.getMTime();\n\n if (model.property !== null) {\n var time = model.property.getMTime();\n mt = time > mt ? time : mt;\n }\n\n if (model.backfaceProperty !== null) {\n var _time = model.backfaceProperty.getMTime();\n\n mt = _time > mt ? _time : mt;\n }\n\n return mt;\n };\n\n publicAPI.getRedrawMTime = function () {\n var mt = model.mtime;\n\n if (model.mapper !== null) {\n var time = model.mapper.getMTime();\n mt = time > mt ? time : mt;\n\n if (model.mapper.getInput() !== null) {\n // FIXME !!! getInputAlgorithm / getInput\n model.mapper.getInputAlgorithm().update();\n time = model.mapper.getInput().getMTime();\n mt = time > mt ? time : mt;\n }\n }\n\n return mt;\n };\n\n publicAPI.getSupportsSelection = function () {\n return model.mapper ? model.mapper.getSupportsSelection() : false;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n mapper: null,\n property: null,\n backfaceProperty: null,\n forceOpaque: false,\n forceTranslucent: false,\n bounds: [1, -1, 1, -1, 1, -1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Prop3D__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues); // vtkTimeStamp\n\n model.boundsMTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(model.boundsMTime); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].set(publicAPI, model, ['property']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['backfaceProperty', 'forceOpaque', 'forceTranslucent', 'mapper']); // Object methods\n\n vtkActor(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkActor'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Camera/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Camera/index.js ***! - \********************************************************************/ -/*! exports provided: DEFAULT_VALUES, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_VALUES\", function() { return DEFAULT_VALUES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkDebugMacro;\n/* eslint-disable new-cap */\n\n/*\n * Convenience function to access elements of a gl-matrix. If it turns\n * out I have rows and columns swapped everywhere, then I'll just change\n * the order of 'row' and 'col' parameters in this function\n */\n// function getMatrixElement(matrix, row, col) {\n// const idx = (row * 4) + col;\n// return matrix[idx];\n// }\n// ----------------------------------------------------------------------------\n// vtkCamera methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCamera(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCamera'); // Set up private variables and methods\n\n var origin = new Float64Array(3);\n var dopbasis = new Float64Array([0.0, 0.0, -1.0]);\n var upbasis = new Float64Array([0.0, 1.0, 0.0]);\n var tmpMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n var tmpvec1 = new Float64Array(3);\n var tmpvec2 = new Float64Array(3);\n var tmpvec3 = new Float64Array(3);\n var rotateMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n var trans = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n var newPosition = new Float64Array(3);\n var newFocalPoint = new Float64Array(3); // Internal Functions that don't need to be public\n\n function computeViewPlaneNormal() {\n // VPN is -DOP\n model.viewPlaneNormal[0] = -model.directionOfProjection[0];\n model.viewPlaneNormal[1] = -model.directionOfProjection[1];\n model.viewPlaneNormal[2] = -model.directionOfProjection[2];\n }\n\n publicAPI.orthogonalizeViewUp = function () {\n var vt = publicAPI.getViewMatrix();\n model.viewUp[0] = vt[4];\n model.viewUp[1] = vt[5];\n model.viewUp[2] = vt[6];\n publicAPI.modified();\n };\n\n publicAPI.setPosition = function (x, y, z) {\n if (x === model.position[0] && y === model.position[1] && z === model.position[2]) {\n return;\n }\n\n model.position[0] = x;\n model.position[1] = y;\n model.position[2] = z; // recompute the focal distance\n\n publicAPI.computeDistance();\n publicAPI.modified();\n };\n\n publicAPI.setFocalPoint = function (x, y, z) {\n if (x === model.focalPoint[0] && y === model.focalPoint[1] && z === model.focalPoint[2]) {\n return;\n }\n\n model.focalPoint[0] = x;\n model.focalPoint[1] = y;\n model.focalPoint[2] = z; // recompute the focal distance\n\n publicAPI.computeDistance();\n publicAPI.modified();\n };\n\n publicAPI.setDistance = function (d) {\n if (model.distance === d) {\n return;\n }\n\n model.distance = d;\n\n if (model.distance < 1e-20) {\n model.distance = 1e-20;\n vtkDebugMacro('Distance is set to minimum.');\n } // we want to keep the camera pointing in the same direction\n\n\n var vec = model.directionOfProjection; // recalculate FocalPoint\n\n model.focalPoint[0] = model.position[0] + vec[0] * model.distance;\n model.focalPoint[1] = model.position[1] + vec[1] * model.distance;\n model.focalPoint[2] = model.position[2] + vec[2] * model.distance;\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n // This method must be called when the focal point or camera position changes\n\n\n publicAPI.computeDistance = function () {\n var dx = model.focalPoint[0] - model.position[0];\n var dy = model.focalPoint[1] - model.position[1];\n var dz = model.focalPoint[2] - model.position[2];\n model.distance = Math.sqrt(dx * dx + dy * dy + dz * dz);\n\n if (model.distance < 1e-20) {\n model.distance = 1e-20;\n vtkDebugMacro('Distance is set to minimum.');\n var vec = model.directionOfProjection; // recalculate FocalPoint\n\n model.focalPoint[0] = model.position[0] + vec[0] * model.distance;\n model.focalPoint[1] = model.position[1] + vec[1] * model.distance;\n model.focalPoint[2] = model.position[2] + vec[2] * model.distance;\n }\n\n model.directionOfProjection[0] = dx / model.distance;\n model.directionOfProjection[1] = dy / model.distance;\n model.directionOfProjection[2] = dz / model.distance;\n computeViewPlaneNormal();\n }; //----------------------------------------------------------------------------\n // Move the position of the camera along the view plane normal. Moving\n // towards the focal point (e.g., > 1) is a dolly-in, moving away\n // from the focal point (e.g., < 1) is a dolly-out.\n\n\n publicAPI.dolly = function (amount) {\n if (amount <= 0.0) {\n return;\n } // dolly moves the camera towards the focus\n\n\n var d = model.distance / amount;\n publicAPI.setPosition(model.focalPoint[0] - d * model.directionOfProjection[0], model.focalPoint[1] - d * model.directionOfProjection[1], model.focalPoint[2] - d * model.directionOfProjection[2]);\n };\n\n publicAPI.roll = function (angle) {\n var eye = model.position;\n var at = model.focalPoint;\n var up = model.viewUp;\n var viewUpVec4 = new Float64Array([up[0], up[1], up[2], 0.0]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(rotateMatrix);\n var viewDir = new Float64Array([at[0] - eye[0], at[1] - eye[1], at[2] - eye[2]]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(rotateMatrix, rotateMatrix, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](angle), viewDir);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec4\"].transformMat4(viewUpVec4, viewUpVec4, rotateMatrix);\n model.viewUp[0] = viewUpVec4[0];\n model.viewUp[1] = viewUpVec4[1];\n model.viewUp[2] = viewUpVec4[2];\n publicAPI.modified();\n };\n\n publicAPI.azimuth = function (angle) {\n var fp = model.focalPoint;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(trans); // translate the focal point to the origin,\n // rotate about view up,\n // translate back again\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, fp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(trans, trans, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](angle), model.viewUp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, [-fp[0], -fp[1], -fp[2]]); // apply the transform to the position\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newPosition, model.position, trans);\n publicAPI.setPosition(newPosition[0], newPosition[1], newPosition[2]);\n };\n\n publicAPI.yaw = function (angle) {\n var position = model.position;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(trans); // translate the camera to the origin,\n // rotate about axis,\n // translate back again\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, position);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(trans, trans, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](angle), model.viewUp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, [-position[0], -position[1], -position[2]]); // apply the transform to the position\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newFocalPoint, model.focalPoint, trans);\n publicAPI.setFocalPoint(newFocalPoint[0], newFocalPoint[1], newFocalPoint[2]);\n };\n\n publicAPI.elevation = function (angle) {\n var fp = model.focalPoint; // get the eye / camera position from the viewMatrix\n\n var vt = publicAPI.getViewMatrix();\n var axis = [-vt[0], -vt[1], -vt[2]];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(trans); // translate the focal point to the origin,\n // rotate about view up,\n // translate back again\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, fp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(trans, trans, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](angle), axis);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, [-fp[0], -fp[1], -fp[2]]); // apply the transform to the position\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newPosition, model.position, trans);\n publicAPI.setPosition(newPosition[0], newPosition[1], newPosition[2]);\n };\n\n publicAPI.pitch = function (angle) {\n var position = model.position;\n var vt = publicAPI.getViewMatrix();\n var axis = [vt[0], vt[1], vt[2]];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(trans); // translate the camera to the origin,\n // rotate about axis,\n // translate back again\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, position);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(trans, trans, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](angle), axis);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(trans, trans, [-position[0], -position[1], -position[2]]); // apply the transform to the focal point\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newFocalPoint, model.focalPoint, trans);\n publicAPI.setFocalPoint.apply(publicAPI, _toConsumableArray(newFocalPoint));\n };\n\n publicAPI.zoom = function (factor) {\n if (factor <= 0) {\n return;\n }\n\n if (model.parallelProjection) {\n model.parallelScale /= factor;\n } else {\n model.viewAngle /= factor;\n }\n\n publicAPI.modified();\n };\n\n publicAPI.translate = function (x, y, z) {\n var offset = [x, y, z];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"add\"](model.position, offset, model.position);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"add\"](model.focalPoint, offset, model.focalPoint);\n publicAPI.computeDistance();\n publicAPI.modified();\n };\n\n publicAPI.applyTransform = function (transformMat4) {\n var vuOld = [].concat(_toConsumableArray(model.viewUp), [1.0]);\n var posNew = [];\n var fpNew = [];\n var vuNew = [];\n vuOld[0] += model.position[0];\n vuOld[1] += model.position[1];\n vuOld[2] += model.position[2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec4\"].transformMat4(posNew, [].concat(_toConsumableArray(model.position), [1.0]), transformMat4);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec4\"].transformMat4(fpNew, [].concat(_toConsumableArray(model.focalPoint), [1.0]), transformMat4);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec4\"].transformMat4(vuNew, vuOld, transformMat4);\n vuNew[0] -= posNew[0];\n vuNew[1] -= posNew[1];\n vuNew[2] -= posNew[2];\n publicAPI.setPosition.apply(publicAPI, _toConsumableArray(posNew.slice(0, 3)));\n publicAPI.setFocalPoint.apply(publicAPI, _toConsumableArray(fpNew.slice(0, 3)));\n publicAPI.setViewUp.apply(publicAPI, _toConsumableArray(vuNew.slice(0, 3)));\n };\n\n publicAPI.getThickness = function () {\n return model.clippingRange[1] - model.clippingRange[0];\n };\n\n publicAPI.setThickness = function (thickness) {\n var t = thickness;\n\n if (t < 1e-20) {\n t = 1e-20;\n vtkDebugMacro('Thickness is set to minimum.');\n }\n\n publicAPI.setClippingRange(model.clippingRange[0], model.clippingRange[0] + t);\n };\n\n publicAPI.setThicknessFromFocalPoint = function (thickness) {\n var t = thickness;\n\n if (t < 1e-20) {\n t = 1e-20;\n vtkDebugMacro('Thickness is set to minimum.');\n }\n\n publicAPI.setClippingRange(model.distance - t / 2, model.distance + t / 2);\n }; // Unimplemented functions\n\n\n publicAPI.setRoll = function (angle) {}; // dependency on GetOrientation() and a model.ViewTransform object, see https://github.com/Kitware/VTK/blob/master/Common/Transforms/vtkTransform.cxx and https://vtk.org/doc/nightly/html/classvtkTransform.html\n\n\n publicAPI.getRoll = function () {};\n\n publicAPI.setObliqueAngles = function (alpha, beta) {};\n\n publicAPI.getOrientation = function () {};\n\n publicAPI.getOrientationWXYZ = function () {};\n\n publicAPI.getFrustumPlanes = function (aspect) {// Return array of 24 params (4 params for each of 6 plane equations)\n };\n\n publicAPI.getCameraLightTransformMatrix = function () {};\n\n publicAPI.deepCopy = function (sourceCamera) {};\n\n publicAPI.physicalOrientationToWorldDirection = function (ori) {\n // push the x axis through the orientation quat\n var oriq = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].fromValues(ori[0], ori[1], ori[2], ori[3]);\n var coriq = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].create();\n var qdir = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].fromValues(0.0, 0.0, 1.0, 0.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].conjugate(coriq, oriq); // rotate the z axis by the quat\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].multiply(qdir, oriq, qdir);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].multiply(qdir, qdir, coriq); // return the z axis in world coords\n\n return [qdir[0], qdir[1], qdir[2]];\n };\n\n publicAPI.getPhysicalToWorldMatrix = function (result) {\n publicAPI.getWorldToPhysicalMatrix(result);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(result, result);\n };\n\n publicAPI.getWorldToPhysicalMatrix = function (result) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(result); // now the physical to vtk world rotation tform\n\n var physVRight = [3];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](model.physicalViewNorth, model.physicalViewUp, physVRight);\n result[0] = physVRight[0];\n result[1] = physVRight[1];\n result[2] = physVRight[2];\n result[4] = model.physicalViewUp[0];\n result[5] = model.physicalViewUp[1];\n result[6] = model.physicalViewUp[2];\n result[8] = -model.physicalViewNorth[0];\n result[9] = -model.physicalViewNorth[1];\n result[10] = -model.physicalViewNorth[2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(result, result);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(tmpvec1, 1 / model.physicalScale, 1 / model.physicalScale, 1 / model.physicalScale);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].scale(result, result, tmpvec1);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(result, result, model.physicalTranslation);\n };\n\n publicAPI.computeViewParametersFromViewMatrix = function (vmat) {\n // invert to get view to world\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(tmpMatrix, vmat); // note with glmatrix operations happen in\n // the reverse order\n // mat.scale\n // mat.translate\n // will result in the translation then the scale\n // mat.mult(a,b)\n // results in perform the B transformation then A\n // then extract the params position, orientation\n // push 0,0,0 through to get a translation\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(tmpvec1, origin, tmpMatrix);\n publicAPI.computeDistance();\n var oldDist = model.distance;\n publicAPI.setPosition(tmpvec1[0], tmpvec1[1], tmpvec1[2]); // push basis vectors to get orientation\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(tmpvec2, dopbasis, tmpMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].subtract(tmpvec2, tmpvec2, tmpvec1);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].normalize(tmpvec2, tmpvec2);\n publicAPI.setDirectionOfProjection(tmpvec2[0], tmpvec2[1], tmpvec2[2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(tmpvec3, upbasis, tmpMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].subtract(tmpvec3, tmpvec3, tmpvec1);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].normalize(tmpvec3, tmpvec3);\n publicAPI.setViewUp(tmpvec3[0], tmpvec3[1], tmpvec3[2]);\n publicAPI.setDistance(oldDist);\n }; // the provided matrix should include\n // translation and orientation only\n // mat is physical to view\n\n\n publicAPI.computeViewParametersFromPhysicalMatrix = function (mat) {\n // get the WorldToPhysicalMatrix\n publicAPI.getWorldToPhysicalMatrix(tmpMatrix); // first convert the physical -> view matrix to be\n // world -> view\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(tmpMatrix, mat, tmpMatrix);\n publicAPI.computeViewParametersFromViewMatrix(tmpMatrix);\n };\n\n publicAPI.setViewMatrix = function (mat) {\n model.viewMatrix = mat;\n\n if (model.viewMatrix) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(tmpMatrix, model.viewMatrix);\n publicAPI.computeViewParametersFromViewMatrix(tmpMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.viewMatrix, model.viewMatrix);\n }\n };\n\n publicAPI.getViewMatrix = function () {\n if (model.viewMatrix) {\n return model.viewMatrix;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].lookAt(tmpMatrix, model.position, // eye\n model.focalPoint, // at\n model.viewUp // up\n );\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(tmpMatrix, tmpMatrix);\n var result = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(result, tmpMatrix);\n return result;\n };\n\n publicAPI.setProjectionMatrix = function (mat) {\n model.projectionMatrix = mat;\n };\n\n publicAPI.getProjectionMatrix = function (aspect, nearz, farz) {\n var result = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(result);\n\n if (model.projectionMatrix) {\n var scale = 1 / model.physicalScale;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].set(tmpvec1, scale, scale, scale);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(result, model.projectionMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].scale(result, result, tmpvec1);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(result, result);\n return result;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(tmpMatrix); // FIXME: Not sure what to do about adjust z buffer here\n // adjust Z-buffer range\n // this->ProjectionTransform->AdjustZBuffer( -1, +1, nearz, farz );\n\n var cWidth = model.clippingRange[1] - model.clippingRange[0];\n var cRange = [model.clippingRange[0] + (nearz + 1) * cWidth / 2.0, model.clippingRange[0] + (farz + 1) * cWidth / 2.0];\n\n if (model.parallelProjection) {\n // set up a rectangular parallelipiped\n var width = model.parallelScale * aspect;\n var height = model.parallelScale;\n var xmin = (model.windowCenter[0] - 1.0) * width;\n var xmax = (model.windowCenter[0] + 1.0) * width;\n var ymin = (model.windowCenter[1] - 1.0) * height;\n var ymax = (model.windowCenter[1] + 1.0) * height;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].ortho(tmpMatrix, xmin, xmax, ymin, ymax, cRange[0], cRange[1]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(tmpMatrix, tmpMatrix);\n } else if (model.useOffAxisProjection) {\n throw new Error('Off-Axis projection is not supported at this time');\n } else {\n var tmp = Math.tan(vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](model.viewAngle) / 2.0);\n\n var _width;\n\n var _height;\n\n if (model.useHorizontalViewAngle === true) {\n _width = model.clippingRange[0] * tmp;\n _height = model.clippingRange[0] * tmp / aspect;\n } else {\n _width = model.clippingRange[0] * tmp * aspect;\n _height = model.clippingRange[0] * tmp;\n }\n\n var _xmin = (model.windowCenter[0] - 1.0) * _width;\n\n var _xmax = (model.windowCenter[0] + 1.0) * _width;\n\n var _ymin = (model.windowCenter[1] - 1.0) * _height;\n\n var _ymax = (model.windowCenter[1] + 1.0) * _height;\n\n var znear = cRange[0];\n var zfar = cRange[1];\n tmpMatrix[0] = 2.0 * znear / (_xmax - _xmin);\n tmpMatrix[5] = 2.0 * znear / (_ymax - _ymin);\n tmpMatrix[2] = (_xmin + _xmax) / (_xmax - _xmin);\n tmpMatrix[6] = (_ymin + _ymax) / (_ymax - _ymin);\n tmpMatrix[10] = -(znear + zfar) / (zfar - znear);\n tmpMatrix[14] = -1.0;\n tmpMatrix[11] = -2.0 * znear * zfar / (zfar - znear);\n tmpMatrix[15] = 0.0;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(result, tmpMatrix);\n return result;\n };\n\n publicAPI.getCompositeProjectionMatrix = function (aspect, nearz, farz) {\n var vMat = publicAPI.getViewMatrix();\n var pMat = publicAPI.getProjectionMatrix(aspect, nearz, farz); // mats are transposed so the order is A then B\n // we reuse pMat as it is a copy so we can do what we want with it\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(pMat, vMat, pMat);\n return pMat;\n };\n\n publicAPI.setDirectionOfProjection = function (x, y, z) {\n if (model.directionOfProjection[0] === x && model.directionOfProjection[1] === y && model.directionOfProjection[2] === z) {\n return;\n }\n\n model.directionOfProjection[0] = x;\n model.directionOfProjection[1] = y;\n model.directionOfProjection[2] = z;\n var vec = model.directionOfProjection; // recalculate FocalPoint\n\n model.focalPoint[0] = model.position[0] + vec[0] * model.distance;\n model.focalPoint[1] = model.position[1] + vec[1] * model.distance;\n model.focalPoint[2] = model.position[2] + vec[2] * model.distance;\n computeViewPlaneNormal();\n }; // used to handle convert js device orientation angles\n // when you use this method the camera will adjust to the\n // device orientation such that the physicalViewUp you set\n // in world coordinates looks up, and the physicalViewNorth\n // you set in world coorindates will (maybe) point north\n //\n // NOTE WARNING - much of the documentation out there on how\n // orientation works is seriously wrong. Even worse the Chrome\n // device orientation simulator is completely wrong and should\n // never be used. OMG it is so messed up.\n //\n // how it seems to work on iOS is that the device orientation\n // is specified in extrinsic angles with a alpha, beta, gamma\n // convention with axes of Z, X, Y (the code below substitutes\n // the physical coordinate system for these axes to get the right\n // modified coordinate system.\n\n\n publicAPI.setDeviceAngles = function (alpha, beta, gamma, screen) {\n var physVRight = [3];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](model.physicalViewNorth, model.physicalViewUp, physVRight); // phone to physical coordinates\n\n var rotmat = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(rotmat, rotmat, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](alpha), model.physicalViewUp);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(rotmat, rotmat, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](beta), physVRight);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(rotmat, rotmat, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](gamma), model.physicalViewNorth);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(rotmat, rotmat, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](-screen), model.physicalViewUp);\n var dop = new Float64Array([-model.physicalViewUp[0], -model.physicalViewUp[1], -model.physicalViewUp[2]]);\n var vup = new Float64Array(model.physicalViewNorth);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(dop, dop, rotmat);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(vup, vup, rotmat);\n publicAPI.setDirectionOfProjection(dop[0], dop[1], dop[2]);\n publicAPI.setViewUp(vup[0], vup[1], vup[2]);\n publicAPI.modified();\n };\n\n publicAPI.setOrientationWXYZ = function (degrees, x, y, z) {\n var quatMat = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n\n if (degrees !== 0.0 && (x !== 0.0 || y !== 0.0 || z !== 0.0)) {\n // convert to radians\n var angle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"radiansFromDegrees\"](degrees);\n var q = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].setAxisAngle(q, [x, y, z], angle);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].fromQuat(quatMat, q);\n }\n\n var newdop = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newdop, [0.0, 0.0, -1.0], quatMat);\n var newvup = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(newvup, [0.0, 1.0, 0.0], quatMat);\n publicAPI.setDirectionOfProjection.apply(publicAPI, _toConsumableArray(newdop));\n publicAPI.setViewUp.apply(publicAPI, _toConsumableArray(newvup));\n publicAPI.modified();\n };\n\n publicAPI.computeClippingRange = function (bounds) {\n var vn = null;\n var position = null;\n vn = model.viewPlaneNormal;\n position = model.position;\n var a = -vn[0];\n var b = -vn[1];\n var c = -vn[2];\n var d = -(a * position[0] + b * position[1] + c * position[2]); // Set the max near clipping plane and the min far clipping plane\n\n var range = [a * bounds[0] + b * bounds[2] + c * bounds[4] + d, 1e-18]; // Find the closest / farthest bounding box vertex\n\n for (var k = 0; k < 2; k++) {\n for (var j = 0; j < 2; j++) {\n for (var i = 0; i < 2; i++) {\n var dist = a * bounds[i] + b * bounds[2 + j] + c * bounds[4 + k] + d;\n range[0] = dist < range[0] ? dist : range[0];\n range[1] = dist > range[1] ? dist : range[1];\n }\n }\n }\n\n return range;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n position: [0, 0, 1],\n focalPoint: [0, 0, 0],\n viewUp: [0, 1, 0],\n directionOfProjection: [0, 0, -1],\n parallelProjection: false,\n useHorizontalViewAngle: false,\n viewAngle: 30,\n parallelScale: 1,\n clippingRange: [0.01, 1000.01],\n windowCenter: [0, 0],\n viewPlaneNormal: [0, 0, 1],\n useOffAxisProjection: false,\n screenBottomLeft: [-0.5, -0.5, -0.5],\n screenBottomRight: [0.5, -0.5, -0.5],\n screenTopRight: [0.5, 0.5, -0.5],\n freezeFocalPoint: false,\n projectionMatrix: null,\n viewMatrix: null,\n // used for world to physical transformations\n physicalTranslation: [0, 0, 0],\n physicalScale: 1.0,\n physicalViewUp: [0, 1, 0],\n physicalViewNorth: [0, 0, -1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get(publicAPI, model, ['distance']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['parallelProjection', 'useHorizontalViewAngle', 'viewAngle', 'parallelScale', 'useOffAxisProjection', 'freezeFocalPoint', 'physicalScale']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getArray(publicAPI, model, ['directionOfProjection', 'viewPlaneNormal', 'position', 'focalPoint']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGetArray(publicAPI, model, ['clippingRange', 'windowCenter'], 2);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGetArray(publicAPI, model, ['viewUp', 'screenBottomLeft', 'screenBottomRight', 'screenTopRight', 'physicalTranslation', 'physicalViewUp', 'physicalViewNorth'], 3); // Object methods\n\n vtkCamera(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkCamera'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Camera/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.js ***! - \***************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json */ \"./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json\");\nvar vtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps_json__WEBPACK_IMPORTED_MODULE_0___namespace = /*#__PURE__*/__webpack_require__.t(/*! vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json */ \"./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json\", 1);\n\nvar presetMap = Object.create(null);\nvtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps_json__WEBPACK_IMPORTED_MODULE_0__.filter(function (p) {\n return p.RGBPoints;\n}).filter(function (p) {\n return p.ColorSpace !== 'CIELAB';\n}).forEach(function (p) {\n presetMap[p.Name] = p;\n}); // ----------------------------------------------------------------------------\n\nvar rgbPresetNames = Object.keys(presetMap);\nrgbPresetNames.sort(); // ----------------------------------------------------------------------------\n\nfunction getPresetByName(name) {\n return presetMap[name];\n} // ----------------------------------------------------------------------------\n\n\nfunction addPreset(preset) {\n if (!preset.RGBPoints || preset.ColorSpace === 'CIELAB') {\n return;\n }\n\n if (!presetMap[preset.Name]) {\n rgbPresetNames.push(preset.Name);\n rgbPresetNames.sort();\n }\n\n presetMap[preset.Name] = preset;\n} // ----------------------------------------------------------------------------\n\n\nfunction removePresetByName(name) {\n var index = rgbPresetNames.indexOf(name);\n\n if (index > -1) {\n rgbPresetNames.splice(index, 1);\n }\n\n delete presetMap[name];\n} // ----------------------------------------------------------------------------\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n addPreset: addPreset,\n removePresetByName: removePresetByName,\n getPresetByName: getPresetByName,\n rgbPresetNames: rgbPresetNames\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json": -/*!*****************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json ***! - \*****************************************************************************************/ -/*! exports provided: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, default */ -/***/ (function(module) { - -eval("module.exports = [{\"Name\":\"KAAMS\",\"IndexedColors\":[1,1,1,1,0,0,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,0.63,0.63,1,0.67,0.5,0.33,1,0.5,0.75,0.53,0.35,0.7,1,0.75,0.5],\"Annotations\":[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11]},{\"ColorSpace\":\"Diverging\",\"Name\":\"Cool to Warm\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0.23137254902,0.298039215686,0.752941176471,0.5,0.865,0.865,0.865,1,0.705882352941,0.0156862745098,0.149019607843]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Cool to Warm (Extended)\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,0,0,0.34902,0.03125,0.039216,0.062745,0.380392,0.0625,0.062745,0.117647,0.411765,0.09375,0.090196,0.184314,0.45098,0.125,0.12549,0.262745,0.501961,0.15625,0.160784,0.337255,0.541176,0.1875,0.2,0.396078,0.568627,0.21875,0.239216,0.454902,0.6,0.25,0.286275,0.521569,0.65098,0.28125,0.337255,0.592157,0.701961,0.3125,0.388235,0.654902,0.74902,0.34375,0.466667,0.737255,0.819608,0.375,0.572549,0.819608,0.878431,0.40625,0.654902,0.866667,0.909804,0.4375,0.752941,0.917647,0.941176,0.46875,0.823529,0.956863,0.968627,0.5,0.988235,0.960784,0.901961,0.5,0.941176,0.984314,0.988235,0.52,0.988235,0.945098,0.85098,0.54,0.980392,0.898039,0.784314,0.5625,0.968627,0.835294,0.698039,0.59375,0.94902,0.733333,0.588235,0.625,0.929412,0.65098,0.509804,0.65625,0.909804,0.564706,0.435294,0.6875,0.878431,0.458824,0.352941,0.71875,0.839216,0.388235,0.286275,0.75,0.760784,0.294118,0.211765,0.78125,0.701961,0.211765,0.168627,0.8125,0.65098,0.156863,0.129412,0.84375,0.6,0.094118,0.094118,0.875,0.54902,0.066667,0.098039,0.90625,0.501961,0.05098,0.12549,0.9375,0.45098,0.054902,0.172549,0.96875,0.4,0.054902,0.192157,1,0.34902,0.070588,0.211765]},{\"ColorSpace\":\"Diverging\",\"Name\":\"Warm to Cool\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0.705882352941,0.0156862745098,0.149019607843,0.5,0.865,0.865,0.865,1,0.23137254902,0.298039215686,0.752941176471]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Warm to Cool (Extended)\",\"NanColor\":[0.250004,0,0],\"RGBPoints\":[0,0.34902,0,0.129412,0.025,0.4,0.00392157,0.101961,0.05,0.470588,0.0156863,0.0901961,0.075,0.54902,0.027451,0.0705882,0.1,0.619608,0.0627451,0.0431373,0.125,0.690196,0.12549,0.0627451,0.15,0.741176,0.184314,0.0745098,0.175,0.788235,0.266667,0.0941176,0.2,0.811765,0.345098,0.113725,0.225,0.831373,0.411765,0.133333,0.25,0.85098,0.47451,0.145098,0.275,0.870588,0.54902,0.156863,0.3,0.878431,0.619608,0.168627,0.325,0.890196,0.658824,0.196078,0.35,0.909804,0.717647,0.235294,0.375,0.929412,0.776471,0.278431,0.395522,0.94902,0.823529,0.321569,0.418905,0.968627,0.87451,0.407843,0.444278,0.980392,0.917647,0.509804,0.470149,0.988235,0.956863,0.643137,0.483582,0.992157,0.964706,0.713725,0.499,0.988235,0.980392,0.870588,0.5,1,1,1,0.501,0.913725,0.988235,0.937255,0.516418,0.827451,0.980392,0.886275,0.531343,0.764706,0.980392,0.866667,0.546766,0.658824,0.980392,0.843137,0.564179,0.572549,0.964706,0.835294,0.587562,0.423529,0.941176,0.87451,0.60597,0.262745,0.901961,0.862745,0.629851,0.0705882,0.854902,0.870588,0.651741,0.0509804,0.8,0.85098,0.681592,0.0235294,0.709804,0.831373,0.712935,0.0313725,0.615686,0.811765,0.75,0.0313725,0.537255,0.788235,0.775,0.0392157,0.466667,0.768627,0.8,0.0509804,0.396078,0.741176,0.825,0.054902,0.317647,0.709804,0.85,0.054902,0.243137,0.678431,0.875,0.0431373,0.164706,0.639216,0.9,0.0313725,0.0980392,0.6,0.925,0.0392157,0.0392157,0.560784,0.95,0.105882,0.0509804,0.509804,0.975,0.113725,0.0235294,0.45098,1,0.12549,0,0.380392]},{\"ColorSpace\":\"RGB\",\"Name\":\"Rainbow Desaturated\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0.278431372549,0.278431372549,0.858823529412,0.143,0,0,0.360784313725,0.285,0,1,1,0.429,0,0.501960784314,0,0.571,1,1,0,0.714,1,0.380392156863,0,0.857,0.419607843137,0,0,1,0.878431372549,0.301960784314,0.301960784314]},{\"ColorSpace\":\"RGB\",\"Name\":\"Cold and Hot\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0,1,1,0.45,0,0,1,0.5,0,0,0.501960784314,0.55,1,0,0,1,1,1,0]},{\"ColorSpace\":\"RGB\",\"Name\":\"Black-Body Radiation\",\"NanColor\":[0,0.498039215686,1],\"RGBPoints\":[0,0,0,0,0.4,0.901960784314,0,0,0.8,0.901960784314,0.901960784314,0,1,1,1,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"X Ray\",\"NanColor\":[1,0,0],\"RGBPoints\":[0,1,1,1,1,0,0,0]},{\"ColorSpace\":\"RGB\",\"Name\":\"Grayscale\",\"NanColor\":[1,0,0],\"RGBPoints\":[0,0,0,0,1,1,1,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"BkRd\",\"NanColor\":[0,1,1],\"RGBPoints\":[0,0,0,0,1,1,0,0]},{\"ColorSpace\":\"RGB\",\"Name\":\"BkGn\",\"NanColor\":[1,0,1],\"RGBPoints\":[0,0,0,0,1,0,1,0]},{\"ColorSpace\":\"RGB\",\"Name\":\"BkBu\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0,0,0,1,0,0,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"BkMa\",\"NanColor\":[0,1,0],\"RGBPoints\":[0,0,0,0,1,1,0,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"BkCy\",\"NanColor\":[0,1,1],\"RGBPoints\":[0,0,0,0,1,0,1,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"Black, Blue and White\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0,0,0,0.333,0,0,0.501960784314,0.666,0,0.501960784314,1,1,1,1,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"Black, Orange and White\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0,0,0,0.333,0.501960784314,0,0,0.666,1,0.501960784314,0,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Linear YGB 1211g\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,1,0.988235,0.968627,0.02,1,0.952941,0.878431,0.05,0.968627,0.905882,0.776471,0.1,0.94902,0.898039,0.647059,0.15,0.901961,0.878431,0.556863,0.2,0.847059,0.858824,0.482353,0.25,0.690196,0.819608,0.435294,0.3,0.513725,0.768627,0.384314,0.35,0.337255,0.721569,0.337255,0.4,0.278431,0.658824,0.392157,0.45,0.231373,0.639216,0.435294,0.5,0.203922,0.6,0.486275,0.55,0.172549,0.568627,0.537255,0.6,0.141176,0.517647,0.54902,0.65,0.133333,0.458824,0.541176,0.7,0.12549,0.396078,0.529412,0.75,0.117647,0.321569,0.521569,0.8,0.121569,0.258824,0.509804,0.85,0.133333,0.227451,0.501961,0.9,0.145098,0.192157,0.490196,0.95,0.188235,0.164706,0.470588,1,0.258824,0.196078,0.439216]},{\"ColorSpace\":\"CIELAB\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Linear Green (Gr4L)\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,0.054902,0.109804,0.121569,0.05,0.07451,0.172549,0.180392,0.1,0.086275,0.231373,0.219608,0.15,0.094118,0.278431,0.25098,0.2,0.109804,0.34902,0.278431,0.25,0.113725,0.4,0.278431,0.3,0.117647,0.45098,0.270588,0.35,0.117647,0.490196,0.243137,0.4,0.113725,0.521569,0.203922,0.45,0.109804,0.54902,0.152941,0.5,0.082353,0.588235,0.082353,0.55,0.109804,0.631373,0.05098,0.6,0.211765,0.678431,0.082353,0.65,0.317647,0.721569,0.113725,0.7,0.431373,0.760784,0.160784,0.75,0.556863,0.8,0.239216,0.8,0.666667,0.839216,0.294118,0.85,0.784314,0.878431,0.396078,0.9,0.886275,0.921569,0.533333,0.95,0.960784,0.94902,0.670588,1,1,0.984314,0.901961]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Linear Blue (8_31f)\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,0.960784,1,0.980392,0.05,0.815686,0.960784,0.913725,0.1,0.670588,0.929412,0.870588,0.15,0.556863,0.901961,0.843137,0.2,0.478431,0.870588,0.823529,0.25,0.439216,0.831373,0.803922,0.3,0.4,0.8,0.788235,0.35,0.376471,0.768627,0.768627,0.4,0.34902,0.709804,0.729412,0.45,0.32549,0.654902,0.690196,0.5,0.301961,0.607843,0.658824,0.55,0.247059,0.545098,0.619608,0.6,0.239216,0.494118,0.580392,0.65,0.227451,0.439216,0.541176,0.7,0.227451,0.403922,0.521569,0.75,0.231373,0.368627,0.501961,0.8,0.227451,0.321569,0.470588,0.85,0.219608,0.282353,0.439216,0.9,0.192157,0.235294,0.4,0.95,0.160784,0.184314,0.34902,1,0.133333,0.12549,0.301961]},{\"ColorSpace\":\"HSV\",\"Name\":\"Blue to Red Rainbow\",\"NanColor\":[0.498039215686,0.498039215686,0.498039215686],\"RGBPoints\":[0,0,0,1,1,1,0,0]},{\"ColorSpace\":\"HSV\",\"Name\":\"Red to Blue Rainbow\",\"NanColor\":[0.498039215686,0.498039215686,0.498039215686],\"RGBPoints\":[0,1,0,0,1,0,0,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"Rainbow Blended White\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,1,1,1,0.17,0,0,1,0.34,0,1,1,0.5,0,1,0,0.67,1,1,0,0.84,1,0,0,1,0.878431372549,0,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"Rainbow Blended Grey\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0.317647058824,0.341176470588,0.43137254902,0.17,0,0,1,0.34,0,1,1,0.5,0,1,0,0.67,1,1,0,0.84,1,0,0,1,0.878431372549,0,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"Rainbow Blended Black\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0,0,0,0.17,0,0,1,0.34,0,1,1,0.5,0,1,0,0.67,1,1,0,0.84,1,0,0,1,0.878431372549,0,1]},{\"ColorSpace\":\"RGB\",\"Name\":\"Blue to Yellow\",\"NanColor\":[1,0,0],\"RGBPoints\":[0,0.0392156862745,0.0392156862745,0.949019607843,1,0.949019607843,0.949019607843,0.0392156862745]},{\"ColorSpace\":\"HSV\",\"Name\":\"blot\",\"RGBPoints\":[0,0,0,1,0.166,0,0,1,0.167,1,0,1,0.332,1,0,1,0.333,0,1,1,0.5,0,1,1,0.501,0,1,0,0.666,0,1,0,0.667,1,1,0,0.832,1,1,0,0.833,1,0,0,1,1,0,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"CIELab Blue to Red\",\"NanColor\":[1,1,0],\"RGBPoints\":[0,0,0.6,0.749019607843,1,0.76862745098,0.466666666667,0.341176470588]},{\"ColorSpace\":\"RGB\",\"Name\":\"jet\",\"RGBPoints\":[-1,0,0,0.5625,-0.777778,0,0,1,-0.269841,0,1,1,-0.015873,0.5,1,0.5,0.238095,1,1,0,0.746032,1,0,0,1,0.5,0,0]},{\"ColorSpace\":\"RGB\",\"Name\":\"rainbow\",\"RGBPoints\":[-1,0,0,1,-0.5,0,1,1,0,0,1,0,0.5,1,1,0,1,1,0,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_rainbow_bright\",\"RGBPoints\":[-1,0.32549,0.14902,0.960784,-0.866221,0.297047,0.375586,0.963836,-0.732441,0.180302,0.536818,0.964627,-0.598662,0.1302,0.649207,0.929647,-0.464883,0.0445143,0.749654,0.855998,-0.331104,0.0271325,0.830713,0.721527,-0.197324,0.259504,0.866145,0.543555,-0.0635452,0.428364,0.890725,0.329819,0.0702341,0.568503,0.898508,0.187623,0.204013,0.738259,0.890317,0.0825461,0.337793,0.84546,0.86136,0.0147555,0.471572,0.912191,0.808018,0,0.605351,0.962848,0.710445,0,0.73913,0.999469,0.600258,0.0176284,0.87291,0.994156,0.445975,0.193912,1,0.980407,0.247105,0.262699]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_rainbow_dark\",\"RGBPoints\":[-1,0,0,0.423499,-0.866221,0,0.119346,0.529237,-0.732441,0,0.238691,0.634976,-0.598662,0,0.346852,0.68788,-0.464883,0,0.45022,0.718141,-0.331104,0,0.553554,0.664839,-0.197324,0,0.651082,0.519303,-0.0635452,0.115841,0.72479,0.352857,0.0702341,0.326771,0.781195,0.140187,0.204013,0.522765,0.798524,0.0284624,0.337793,0.703162,0.788685,0.00885756,0.471572,0.845118,0.751133,0,0.605351,0.955734,0.690825,0,0.73913,0.995402,0.567916,0.0618524,0.87291,0.987712,0.403398,0.164851,1,0.980407,0.247105,0.262699]},{\"ColorSpace\":\"Lab\",\"Name\":\"nic_CubicL\",\"RGBPoints\":[-1,0.479965,0.0118108,0.5307,-0.87451,0.522213,0.0551282,0.706919,-0.74902,0.50839,0.237278,0.867764,-0.623529,0.451617,0.373834,0.987255,-0.498039,0.39365,0.497255,0.97506,-0.372549,0.328631,0.599639,0.891843,-0.247059,0.250043,0.690286,0.778553,-0.121569,0.249656,0.764905,0.645857,0.00392157,0.297954,0.821466,0.50449,0.129412,0.337509,0.872595,0.358447,0.254902,0.430011,0.913789,0.297079,0.380392,0.587191,0.931381,0.333353,0.505882,0.727937,0.93591,0.353742,0.631373,0.826403,0.921081,0.365066,0.756863,0.893201,0.846317,0.372662,0.882353,0.965347,0.73884,0.378506,1,0.983235,0.597451,0.366856]},{\"ColorSpace\":\"Lab\",\"Name\":\"nic_CubicYF\",\"RGBPoints\":[-1,0.5151,0.0482,0.6697,-0.87451,0.520711,0.168955,0.800574,-0.74902,0.493694,0.278596,0.911824,-0.623529,0.440026,0.369475,0.984978,-0.498039,0.398932,0.457593,0.987053,-0.372549,0.350651,0.540644,0.929608,-0.247059,0.298827,0.615625,0.857729,-0.121569,0.239928,0.685061,0.769531,0.00392157,0.228832,0.739349,0.673287,0.129412,0.263297,0.78608,0.569988,0.254902,0.298107,0.828337,0.460214,0.380392,0.33092,0.864071,0.352674,0.505882,0.38306,0.898169,0.287309,0.631373,0.49023,0.917481,0.307961,0.756863,0.62372,0.926026,0.332309,0.882353,0.717458,0.92527,0.342476,1,0.8,0.9255,0.3529]},{\"ColorSpace\":\"Lab\",\"Name\":\"gist_earth\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.239216,0.027451,0.415686,-0.74902,0.0901961,0.254902,0.556863,-0.623529,0.0941176,0.352941,0.54902,-0.498039,0.105882,0.435294,0.533333,-0.372549,0.12549,0.52549,0.501961,-0.247059,0.156863,0.596078,0.443137,-0.121569,0.196078,0.65098,0.380392,0.00392157,0.282353,0.717647,0.301961,0.129412,0.466667,0.772549,0.27451,0.254902,0.678431,0.784314,0.309804,0.380392,0.901961,0.756863,0.376471,0.505882,0.992157,0.705882,0.521569,0.631373,1,0.721569,0.701961,0.756863,1,0.784314,0.784314,0.882353,1,0.866667,0.866667,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"2hot\",\"RGBPoints\":[-1,0.0416667,0,0,-0.873016,0.208333,0,0,-0.746032,0.375,0,0,-0.619048,0.541667,0,0,-0.492063,0.708333,0,0,-0.365079,0.854137,0,0,-0.238095,0.937488,0.039062,0,-0.111111,1,0.208333,0,0.015873,1,0.375,0,0.142857,1,0.541667,0,0.269841,1,0.708333,0,0.396825,1,0.858805,0.03125,0.52381,1,0.947392,0.15625,0.650794,1,1,0.3125,0.777778,1,1,0.5625,0.904762,1,1,0.8125,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_red2yellow_BW\",\"RGBPoints\":[-1,7.54296e-7,0,0.0000109827,-0.87451,0.18285,0.0264094,0,-0.74902,0.3066,0,0,-0.623529,0.422841,0,0,-0.498039,0.522945,0,0,-0.372549,0.605721,0,0,-0.247059,0.672502,0.14168,0,-0.121569,0.728167,0.244025,0,0.00392157,0.781215,0.333454,0,0.129412,0.825,0.423586,0,0.254902,0.855893,0.516793,0,0.380392,0.880491,0.608846,0,0.505882,0.910305,0.695505,0,0.631373,0.94109,0.779067,0.223528,0.756863,0.967873,0.858572,0.473521,0.882353,0.986815,0.933211,0.751583,1,1,1,0.999997]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_marine2gold_BW\",\"RGBPoints\":[-1,1.11641e-7,0,0.00000162551,-0.87451,0.0413146,0.0619808,0.209857,-0.74902,0.0185557,0.101341,0.350684,-0.623529,0.00486405,0.149847,0.461054,-0.498039,0.0836345,0.210845,0.517906,-0.372549,0.173222,0.276134,0.541793,-0.247059,0.259857,0.343877,0.535869,-0.121569,0.362299,0.408124,0.504293,0.00392157,0.468266,0.468276,0.468257,0.129412,0.582781,0.527545,0.374914,0.254902,0.691591,0.585251,0.274266,0.380392,0.784454,0.645091,0.247332,0.505882,0.862299,0.710383,0.27518,0.631373,0.920863,0.782923,0.351563,0.756863,0.955792,0.859699,0.533541,0.882353,0.976162,0.93433,0.780671,1,1,1,0.999983]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue2gold_BW\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.0742735,0.0440331,0.230013,-0.74902,0.125276,0.0258685,0.415826,-0.623529,0.143879,0.0163031,0.591346,-0.498039,0.212261,0.0627855,0.705239,-0.372549,0.306048,0.141178,0.763636,-0.247059,0.391537,0.232286,0.773263,-0.121569,0.461734,0.336633,0.708321,0.00392157,0.54209,0.427581,0.590007,0.129412,0.61704,0.508623,0.460978,0.254902,0.702703,0.579586,0.309117,0.380392,0.790336,0.644811,0.170397,0.505882,0.870173,0.710733,0.117134,0.631373,0.93656,0.781991,0.157144,0.756863,0.965672,0.862068,0.409836,0.882353,0.985751,0.936296,0.714162,1,1,1,0.999999]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_sapphire2gold_BW\",\"RGBPoints\":[-1,0.107704,0.107708,0.107694,-0.87451,0.1851,0.112354,0.308554,-0.74902,0.236782,0.114233,0.48788,-0.623529,0.28296,0.126187,0.639464,-0.498039,0.344787,0.171643,0.739713,-0.372549,0.413325,0.242371,0.76913,-0.247059,0.481863,0.3131,0.719841,-0.121569,0.550402,0.383829,0.612222,0.00392157,0.61894,0.454558,0.51126,0.129412,0.687478,0.525287,0.39993,0.254902,0.756017,0.596016,0.289923,0.380392,0.824555,0.666745,0.255498,0.505882,0.892979,0.736822,0.27696,0.631373,0.938851,0.804966,0.351734,0.756863,0.966491,0.874853,0.53572,0.882353,0.982105,0.94153,0.782579,1,1,1,0.999986]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_red2purple_BW\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.167793,0.0166271,0.0431278,-0.74902,0.262608,0.0107595,0.0791181,-0.623529,0.351902,0.0101858,0.100926,-0.498039,0.441257,0.0160835,0.131919,-0.372549,0.5221,0.0555972,0.195625,-0.247059,0.593852,0.104294,0.310234,-0.121569,0.654628,0.158115,0.448486,0.00392157,0.707443,0.220914,0.570253,0.129412,0.749504,0.293268,0.67897,0.254902,0.781587,0.370517,0.779269,0.380392,0.809951,0.451099,0.855831,0.505882,0.84424,0.531462,0.900451,0.631373,0.865174,0.620901,0.91606,0.756863,0.875041,0.714054,0.910284,0.882353,0.880764,0.80554,0.896276,1,0.887572,0.887591,0.887556]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_purple2pink_BW\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.117562,0.0291202,0.175876,-0.74902,0.178368,0.0458476,0.285454,-0.623529,0.237731,0.0680173,0.387717,-0.498039,0.300877,0.0956291,0.484802,-0.372549,0.370929,0.136858,0.554985,-0.247059,0.449033,0.189273,0.58863,-0.121569,0.529971,0.245796,0.598587,0.00392157,0.609914,0.300643,0.610244,0.129412,0.697079,0.351286,0.616371,0.254902,0.785858,0.401991,0.617376,0.380392,0.862517,0.45745,0.64463,0.505882,0.91359,0.525462,0.705336,0.631373,0.932583,0.61064,0.767412,0.756863,0.922478,0.706966,0.817522,0.882353,0.901302,0.803071,0.856311,1,0.887571,0.887591,0.887549]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_pbj_lin\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.091821,0.0611476,0.10617,-0.74902,0.160311,0.0900022,0.192713,-0.623529,0.22484,0.12126,0.272128,-0.498039,0.291263,0.157469,0.340828,-0.372549,0.360015,0.200388,0.388903,-0.247059,0.437497,0.250058,0.387201,-0.121569,0.512636,0.304969,0.355955,0.00392157,0.582603,0.360874,0.33488,0.129412,0.655126,0.416374,0.306351,0.254902,0.725889,0.473329,0.279051,0.380392,0.778125,0.537928,0.302697,0.505882,0.815894,0.606931,0.382431,0.631373,0.839159,0.679308,0.497608,0.756863,0.854748,0.751666,0.631792,0.882353,0.869483,0.822508,0.768592,1,0.887572,0.887589,0.887565]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue2green_muted\",\"RGBPoints\":[-1,0.107704,0.107708,0.107695,-0.87451,0.141522,0.13066,0.270741,-0.74902,0.180123,0.146119,0.42308,-0.623529,0.210161,0.169674,0.551795,-0.498039,0.239701,0.212939,0.634969,-0.372549,0.253916,0.282947,0.653641,-0.247059,0.242791,0.366933,0.608521,-0.121569,0.226302,0.446776,0.52693,0.00392157,0.236237,0.514689,0.458798,0.129412,0.274641,0.577589,0.376069,0.254902,0.349625,0.633993,0.288131,0.380392,0.4437,0.683677,0.260497,0.505882,0.536247,0.731214,0.285424,0.631373,0.628472,0.777128,0.349151,0.756863,0.718259,0.819287,0.496825,0.882353,0.804768,0.856164,0.703299,1,0.887571,0.887591,0.887548]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue2green_BW\",\"RGBPoints\":[-1,3.63578e-7,0,0.00000529374,-0.87451,0.0539915,0.0577948,0.212806,-0.74902,0.0620393,0.0758942,0.388959,-0.623529,0.0697499,0.102032,0.54177,-0.498039,0.113295,0.156156,0.64334,-0.372549,0.152047,0.243196,0.670283,-0.247059,0.158096,0.344084,0.622864,-0.121569,0.151142,0.43922,0.532767,0.00392157,0.17155,0.521588,0.457719,0.129412,0.225861,0.599141,0.363997,0.254902,0.32328,0.67007,0.259083,0.380392,0.442344,0.733697,0.223754,0.505882,0.558409,0.794941,0.257411,0.631373,0.673875,0.854344,0.340822,0.756863,0.787244,0.909326,0.524717,0.882353,0.896483,0.958063,0.775914,1,1,1,0.999982]},{\"ColorSpace\":\"Lab\",\"Name\":\"GREEN-WHITE_LINEAR\",\"RGBPoints\":[-1,0,0,0,-0.87451,0,0.062745,0,-0.74902,0,0.12549,0,-0.623529,0,0.188235,0,-0.498039,0,0.25098,0,-0.372549,0,0.313725,0,-0.247059,0,0.376471,0,-0.121569,0.094118,0.439216,0,0.00392157,0.196078,0.501961,0,0.129412,0.294118,0.564706,0,0.254902,0.396078,0.627451,0,0.380392,0.498039,0.690196,0,0.505882,0.6,0.752941,0.145098,0.631373,0.701961,0.815686,0.364706,0.756863,0.8,0.878431,0.580392,0.882353,0.901961,0.941176,0.796078,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_green2yellow_BW\",\"RGBPoints\":[-1,0,0,0,-0.87451,0,0.105542,0.0603919,-0.74902,0,0.159454,0.104148,-0.623529,0,0.219502,0.15542,-0.498039,0,0.282276,0.203811,-0.372549,0,0.346331,0.235652,-0.247059,0,0.411765,0.235428,-0.121569,0,0.477177,0.217977,0.00392157,0.0593644,0.541635,0.21361,0.129412,0.233081,0.604722,0.210591,0.254902,0.369803,0.664942,0.226536,0.380392,0.498446,0.722367,0.288237,0.505882,0.601929,0.782244,0.380815,0.631373,0.703207,0.840497,0.512134,0.756863,0.803186,0.896433,0.674462,0.882353,0.903834,0.950266,0.846715,1,1,1,0.999981]},{\"ColorSpace\":\"Lab\",\"Name\":\"blue2cyan\",\"RGBPoints\":[-1,0,0,0,-0.87451,0,0.152941,0.364706,-0.74902,0,0.254902,0.470588,-0.623529,0,0.34902,0.572549,-0.498039,0,0.443137,0.670588,-0.372549,0,0.537255,0.772549,-0.247059,0,0.627451,0.870588,-0.121569,0,0.717647,0.964706,0.00392157,0.0784314,0.772549,1,0.129412,0.207843,0.858824,1,0.254902,0.32549,0.941176,1,0.380392,0.45098,1,1,0.505882,0.560784,1,1,0.631373,0.662745,1,1,0.756863,0.760784,1,1,0.882353,0.870588,1,1,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue2cyan_BW\",\"RGBPoints\":[-1,4.05298e-7,0,0.0000059012,-0.87451,0.0207526,0.0740933,0.18093,-0.74902,0,0.121033,0.30343,-0.623529,0,0.166892,0.416095,-0.498039,0,0.216768,0.524796,-0.372549,0.0164769,0.275471,0.608585,-0.247059,0.0544527,0.344824,0.659267,-0.121569,0.0880643,0.419118,0.688675,0.00392157,0.127938,0.492556,0.720256,0.129412,0.149476,0.566946,0.756918,0.254902,0.188961,0.641333,0.792122,0.380392,0.245482,0.715336,0.827609,0.505882,0.329216,0.786235,0.874761,0.631373,0.453558,0.852803,0.918466,0.756863,0.626281,0.910493,0.954,0.882353,0.82257,0.958709,0.980146,1,1,1,0.999989]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue_BW\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.0425591,0.0763529,0.150682,-0.74902,0.0569472,0.119154,0.275403,-0.623529,0.0635978,0.164772,0.395427,-0.498039,0.0774342,0.213851,0.510014,-0.372549,0.106815,0.267034,0.615102,-0.247059,0.122093,0.324649,0.720068,-0.121569,0.160851,0.387068,0.806956,0.00392157,0.213754,0.453516,0.878012,0.129412,0.26722,0.524656,0.932436,0.254902,0.326844,0.599279,0.968038,0.380392,0.403403,0.674712,0.984784,0.505882,0.499703,0.745519,1,0.631373,0.615055,0.813983,1,0.756863,0.74405,0.879228,1,0.882353,0.877909,0.941913,1,1,1,1,0.999996]},{\"ColorSpace\":\"Lab\",\"Name\":\"BLUE-WHITE\",\"RGBPoints\":[-1,0,0,0,-0.87451,0,0,0.082353,-0.74902,0,0,0.168627,-0.623529,0,0,0.254902,-0.498039,0,0,0.337255,-0.372549,0,0,0.423529,-0.247059,0,0,0.509804,-0.121569,0,0.101961,0.592157,0.00392157,0,0.203922,0.678431,0.129412,0,0.301961,0.764706,0.254902,0,0.403922,0.85098,0.380392,0,0.505882,0.933333,0.505882,0,0.603922,1,0.631373,0.254902,0.705882,1,0.756863,0.509804,0.807843,1,0.882353,0.764706,0.905882,1,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_purple_BW\",\"RGBPoints\":[-1,4.264e-8,0,6.20844e-7,-0.87451,0.100579,0.0593111,0.145666,-0.74902,0.167794,0.0889224,0.254953,-0.623529,0.231446,0.123339,0.360511,-0.498039,0.296699,0.163027,0.461278,-0.372549,0.363211,0.209286,0.55306,-0.247059,0.431136,0.260776,0.637195,-0.121569,0.498202,0.320012,0.705799,0.00392157,0.567456,0.380459,0.778091,0.129412,0.629381,0.445284,0.8448,0.254902,0.688373,0.517374,0.895694,0.380392,0.74891,0.590906,0.93976,0.505882,0.805017,0.667956,0.977626,0.631373,0.850914,0.752618,0.992396,0.756863,0.89724,0.838454,0.994093,0.882353,0.948461,0.922603,0.994449,1,1,1,0.999967]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_magenta_BW\",\"RGBPoints\":[-1,0,0,0.0000254023,-0.87451,0.128696,0.0456782,0.11635,-0.74902,0.228133,0.0476299,0.201452,-0.623529,0.327273,0.0374065,0.282107,-0.498039,0.420953,0.0408166,0.35709,-0.372549,0.511562,0.0642203,0.430511,-0.247059,0.599552,0.102686,0.504257,-0.121569,0.684646,0.150536,0.579429,0.00392157,0.765817,0.205978,0.656062,0.129412,0.839176,0.27229,0.731807,0.254902,0.89536,0.357594,0.797309,0.380392,0.930238,0.457825,0.846984,0.505882,0.945921,0.564536,0.880571,0.631373,0.948995,0.670753,0.902279,0.756863,0.947124,0.772819,0.918171,0.882353,0.947265,0.869424,0.934352,1,0.954719,0.95475,0.954726]},{\"ColorSpace\":\"Lab\",\"Name\":\"magenta\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.364706,0,0.152941,-0.74902,0.470588,0,0.254902,-0.623529,0.572549,0,0.34902,-0.498039,0.670588,0,0.443137,-0.372549,0.772549,0,0.537255,-0.247059,0.870588,0,0.627451,-0.121569,0.964706,0,0.717647,0.00392157,1,0.0784314,0.772549,0.129412,1,0.207843,0.858824,0.254902,1,0.32549,0.941176,0.380392,1,0.45098,1,0.505882,1,0.560784,1,0.631373,1,0.662745,1,0.756863,1,0.760784,1,0.882353,1,0.870588,1,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"RED-PURPLE\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.188235,0,0.007843,-0.74902,0.345098,0,0.035294,-0.623529,0.439216,0,0.098039,-0.498039,0.533333,0,0.152941,-0.372549,0.627451,0.015686,0.211765,-0.247059,0.721569,0.031373,0.266667,-0.121569,0.8,0.047059,0.329412,0.00392157,0.862745,0.047059,0.403922,0.129412,0.941176,0.062745,0.466667,0.254902,0.988235,0.078431,0.54902,0.380392,0.988235,0.141176,0.643137,0.505882,0.988235,0.25098,0.729412,0.631373,0.988235,0.376471,0.811765,0.756863,0.988235,0.54902,0.886275,0.882353,0.988235,0.752941,0.952941,1,0.996078,0.996078,0.996078]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_red_BW\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.147204,0.0480135,0.0401815,-0.74902,0.253411,0.0617478,0.0301333,-0.623529,0.356059,0.0746331,0.0446897,-0.498039,0.457731,0.0934935,0.0636931,-0.372549,0.557199,0.122714,0.0860013,-0.247059,0.665179,0.144238,0.105585,-0.121569,0.763833,0.187056,0.138326,0.00392157,0.847035,0.254558,0.189407,0.129412,0.905663,0.345937,0.258215,0.254902,0.941431,0.447111,0.346277,0.380392,0.962608,0.546927,0.457571,0.505882,0.987833,0.637276,0.569944,0.631373,0.994202,0.732176,0.687958,0.756863,0.993304,0.826268,0.800567,0.882353,0.994413,0.917205,0.906393,1,1,1,0.999979]},{\"ColorSpace\":\"Lab\",\"Name\":\"RED_TEMPERATURE\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.090196,0,0,-0.74902,0.180392,0,0,-0.623529,0.270588,0,0,-0.498039,0.360784,0,0,-0.372549,0.45098,0,0,-0.247059,0.545098,0,0,-0.121569,0.635294,0,0,0.00392157,0.72549,0.058824,0,0.129412,0.815686,0.176471,0,0.254902,0.905882,0.294118,0,0.380392,1,0.411765,0,0.505882,1,0.533333,0.027451,0.631373,1,0.65098,0.27451,0.756863,1,0.768627,0.521569,0.882353,1,0.886275,0.768627,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_orange_BW\",\"RGBPoints\":[-1,0,0,0.0000253806,-0.87451,0.135871,0.0593824,0,-0.74902,0.224328,0.0907216,0,-0.623529,0.318083,0.119647,0,-0.498039,0.414443,0.150246,0,-0.372549,0.511077,0.184884,0,-0.247059,0.605501,0.226033,0,-0.121569,0.695274,0.275491,0,0.00392157,0.777826,0.334445,0,0.129412,0.851498,0.402441,0,0.254902,0.915899,0.47759,0.000602975,0.380392,0.971984,0.557882,0.0361443,0.505882,1,0.641287,0.135967,0.631373,1,0.725198,0.27997,0.756863,1,0.808205,0.438135,0.882353,1,0.89306,0.587036,1,1,0.977928,0.721599]},{\"ColorSpace\":\"Lab\",\"Name\":\"heated_object\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.34902,0.0862745,0,-0.74902,0.45098,0.172549,0,-0.623529,0.52549,0.231373,0,-0.498039,0.580392,0.278431,0,-0.372549,0.623529,0.313725,0,-0.247059,0.670588,0.352941,0,-0.121569,0.717647,0.392157,0,0.00392157,0.772549,0.439216,0,0.129412,0.839216,0.494118,0,0.254902,0.901961,0.541176,0,0.380392,0.968627,0.6,0,0.505882,1,0.658824,0,0.631373,1,0.721569,0,0.756863,1,0.827451,0.298039,0.882353,1,0.976471,0.72549,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_gold_BW\",\"RGBPoints\":[-1,0,0,0.0000190933,-0.87451,0.128363,0.0636265,0,-0.74902,0.193795,0.111057,0,-0.623529,0.25976,0.15987,0,-0.498039,0.328546,0.210589,0,-0.372549,0.399726,0.26332,0,-0.247059,0.472969,0.318261,0,-0.121569,0.546245,0.375827,0,0.00392157,0.61745,0.436719,0,0.129412,0.685545,0.501113,0,0.254902,0.749578,0.568799,0,0.380392,0.80962,0.6394,0,0.505882,0.865572,0.712699,0.10257,0.631373,0.917709,0.787569,0.233665,0.756863,0.966914,0.863138,0.369608,0.882353,1,0.939405,0.496104,1,0.999225,1,0.612275]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_brown_BW\",\"RGBPoints\":[-1,3.3216e-7,0,0.00000483629,-0.87451,0.14693,0.0518172,0,-0.74902,0.225806,0.0814996,0,-0.623529,0.301681,0.111452,0,-0.498039,0.370487,0.150664,0,-0.372549,0.43108,0.199477,0,-0.247059,0.4849,0.255107,0,-0.121569,0.536798,0.313486,0,0.00392157,0.59286,0.371167,0,0.129412,0.653119,0.428135,0,0.254902,0.714589,0.485917,0.0379541,0.380392,0.774667,0.54565,0.116634,0.505882,0.831222,0.608047,0.183895,0.631373,0.880305,0.674199,0.260298,0.756863,0.922314,0.742472,0.367086,0.882353,0.959408,0.811222,0.497258,1,0.993548,0.875183,0.622093]},{\"ColorSpace\":\"Lab\",\"Name\":\"copper_Matlab\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.0784314,0.0501961,0.0313725,-0.74902,0.156863,0.100392,0.0627451,-0.623529,0.235294,0.150588,0.0941176,-0.498039,0.313725,0.200784,0.12549,-0.372549,0.392157,0.25098,0.156863,-0.247059,0.470588,0.301176,0.188235,-0.121569,0.54902,0.351373,0.219608,0.00392157,0.627451,0.401569,0.25098,0.129412,0.705882,0.451765,0.282353,0.254902,0.784314,0.501961,0.313725,0.380392,0.862745,0.552157,0.345098,0.505882,0.941176,0.602353,0.376471,0.631373,1,0.652549,0.407843,0.756863,1,0.702745,0.439216,0.882353,1,0.752941,0.470588,1,1,0.8,0.5]},{\"ColorSpace\":\"Lab\",\"Name\":\"pink_Matlab\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.312416,0.204524,0.204524,-0.74902,0.441822,0.289241,0.289241,-0.623529,0.54112,0.354246,0.354246,-0.498039,0.624831,0.409048,0.409048,-0.372549,0.698582,0.45733,0.45733,-0.247059,0.764404,0.502282,0.500979,-0.121569,0.791292,0.591516,0.54112,0.00392157,0.817297,0.66895,0.578481,0.129412,0.842499,0.738308,0.613572,0.254902,0.866968,0.801687,0.646762,0.380392,0.890766,0.86041,0.678329,0.505882,0.913944,0.913944,0.711254,0.631373,0.936549,0.936549,0.79459,0.756863,0.958621,0.958621,0.869979,0.882353,0.980196,0.980196,0.939336,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"bone_Matlab\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.054902,0.054902,0.075817,-0.74902,0.109804,0.109804,0.151634,-0.623529,0.164706,0.164706,0.227451,-0.498039,0.219608,0.219608,0.303268,-0.372549,0.27451,0.27451,0.379085,-0.247059,0.329412,0.329902,0.454412,-0.121569,0.384314,0.405719,0.509314,0.00392157,0.439216,0.481536,0.564216,0.129412,0.494118,0.557353,0.619118,0.254902,0.54902,0.63317,0.67402,0.380392,0.603922,0.708987,0.728922,0.505882,0.660294,0.783824,0.783824,0.631373,0.746569,0.838725,0.838725,0.756863,0.832843,0.893627,0.893627,0.882353,0.919118,0.948529,0.948529,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"gray_Matlab\",\"RGBPoints\":[-1,0,0,0,-0.87451,0.0627451,0.0627451,0.0627451,-0.74902,0.12549,0.12549,0.12549,-0.623529,0.188235,0.188235,0.188235,-0.498039,0.25098,0.25098,0.25098,-0.372549,0.313725,0.313725,0.313725,-0.247059,0.376471,0.376471,0.376471,-0.121569,0.439216,0.439216,0.439216,0.00392157,0.501961,0.501961,0.501961,0.129412,0.564706,0.564706,0.564706,0.254902,0.627451,0.627451,0.627451,0.380392,0.690196,0.690196,0.690196,0.505882,0.752941,0.752941,0.752941,0.631373,0.815686,0.815686,0.815686,0.756863,0.878431,0.878431,0.878431,0.882353,0.941176,0.941176,0.941176,1,1,1,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"Purples\",\"RGBPoints\":[-1,0.247059,0,0.490196,-0.87451,0.288397,0.07677,0.525629,-0.74902,0.32975,0.153587,0.561092,-0.623529,0.373057,0.236263,0.600461,-0.498039,0.416363,0.319,0.639923,-0.372549,0.459669,0.405613,0.685198,-0.247059,0.503345,0.491534,0.730058,-0.121569,0.562399,0.54862,0.757616,0.00392157,0.621453,0.606075,0.785544,0.129412,0.680508,0.674971,0.824914,0.254902,0.739562,0.743406,0.863899,0.380392,0.798616,0.800492,0.893426,0.505882,0.85684,0.856655,0.922491,0.631373,0.898178,0.894056,0.942176,0.756863,0.938654,0.930919,0.961646,0.882353,0.964245,0.958478,0.977393,1,0.988235,0.984314,0.992157]},{\"ColorSpace\":\"Lab\",\"Name\":\"Blues\",\"RGBPoints\":[-1,0.031373,0.188235,0.419608,-0.87451,0.031373,0.253195,0.516063,-0.74902,0.031757,0.318139,0.612149,-0.623529,0.080969,0.38113,0.661361,-0.498039,0.130427,0.444152,0.710327,-0.372549,0.195386,0.509112,0.743791,-0.247059,0.260715,0.573841,0.777209,-0.121569,0.341423,0.628958,0.808704,0.00392157,0.422745,0.684075,0.839892,0.129412,0.523137,0.739193,0.861546,0.254902,0.622684,0.793464,0.883429,0.380392,0.701423,0.826928,0.910988,0.505882,0.778685,0.8603,0.937993,0.631373,0.825928,0.891795,0.953741,0.756863,0.87328,0.923291,0.969489,0.882353,0.922491,0.954787,0.985236,1,0.968627,0.984314,1]},{\"ColorSpace\":\"Lab\",\"Name\":\"Greens\",\"RGBPoints\":[-1,0,0.266667,0.105882,-0.87451,0,0.347374,0.139346,-0.74902,0.000538,0.427912,0.172933,-0.623529,0.069435,0.486967,0.222145,-0.498039,0.138178,0.546082,0.271326,-0.372549,0.197232,0.609073,0.31857,-0.247059,0.257255,0.671742,0.365859,-0.121569,0.357647,0.720953,0.415071,0.00392157,0.45767,0.769919,0.465021,0.129412,0.546251,0.811257,0.537855,0.254902,0.634295,0.852211,0.610688,0.380392,0.709097,0.883706,0.683522,0.505882,0.78316,0.914833,0.755894,0.631373,0.842215,0.938454,0.818885,0.756863,0.899977,0.961538,0.880692,0.882353,0.935409,0.975317,0.92203,1,0.968627,0.988235,0.960784]},{\"ColorSpace\":\"Lab\",\"Name\":\"PuBu\",\"RGBPoints\":[-1,0.301961,0,0.294118,-0.87451,0.404321,0.029527,0.390573,-0.74902,0.50599,0.059592,0.486782,-0.623529,0.519769,0.158016,0.551742,-0.498039,0.533456,0.256194,0.616301,-0.372549,0.54133,0.33887,0.655671,-0.247059,0.54902,0.421592,0.695087,-0.121569,0.54902,0.506236,0.736424,0.00392157,0.550127,0.590573,0.777701,0.129412,0.585559,0.665375,0.81707,0.254902,0.622145,0.739023,0.855825,0.380392,0.687105,0.784298,0.879446,0.505882,0.752065,0.829758,0.903253,0.631373,0.817024,0.87897,0.930811,0.756863,0.880907,0.927213,0.957832,0.882353,0.926182,0.958708,0.975548,1,0.968627,0.988235,0.992157]},{\"ColorSpace\":\"Lab\",\"Name\":\"BuPu\",\"RGBPoints\":[-1,0.007843,0.219608,0.345098,-0.87451,0.01178,0.286536,0.449427,-0.74902,0.015702,0.35328,0.553479,-0.623529,0.01767,0.396586,0.622376,-0.498039,0.021115,0.4402,0.690688,-0.372549,0.11757,0.503191,0.722184,-0.247059,0.214625,0.565859,0.753633,-0.121569,0.336671,0.615071,0.78316,0.00392157,0.457978,0.663975,0.812503,0.129412,0.556401,0.703345,0.836125,0.254902,0.65421,0.742714,0.859669,0.380392,0.736886,0.782084,0.881323,0.505882,0.81827,0.821638,0.903068,0.631373,0.873387,0.864944,0.92669,0.756863,0.927536,0.907605,0.949988,0.882353,0.964937,0.9391,0.967705,1,1,0.968627,0.984314]},{\"ColorSpace\":\"Lab\",\"Name\":\"BuGn\",\"RGBPoints\":[-1,0.031373,0.25098,0.505882,-0.87451,0.031373,0.329719,0.590527,-0.74902,0.031911,0.408397,0.674787,-0.623529,0.100807,0.479262,0.710219,-0.498039,0.169704,0.550219,0.745744,-0.372549,0.238601,0.62699,0.787082,-0.247059,0.307958,0.703114,0.826759,-0.121569,0.39654,0.752326,0.797232,0.00392157,0.485121,0.801046,0.767705,0.129412,0.573702,0.83451,0.738178,0.254902,0.661592,0.867743,0.711034,0.380392,0.732457,0.895302,0.74253,0.505882,0.801845,0.922307,0.774579,0.631373,0.841215,0.938055,0.817885,0.756863,0.880907,0.95391,0.861084,0.882353,0.926182,0.971626,0.902422,1,0.968627,0.988235,0.941176]},{\"ColorSpace\":\"Lab\",\"Name\":\"GnBu\",\"RGBPoints\":[-1,0,0.266667,0.105882,-0.87451,0,0.347374,0.139346,-0.74902,0.000538,0.427912,0.172933,-0.623529,0.069435,0.486967,0.222145,-0.498039,0.138178,0.546175,0.272095,-0.372549,0.197232,0.615071,0.368551,-0.247059,0.256609,0.683276,0.464867,-0.121569,0.329443,0.722645,0.555417,0.00392157,0.403137,0.762138,0.645413,0.129412,0.503529,0.805444,0.718247,0.254902,0.603922,0.848597,0.790465,0.380392,0.704314,0.887966,0.847551,0.505882,0.802307,0.926321,0.903714,0.631373,0.851519,0.944037,0.941115,0.756863,0.899977,0.961538,0.976901,0.882353,0.935409,0.975317,0.984775,1,0.968627,0.988235,0.992157]},{\"ColorSpace\":\"Lab\",\"Name\":\"GnBuPu\",\"RGBPoints\":[-1,0.003922,0.27451,0.211765,-0.87451,0.003922,0.349312,0.280661,-0.74902,0.003937,0.423852,0.349773,-0.623529,0.005905,0.46519,0.446228,-0.498039,0.009443,0.506344,0.542837,-0.372549,0.111803,0.535871,0.649135,-0.247059,0.214025,0.565859,0.753633,-0.121569,0.310481,0.615071,0.78316,0.00392157,0.407797,0.663975,0.812503,0.129412,0.531811,0.703345,0.836125,0.254902,0.65421,0.742714,0.859669,0.380392,0.736886,0.782084,0.881323,0.505882,0.81827,0.821176,0.902884,0.631373,0.873387,0.854641,0.922568,0.756863,0.927536,0.888535,0.942361,0.882353,0.964937,0.929873,0.964014,1,1,0.968627,0.984314]},{\"ColorSpace\":\"Lab\",\"Name\":\"BuGnYl\",\"RGBPoints\":[-1,0.031373,0.113725,0.345098,-0.87451,0.088458,0.159,0.463206,-0.74902,0.145052,0.204567,0.5807,-0.623529,0.139146,0.287243,0.620069,-0.498039,0.13318,0.370196,0.659562,-0.372549,0.123337,0.470588,0.706805,-0.247059,0.115386,0.570335,0.753126,-0.121569,0.186251,0.643168,0.761,0.00392157,0.258716,0.71514,0.768074,0.129412,0.380761,0.760415,0.750358,0.254902,0.503576,0.806075,0.732795,0.380392,0.645306,0.861192,0.719016,0.505882,0.783899,0.91511,0.705606,0.631373,0.858701,0.944637,0.6997,0.756863,0.931349,0.973303,0.698424,0.882353,0.966782,0.987082,0.777163,1,1,1,0.85098]},{\"ColorSpace\":\"Lab\",\"Name\":\"PuRd\",\"RGBPoints\":[-1,0.286275,0,0.415686,-0.87451,0.38273,0.001968,0.441276,-0.74902,0.479231,0.003922,0.466774,-0.623529,0.581592,0.003922,0.480554,-0.498039,0.683799,0.00549,0.494887,-0.372549,0.776317,0.105882,0.544098,-0.247059,0.867866,0.206321,0.592618,-0.121569,0.919047,0.308681,0.612303,0.00392157,0.968812,0.411226,0.632603,0.129412,0.974717,0.519493,0.671972,0.254902,0.980546,0.626451,0.71065,0.380392,0.984483,0.701253,0.732303,0.505882,0.988328,0.77504,0.755617,0.631373,0.990296,0.828189,0.812703,0.756863,0.992372,0.880907,0.869035,0.882353,0.996309,0.926182,0.912341,1,1,0.968627,0.952941]},{\"ColorSpace\":\"Lab\",\"Name\":\"RdPu\",\"RGBPoints\":[-1,0.403922,0,0.121569,-0.87451,0.500377,0,0.192434,-0.74902,0.596909,0.000277,0.263037,-0.623529,0.703206,0.035709,0.300438,-0.498039,0.808612,0.071296,0.338854,-0.372549,0.857824,0.116571,0.441215,-0.247059,0.905513,0.163552,0.54293,-0.121569,0.889765,0.281661,0.617732,0.00392157,0.873156,0.39897,0.691611,0.129412,0.82985,0.491488,0.736886,0.254902,0.789081,0.583237,0.781853,0.380392,0.810734,0.656071,0.819254,0.505882,0.833126,0.729181,0.85684,0.631373,0.870527,0.80792,0.898178,0.756863,0.907605,0.884398,0.938331,0.882353,0.9391,0.921799,0.958016,1,0.968627,0.956863,0.976471]},{\"ColorSpace\":\"Lab\",\"Name\":\"Oranges\",\"RGBPoints\":[-1,0.498039,0.152941,0.015686,-0.87451,0.57481,0.182468,0.013718,-0.74902,0.651765,0.212042,0.011734,-0.623529,0.752157,0.247474,0.007797,-0.498039,0.851719,0.283368,0.004475,-0.372549,0.898962,0.348328,0.039908,-0.247059,0.945652,0.413426,0.076401,-0.121569,0.969273,0.484291,0.157109,0.00392157,0.992157,0.554971,0.238185,0.129412,0.992157,0.619931,0.330704,0.254902,0.992157,0.684967,0.423837,0.380392,0.992157,0.751895,0.532103,0.505882,0.992249,0.817716,0.639354,0.631373,0.994218,0.861023,0.725967,0.756863,0.996186,0.903576,0.810965,0.882353,0.998155,0.933103,0.868051,1,1,0.960784,0.921569]},{\"ColorSpace\":\"Lab\",\"Name\":\"Reds\",\"RGBPoints\":[-1,0.403922,0,0.05098,-0.87451,0.525967,0.029527,0.066728,-0.74902,0.647643,0.058962,0.082476,-0.623529,0.722445,0.076678,0.098224,-0.498039,0.797186,0.095194,0.114187,-0.372549,0.868051,0.164091,0.143714,-0.247059,0.937809,0.233541,0.173933,-0.121569,0.96143,0.326059,0.232987,0.00392157,0.984375,0.418147,0.292657,0.129412,0.986344,0.496886,0.371396,0.254902,0.988235,0.575702,0.450673,0.380392,0.988235,0.656409,0.543191,0.505882,0.98842,0.736747,0.635894,0.631373,0.992357,0.809581,0.732349,0.756863,0.996186,0.880692,0.826759,0.882353,0.998155,0.92203,0.885813,1,1,0.960784,0.941176]},{\"ColorSpace\":\"Lab\",\"Name\":\"RdOr\",\"RGBPoints\":[-1,0.498039,0,0,-0.87451,0.6004,0,0,-0.74902,0.702514,0.000738,0.000477,-0.623529,0.773379,0.095225,0.061499,-0.498039,0.843875,0.189865,0.12283,-0.372549,0.891119,0.294195,0.203537,-0.247059,0.937855,0.397924,0.283137,-0.121569,0.963445,0.476663,0.316601,0.00392157,0.988297,0.555771,0.351665,0.129412,0.990265,0.646321,0.436309,0.254902,0.992157,0.735256,0.519646,0.380392,0.992157,0.784468,0.570827,0.505882,0.992249,0.833218,0.623483,0.631373,0.994218,0.872587,0.706159,0.756863,0.996186,0.911419,0.788189,0.882353,0.998155,0.940946,0.859054,1,1,0.968627,0.92549]},{\"ColorSpace\":\"Lab\",\"Name\":\"BrOrYl\",\"RGBPoints\":[-1,0.4,0.145098,0.023529,-0.87451,0.500392,0.174625,0.019592,-0.74902,0.600784,0.204291,0.015656,-0.623529,0.701176,0.251534,0.011719,-0.498039,0.800984,0.299146,0.008397,-0.372549,0.863975,0.370012,0.043829,-0.247059,0.926321,0.441107,0.0794,-0.121569,0.961753,0.521815,0.120738,0.00392157,0.996078,0.602645,0.163122,0.129412,0.996078,0.68729,0.237924,0.254902,0.996078,0.771011,0.314879,0.380392,0.996078,0.832034,0.444798,0.505882,0.996171,0.892042,0.572595,0.631373,0.998139,0.931411,0.65724,0.756863,1,0.969489,0.741669,0.882353,1,0.985236,0.822376,1,1,1,0.898039]},{\"ColorSpace\":\"Lab\",\"Name\":\"RdOrYl\",\"RGBPoints\":[-1,0.501961,0,0.14902,-0.87451,0.622038,0,0.14902,-0.74902,0.741761,0.0004,0.148866,-0.623529,0.816563,0.05158,0.129181,-0.498039,0.890965,0.10356,0.110235,-0.372549,0.940177,0.205921,0.137793,-0.247059,0.988281,0.308789,0.165536,-0.121569,0.99025,0.432803,0.200969,0.00392157,0.992218,0.555217,0.236278,0.129412,0.994187,0.628051,0.267774,0.254902,0.996078,0.701038,0.301269,0.380392,0.996078,0.777809,0.383945,0.505882,0.996171,0.852826,0.466621,0.631373,0.998139,0.892195,0.549296,0.756863,1,0.931349,0.632188,0.882353,1,0.966782,0.7188,1,1,1,0.8]},{\"ColorSpace\":\"Lab\",\"Name\":\"CIELab_blue2red\",\"RGBPoints\":[-1,0,0.6,0.74902,1,0.76863,0.46667,0.34118]},{\"ColorSpace\":\"Lab\",\"Name\":\"blue2yellow\",\"RGBPoints\":[-1,0,0,1,0,0.5,0.5,0.5,1,1,1,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue2gold\",\"RGBPoints\":[-1,0.175119,0.0438468,1,-0.874016,0.22383,0.159771,0.94557,-0.748031,0.27254,0.233611,0.891216,-0.622047,0.321251,0.296526,0.836857,-0.496063,0.369962,0.354296,0.782359,-0.370079,0.418672,0.409139,0.72754,-0.244094,0.467383,0.462152,0.672148,-0.11811,0.51609,0.51396,0.615825,0.00787402,0.572863,0.55452,0.559172,0.133858,0.630269,0.593822,0.517729,0.259843,0.689588,0.624668,0.47446,0.385827,0.745394,0.656113,0.428638,0.511811,0.798624,0.688104,0.379105,0.637795,0.849926,0.720593,0.323834,0.76378,0.899765,0.753543,0.258657,0.889764,0.948487,0.78692,0.171778,1,0.990413,0.816451,0.00729848]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_blue2yellow\",\"RGBPoints\":[-1,0.0830122,0,0.495617,-0.87451,0.141973,0.0551288,0.57363,-0.74902,0.193048,0.110258,0.604561,-0.623529,0.234231,0.165386,0.57643,-0.498039,0.275413,0.220515,0.548299,-0.372549,0.316596,0.275644,0.520169,-0.247059,0.357778,0.330773,0.492038,-0.121569,0.398961,0.385901,0.463908,0.00392157,0.449929,0.438487,0.426815,0.129412,0.511572,0.488299,0.379944,0.254902,0.581222,0.53603,0.325741,0.380392,0.650871,0.583761,0.271538,0.505882,0.720521,0.631493,0.217335,0.631373,0.79017,0.679224,0.163132,0.756863,0.85982,0.726955,0.108929,0.882353,0.910254,0.774159,0.14112,1,0.927513,0.81759,0.306289]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_cyan2orange\",\"RGBPoints\":[-1,0.0471513,0.213874,0.414329,-0.87451,0.0674702,0.256648,0.439027,-0.74902,0.0959957,0.299331,0.462089,-0.623529,0.132428,0.341872,0.483212,-0.498039,0.188743,0.38277,0.500597,-0.372549,0.268511,0.420229,0.512179,-0.247059,0.352945,0.455602,0.519101,-0.121569,0.43893,0.489368,0.521538,0.00392157,0.522445,0.522495,0.522436,0.129412,0.600089,0.555682,0.53205,0.254902,0.67988,0.587981,0.539163,0.380392,0.761011,0.619586,0.544439,0.505882,0.84278,0.650741,0.548567,0.631373,0.910713,0.687347,0.557822,0.756863,0.952232,0.734972,0.577775,0.882353,0.975642,0.789858,0.604868,1,0.990752,0.843643,0.632857]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_purple2green\",\"RGBPoints\":[-1,0.235006,0.0483128,0.530899,-0.87451,0.302968,0.108419,0.552391,-0.74902,0.360241,0.166059,0.569502,-0.623529,0.406746,0.226782,0.579373,-0.498039,0.444073,0.28964,0.582094,-0.372549,0.473648,0.353774,0.577947,-0.247059,0.497636,0.418154,0.567911,-0.121569,0.519086,0.481741,0.553968,0.00392157,0.542884,0.542914,0.542875,0.129412,0.566303,0.603989,0.527499,0.254902,0.595218,0.662965,0.516857,0.380392,0.628641,0.720701,0.510673,0.505882,0.665373,0.777849,0.508165,0.631373,0.704182,0.834921,0.508303,0.756863,0.743846,0.892328,0.50999,0.882353,0.783158,0.950422,0.512181,1,0.818617,1,0.513888]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_purple2green_dark\",\"RGBPoints\":[-1,0.107656,0,0.428682,-0.87451,0.1924,0,0.449799,-0.74902,0.255118,0.0648939,0.466726,-0.623529,0.304256,0.133066,0.476703,-0.498039,0.343202,0.19716,0.479793,-0.372549,0.373876,0.260353,0.476241,-0.247059,0.398497,0.322872,0.466953,-0.121569,0.420016,0.384252,0.453785,0.00392157,0.44319,0.443216,0.443186,0.129412,0.465553,0.502139,0.428233,0.254902,0.492959,0.559151,0.417591,0.380392,0.524654,0.615092,0.411016,0.505882,0.55959,0.670583,0.40779,0.631373,0.596614,0.726102,0.406948,0.756863,0.634544,0.782032,0.407439,0.882353,0.672183,0.838703,0.408237,1,0.706131,0.892759,0.408452]},{\"ColorSpace\":\"Lab\",\"Name\":\"coolwarm\",\"RGBPoints\":[-1,0.229806,0.298718,0.753683,-0.875,0.303869,0.406535,0.844959,-0.75,0.383013,0.509419,0.917388,-0.625,0.466667,0.604563,0.968155,-0.5,0.552953,0.688929,0.995376,-0.375,0.639176,0.7596,0.998151,-0.25,0.722193,0.813953,0.976575,-0.125,0.798692,0.849786,0.931689,0,0.865395,0.86541,0.865396,0.125,0.924128,0.827385,0.774508,0.25,0.958853,0.769768,0.678008,0.375,0.969954,0.694267,0.579375,0.5,0.958003,0.602842,0.481776,0.625,0.923945,0.497309,0.38797,0.75,0.869187,0.378313,0.300267,0.875,0.795632,0.241284,0.220526,1,0.705673,0.0155562,0.150233]},{\"ColorSpace\":\"Lab\",\"Name\":\"BuRd\",\"RGBPoints\":[-1,0.019608,0.188235,0.380392,-0.87451,0.088504,0.321107,0.564937,-0.74902,0.163399,0.444983,0.697501,-0.623529,0.247059,0.555709,0.754095,-0.498039,0.420684,0.676432,0.818685,-0.372549,0.606459,0.789773,0.880277,-0.247059,0.761476,0.868512,0.924567,-0.121569,0.878047,0.925721,0.951942,0.00392157,0.969089,0.966474,0.964937,0.129412,0.983852,0.897578,0.846828,0.254902,0.982468,0.800692,0.706113,0.380392,0.960323,0.66782,0.536332,0.505882,0.894579,0.503806,0.399769,0.631373,0.81707,0.33218,0.281046,0.756863,0.728489,0.155017,0.197386,0.882353,0.576932,0.055363,0.14925,1,0.403922,0,0.121569]},{\"ColorSpace\":\"Lab\",\"Name\":\"Spectral_lowBlue\",\"RGBPoints\":[-1,0.368627,0.309804,0.635294,-0.87451,0.260361,0.450058,0.70173,-0.74902,0.248058,0.591311,0.717186,-0.623529,0.376009,0.734025,0.658132,-0.498039,0.537947,0.814764,0.64506,-0.372549,0.702345,0.879585,0.636678,-0.247059,0.84752,0.938639,0.607151,-0.121569,0.940408,0.976163,0.656055,0.00392157,0.999923,0.997616,0.745021,0.129412,0.997463,0.921338,0.61707,0.254902,0.995002,0.824606,0.499885,0.380392,0.992541,0.701576,0.39654,0.505882,0.973472,0.547405,0.318108,0.631373,0.937793,0.398539,0.270127,0.756863,0.861515,0.282891,0.299654,0.882353,0.746482,0.144637,0.288812,1,0.619608,0.003922,0.258824]},{\"ColorSpace\":\"Lab\",\"Name\":\"GnRP\",\"RGBPoints\":[-1,0,0.266667,0.105882,-0.87451,0.066436,0.394617,0.174779,-0.74902,0.168858,0.524567,0.25767,-0.623529,0.323875,0.657439,0.361015,-0.498039,0.504883,0.772318,0.506344,-0.372549,0.678431,0.870127,0.654902,-0.247059,0.803922,0.921799,0.780392,-0.121569,0.897116,0.951942,0.882814,0.00392157,0.967397,0.965936,0.967474,0.129412,0.928028,0.879815,0.930565,0.254902,0.866052,0.780777,0.882891,0.380392,0.77501,0.665129,0.821376,0.505882,0.675663,0.537024,0.737024,0.631373,0.57847,0.396155,0.645982,0.756863,0.492349,0.223914,0.547559,0.882353,0.375548,0.096886,0.423299,1,0.25098,0,0.294118]},{\"ColorSpace\":\"Lab\",\"Name\":\"GYPi\",\"RGBPoints\":[-1,0.152941,0.392157,0.098039,-0.87451,0.246444,0.505344,0.117724,-0.74902,0.351942,0.614533,0.161399,-0.623529,0.474971,0.717878,0.240138,-0.498039,0.611995,0.811226,0.392849,-0.372549,0.746328,0.893118,0.565321,-0.247059,0.859516,0.94233,0.747405,-0.121569,0.928105,0.96386,0.875663,0.00392157,0.969089,0.966859,0.968012,0.129412,0.983852,0.910265,0.948328,0.254902,0.979239,0.833218,0.914648,0.380392,0.949712,0.729873,0.862976,0.505882,0.905652,0.58293,0.763552,0.631373,0.85521,0.410073,0.652211,0.756863,0.793695,0.183699,0.531642,0.882353,0.683737,0.063899,0.420761,1,0.556863,0.003922,0.321569]},{\"ColorSpace\":\"Lab\",\"Name\":\"GnYlRd\",\"RGBPoints\":[-1,0,0.407843,0.215686,-0.87451,0.063975,0.525952,0.277201,-0.74902,0.177932,0.633064,0.332718,-0.623529,0.364937,0.724106,0.379469,-0.498039,0.527951,0.797155,0.40223,-0.372549,0.678431,0.862822,0.433449,-0.247059,0.803922,0.916955,0.514648,-0.121569,0.909419,0.961861,0.625067,0.00392157,0.999923,0.997616,0.745021,0.129412,0.997463,0.921338,0.61707,0.254902,0.995002,0.824606,0.499885,0.380392,0.992541,0.701576,0.39654,0.505882,0.973472,0.547405,0.318108,0.631373,0.939023,0.389927,0.245521,0.756863,0.867666,0.239831,0.176624,0.882353,0.762399,0.110727,0.151326,1,0.647059,0,0.14902]},{\"ColorSpace\":\"Lab\",\"Name\":\"GBBr\",\"RGBPoints\":[-1,0,0.235294,0.188235,-0.87451,0.002461,0.338639,0.301423,-0.74902,0.055902,0.448981,0.417609,-0.623529,0.183852,0.56955,0.538178,-0.498039,0.357785,0.700115,0.660746,-0.372549,0.540177,0.819531,0.77624,-0.247059,0.714879,0.890888,0.864821,-0.121569,0.851134,0.934564,0.922645,0.00392157,0.960861,0.959785,0.95694,0.129412,0.963322,0.927797,0.83391,0.254902,0.939946,0.868897,0.68935,0.380392,0.883353,0.775394,0.517109,0.505882,0.808074,0.625836,0.324106,0.631373,0.717647,0.476355,0.15494,0.756863,0.592157,0.358247,0.06882,0.882353,0.458593,0.26436,0.031142,1,0.329412,0.188235,0.019608]},{\"ColorSpace\":\"Lab\",\"Name\":\"PuOr\",\"RGBPoints\":[-1,0.498039,0.231373,0.031373,-0.87451,0.62599,0.30273,0.026451,-0.74902,0.746943,0.387082,0.037524,-0.623529,0.85767,0.490427,0.071972,-0.498039,0.936409,0.617762,0.236371,-0.372549,0.992695,0.743099,0.43291,-0.247059,0.995156,0.841523,0.63714,-0.121569,0.985313,0.913802,0.813687,0.00392157,0.966244,0.966398,0.967705,0.129412,0.889965,0.89504,0.938178,0.254902,0.806151,0.804306,0.894656,0.380392,0.712649,0.688658,0.833141,0.505882,0.594233,0.554325,0.744637,0.631373,0.474894,0.404229,0.652364,0.756863,0.366628,0.217224,0.563783,0.882353,0.266436,0.089965,0.434833,1,0.176471,0,0.294118]},{\"ColorSpace\":\"Lab\",\"Name\":\"PRGn\",\"RGBPoints\":[-1,0.25098,0,0.294118,-0.87451,0.383852,0.103345,0.431911,-0.74902,0.497732,0.234679,0.55371,-0.623529,0.583852,0.40692,0.652134,-0.498039,0.681968,0.545175,0.742561,-0.372549,0.7807,0.672357,0.825221,-0.247059,0.871742,0.788005,0.886736,-0.121569,0.930488,0.885198,0.932872,0.00392157,0.966321,0.968089,0.965859,0.129412,0.892503,0.950865,0.877278,0.254902,0.796078,0.91857,0.772549,0.380392,0.670588,0.866897,0.647059,0.505882,0.493195,0.765398,0.496655,0.631373,0.314187,0.649135,0.354556,0.756863,0.15917,0.516263,0.251211,0.882353,0.062284,0.386621,0.170473,1,0,0.266667,0.105882]},{\"ColorSpace\":\"Lab\",\"Name\":\"PiYG\",\"RGBPoints\":[-1,0.556863,0.003922,0.321569,-0.87451,0.692195,0.067897,0.427374,-0.74902,0.797539,0.197847,0.539177,-0.623529,0.859054,0.424221,0.659746,-0.498039,0.908574,0.592618,0.770319,-0.372549,0.951557,0.736332,0.866205,-0.247059,0.981084,0.839677,0.917878,-0.121569,0.98293,0.913802,0.949558,0.00392157,0.96732,0.968474,0.965629,0.129412,0.92549,0.963552,0.869666,0.254902,0.852441,0.939254,0.736025,0.380392,0.739254,0.890042,0.553941,0.505882,0.60323,0.805536,0.382238,0.631373,0.467282,0.711419,0.235217,0.756863,0.344252,0.608074,0.156478,0.882353,0.2406,0.49827,0.116494,1,0.152941,0.392157,0.098039]},{\"ColorSpace\":\"Lab\",\"Name\":\"OrPu\",\"RGBPoints\":[-1,0.176471,0,0.294118,-0.87451,0.272434,0.095963,0.444214,-0.74902,0.373395,0.228912,0.56932,-0.623529,0.481661,0.415917,0.657901,-0.498039,0.601922,0.562937,0.750481,-0.372549,0.718493,0.695886,0.836986,-0.247059,0.811995,0.811534,0.898501,-0.121569,0.894733,0.8995,0.940023,0.00392157,0.969166,0.966859,0.963629,0.129412,0.98639,0.910265,0.803691,0.254902,0.995002,0.835371,0.624375,0.380392,0.992541,0.736947,0.420146,0.505882,0.931949,0.609458,0.224221,0.631373,0.85075,0.483968,0.069819,0.756863,0.740023,0.380623,0.035371,0.882353,0.617993,0.29827,0.026759,1,0.498039,0.231373,0.031373]},{\"ColorSpace\":\"Lab\",\"Name\":\"BrBG\",\"RGBPoints\":[-1,0.329412,0.188235,0.019608,-0.87451,0.467205,0.269435,0.031911,-0.74902,0.6,0.365629,0.074202,-0.623529,0.72549,0.483737,0.160323,-0.498039,0.812995,0.635832,0.336409,-0.372549,0.88689,0.781238,0.527874,-0.247059,0.943483,0.87474,0.700115,-0.121569,0.963168,0.929796,0.841599,0.00392157,0.957247,0.959938,0.959554,0.129412,0.84406,0.932872,0.920185,0.254902,0.70396,0.886428,0.859285,0.380392,0.529258,0.815071,0.770704,0.505882,0.346251,0.691811,0.653057,0.631373,0.175855,0.562015,0.530642,0.756863,0.047905,0.441446,0.410073,0.882353,0.002307,0.33218,0.294348,1,0,0.235294,0.188235]},{\"ColorSpace\":\"Lab\",\"Name\":\"GyRd\",\"RGBPoints\":[-1,0.101961,0.101961,0.101961,-0.87451,0.227451,0.227451,0.227451,-0.74902,0.359939,0.359939,0.359939,-0.623529,0.502653,0.502653,0.502653,-0.498039,0.631373,0.631373,0.631373,-0.372549,0.749865,0.749865,0.749865,-0.247059,0.843368,0.843368,0.843368,-0.121569,0.926105,0.926105,0.926105,0.00392157,0.999846,0.997232,0.995694,0.129412,0.994925,0.908651,0.857901,0.254902,0.982468,0.800692,0.706113,0.380392,0.960323,0.66782,0.536332,0.505882,0.894579,0.503806,0.399769,0.631373,0.81707,0.33218,0.281046,0.756863,0.728489,0.155017,0.197386,0.882353,0.576932,0.055363,0.14925,1,0.403922,0,0.121569]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_divHi_purpleGreen\",\"RGBPoints\":[-1,0.297553,0,0.489074,-0.87451,0.40259,0.151146,0.567754,-0.74902,0.516038,0.284843,0.658231,-0.623529,0.629783,0.423646,0.750938,-0.498039,0.735198,0.563697,0.835956,-0.372549,0.82408,0.695541,0.903582,-0.247059,0.889091,0.807454,0.944862,-0.121569,0.92334,0.886917,0.951839,0.00392157,0.921045,0.921084,0.921003,0.129412,0.877324,0.907455,0.845381,0.254902,0.797649,0.849713,0.734695,0.380392,0.691646,0.75964,0.600532,0.505882,0.568981,0.649159,0.453807,0.631373,0.438945,0.529756,0.304259,0.756863,0.30973,0.412001,0.158303,0.882353,0.187078,0.305111,0.00251458,1,0.101655,0.220836,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_divHi_purpleGreen_dim\",\"RGBPoints\":[-1,0.404088,0.131038,0.592767,-0.87451,0.486469,0.230957,0.651243,-0.74902,0.575165,0.339335,0.717723,-0.623529,0.662741,0.454332,0.784263,-0.498039,0.742071,0.570213,0.842918,-0.372549,0.806935,0.678992,0.886227,-0.247059,0.852219,0.771315,0.90763,-0.121569,0.873345,0.837327,0.901572,0.00392157,0.866783,0.86682,0.866745,0.129412,0.82839,0.858225,0.796812,0.254902,0.762578,0.814287,0.700202,0.380392,0.676429,0.744229,0.585735,0.505882,0.577033,0.65732,0.461526,0.631373,0.47128,0.562476,0.33476,0.756863,0.365461,0.467957,0.21076,0.882353,0.264758,0.381138,0.0878313,1,0.182591,0.312249,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_divLow_icePeach\",\"RGBPoints\":[-1,0.480048,0.817441,0.998056,-0.87451,0.425898,0.726921,0.883187,-0.74902,0.366682,0.629445,0.761936,-0.623529,0.308756,0.531002,0.640217,-0.498039,0.258021,0.43705,0.523433,-0.372549,0.219244,0.352381,0.416348,-0.247059,0.195127,0.281032,0.322979,-0.121569,0.186286,0.22627,0.246525,0.00392157,0.192352,0.19236,0.192364,0.129412,0.255927,0.214469,0.191756,0.254902,0.340459,0.254426,0.206666,0.380392,0.444655,0.309315,0.234029,0.505882,0.565353,0.376004,0.270969,0.631373,0.697917,0.450748,0.314293,0.756863,0.836657,0.529064,0.360227,0.882353,0.972695,0.614884,0.413123,1,1,0.705904,0.472699]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_divLow_purpleGreen\",\"RGBPoints\":[-1,0.956034,0.666487,0.952663,-0.87451,0.874457,0.572698,0.936352,-0.74902,0.753465,0.488253,0.909063,-0.623529,0.63309,0.413507,0.763833,-0.498039,0.514491,0.345878,0.620015,-0.372549,0.405008,0.288141,0.484376,-0.247059,0.311388,0.241986,0.363556,-0.121569,0.238722,0.209044,0.263449,0.00392157,0.192352,0.192366,0.192362,0.129412,0.200379,0.233201,0.168618,0.254902,0.230151,0.291737,0.165227,0.380392,0.279481,0.366076,0.178607,0.505882,0.344927,0.453267,0.205703,0.631373,0.421554,0.549449,0.242643,0.756863,0.503334,0.649999,0.284377,0.882353,0.583497,0.749672,0.324969,1,0.650705,0.837228,0.356264]},{\"ColorSpace\":\"Lab\",\"Name\":\"Haze_green\",\"RGBPoints\":[-1,1,0.835294,0.886275,-0.87451,0.937255,0.756863,0.870443,-0.74902,0.875817,0.666376,0.857807,-0.623529,0.778359,0.583007,0.808134,-0.498039,0.676253,0.494118,0.745098,-0.372549,0.561365,0.390123,0.682353,-0.247059,0.438344,0.262745,0.621496,-0.121569,0.321133,0.141031,0.558751,0.00392157,0.203922,0.0217865,0.495861,0.129412,0.265505,0.129412,0.433261,0.254902,0.311692,0.255338,0.37008,0.380392,0.356282,0.377342,0.310821,0.505882,0.39971,0.488889,0.258243,0.631373,0.442556,0.604357,0.205519,0.756863,0.48671,0.71968,0.152941,0.882353,0.529847,0.830356,0.100944,1,0.572549,0.933333,0.054902]},{\"ColorSpace\":\"Lab\",\"Name\":\"Haze_lime\",\"RGBPoints\":[-1,0.704034,0.784196,1,-0.87451,0.633111,0.691418,0.956078,-0.74902,0.564021,0.600606,0.912157,-0.623529,0.496827,0.51189,0.868235,-0.498039,0.43157,0.425416,0.824314,-0.372549,0.368248,0.341347,0.780392,-0.247059,0.306767,0.259855,0.736471,-0.121569,0.246862,0.181069,0.692549,0.00392157,0.191619,0.109542,0.648627,0.129412,0.257404,0.194031,0.604706,0.254902,0.321794,0.278775,0.560784,0.380392,0.387909,0.364617,0.516863,0.505882,0.456569,0.451881,0.472941,0.631373,0.527424,0.540773,0.42902,0.756863,0.599759,0.631427,0.385098,0.882353,0.673065,0.723898,0.341176,1,0.742751,0.812252,0.3]},{\"ColorSpace\":\"RGB\",\"Name\":\"Haze\",\"RGBPoints\":[-1,1,0.835294,0.996078,-0.00392157,0.023529,0.141176,0.498039,0.00392157,0.015686,0.137255,0.494118,1,0.984314,0.764706,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"Haze_cyan\",\"RGBPoints\":[-1,0.956863,1,0.835294,-0.87451,0.933188,0.921714,0.760784,-0.74902,0.870588,0.803486,0.671605,-0.623529,0.807843,0.684096,0.583297,-0.498039,0.745098,0.569208,0.494118,-0.372549,0.682353,0.437763,0.390123,-0.247059,0.621496,0.288163,0.262745,-0.121569,0.558751,0.144517,0.141031,0.00392157,0.495861,0.0217865,0.0413943,0.129412,0.433261,0.137255,0.129412,0.254902,0.37008,0.263181,0.255338,0.380392,0.306318,0.381845,0.372694,0.505882,0.243137,0.503994,0.494263,0.631373,0.180392,0.629484,0.619753,0.756863,0.117647,0.754975,0.747131,0.882353,0.054902,0.876398,0.866812,1,0,0.988235,0.976471]},{\"ColorSpace\":\"Lab\",\"Name\":\"nic_Edge\",\"RGBPoints\":[-1,0.191208,0.191208,0.191208,-0.87451,0.239484,0.00545035,0.614821,-0.74902,0.220593,0.0617459,0.863547,-0.623529,0.17509,0.278988,0.97794,-0.498039,0.143526,0.576069,0.998553,-0.372549,0.166456,0.871883,0.96594,-0.247059,0.376202,0.993555,0.981833,-0.121569,0.681996,0.991297,0.999239,0.00392157,0.954172,0.952734,0.94374,0.129412,0.999735,0.99301,0.662896,0.254902,0.979399,0.991466,0.357973,0.380392,0.968771,0.854967,0.162659,0.505882,0.999245,0.556697,0.144323,0.631373,0.973959,0.26223,0.177946,0.756863,0.852358,0.0526707,0.222974,0.882353,0.593889,0.00912724,0.238855,1,0.191208,0.191208,0.191208]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_iceFire_H\",\"RGBPoints\":[-1,4.05432e-7,0,0.00000590122,-0.87451,0,0.120401,0.302675,-0.74902,0,0.216583,0.524574,-0.623529,0.0552475,0.345025,0.6595,-0.498039,0.128047,0.492588,0.720288,-0.372549,0.188955,0.641309,0.792092,-0.247059,0.327673,0.784935,0.873434,-0.121569,0.60824,0.892164,0.935547,0.00392157,0.881371,0.912178,0.818099,0.129412,0.951407,0.835621,0.449279,0.254902,0.904481,0.690489,0,0.380392,0.85407,0.510864,0,0.505882,0.777093,0.33018,0.00088199,0.631373,0.672862,0.139087,0.00269398,0.756863,0.508815,0,0,0.882353,0.299417,0.000366289,0.000547829,1,0.0157519,0.00332021,4.55569e-8]},{\"ColorSpace\":\"Lab\",\"Name\":\"erdc_iceFire_L\",\"RGBPoints\":[-1,0.870485,0.913768,0.832905,-0.87451,0.586919,0.887865,0.934003,-0.74902,0.31583,0.776442,0.867858,-0.623529,0.18302,0.632034,0.787722,-0.498039,0.117909,0.484134,0.713825,-0.372549,0.0507239,0.335979,0.654741,-0.247059,0,0.209874,0.511832,-0.121569,0,0.114689,0.28935,0.00392157,0.0157519,0.00332021,4.55569e-8,0.129412,0.312914,0,0,0.254902,0.520865,0,0,0.380392,0.680105,0.15255,0.0025996,0.505882,0.785109,0.339479,0.000797922,0.631373,0.857354,0.522494,0,0.756863,0.910974,0.699774,0,0.882353,0.951921,0.842817,0.478545,1,0.881371,0.912178,0.818099]},{\"ColorSpace\":\"RGB\",\"Name\":\"hsv\",\"RGBPoints\":[-1,1,0,0,-0.666666,1,0,1,-0.333333,0,0,1,0,0,1,1,0.33333,0,1,0,0.66666,1,1,0,1,1,0,0]},{\"ColorSpace\":\"Lab\",\"Name\":\"hue_L60\",\"RGBPoints\":[-1,0.964784,0.400592,0.349549,-0.87451,0.964915,0.372498,0.53785,-0.74902,0.892353,0.401039,0.759569,-0.623529,0.79263,0.446956,0.903017,-0.498039,0.682208,0.49954,0.966673,-0.372549,0.56392,0.553082,0.968836,-0.247059,0.442031,0.606396,0.901601,-0.121569,0.305499,0.65701,0.765784,0.00392157,0.197251,0.687914,0.620914,0.129412,0.193882,0.701887,0.472654,0.254902,0.249866,0.706123,0.320005,0.380392,0.35132,0.697417,0.202919,0.505882,0.498097,0.669467,0.125232,0.631373,0.637477,0.626239,0.107431,0.756863,0.762115,0.56872,0.155812,0.882353,0.889434,0.481116,0.240445,1,0.964784,0.400592,0.349549]},{\"IndexedColors\":[0,0,0,0.8941176470588236,0.1019607843137255,0.1098039215686274,0.2156862745098039,0.4941176470588236,0.7215686274509804,0.3019607843137255,0.6862745098039216,0.2901960784313726,0.596078431372549,0.3058823529411765,0.6392156862745098,1,0.4980392156862745,0,0.6509803921568628,0.3372549019607843,0.1568627450980392],\"Name\":\"Spectrum\",\"NanColor\":[0.6509803921568628,0.3372549019607843,0.1568627450980392]},{\"IndexedColors\":[0.4745098039215686,0.09019607843137255,0.09019607843137255,0.7098039215686275,0.00392156862745098,0.00392156862745098,0.9372549019607843,0.2784313725490196,0.09803921568627451,0.9764705882352941,0.5137254901960784,0.1411764705882353,1,0.7058823529411765,0,1,0.8980392156862745,0.02352941176470588],\"Name\":\"Warm\",\"NanColor\":[1,0.8980392156862745,0.02352941176470588]},{\"IndexedColors\":[0.4588235294117647,0.6941176470588235,0.00392156862745098,0.3450980392156863,0.5019607843137255,0.1607843137254902,0.3137254901960784,0.8431372549019608,0.7490196078431373,0.1098039215686274,0.5843137254901961,0.803921568627451,0.2313725490196079,0.407843137254902,0.6705882352941176,0.6039215686274509,0.407843137254902,1,0.3725490196078431,0.2,0.5019607843137255],\"Name\":\"Cool\",\"NanColor\":[0.3725490196078431,0.2,0.5019607843137255]},{\"IndexedColors\":[0.2313725490196079,0.407843137254902,0.6705882352941176,0.1098039215686274,0.5843137254901961,0.803921568627451,0.3058823529411765,0.8509803921568627,0.9176470588235294,0.4509803921568628,0.6039215686274509,0.8352941176470589,0.2588235294117647,0.2392156862745098,0.6627450980392157,0.3137254901960784,0.3294117647058823,0.5294117647058824,0.06274509803921569,0.1647058823529412,0.3215686274509804],\"Name\":\"Blues\",\"NanColor\":[0.06274509803921569,0.1647058823529412,0.3215686274509804]},{\"IndexedColors\":[0.1098039215686274,0.5843137254901961,0.803921568627451,0.2313725490196079,0.407843137254902,0.6705882352941176,0.4,0.2431372549019608,0.7176470588235294,0.6352941176470588,0.3294117647058823,0.8117647058823529,0.8705882352941177,0.3803921568627451,0.807843137254902,0.8627450980392157,0.3803921568627451,0.5843137254901961,0.2392156862745098,0.06274509803921569,0.3215686274509804],\"Name\":\"Wild Flower\",\"NanColor\":[0.2392156862745098,0.06274509803921569,0.3215686274509804]},{\"IndexedColors\":[0.396078431372549,0.4862745098039216,0.2156862745098039,0.4588235294117647,0.6941176470588235,0.00392156862745098,0.6980392156862745,0.7294117647058823,0.1882352941176471,1,0.8980392156862745,0.02352941176470588,1,0.7058823529411765,0,0.9764705882352941,0.5137254901960784,0.1411764705882353],\"Name\":\"Citrus\",\"NanColor\":[0.9764705882352941,0.5137254901960784,0.1411764705882353]},{\"IndexedColors\":[0.4980392156862745,0.2313725490196079,0.03137254901960784,0.7019607843137254,0.3450980392156863,0.02352941176470588,0.8784313725490196,0.5098039215686274,0.0784313725490196,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.996078431372549,0.8784313725490196,0.7137254901960784,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.5019607843137255,0.4509803921568628,0.6745098039215687,0.3294117647058823,0.1529411764705882,0.5333333333333333,0.1764705882352941,0,0.2941176470588235],\"Name\":\"Brewer Diverging Purple-Orange (11)\",\"NanColor\":[0.1764705882352941,0,0.2941176470588235]},{\"IndexedColors\":[0.4980392156862745,0.2313725490196079,0.03137254901960784,0.7019607843137254,0.3450980392156863,0.02352941176470588,0.8784313725490196,0.5098039215686274,0.0784313725490196,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.996078431372549,0.8784313725490196,0.7137254901960784,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.5019607843137255,0.4509803921568628,0.6745098039215687,0.3294117647058823,0.1529411764705882,0.5333333333333333,0.1764705882352941,0,0.2941176470588235],\"Name\":\"Brewer Diverging Purple-Orange (10)\",\"NanColor\":[0.1764705882352941,0,0.2941176470588235]},{\"IndexedColors\":[0.7019607843137254,0.3450980392156863,0.02352941176470588,0.8784313725490196,0.5098039215686274,0.0784313725490196,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.996078431372549,0.8784313725490196,0.7137254901960784,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.5019607843137255,0.4509803921568628,0.6745098039215687,0.3294117647058823,0.1529411764705882,0.5333333333333333],\"Name\":\"Brewer Diverging Purple-Orange (9)\",\"NanColor\":[0.3294117647058823,0.1529411764705882,0.5333333333333333]},{\"IndexedColors\":[0.7019607843137254,0.3450980392156863,0.02352941176470588,0.8784313725490196,0.5098039215686274,0.0784313725490196,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.996078431372549,0.8784313725490196,0.7137254901960784,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.5019607843137255,0.4509803921568628,0.6745098039215687,0.3294117647058823,0.1529411764705882,0.5333333333333333],\"Name\":\"Brewer Diverging Purple-Orange (8)\",\"NanColor\":[0.3294117647058823,0.1529411764705882,0.5333333333333333]},{\"IndexedColors\":[0.7019607843137254,0.3450980392156863,0.02352941176470588,0.9450980392156862,0.6392156862745098,0.2509803921568627,0.996078431372549,0.8784313725490196,0.7137254901960784,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6,0.5568627450980392,0.7647058823529411,0.3294117647058823,0.1529411764705882,0.5333333333333333],\"Name\":\"Brewer Diverging Purple-Orange (7)\",\"NanColor\":[0.3294117647058823,0.1529411764705882,0.5333333333333333]},{\"IndexedColors\":[0.7019607843137254,0.3450980392156863,0.02352941176470588,0.9450980392156862,0.6392156862745098,0.2509803921568627,0.996078431372549,0.8784313725490196,0.7137254901960784,0.8470588235294118,0.8549019607843137,0.9215686274509803,0.6,0.5568627450980392,0.7647058823529411,0.3294117647058823,0.1529411764705882,0.5333333333333333],\"Name\":\"Brewer Diverging Purple-Orange (6)\",\"NanColor\":[0.3294117647058823,0.1529411764705882,0.5333333333333333]},{\"IndexedColors\":[0.9019607843137255,0.3803921568627451,0.00392156862745098,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.3686274509803922,0.2352941176470588,0.6],\"Name\":\"Brewer Diverging Purple-Orange (5)\",\"NanColor\":[0.3686274509803922,0.2352941176470588,0.6]},{\"IndexedColors\":[0.9019607843137255,0.3803921568627451,0.00392156862745098,0.9921568627450981,0.7215686274509804,0.3882352941176471,0.6980392156862745,0.6705882352941176,0.8235294117647058,0.3686274509803922,0.2352941176470588,0.6],\"Name\":\"Brewer Diverging Purple-Orange (4)\",\"NanColor\":[0.3686274509803922,0.2352941176470588,0.6]},{\"IndexedColors\":[0.9450980392156862,0.6392156862745098,0.2509803921568627,0.9686274509803922,0.9686274509803922,0.9686274509803922,0.6,0.5568627450980392,0.7647058823529411],\"Name\":\"Brewer Diverging Purple-Orange (3)\",\"NanColor\":[0.6,0.5568627450980392,0.7647058823529411]},{\"IndexedColors\":[0.6196078431372549,0.00392156862745098,0.2588235294117647,0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9568627450980393,0.4274509803921568,0.2627450980392157,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.996078431372549,0.8784313725490196,0.5450980392156862,1,1,0.7490196078431373,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.4,0.7607843137254902,0.6470588235294118,0.196078431372549,0.5333333333333333,0.7411764705882353,0.3686274509803922,0.3098039215686275,0.6352941176470588],\"Name\":\"Brewer Diverging Spectral (11)\",\"NanColor\":[0.3686274509803922,0.3098039215686275,0.6352941176470588]},{\"IndexedColors\":[0.6196078431372549,0.00392156862745098,0.2588235294117647,0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9568627450980393,0.4274509803921568,0.2627450980392157,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.996078431372549,0.8784313725490196,0.5450980392156862,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.4,0.7607843137254902,0.6470588235294118,0.196078431372549,0.5333333333333333,0.7411764705882353,0.3686274509803922,0.3098039215686275,0.6352941176470588],\"Name\":\"Brewer Diverging Spectral (10)\",\"NanColor\":[0.3686274509803922,0.3098039215686275,0.6352941176470588]},{\"IndexedColors\":[0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9568627450980393,0.4274509803921568,0.2627450980392157,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.996078431372549,0.8784313725490196,0.5450980392156862,1,1,0.7490196078431373,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.4,0.7607843137254902,0.6470588235294118,0.196078431372549,0.5333333333333333,0.7411764705882353],\"Name\":\"Brewer Diverging Spectral (9)\",\"NanColor\":[0.196078431372549,0.5333333333333333,0.7411764705882353]},{\"IndexedColors\":[0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9568627450980393,0.4274509803921568,0.2627450980392157,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.996078431372549,0.8784313725490196,0.5450980392156862,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.4,0.7607843137254902,0.6470588235294118,0.196078431372549,0.5333333333333333,0.7411764705882353],\"Name\":\"Brewer Diverging Spectral (8)\",\"NanColor\":[0.196078431372549,0.5333333333333333,0.7411764705882353]},{\"IndexedColors\":[0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9882352941176471,0.5529411764705883,0.3490196078431372,0.996078431372549,0.8784313725490196,0.5450980392156862,1,1,0.7490196078431373,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6,0.8352941176470589,0.5803921568627451,0.196078431372549,0.5333333333333333,0.7411764705882353],\"Name\":\"Brewer Diverging Spectral (7)\",\"NanColor\":[0.196078431372549,0.5333333333333333,0.7411764705882353]},{\"IndexedColors\":[0.8352941176470589,0.2431372549019608,0.3098039215686275,0.9882352941176471,0.5529411764705883,0.3490196078431372,0.996078431372549,0.8784313725490196,0.5450980392156862,0.9019607843137255,0.9607843137254902,0.596078431372549,0.6,0.8352941176470589,0.5803921568627451,0.196078431372549,0.5333333333333333,0.7411764705882353],\"Name\":\"Brewer Diverging Spectral (6)\",\"NanColor\":[0.196078431372549,0.5333333333333333,0.7411764705882353]},{\"IndexedColors\":[0.8431372549019608,0.09803921568627451,0.1098039215686274,0.9921568627450981,0.6823529411764706,0.3803921568627451,1,1,0.7490196078431373,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.1686274509803922,0.5137254901960784,0.7294117647058823],\"Name\":\"Brewer Diverging Spectral (5)\",\"NanColor\":[0.1686274509803922,0.5137254901960784,0.7294117647058823]},{\"IndexedColors\":[0.8431372549019608,0.09803921568627451,0.1098039215686274,0.9921568627450981,0.6823529411764706,0.3803921568627451,0.6705882352941176,0.8666666666666667,0.6431372549019608,0.1686274509803922,0.5137254901960784,0.7294117647058823],\"Name\":\"Brewer Diverging Spectral (4)\",\"NanColor\":[0.1686274509803922,0.5137254901960784,0.7294117647058823]},{\"IndexedColors\":[0.9882352941176471,0.5529411764705883,0.3490196078431372,1,1,0.7490196078431373,0.6,0.8352941176470589,0.5803921568627451],\"Name\":\"Brewer Diverging Spectral (3)\",\"NanColor\":[0.6,0.8352941176470589,0.5803921568627451]},{\"IndexedColors\":[0.3294117647058823,0.1882352941176471,0.0196078431372549,0.5490196078431373,0.3176470588235294,0.0392156862745098,0.7490196078431373,0.5058823529411764,0.1764705882352941,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.5019607843137255,0.803921568627451,0.7568627450980392,0.207843137254902,0.592156862745098,0.5607843137254902,0.00392156862745098,0.4,0.3686274509803922,0,0.2352941176470588,0.1882352941176471],\"Name\":\"Brewer Diverging Brown-Blue-Green (11)\",\"NanColor\":[0,0.2352941176470588,0.1882352941176471]},{\"IndexedColors\":[0.3294117647058823,0.1882352941176471,0.0196078431372549,0.5490196078431373,0.3176470588235294,0.0392156862745098,0.7490196078431373,0.5058823529411764,0.1764705882352941,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.5019607843137255,0.803921568627451,0.7568627450980392,0.207843137254902,0.592156862745098,0.5607843137254902,0.00392156862745098,0.4,0.3686274509803922,0,0.2352941176470588,0.1882352941176471],\"Name\":\"Brewer Diverging Brown-Blue-Green (10)\",\"NanColor\":[0,0.2352941176470588,0.1882352941176471]},{\"IndexedColors\":[0.5490196078431373,0.3176470588235294,0.0392156862745098,0.7490196078431373,0.5058823529411764,0.1764705882352941,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.5019607843137255,0.803921568627451,0.7568627450980392,0.207843137254902,0.592156862745098,0.5607843137254902,0.00392156862745098,0.4,0.3686274509803922],\"Name\":\"Brewer Diverging Brown-Blue-Green (9)\",\"NanColor\":[0.00392156862745098,0.4,0.3686274509803922]},{\"IndexedColors\":[0.5490196078431373,0.3176470588235294,0.0392156862745098,0.7490196078431373,0.5058823529411764,0.1764705882352941,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.5019607843137255,0.803921568627451,0.7568627450980392,0.207843137254902,0.592156862745098,0.5607843137254902,0.00392156862745098,0.4,0.3686274509803922],\"Name\":\"Brewer Diverging Brown-Blue-Green (8)\",\"NanColor\":[0.00392156862745098,0.4,0.3686274509803922]},{\"IndexedColors\":[0.5490196078431373,0.3176470588235294,0.0392156862745098,0.8470588235294118,0.7019607843137254,0.396078431372549,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.3529411764705883,0.7058823529411765,0.6745098039215687,0.00392156862745098,0.4,0.3686274509803922],\"Name\":\"Brewer Diverging Brown-Blue-Green (7)\",\"NanColor\":[0.00392156862745098,0.4,0.3686274509803922]},{\"IndexedColors\":[0.5490196078431373,0.3176470588235294,0.0392156862745098,0.8470588235294118,0.7019607843137254,0.396078431372549,0.9647058823529412,0.9098039215686274,0.7647058823529411,0.7803921568627451,0.9176470588235294,0.8980392156862745,0.3529411764705883,0.7058823529411765,0.6745098039215687,0.00392156862745098,0.4,0.3686274509803922],\"Name\":\"Brewer Diverging Brown-Blue-Green (6)\",\"NanColor\":[0.00392156862745098,0.4,0.3686274509803922]},{\"IndexedColors\":[0.6509803921568628,0.3803921568627451,0.1019607843137255,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.5019607843137255,0.803921568627451,0.7568627450980392,0.00392156862745098,0.5215686274509804,0.4431372549019608],\"Name\":\"Brewer Diverging Brown-Blue-Green (5)\",\"NanColor\":[0.00392156862745098,0.5215686274509804,0.4431372549019608]},{\"IndexedColors\":[0.6509803921568628,0.3803921568627451,0.1019607843137255,0.8745098039215686,0.7607843137254902,0.4901960784313725,0.5019607843137255,0.803921568627451,0.7568627450980392,0.00392156862745098,0.5215686274509804,0.4431372549019608],\"Name\":\"Brewer Diverging Brown-Blue-Green (4)\",\"NanColor\":[0.00392156862745098,0.5215686274509804,0.4431372549019608]},{\"IndexedColors\":[0.8470588235294118,0.7019607843137254,0.396078431372549,0.9607843137254902,0.9607843137254902,0.9607843137254902,0.3529411764705883,0.7058823529411765,0.6745098039215687],\"Name\":\"Brewer Diverging Brown-Blue-Green (3)\",\"NanColor\":[0.3529411764705883,0.7058823529411765,0.6745098039215687]},{\"IndexedColors\":[0.9686274509803922,0.9882352941176471,0.9921568627450981,0.8980392156862745,0.9607843137254902,0.9764705882352941,0.8,0.9254901960784314,0.9019607843137255,0.6,0.8470588235294118,0.788235294117647,0.4,0.7607843137254902,0.6431372549019608,0.2549019607843137,0.6823529411764706,0.4627450980392157,0.1372549019607843,0.5450980392156862,0.2705882352941176,0,0.4274509803921568,0.1725490196078431,0,0.2666666666666667,0.1058823529411765],\"Name\":\"Brewer Sequential Blue-Green (9)\",\"NanColor\":[0,0.2666666666666667,0.1058823529411765]},{\"IndexedColors\":[0.9686274509803922,0.9882352941176471,0.9921568627450981,0.8980392156862745,0.9607843137254902,0.9764705882352941,0.8,0.9254901960784314,0.9019607843137255,0.6,0.8470588235294118,0.788235294117647,0.4,0.7607843137254902,0.6431372549019608,0.2549019607843137,0.6823529411764706,0.4627450980392157,0.1372549019607843,0.5450980392156862,0.2705882352941176,0,0.3450980392156863,0.1411764705882353],\"Name\":\"Brewer Sequential Blue-Green (8)\",\"NanColor\":[0,0.3450980392156863,0.1411764705882353]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.8,0.9254901960784314,0.9019607843137255,0.8,0.9254901960784314,0.9019607843137255,0.4,0.7607843137254902,0.6431372549019608,0.2549019607843137,0.6823529411764706,0.4627450980392157,0.1372549019607843,0.5450980392156862,0.2705882352941176,0,0.3450980392156863,0.1411764705882353],\"Name\":\"Brewer Sequential Blue-Green (7)\",\"NanColor\":[0,0.3450980392156863,0.1411764705882353]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.8,0.9254901960784314,0.9019607843137255,0.6,0.8470588235294118,0.788235294117647,0.4,0.7607843137254902,0.6431372549019608,0.1725490196078431,0.6352941176470588,0.3725490196078431,0,0.4274509803921568,0.1725490196078431],\"Name\":\"Brewer Sequential Blue-Green (6)\",\"NanColor\":[0,0.4274509803921568,0.1725490196078431]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.6980392156862745,0.8862745098039215,0.8862745098039215,0.4,0.7607843137254902,0.6431372549019608,0.1725490196078431,0.6352941176470588,0.3725490196078431,0,0.4274509803921568,0.1725490196078431],\"Name\":\"Brewer Sequential Blue-Green (5)\",\"NanColor\":[0,0.4274509803921568,0.1725490196078431]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.6980392156862745,0.8862745098039215,0.8862745098039215,0.4,0.7607843137254902,0.6431372549019608,0.1372549019607843,0.5450980392156862,0.2705882352941176],\"Name\":\"Brewer Sequential Blue-Green (4)\",\"NanColor\":[0.1372549019607843,0.5450980392156862,0.2705882352941176]},{\"IndexedColors\":[0.8980392156862745,0.9607843137254902,0.9764705882352941,0.6,0.8470588235294118,0.788235294117647,0.1725490196078431,0.6352941176470588,0.3725490196078431],\"Name\":\"Brewer Sequential Blue-Green (3)\",\"NanColor\":[0.1725490196078431,0.6352941176470588,0.3725490196078431]},{\"IndexedColors\":[1,1,0.8980392156862745,1,0.9686274509803922,0.7372549019607844,0.996078431372549,0.8901960784313725,0.5686274509803921,0.996078431372549,0.7686274509803922,0.3098039215686275,0.996078431372549,0.6,0.1607843137254902,0.9254901960784314,0.4392156862745098,0.0784313725490196,0.8,0.2980392156862745,0.00784313725490196,0.6,0.203921568627451,0.01568627450980392,0.4,0.1450980392156863,0.02352941176470588],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (9)\",\"NanColor\":[0.4,0.1450980392156863,0.02352941176470588]},{\"IndexedColors\":[1,1,0.8980392156862745,1,0.9686274509803922,0.7372549019607844,0.996078431372549,0.8901960784313725,0.5686274509803921,0.996078431372549,0.7686274509803922,0.3098039215686275,0.996078431372549,0.6,0.1607843137254902,0.9254901960784314,0.4392156862745098,0.0784313725490196,0.8,0.2980392156862745,0.00784313725490196,0.5490196078431373,0.1764705882352941,0.01568627450980392],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (8)\",\"NanColor\":[0.5490196078431373,0.1764705882352941,0.01568627450980392]},{\"IndexedColors\":[1,1,0.8313725490196079,0.996078431372549,0.8901960784313725,0.5686274509803921,0.996078431372549,0.7686274509803922,0.3098039215686275,0.996078431372549,0.6,0.1607843137254902,0.9254901960784314,0.4392156862745098,0.0784313725490196,0.8,0.2980392156862745,0.00784313725490196,0.5490196078431373,0.1764705882352941,0.01568627450980392],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (7)\",\"NanColor\":[0.5490196078431373,0.1764705882352941,0.01568627450980392]},{\"IndexedColors\":[1,1,0.8313725490196079,0.996078431372549,0.8901960784313725,0.5686274509803921,0.996078431372549,0.7686274509803922,0.3098039215686275,0.996078431372549,0.6,0.1607843137254902,0.8509803921568627,0.3725490196078431,0.05490196078431372,0.6,0.203921568627451,0.01568627450980392],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (6)\",\"NanColor\":[0.6,0.203921568627451,0.01568627450980392]},{\"IndexedColors\":[1,1,0.8313725490196079,0.996078431372549,0.8509803921568627,0.5568627450980392,0.996078431372549,0.6,0.1607843137254902,0.8509803921568627,0.3725490196078431,0.05490196078431372,0.6,0.203921568627451,0.01568627450980392],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (5)\",\"NanColor\":[0.6,0.203921568627451,0.01568627450980392]},{\"IndexedColors\":[1,1,0.8313725490196079,0.996078431372549,0.8509803921568627,0.5568627450980392,0.996078431372549,0.6,0.1607843137254902,0.8,0.2980392156862745,0.00784313725490196],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (4)\",\"NanColor\":[0.8,0.2980392156862745,0.00784313725490196]},{\"IndexedColors\":[1,0.9686274509803922,0.7372549019607844,0.996078431372549,0.7686274509803922,0.3098039215686275,0.8509803921568627,0.3725490196078431,0.05490196078431372],\"Name\":\"Brewer Sequential Yellow-Orange-Brown (3)\",\"NanColor\":[0.8509803921568627,0.3725490196078431,0.05490196078431372]},{\"IndexedColors\":[0.9686274509803922,0.9882352941176471,0.9921568627450981,0.8784313725490196,0.9254901960784314,0.9568627450980393,0.7490196078431373,0.8274509803921568,0.9019607843137255,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5490196078431373,0.4196078431372549,0.6941176470588235,0.5333333333333333,0.2549019607843137,0.615686274509804,0.5058823529411764,0.05882352941176471,0.4862745098039216,0.3019607843137255,0,0.2941176470588235],\"Name\":\"Brewer Sequential Blue-Purple (9)\",\"NanColor\":[0.3019607843137255,0,0.2941176470588235]},{\"IndexedColors\":[0.9686274509803922,0.9882352941176471,0.9921568627450981,0.8784313725490196,0.9254901960784314,0.9568627450980393,0.7490196078431373,0.8274509803921568,0.9019607843137255,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5490196078431373,0.4196078431372549,0.6941176470588235,0.5333333333333333,0.2549019607843137,0.615686274509804,0.4313725490196079,0.00392156862745098,0.4196078431372549],\"Name\":\"Brewer Sequential Blue-Purple (8)\",\"NanColor\":[0.4313725490196079,0.00392156862745098,0.4196078431372549]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.7490196078431373,0.8274509803921568,0.9019607843137255,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5490196078431373,0.4196078431372549,0.6941176470588235,0.5333333333333333,0.2549019607843137,0.615686274509804,0.4313725490196079,0.00392156862745098,0.4196078431372549],\"Name\":\"Brewer Sequential Blue-Purple (7)\",\"NanColor\":[0.4313725490196079,0.00392156862745098,0.4196078431372549]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.7490196078431373,0.8274509803921568,0.9019607843137255,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5333333333333333,0.3372549019607843,0.6549019607843137,0.5058823529411764,0.05882352941176471,0.4862745098039216],\"Name\":\"Brewer Sequential Blue-Purple (6)\",\"NanColor\":[0.5058823529411764,0.05882352941176471,0.4862745098039216]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.7019607843137254,0.803921568627451,0.8901960784313725,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5333333333333333,0.3372549019607843,0.6549019607843137,0.5058823529411764,0.05882352941176471,0.4862745098039216],\"Name\":\"Brewer Sequential Blue-Purple (5)\",\"NanColor\":[0.5058823529411764,0.05882352941176471,0.4862745098039216]},{\"IndexedColors\":[0.9294117647058824,0.9725490196078431,0.984313725490196,0.7019607843137254,0.803921568627451,0.8901960784313725,0.5490196078431373,0.5882352941176471,0.7764705882352941,0.5333333333333333,0.2549019607843137,0.615686274509804],\"Name\":\"Brewer Sequential Blue-Purple (4)\",\"NanColor\":[0.5333333333333333,0.2549019607843137,0.615686274509804]},{\"IndexedColors\":[0.8784313725490196,0.9254901960784314,0.9568627450980393,0.6196078431372549,0.7372549019607844,0.8549019607843137,0.5333333333333333,0.3372549019607843,0.6549019607843137],\"Name\":\"Brewer Sequential Blue-Purple (3)\",\"NanColor\":[0.5333333333333333,0.3372549019607843,0.6549019607843137]},{\"IndexedColors\":[0.4980392156862745,0.788235294117647,0.4980392156862745,0.7450980392156863,0.6823529411764706,0.8313725490196079,0.9921568627450981,0.7529411764705882,0.5254901960784314,1,1,0.6,0.2196078431372549,0.4235294117647059,0.6901960784313725,0.9411764705882353,0.00784313725490196,0.4980392156862745,0.7490196078431373,0.3568627450980392,0.09019607843137255,0.4,0.4,0.4],\"Name\":\"Brewer Qualitative Accent\",\"NanColor\":[0.4,0.4,0.4]},{\"IndexedColors\":[0.1058823529411765,0.6196078431372549,0.4666666666666667,0.8509803921568627,0.3725490196078431,0.00784313725490196,0.4588235294117647,0.4392156862745098,0.7019607843137254,0.9058823529411765,0.1607843137254902,0.5411764705882353,0.4,0.6509803921568628,0.1176470588235294,0.9019607843137255,0.6705882352941176,0.00784313725490196,0.6509803921568628,0.4627450980392157,0.1137254901960784,0.4,0.4,0.4],\"Name\":\"Brewer Qualitative Dark2\",\"NanColor\":[0.4,0.4,0.4]},{\"IndexedColors\":[0.4,0.7607843137254902,0.6470588235294118,0.9882352941176471,0.5529411764705883,0.3843137254901961,0.5529411764705883,0.6274509803921569,0.796078431372549,0.9058823529411765,0.5411764705882353,0.7647058823529411,0.6509803921568628,0.8470588235294118,0.3294117647058823,1,0.8509803921568627,0.1843137254901961,0.8980392156862745,0.7686274509803922,0.5803921568627451,0.7019607843137254,0.7019607843137254,0.7019607843137254],\"Name\":\"Brewer Qualitative Set2\",\"NanColor\":[0.7019607843137254,0.7019607843137254,0.7019607843137254]},{\"IndexedColors\":[0.7019607843137254,0.8862745098039215,0.803921568627451,0.9921568627450981,0.803921568627451,0.6745098039215687,0.796078431372549,0.8352941176470589,0.9098039215686274,0.9568627450980393,0.792156862745098,0.8941176470588236,0.9019607843137255,0.9607843137254902,0.788235294117647,1,0.9490196078431372,0.6823529411764706,0.9450980392156862,0.8862745098039215,0.8,0.8,0.8,0.8],\"Name\":\"Brewer Qualitative Pastel2\",\"NanColor\":[0.8,0.8,0.8]},{\"IndexedColors\":[0.984313725490196,0.7058823529411765,0.6823529411764706,0.7019607843137254,0.803921568627451,0.8901960784313725,0.8,0.9215686274509803,0.7725490196078432,0.8705882352941177,0.796078431372549,0.8941176470588236,0.996078431372549,0.8509803921568627,0.6509803921568628,1,1,0.8,0.8980392156862745,0.8470588235294118,0.7411764705882353,0.9921568627450981,0.8549019607843137,0.9254901960784314,0.9490196078431372,0.9490196078431372,0.9490196078431372],\"Name\":\"Brewer Qualitative Pastel1\",\"NanColor\":[0.9490196078431372,0.9490196078431372,0.9490196078431372]},{\"IndexedColors\":[0.8941176470588236,0.1019607843137255,0.1098039215686274,0.2156862745098039,0.4941176470588236,0.7215686274509804,0.3019607843137255,0.6862745098039216,0.2901960784313726,0.596078431372549,0.3058823529411765,0.6392156862745098,1,0.4980392156862745,0,1,1,0.2,0.6509803921568628,0.3372549019607843,0.1568627450980392,0.9686274509803922,0.5058823529411764,0.7490196078431373,0.6,0.6,0.6],\"Name\":\"Brewer Qualitative Set1\",\"NanColor\":[0.6,0.6,0.6]},{\"IndexedColors\":[0.6509803921568628,0.807843137254902,0.8901960784313725,0.1215686274509804,0.4705882352941176,0.7058823529411765,0.6980392156862745,0.8745098039215686,0.5411764705882353,0.2,0.6274509803921569,0.1725490196078431,0.984313725490196,0.6039215686274509,0.6,0.8901960784313725,0.1019607843137255,0.1098039215686274,0.9921568627450981,0.7490196078431373,0.4352941176470588,1,0.4980392156862745,0,0.792156862745098,0.6980392156862745,0.8392156862745098,0.4156862745098039,0.2392156862745098,0.6039215686274509,1,1,0.6],\"Name\":\"Brewer Qualitative Paired\",\"NanColor\":[1,1,0.6]},{\"IndexedColors\":[0.5529411764705883,0.8274509803921568,0.7803921568627451,1,1,0.7019607843137254,0.7450980392156863,0.7294117647058823,0.8549019607843137,0.984313725490196,0.5019607843137255,0.4470588235294118,0.5019607843137255,0.6941176470588235,0.8274509803921568,0.9921568627450981,0.7058823529411765,0.3843137254901961,0.7019607843137254,0.8705882352941177,0.4117647058823529,0.9882352941176471,0.803921568627451,0.8980392156862745,0.8509803921568627,0.8509803921568627,0.8509803921568627,0.7372549019607844,0.5019607843137255,0.7411764705882353,0.8,0.9215686274509803,0.7725490196078432,1,0.9294117647058824,0.4352941176470588],\"Name\":\"Brewer Qualitative Set3\",\"NanColor\":[1,0.9294117647058824,0.4352941176470588]},{\"IndexedColors\":[1,0,0,1,0.862745,0,0,0.695201,0],\"Name\":\"Traffic Lights\",\"NanColor\":[0.803922,0,0.803922]},{\"IndexedColors\":[0.908659,0.604013,0.581857,1,0.862745,0,0,0.695201,0],\"Name\":\"Traffic Lights For Deuteranopes\",\"NanColor\":[0.803922,0,0.803922]},{\"IndexedColors\":[0.4196078431372549,0,0.07058823529411765,0.9019607843137255,0.9411764705882353,0.0196078431372549,0.01568627450980392,0.6196078431372549,0.00784313725490196],\"Name\":\"Traffic Lights For Deuteranopes 2\",\"NanColor\":[0.803922,0,0.803922]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Muted Blue-Green\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,0.109804,0.27451,0.301961,0.02,0.129412,0.309804,0.341176,0.05,0.14902,0.341176,0.380392,0.1,0.188235,0.403922,0.458824,0.15,0.227451,0.447059,0.521569,0.2,0.290196,0.494118,0.588235,0.25,0.368627,0.552941,0.670588,0.3,0.458824,0.619608,0.74902,0.35,0.588235,0.713725,0.85098,0.4,0.72549,0.815686,0.941176,0.45,0.831373,0.882353,0.980392,0.475,0.909804,0.933333,1,0.5,0.980392,0.984314,1,0.5,0.996078,1,0.94902,0.5,1,1,0.980392,0.5,0.980392,0.984314,1,0.525,0.972549,0.988235,0.890196,0.55,0.917647,0.960784,0.835294,0.6,0.835294,0.921569,0.772549,0.65,0.768627,0.901961,0.737255,0.7,0.670588,0.831373,0.654902,0.75,0.576471,0.760784,0.584314,0.8,0.498039,0.678431,0.521569,0.85,0.392157,0.560784,0.427451,0.9,0.294118,0.45098,0.333333,0.95,0.211765,0.34902,0.254902,1,0.152941,0.278431,0.196078]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Green-Blue Asymmetric Divergent (62Blbc)\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,0.121569,0.2,0.145098,0.05,0.196078,0.301961,0.223529,0.1,0.258824,0.4,0.278431,0.2,0.341176,0.54902,0.341176,0.25,0.419608,0.619608,0.376471,0.3,0.545098,0.701961,0.392157,0.35,0.643137,0.780392,0.403922,0.4,0.729412,0.819608,0.45098,0.45,0.811765,0.870588,0.521569,0.5,0.898039,0.909804,0.564706,0.55,0.941176,0.92549,0.686275,0.6,0.960784,0.94902,0.776471,0.64,1,1,1,0.65,0.890196,0.988235,0.972549,0.7,0.721569,0.894118,0.901961,0.75,0.631373,0.823529,0.839216,0.8,0.517647,0.662745,0.701961,0.85,0.384314,0.494118,0.54902,0.9,0.298039,0.360784,0.45098,0.95,0.223529,0.25098,0.34902,0.99,0.156863,0.172549,0.25098,1,0.137255,0.137255,0.188235]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Asymmtrical Earth Tones (6_21b)\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,0.141176,0.14902,0.2,0.05,0.215686,0.258824,0.321569,0.1,0.243137,0.368627,0.380392,0.15,0.27451,0.439216,0.4,0.2,0.32549,0.501961,0.384314,0.25,0.403922,0.6,0.419608,0.3,0.486275,0.701961,0.454902,0.35,0.556863,0.74902,0.494118,0.4,0.670588,0.8,0.545098,0.5,0.854902,0.901961,0.631373,0.55,0.92549,0.941176,0.694118,0.6,0.960784,0.94902,0.776471,0.65,0.988235,0.968627,0.909804,0.7,0.839216,0.815686,0.772549,0.75,0.701961,0.662745,0.615686,0.8,0.6,0.529412,0.478431,0.85,0.501961,0.403922,0.360784,0.9,0.439216,0.313725,0.290196,1,0.301961,0.164706,0.176471]},{\"ColorSpace\":\"Lab\",\"Creator\":\"Francesca Samsel\",\"Name\":\"Yellow 15\",\"NanColor\":[0.25,0,0],\"RGBPoints\":[0,1,1,0.988235,0.002,1,1,0.988235,0.05,0.984314,0.988235,0.843137,0.1,0.988235,0.988235,0.741176,0.15,0.980392,0.968627,0.654902,0.2,0.980392,0.945098,0.576471,0.25,0.968627,0.905882,0.486275,0.3,0.968627,0.862745,0.388235,0.35,0.960784,0.803922,0.286275,0.4,0.94902,0.741176,0.219608,0.45,0.941176,0.678431,0.14902,0.5,0.929412,0.607843,0.094118,0.55,0.921569,0.545098,0.054902,0.6,0.909804,0.486275,0.035294,0.65,0.890196,0.411765,0.019608,0.7,0.8,0.305882,0,0.75,0.760784,0.239216,0,0.8,0.678431,0.180392,0.011765,0.85,0.6,0.121569,0.023529,0.9,0.501961,0.054902,0.031373,0.95,0.4,0.039216,0.058824,1,0.301961,0.047059,0.090196]},{\"ColorSpace\":\"Diverging\",\"Name\":\"Magma (matplotlib)\",\"NanColor\":[0,1,0],\"Source\":\"https://github.com/BIDS/colormap/blob/master/colormaps.py\",\"License\":\"CC0\",\"Creator\":\"Nathaniel J. Smith & Stefan van der Walt\",\"RGBPoints\":[0,0.001462,0.000466,0.013866,0.003922,0.002258,0.001295,0.018331,0.007843,0.003279,0.002305,0.023708,0.011765,0.004512,0.00349,0.029965,0.015686,0.00595,0.004843,0.03713,0.019608,0.007588,0.006356,0.044973,0.023529,0.009426,0.008022,0.052844,0.027451,0.011465,0.009828,0.06075,0.031373,0.013708,0.011771,0.068667,0.035294,0.016156,0.01384,0.076603,0.039216,0.018815,0.016026,0.084584,0.043137,0.021692,0.01832,0.09261,0.047059,0.024792,0.020715,0.100676,0.05098,0.028123,0.023201,0.108787,0.054902,0.031696,0.025765,0.116965,0.058824,0.03552,0.028397,0.125209,0.062745,0.039608,0.03109,0.133515,0.066667,0.04383,0.03383,0.141886,0.070588,0.048062,0.036607,0.150327,0.07451,0.05232,0.039407,0.158841,0.078431,0.056615,0.04216,0.167446,0.082353,0.060949,0.044794,0.176129,0.086275,0.06533,0.047318,0.184892,0.090196,0.069764,0.049726,0.193735,0.094118,0.074257,0.052017,0.20266,0.098039,0.078815,0.054184,0.211667,0.101961,0.083446,0.056225,0.220755,0.105882,0.088155,0.058133,0.229922,0.109804,0.092949,0.059904,0.239164,0.113725,0.097833,0.061531,0.248477,0.117647,0.102815,0.06301,0.257854,0.121569,0.107899,0.064335,0.267289,0.12549,0.113094,0.065492,0.276784,0.129412,0.118405,0.066479,0.286321,0.133333,0.123833,0.067295,0.295879,0.137255,0.12938,0.067935,0.305443,0.141176,0.135053,0.068391,0.315,0.145098,0.140858,0.068654,0.324538,0.14902,0.146785,0.068738,0.334011,0.152941,0.152839,0.068637,0.343404,0.156863,0.159018,0.068354,0.352688,0.160784,0.165308,0.067911,0.361816,0.164706,0.171713,0.067305,0.370771,0.168627,0.178212,0.066576,0.379497,0.172549,0.184801,0.065732,0.387973,0.176471,0.19146,0.064818,0.396152,0.180392,0.198177,0.063862,0.404009,0.184314,0.204935,0.062907,0.411514,0.188235,0.211718,0.061992,0.418647,0.192157,0.218512,0.061158,0.425392,0.196078,0.225302,0.060445,0.431742,0.2,0.232077,0.059889,0.437695,0.203922,0.238826,0.059517,0.443256,0.207843,0.245543,0.059352,0.448436,0.211765,0.25222,0.059415,0.453248,0.215686,0.258857,0.059706,0.45771,0.219608,0.265447,0.060237,0.46184,0.223529,0.271994,0.060994,0.46566,0.227451,0.278493,0.061978,0.46919,0.231373,0.284951,0.063168,0.472451,0.235294,0.291366,0.064553,0.475462,0.239216,0.29774,0.066117,0.478243,0.243137,0.304081,0.067835,0.480812,0.247059,0.310382,0.069702,0.483186,0.25098,0.316654,0.07169,0.48538,0.254902,0.322899,0.073782,0.487408,0.258824,0.329114,0.075972,0.489287,0.262745,0.335308,0.078236,0.491024,0.266667,0.341482,0.080564,0.492631,0.270588,0.347636,0.082946,0.494121,0.27451,0.353773,0.085373,0.495501,0.278431,0.359898,0.087831,0.496778,0.282353,0.366012,0.090314,0.49796,0.286275,0.372116,0.092816,0.499053,0.290196,0.378211,0.095332,0.500067,0.294118,0.384299,0.097855,0.501002,0.298039,0.390384,0.100379,0.501864,0.301961,0.396467,0.102902,0.502658,0.305882,0.402548,0.10542,0.503386,0.309804,0.408629,0.10793,0.504052,0.313725,0.414709,0.110431,0.504662,0.317647,0.420791,0.11292,0.505215,0.321569,0.426877,0.115395,0.505714,0.32549,0.432967,0.117855,0.50616,0.329412,0.439062,0.120298,0.506555,0.333333,0.445163,0.122724,0.506901,0.337255,0.451271,0.125132,0.507198,0.341176,0.457386,0.127522,0.507448,0.345098,0.463508,0.129893,0.507652,0.34902,0.46964,0.132245,0.507809,0.352941,0.47578,0.134577,0.507921,0.356863,0.481929,0.136891,0.507989,0.360784,0.488088,0.139186,0.508011,0.364706,0.494258,0.141462,0.507988,0.368627,0.500438,0.143719,0.50792,0.372549,0.506629,0.145958,0.507806,0.376471,0.512831,0.148179,0.507648,0.380392,0.519045,0.150383,0.507443,0.384314,0.52527,0.152569,0.507192,0.388235,0.531507,0.154739,0.506895,0.392157,0.537755,0.156894,0.506551,0.396078,0.544015,0.159033,0.506159,0.4,0.550287,0.161158,0.505719,0.403922,0.556571,0.163269,0.50523,0.407843,0.562866,0.165368,0.504692,0.411765,0.569172,0.167454,0.504105,0.415686,0.57549,0.16953,0.503466,0.419608,0.581819,0.171596,0.502777,0.423529,0.588158,0.173652,0.502035,0.427451,0.594508,0.175701,0.501241,0.431373,0.600868,0.177743,0.500394,0.435294,0.607238,0.179779,0.499492,0.439216,0.613617,0.181811,0.498536,0.443137,0.620005,0.18384,0.497524,0.447059,0.626401,0.185867,0.496456,0.45098,0.632805,0.187893,0.495332,0.454902,0.639216,0.189921,0.49415,0.458824,0.645633,0.191952,0.49291,0.462745,0.652056,0.193986,0.491611,0.466667,0.658483,0.196027,0.490253,0.470588,0.664915,0.198075,0.488836,0.47451,0.671349,0.200133,0.487358,0.478431,0.677786,0.202203,0.485819,0.482353,0.684224,0.204286,0.484219,0.486275,0.690661,0.206384,0.482558,0.490196,0.697098,0.208501,0.480835,0.494118,0.703532,0.210638,0.479049,0.498039,0.709962,0.212797,0.477201,0.501961,0.716387,0.214982,0.47529,0.505882,0.722805,0.217194,0.473316,0.509804,0.729216,0.219437,0.471279,0.513725,0.735616,0.221713,0.46918,0.517647,0.742004,0.224025,0.467018,0.521569,0.748378,0.226377,0.464794,0.52549,0.754737,0.228772,0.462509,0.529412,0.761077,0.231214,0.460162,0.533333,0.767398,0.233705,0.457755,0.537255,0.773695,0.236249,0.455289,0.541176,0.779968,0.238851,0.452765,0.545098,0.786212,0.241514,0.450184,0.54902,0.792427,0.244242,0.447543,0.552941,0.798608,0.24704,0.444848,0.556863,0.804752,0.249911,0.442102,0.560784,0.810855,0.252861,0.439305,0.564706,0.816914,0.255895,0.436461,0.568627,0.822926,0.259016,0.433573,0.572549,0.828886,0.262229,0.430644,0.576471,0.834791,0.26554,0.427671,0.580392,0.840636,0.268953,0.424666,0.584314,0.846416,0.272473,0.421631,0.588235,0.852126,0.276106,0.418573,0.592157,0.857763,0.279857,0.415496,0.596078,0.86332,0.283729,0.412403,0.6,0.868793,0.287728,0.409303,0.603922,0.874176,0.291859,0.406205,0.607843,0.879464,0.296125,0.403118,0.611765,0.884651,0.30053,0.400047,0.615686,0.889731,0.305079,0.397002,0.619608,0.8947,0.309773,0.393995,0.623529,0.899552,0.314616,0.391037,0.627451,0.904281,0.31961,0.388137,0.631373,0.908884,0.324755,0.385308,0.635294,0.913354,0.330052,0.382563,0.639216,0.917689,0.3355,0.379915,0.643137,0.921884,0.341098,0.377376,0.647059,0.925937,0.346844,0.374959,0.65098,0.929845,0.352734,0.372677,0.654902,0.933606,0.358764,0.370541,0.658824,0.937221,0.364929,0.368567,0.662745,0.940687,0.371224,0.366762,0.666667,0.944006,0.377643,0.365136,0.670588,0.94718,0.384178,0.363701,0.67451,0.95021,0.39082,0.362468,0.678431,0.953099,0.397563,0.361438,0.682353,0.955849,0.4044,0.360619,0.686275,0.958464,0.411324,0.360014,0.690196,0.960949,0.418323,0.35963,0.694118,0.96331,0.42539,0.359469,0.698039,0.965549,0.432519,0.359529,0.701961,0.967671,0.439703,0.35981,0.705882,0.96968,0.446936,0.360311,0.709804,0.971582,0.45421,0.36103,0.713725,0.973381,0.46152,0.361965,0.717647,0.975082,0.468861,0.363111,0.721569,0.97669,0.476226,0.364466,0.72549,0.97821,0.483612,0.366025,0.729412,0.979645,0.491014,0.367783,0.733333,0.981,0.498428,0.369734,0.737255,0.982279,0.505851,0.371874,0.741176,0.983485,0.51328,0.374198,0.745098,0.984622,0.520713,0.376698,0.74902,0.985693,0.528148,0.379371,0.752941,0.9867,0.535582,0.38221,0.756863,0.987646,0.543015,0.38521,0.760784,0.988533,0.550446,0.388365,0.764706,0.989363,0.557873,0.391671,0.768627,0.990138,0.565296,0.395122,0.772549,0.990871,0.572706,0.398714,0.776471,0.991558,0.580107,0.402441,0.780392,0.992196,0.587502,0.406299,0.784314,0.992785,0.594891,0.410283,0.788235,0.993326,0.602275,0.41439,0.792157,0.993834,0.609644,0.418613,0.796078,0.994309,0.616999,0.42295,0.8,0.994738,0.62435,0.427397,0.803922,0.995122,0.631696,0.431951,0.807843,0.99548,0.639027,0.436607,0.811765,0.99581,0.646344,0.441361,0.815686,0.996096,0.653659,0.446213,0.819608,0.996341,0.660969,0.45116,0.823529,0.99658,0.668256,0.456192,0.827451,0.996775,0.675541,0.461314,0.831373,0.996925,0.682828,0.466526,0.835294,0.997077,0.690088,0.471811,0.839216,0.997186,0.697349,0.477182,0.843137,0.997254,0.704611,0.482635,0.847059,0.997325,0.711848,0.488154,0.85098,0.997351,0.719089,0.493755,0.854902,0.997351,0.726324,0.499428,0.858824,0.997341,0.733545,0.505167,0.862745,0.997285,0.740772,0.510983,0.866667,0.997228,0.747981,0.516859,0.870588,0.997138,0.75519,0.522806,0.87451,0.997019,0.762398,0.528821,0.878431,0.996898,0.769591,0.534892,0.882353,0.996727,0.776795,0.541039,0.886275,0.996571,0.783977,0.547233,0.890196,0.996369,0.791167,0.553499,0.894118,0.996162,0.798348,0.55982,0.898039,0.995932,0.805527,0.566202,0.901961,0.99568,0.812706,0.572645,0.905882,0.995424,0.819875,0.57914,0.909804,0.995131,0.827052,0.585701,0.913725,0.994851,0.834213,0.592307,0.917647,0.994524,0.841387,0.598983,0.921569,0.994222,0.84854,0.605696,0.92549,0.993866,0.855711,0.612482,0.929412,0.993545,0.862859,0.619299,0.933333,0.99317,0.870024,0.626189,0.937255,0.992831,0.877168,0.633109,0.941176,0.99244,0.88433,0.640099,0.945098,0.992089,0.89147,0.647116,0.94902,0.991688,0.898627,0.654202,0.952941,0.991332,0.905763,0.661309,0.956863,0.99093,0.912915,0.668481,0.960784,0.99057,0.920049,0.675675,0.964706,0.990175,0.927196,0.682926,0.968627,0.989815,0.934329,0.690198,0.972549,0.989434,0.94147,0.697519,0.976471,0.989077,0.948604,0.704863,0.980392,0.988717,0.955742,0.712242,0.984314,0.988367,0.962878,0.719649,0.988235,0.988033,0.970012,0.727077,0.992157,0.987691,0.977154,0.734536,0.996078,0.987387,0.984288,0.742002,1,0.987053,0.991438,0.749504]},{\"ColorSpace\":\"Diverging\",\"Name\":\"Inferno (matplotlib)\",\"NanColor\":[0,1,0],\"Source\":\"https://github.com/BIDS/colormap/blob/master/colormaps.py\",\"License\":\"CC0\",\"Creator\":\"Nathaniel J. Smith & Stefan van der Walt\",\"RGBPoints\":[0,0.001462,0.000466,0.013866,0.003922,0.002267,0.00127,0.01857,0.007843,0.003299,0.002249,0.024239,0.011765,0.004547,0.003392,0.030909,0.015686,0.006006,0.004692,0.038558,0.019608,0.007676,0.006136,0.046836,0.023529,0.009561,0.007713,0.055143,0.027451,0.011663,0.009417,0.06346,0.031373,0.013995,0.011225,0.071862,0.035294,0.016561,0.013136,0.080282,0.039216,0.019373,0.015133,0.088767,0.043137,0.022447,0.017199,0.097327,0.047059,0.025793,0.019331,0.10593,0.05098,0.029432,0.021503,0.114621,0.054902,0.033385,0.023702,0.123397,0.058824,0.037668,0.025921,0.132232,0.062745,0.042253,0.028139,0.141141,0.066667,0.046915,0.030324,0.150164,0.070588,0.051644,0.032474,0.159254,0.07451,0.056449,0.034569,0.168414,0.078431,0.06134,0.03659,0.177642,0.082353,0.066331,0.038504,0.186962,0.086275,0.071429,0.040294,0.196354,0.090196,0.076637,0.041905,0.205799,0.094118,0.081962,0.043328,0.215289,0.098039,0.087411,0.044556,0.224813,0.101961,0.09299,0.045583,0.234358,0.105882,0.098702,0.046402,0.243904,0.109804,0.104551,0.047008,0.25343,0.113725,0.110536,0.047399,0.262912,0.117647,0.116656,0.047574,0.272321,0.121569,0.122908,0.047536,0.281624,0.12549,0.129285,0.047293,0.290788,0.129412,0.135778,0.046856,0.299776,0.133333,0.142378,0.046242,0.308553,0.137255,0.149073,0.045468,0.317085,0.141176,0.15585,0.044559,0.325338,0.145098,0.162689,0.043554,0.333277,0.14902,0.169575,0.042489,0.340874,0.152941,0.176493,0.041402,0.348111,0.156863,0.183429,0.040329,0.354971,0.160784,0.190367,0.039309,0.361447,0.164706,0.197297,0.0384,0.367535,0.168627,0.204209,0.037632,0.373238,0.172549,0.211095,0.03703,0.378563,0.176471,0.217949,0.036615,0.383522,0.180392,0.224763,0.036405,0.388129,0.184314,0.231538,0.036405,0.3924,0.188235,0.238273,0.036621,0.396353,0.192157,0.244967,0.037055,0.400007,0.196078,0.25162,0.037705,0.403378,0.2,0.258234,0.038571,0.406485,0.203922,0.26481,0.039647,0.409345,0.207843,0.271347,0.040922,0.411976,0.211765,0.27785,0.042353,0.414392,0.215686,0.284321,0.043933,0.416608,0.219608,0.290763,0.045644,0.418637,0.223529,0.297178,0.04747,0.420491,0.227451,0.303568,0.049396,0.422182,0.231373,0.309935,0.051407,0.423721,0.235294,0.316282,0.05349,0.425116,0.239216,0.32261,0.055634,0.426377,0.243137,0.328921,0.057827,0.427511,0.247059,0.335217,0.06006,0.428524,0.25098,0.3415,0.062325,0.429425,0.254902,0.347771,0.064616,0.430217,0.258824,0.354032,0.066925,0.430906,0.262745,0.360284,0.069247,0.431497,0.266667,0.366529,0.071579,0.431994,0.270588,0.372768,0.073915,0.4324,0.27451,0.379001,0.076253,0.432719,0.278431,0.385228,0.078591,0.432955,0.282353,0.391453,0.080927,0.433109,0.286275,0.397674,0.083257,0.433183,0.290196,0.403894,0.08558,0.433179,0.294118,0.410113,0.087896,0.433098,0.298039,0.416331,0.090203,0.432943,0.301961,0.422549,0.092501,0.432714,0.305882,0.428768,0.09479,0.432412,0.309804,0.434987,0.097069,0.432039,0.313725,0.441207,0.099338,0.431594,0.317647,0.447428,0.101597,0.43108,0.321569,0.453651,0.103848,0.430498,0.32549,0.459875,0.106089,0.429846,0.329412,0.4661,0.108322,0.429125,0.333333,0.472328,0.110547,0.428334,0.337255,0.478558,0.112764,0.427475,0.341176,0.484789,0.114974,0.426548,0.345098,0.491022,0.117179,0.425552,0.34902,0.497257,0.119379,0.424488,0.352941,0.503493,0.121575,0.423356,0.356863,0.50973,0.123769,0.422156,0.360784,0.515967,0.12596,0.420887,0.364706,0.522206,0.12815,0.419549,0.368627,0.528444,0.130341,0.418142,0.372549,0.534683,0.132534,0.416667,0.376471,0.54092,0.134729,0.415123,0.380392,0.547157,0.136929,0.413511,0.384314,0.553392,0.139134,0.411829,0.388235,0.559624,0.141346,0.410078,0.392157,0.565854,0.143567,0.408258,0.396078,0.572081,0.145797,0.406369,0.4,0.578304,0.148039,0.404411,0.403922,0.584521,0.150294,0.402385,0.407843,0.590734,0.152563,0.40029,0.411765,0.59694,0.154848,0.398125,0.415686,0.603139,0.157151,0.395891,0.419608,0.60933,0.159474,0.393589,0.423529,0.615513,0.161817,0.391219,0.427451,0.621685,0.164184,0.388781,0.431373,0.627847,0.166575,0.386276,0.435294,0.633998,0.168992,0.383704,0.439216,0.640135,0.171438,0.381065,0.443137,0.64626,0.173914,0.378359,0.447059,0.652369,0.176421,0.375586,0.45098,0.658463,0.178962,0.372748,0.454902,0.66454,0.181539,0.369846,0.458824,0.670599,0.184153,0.366879,0.462745,0.676638,0.186807,0.363849,0.466667,0.682656,0.189501,0.360757,0.470588,0.688653,0.192239,0.357603,0.47451,0.694627,0.195021,0.354388,0.478431,0.700576,0.197851,0.351113,0.482353,0.7065,0.200728,0.347777,0.486275,0.712396,0.203656,0.344383,0.490196,0.718264,0.206636,0.340931,0.494118,0.724103,0.20967,0.337424,0.498039,0.729909,0.212759,0.333861,0.501961,0.735683,0.215906,0.330245,0.505882,0.741423,0.219112,0.326576,0.509804,0.747127,0.222378,0.322856,0.513725,0.752794,0.225706,0.319085,0.517647,0.758422,0.229097,0.315266,0.521569,0.76401,0.232554,0.311399,0.52549,0.769556,0.236077,0.307485,0.529412,0.775059,0.239667,0.303526,0.533333,0.780517,0.243327,0.299523,0.537255,0.785929,0.247056,0.295477,0.541176,0.791293,0.250856,0.29139,0.545098,0.796607,0.254728,0.287264,0.54902,0.801871,0.258674,0.283099,0.552941,0.807082,0.262692,0.278898,0.556863,0.812239,0.266786,0.274661,0.560784,0.817341,0.270954,0.27039,0.564706,0.822386,0.275197,0.266085,0.568627,0.827372,0.279517,0.26175,0.572549,0.832299,0.283913,0.257383,0.576471,0.837165,0.288385,0.252988,0.580392,0.841969,0.292933,0.248564,0.584314,0.846709,0.297559,0.244113,0.588235,0.851384,0.30226,0.239636,0.592157,0.855992,0.307038,0.235133,0.596078,0.860533,0.311892,0.230606,0.6,0.865006,0.316822,0.226055,0.603922,0.869409,0.321827,0.221482,0.607843,0.873741,0.326906,0.216886,0.611765,0.878001,0.33206,0.212268,0.615686,0.882188,0.337287,0.207628,0.619608,0.886302,0.342586,0.202968,0.623529,0.890341,0.347957,0.198286,0.627451,0.894305,0.353399,0.193584,0.631373,0.898192,0.358911,0.18886,0.635294,0.902003,0.364492,0.184116,0.639216,0.905735,0.37014,0.17935,0.643137,0.90939,0.375856,0.174563,0.647059,0.912966,0.381636,0.169755,0.65098,0.916462,0.387481,0.164924,0.654902,0.919879,0.393389,0.16007,0.658824,0.923215,0.399359,0.155193,0.662745,0.92647,0.405389,0.150292,0.666667,0.929644,0.411479,0.145367,0.670588,0.932737,0.417627,0.140417,0.67451,0.935747,0.423831,0.13544,0.678431,0.938675,0.430091,0.130438,0.682353,0.941521,0.436405,0.125409,0.686275,0.944285,0.442772,0.120354,0.690196,0.946965,0.449191,0.115272,0.694118,0.949562,0.45566,0.110164,0.698039,0.952075,0.462178,0.105031,0.701961,0.954506,0.468744,0.099874,0.705882,0.956852,0.475356,0.094695,0.709804,0.959114,0.482014,0.089499,0.713725,0.961293,0.488716,0.084289,0.717647,0.963387,0.495462,0.079073,0.721569,0.965397,0.502249,0.073859,0.72549,0.967322,0.509078,0.068659,0.729412,0.969163,0.515946,0.063488,0.733333,0.970919,0.522853,0.058367,0.737255,0.97259,0.529798,0.053324,0.741176,0.974176,0.53678,0.048392,0.745098,0.975677,0.543798,0.043618,0.74902,0.977092,0.55085,0.03905,0.752941,0.978422,0.557937,0.034931,0.756863,0.979666,0.565057,0.031409,0.760784,0.980824,0.572209,0.028508,0.764706,0.981895,0.579392,0.02625,0.768627,0.982881,0.586606,0.024661,0.772549,0.983779,0.593849,0.02377,0.776471,0.984591,0.601122,0.023606,0.780392,0.985315,0.608422,0.024202,0.784314,0.985952,0.61575,0.025592,0.788235,0.986502,0.623105,0.027814,0.792157,0.986964,0.630485,0.030908,0.796078,0.987337,0.63789,0.034916,0.8,0.987622,0.64532,0.039886,0.803922,0.987819,0.652773,0.045581,0.807843,0.987926,0.66025,0.05175,0.811765,0.987945,0.667748,0.058329,0.815686,0.987874,0.675267,0.065257,0.819608,0.987714,0.682807,0.072489,0.823529,0.987464,0.690366,0.07999,0.827451,0.987124,0.697944,0.087731,0.831373,0.986694,0.70554,0.095694,0.835294,0.986175,0.713153,0.103863,0.839216,0.985566,0.720782,0.112229,0.843137,0.984865,0.728427,0.120785,0.847059,0.984075,0.736087,0.129527,0.85098,0.983196,0.743758,0.138453,0.854902,0.982228,0.751442,0.147565,0.858824,0.981173,0.759135,0.156863,0.862745,0.980032,0.766837,0.166353,0.866667,0.978806,0.774545,0.176037,0.870588,0.977497,0.782258,0.185923,0.87451,0.976108,0.789974,0.196018,0.878431,0.974638,0.797692,0.206332,0.882353,0.973088,0.805409,0.216877,0.886275,0.971468,0.813122,0.227658,0.890196,0.969783,0.820825,0.238686,0.894118,0.968041,0.828515,0.249972,0.898039,0.966243,0.836191,0.261534,0.901961,0.964394,0.843848,0.273391,0.905882,0.962517,0.851476,0.285546,0.909804,0.960626,0.859069,0.29801,0.913725,0.95872,0.866624,0.31082,0.917647,0.956834,0.874129,0.323974,0.921569,0.954997,0.881569,0.337475,0.92549,0.953215,0.888942,0.351369,0.929412,0.951546,0.896226,0.365627,0.933333,0.950018,0.903409,0.380271,0.937255,0.948683,0.910473,0.395289,0.941176,0.947594,0.917399,0.410665,0.945098,0.946809,0.924168,0.426373,0.94902,0.946392,0.930761,0.442367,0.952941,0.946403,0.937159,0.458592,0.956863,0.946903,0.943348,0.47497,0.960784,0.947937,0.949318,0.491426,0.964706,0.949545,0.955063,0.50786,0.968627,0.95174,0.960587,0.524203,0.972549,0.954529,0.965896,0.540361,0.976471,0.957896,0.971003,0.556275,0.980392,0.961812,0.975924,0.571925,0.984314,0.966249,0.980678,0.587206,0.988235,0.971162,0.985282,0.602154,0.992157,0.976511,0.989753,0.61676,0.996078,0.982257,0.994109,0.631017,1,0.988362,0.998364,0.644924]},{\"ColorSpace\":\"Diverging\",\"Name\":\"Plasma (matplotlib)\",\"NanColor\":[0,1,0],\"Source\":\"https://github.com/BIDS/colormap/blob/master/colormaps.py\",\"License\":\"CC0\",\"Creator\":\"Nathaniel J. Smith & Stefan van der Walt\",\"RGBPoints\":[0,0.050383,0.029803,0.527975,0.003922,0.063536,0.028426,0.533124,0.007843,0.075353,0.027206,0.538007,0.011765,0.086222,0.026125,0.542658,0.015686,0.096379,0.025165,0.547103,0.019608,0.10598,0.024309,0.551368,0.023529,0.115124,0.023556,0.555468,0.027451,0.123903,0.022878,0.559423,0.031373,0.132381,0.022258,0.56325,0.035294,0.140603,0.021687,0.566959,0.039216,0.148607,0.021154,0.570562,0.043137,0.156421,0.020651,0.574065,0.047059,0.16407,0.020171,0.577478,0.05098,0.171574,0.019706,0.580806,0.054902,0.17895,0.019252,0.584054,0.058824,0.186213,0.018803,0.587228,0.062745,0.193374,0.018354,0.59033,0.066667,0.200445,0.017902,0.593364,0.070588,0.207435,0.017442,0.596333,0.07451,0.21435,0.016973,0.599239,0.078431,0.221197,0.016497,0.602083,0.082353,0.227983,0.016007,0.604867,0.086275,0.234715,0.015502,0.607592,0.090196,0.241396,0.014979,0.610259,0.094118,0.248032,0.014439,0.612868,0.098039,0.254627,0.013882,0.615419,0.101961,0.261183,0.013308,0.617911,0.105882,0.267703,0.012716,0.620346,0.109804,0.274191,0.012109,0.622722,0.113725,0.280648,0.011488,0.625038,0.117647,0.287076,0.010855,0.627295,0.121569,0.293478,0.010213,0.62949,0.12549,0.299855,0.009561,0.631624,0.129412,0.30621,0.008902,0.633694,0.133333,0.312543,0.008239,0.6357,0.137255,0.318856,0.007576,0.63764,0.141176,0.32515,0.006915,0.639512,0.145098,0.331426,0.006261,0.641316,0.14902,0.337683,0.005618,0.643049,0.152941,0.343925,0.004991,0.64471,0.156863,0.35015,0.004382,0.646298,0.160784,0.356359,0.003798,0.64781,0.164706,0.362553,0.003243,0.649245,0.168627,0.368733,0.002724,0.650601,0.172549,0.374897,0.002245,0.651876,0.176471,0.381047,0.001814,0.653068,0.180392,0.387183,0.001434,0.654177,0.184314,0.393304,0.001114,0.655199,0.188235,0.399411,0.000859,0.656133,0.192157,0.405503,0.000678,0.656977,0.196078,0.41158,0.000577,0.65773,0.2,0.417642,0.000564,0.65839,0.203922,0.423689,0.000646,0.658956,0.207843,0.429719,0.000831,0.659425,0.211765,0.435734,0.001127,0.659797,0.215686,0.441732,0.00154,0.660069,0.219608,0.447714,0.00208,0.66024,0.223529,0.453677,0.002755,0.66031,0.227451,0.459623,0.003574,0.660277,0.231373,0.46555,0.004545,0.660139,0.235294,0.471457,0.005678,0.659897,0.239216,0.477344,0.00698,0.659549,0.243137,0.48321,0.00846,0.659095,0.247059,0.489055,0.010127,0.658534,0.25098,0.494877,0.01199,0.657865,0.254902,0.500678,0.014055,0.657088,0.258824,0.506454,0.016333,0.656202,0.262745,0.512206,0.018833,0.655209,0.266667,0.517933,0.021563,0.654109,0.270588,0.523633,0.024532,0.652901,0.27451,0.529306,0.027747,0.651586,0.278431,0.534952,0.031217,0.650165,0.282353,0.54057,0.03495,0.64864,0.286275,0.546157,0.038954,0.64701,0.290196,0.551715,0.043136,0.645277,0.294118,0.557243,0.047331,0.643443,0.298039,0.562738,0.051545,0.641509,0.301961,0.568201,0.055778,0.639477,0.305882,0.573632,0.060028,0.637349,0.309804,0.579029,0.064296,0.635126,0.313725,0.584391,0.068579,0.632812,0.317647,0.589719,0.072878,0.630408,0.321569,0.595011,0.07719,0.627917,0.32549,0.600266,0.081516,0.625342,0.329412,0.605485,0.085854,0.622686,0.333333,0.610667,0.090204,0.619951,0.337255,0.615812,0.094564,0.61714,0.341176,0.620919,0.098934,0.614257,0.345098,0.625987,0.103312,0.611305,0.34902,0.631017,0.107699,0.608287,0.352941,0.636008,0.112092,0.605205,0.356863,0.640959,0.116492,0.602065,0.360784,0.645872,0.120898,0.598867,0.364706,0.650746,0.125309,0.595617,0.368627,0.65558,0.129725,0.592317,0.372549,0.660374,0.134144,0.588971,0.376471,0.665129,0.138566,0.585582,0.380392,0.669845,0.142992,0.582154,0.384314,0.674522,0.147419,0.578688,0.388235,0.67916,0.151848,0.575189,0.392157,0.683758,0.156278,0.57166,0.396078,0.688318,0.160709,0.568103,0.4,0.69284,0.165141,0.564522,0.403922,0.697324,0.169573,0.560919,0.407843,0.701769,0.174005,0.557296,0.411765,0.706178,0.178437,0.553657,0.415686,0.710549,0.182868,0.550004,0.419608,0.714883,0.187299,0.546338,0.423529,0.719181,0.191729,0.542663,0.427451,0.723444,0.196158,0.538981,0.431373,0.72767,0.200586,0.535293,0.435294,0.731862,0.205013,0.531601,0.439216,0.736019,0.209439,0.527908,0.443137,0.740143,0.213864,0.524216,0.447059,0.744232,0.218288,0.520524,0.45098,0.748289,0.222711,0.516834,0.454902,0.752312,0.227133,0.513149,0.458824,0.756304,0.231555,0.509468,0.462745,0.760264,0.235976,0.505794,0.466667,0.764193,0.240396,0.502126,0.470588,0.76809,0.244817,0.498465,0.47451,0.771958,0.249237,0.494813,0.478431,0.775796,0.253658,0.491171,0.482353,0.779604,0.258078,0.487539,0.486275,0.783383,0.2625,0.483918,0.490196,0.787133,0.266922,0.480307,0.494118,0.790855,0.271345,0.476706,0.498039,0.794549,0.27577,0.473117,0.501961,0.798216,0.280197,0.469538,0.505882,0.801855,0.284626,0.465971,0.509804,0.805467,0.289057,0.462415,0.513725,0.809052,0.293491,0.45887,0.517647,0.812612,0.297928,0.455338,0.521569,0.816144,0.302368,0.451816,0.52549,0.819651,0.306812,0.448306,0.529412,0.823132,0.311261,0.444806,0.533333,0.826588,0.315714,0.441316,0.537255,0.830018,0.320172,0.437836,0.541176,0.833422,0.324635,0.434366,0.545098,0.836801,0.329105,0.430905,0.54902,0.840155,0.33358,0.427455,0.552941,0.843484,0.338062,0.424013,0.556863,0.846788,0.342551,0.420579,0.560784,0.850066,0.347048,0.417153,0.564706,0.853319,0.351553,0.413734,0.568627,0.856547,0.356066,0.410322,0.572549,0.85975,0.360588,0.406917,0.576471,0.862927,0.365119,0.403519,0.580392,0.866078,0.36966,0.400126,0.584314,0.869203,0.374212,0.396738,0.588235,0.872303,0.378774,0.393355,0.592157,0.875376,0.383347,0.389976,0.596078,0.878423,0.387932,0.3866,0.6,0.881443,0.392529,0.383229,0.603922,0.884436,0.397139,0.37986,0.607843,0.887402,0.401762,0.376494,0.611765,0.89034,0.406398,0.37313,0.615686,0.89325,0.411048,0.369768,0.619608,0.896131,0.415712,0.366407,0.623529,0.898984,0.420392,0.363047,0.627451,0.901807,0.425087,0.359688,0.631373,0.904601,0.429797,0.356329,0.635294,0.907365,0.434524,0.35297,0.639216,0.910098,0.439268,0.34961,0.643137,0.9128,0.444029,0.346251,0.647059,0.915471,0.448807,0.34289,0.65098,0.918109,0.453603,0.339529,0.654902,0.920714,0.458417,0.336166,0.658824,0.923287,0.463251,0.332801,0.662745,0.925825,0.468103,0.329435,0.666667,0.928329,0.472975,0.326067,0.670588,0.930798,0.477867,0.322697,0.67451,0.933232,0.48278,0.319325,0.678431,0.93563,0.487712,0.315952,0.682353,0.93799,0.492667,0.312575,0.686275,0.940313,0.497642,0.309197,0.690196,0.942598,0.502639,0.305816,0.694118,0.944844,0.507658,0.302433,0.698039,0.947051,0.512699,0.299049,0.701961,0.949217,0.517763,0.295662,0.705882,0.951344,0.52285,0.292275,0.709804,0.953428,0.52796,0.288883,0.713725,0.95547,0.533093,0.28549,0.717647,0.957469,0.53825,0.282096,0.721569,0.959424,0.543431,0.278701,0.72549,0.961336,0.548636,0.275305,0.729412,0.963203,0.553865,0.271909,0.733333,0.965024,0.559118,0.268513,0.737255,0.966798,0.564396,0.265118,0.741176,0.968526,0.5697,0.261721,0.745098,0.970205,0.575028,0.258325,0.74902,0.971835,0.580382,0.254931,0.752941,0.973416,0.585761,0.25154,0.756863,0.974947,0.591165,0.248151,0.760784,0.976428,0.596595,0.244767,0.764706,0.977856,0.602051,0.241387,0.768627,0.979233,0.607532,0.238013,0.772549,0.980556,0.613039,0.234646,0.776471,0.981826,0.618572,0.231287,0.780392,0.983041,0.624131,0.227937,0.784314,0.984199,0.629718,0.224595,0.788235,0.985301,0.63533,0.221265,0.792157,0.986345,0.640969,0.217948,0.796078,0.987332,0.646633,0.214648,0.8,0.98826,0.652325,0.211364,0.803922,0.989128,0.658043,0.2081,0.807843,0.989935,0.663787,0.204859,0.811765,0.990681,0.669558,0.201642,0.815686,0.991365,0.675355,0.198453,0.819608,0.991985,0.681179,0.195295,0.823529,0.992541,0.68703,0.19217,0.827451,0.993032,0.692907,0.189084,0.831373,0.993456,0.69881,0.186041,0.835294,0.993814,0.704741,0.183043,0.839216,0.994103,0.710698,0.180097,0.843137,0.994324,0.716681,0.177208,0.847059,0.994474,0.722691,0.174381,0.85098,0.994553,0.728728,0.171622,0.854902,0.994561,0.734791,0.168938,0.858824,0.994495,0.74088,0.166335,0.862745,0.994355,0.746995,0.163821,0.866667,0.994141,0.753137,0.161404,0.870588,0.993851,0.759304,0.159092,0.87451,0.993482,0.765499,0.156891,0.878431,0.993033,0.77172,0.154808,0.882353,0.992505,0.777967,0.152855,0.886275,0.991897,0.784239,0.151042,0.890196,0.991209,0.790537,0.149377,0.894118,0.990439,0.796859,0.14787,0.898039,0.989587,0.803205,0.146529,0.901961,0.988648,0.809579,0.145357,0.905882,0.987621,0.815978,0.144363,0.909804,0.986509,0.822401,0.143557,0.913725,0.985314,0.828846,0.142945,0.917647,0.984031,0.835315,0.142528,0.921569,0.982653,0.841812,0.142303,0.92549,0.98119,0.848329,0.142279,0.929412,0.979644,0.854866,0.142453,0.933333,0.977995,0.861432,0.142808,0.937255,0.976265,0.868016,0.143351,0.941176,0.974443,0.874622,0.144061,0.945098,0.97253,0.88125,0.144923,0.94902,0.970533,0.887896,0.145919,0.952941,0.968443,0.894564,0.147014,0.956863,0.966271,0.901249,0.14818,0.960784,0.964021,0.90795,0.14937,0.964706,0.961681,0.914672,0.15052,0.968627,0.959276,0.921407,0.151566,0.972549,0.956808,0.928152,0.152409,0.976471,0.954287,0.934908,0.152921,0.980392,0.951726,0.941671,0.152925,0.984314,0.949151,0.948435,0.152178,0.988235,0.946602,0.95519,0.150328,0.992157,0.944152,0.961916,0.146861,0.996078,0.941896,0.96859,0.140956,1,0.940015,0.975158,0.131326]},{\"ColorSpace\":\"Diverging\",\"Name\":\"Viridis (matplotlib)\",\"NanColor\":[1,0,0],\"Source\":\"https://github.com/BIDS/colormap/blob/master/colormaps.py\",\"License\":\"CC0\",\"Creator\":\"Eric Firing\",\"RGBPoints\":[0,0.267004,0.004874,0.329415,0.003922,0.26851,0.009605,0.335427,0.007843,0.269944,0.014625,0.341379,0.011765,0.271305,0.019942,0.347269,0.015686,0.272594,0.025563,0.353093,0.019608,0.273809,0.031497,0.358853,0.023529,0.274952,0.037752,0.364543,0.027451,0.276022,0.044167,0.370164,0.031373,0.277018,0.050344,0.375715,0.035294,0.277941,0.056324,0.381191,0.039216,0.278791,0.062145,0.386592,0.043137,0.279566,0.067836,0.391917,0.047059,0.280267,0.073417,0.397163,0.05098,0.280894,0.078907,0.402329,0.054902,0.281446,0.08432,0.407414,0.058824,0.281924,0.089666,0.412415,0.062745,0.282327,0.094955,0.417331,0.066667,0.282656,0.100196,0.42216,0.070588,0.28291,0.105393,0.426902,0.07451,0.283091,0.110553,0.431554,0.078431,0.283197,0.11568,0.436115,0.082353,0.283229,0.120777,0.440584,0.086275,0.283187,0.125848,0.44496,0.090196,0.283072,0.130895,0.449241,0.094118,0.282884,0.13592,0.453427,0.098039,0.282623,0.140926,0.457517,0.101961,0.28229,0.145912,0.46151,0.105882,0.281887,0.150881,0.465405,0.109804,0.281412,0.155834,0.469201,0.113725,0.280868,0.160771,0.472899,0.117647,0.280255,0.165693,0.476498,0.121569,0.279574,0.170599,0.479997,0.12549,0.278826,0.17549,0.483397,0.129412,0.278012,0.180367,0.486697,0.133333,0.277134,0.185228,0.489898,0.137255,0.276194,0.190074,0.493001,0.141176,0.275191,0.194905,0.496005,0.145098,0.274128,0.199721,0.498911,0.14902,0.273006,0.20452,0.501721,0.152941,0.271828,0.209303,0.504434,0.156863,0.270595,0.214069,0.507052,0.160784,0.269308,0.218818,0.509577,0.164706,0.267968,0.223549,0.512008,0.168627,0.26658,0.228262,0.514349,0.172549,0.265145,0.232956,0.516599,0.176471,0.263663,0.237631,0.518762,0.180392,0.262138,0.242286,0.520837,0.184314,0.260571,0.246922,0.522828,0.188235,0.258965,0.251537,0.524736,0.192157,0.257322,0.25613,0.526563,0.196078,0.255645,0.260703,0.528312,0.2,0.253935,0.265254,0.529983,0.203922,0.252194,0.269783,0.531579,0.207843,0.250425,0.27429,0.533103,0.211765,0.248629,0.278775,0.534556,0.215686,0.246811,0.283237,0.535941,0.219608,0.244972,0.287675,0.53726,0.223529,0.243113,0.292092,0.538516,0.227451,0.241237,0.296485,0.539709,0.231373,0.239346,0.300855,0.540844,0.235294,0.237441,0.305202,0.541921,0.239216,0.235526,0.309527,0.542944,0.243137,0.233603,0.313828,0.543914,0.247059,0.231674,0.318106,0.544834,0.25098,0.229739,0.322361,0.545706,0.254902,0.227802,0.326594,0.546532,0.258824,0.225863,0.330805,0.547314,0.262745,0.223925,0.334994,0.548053,0.266667,0.221989,0.339161,0.548752,0.270588,0.220057,0.343307,0.549413,0.27451,0.21813,0.347432,0.550038,0.278431,0.21621,0.351535,0.550627,0.282353,0.214298,0.355619,0.551184,0.286275,0.212395,0.359683,0.55171,0.290196,0.210503,0.363727,0.552206,0.294118,0.208623,0.367752,0.552675,0.298039,0.206756,0.371758,0.553117,0.301961,0.204903,0.375746,0.553533,0.305882,0.203063,0.379716,0.553925,0.309804,0.201239,0.38367,0.554294,0.313725,0.19943,0.387607,0.554642,0.317647,0.197636,0.391528,0.554969,0.321569,0.19586,0.395433,0.555276,0.32549,0.1941,0.399323,0.555565,0.329412,0.192357,0.403199,0.555836,0.333333,0.190631,0.407061,0.556089,0.337255,0.188923,0.41091,0.556326,0.341176,0.187231,0.414746,0.556547,0.345098,0.185556,0.41857,0.556753,0.34902,0.183898,0.422383,0.556944,0.352941,0.182256,0.426184,0.55712,0.356863,0.180629,0.429975,0.557282,0.360784,0.179019,0.433756,0.55743,0.364706,0.177423,0.437527,0.557565,0.368627,0.175841,0.44129,0.557685,0.372549,0.174274,0.445044,0.557792,0.376471,0.172719,0.448791,0.557885,0.380392,0.171176,0.45253,0.557965,0.384314,0.169646,0.456262,0.55803,0.388235,0.168126,0.459988,0.558082,0.392157,0.166617,0.463708,0.558119,0.396078,0.165117,0.467423,0.558141,0.4,0.163625,0.471133,0.558148,0.403922,0.162142,0.474838,0.55814,0.407843,0.160665,0.47854,0.558115,0.411765,0.159194,0.482237,0.558073,0.415686,0.157729,0.485932,0.558013,0.419608,0.15627,0.489624,0.557936,0.423529,0.154815,0.493313,0.55784,0.427451,0.153364,0.497,0.557724,0.431373,0.151918,0.500685,0.557587,0.435294,0.150476,0.504369,0.55743,0.439216,0.149039,0.508051,0.55725,0.443137,0.147607,0.511733,0.557049,0.447059,0.14618,0.515413,0.556823,0.45098,0.144759,0.519093,0.556572,0.454902,0.143343,0.522773,0.556295,0.458824,0.141935,0.526453,0.555991,0.462745,0.140536,0.530132,0.555659,0.466667,0.139147,0.533812,0.555298,0.470588,0.13777,0.537492,0.554906,0.47451,0.136408,0.541173,0.554483,0.478431,0.135066,0.544853,0.554029,0.482353,0.133743,0.548535,0.553541,0.486275,0.132444,0.552216,0.553018,0.490196,0.131172,0.555899,0.552459,0.494118,0.129933,0.559582,0.551864,0.498039,0.128729,0.563265,0.551229,0.501961,0.127568,0.566949,0.550556,0.505882,0.126453,0.570633,0.549841,0.509804,0.125394,0.574318,0.549086,0.513725,0.124395,0.578002,0.548287,0.517647,0.123463,0.581687,0.547445,0.521569,0.122606,0.585371,0.546557,0.52549,0.121831,0.589055,0.545623,0.529412,0.121148,0.592739,0.544641,0.533333,0.120565,0.596422,0.543611,0.537255,0.120092,0.600104,0.54253,0.541176,0.119738,0.603785,0.5414,0.545098,0.119512,0.607464,0.540218,0.54902,0.119423,0.611141,0.538982,0.552941,0.119483,0.614817,0.537692,0.556863,0.119699,0.61849,0.536347,0.560784,0.120081,0.622161,0.534946,0.564706,0.120638,0.625828,0.533488,0.568627,0.12138,0.629492,0.531973,0.572549,0.122312,0.633153,0.530398,0.576471,0.123444,0.636809,0.528763,0.580392,0.12478,0.640461,0.527068,0.584314,0.126326,0.644107,0.525311,0.588235,0.128087,0.647749,0.523491,0.592157,0.130067,0.651384,0.521608,0.596078,0.132268,0.655014,0.519661,0.6,0.134692,0.658636,0.517649,0.603922,0.137339,0.662252,0.515571,0.607843,0.14021,0.665859,0.513427,0.611765,0.143303,0.669459,0.511215,0.615686,0.146616,0.67305,0.508936,0.619608,0.150148,0.676631,0.506589,0.623529,0.153894,0.680203,0.504172,0.627451,0.157851,0.683765,0.501686,0.631373,0.162016,0.687316,0.499129,0.635294,0.166383,0.690856,0.496502,0.639216,0.170948,0.694384,0.493803,0.643137,0.175707,0.6979,0.491033,0.647059,0.180653,0.701402,0.488189,0.65098,0.185783,0.704891,0.485273,0.654902,0.19109,0.708366,0.482284,0.658824,0.196571,0.711827,0.479221,0.662745,0.202219,0.715272,0.476084,0.666667,0.20803,0.718701,0.472873,0.670588,0.214,0.722114,0.469588,0.67451,0.220124,0.725509,0.466226,0.678431,0.226397,0.728888,0.462789,0.682353,0.232815,0.732247,0.459277,0.686275,0.239374,0.735588,0.455688,0.690196,0.24607,0.73891,0.452024,0.694118,0.252899,0.742211,0.448284,0.698039,0.259857,0.745492,0.444467,0.701961,0.266941,0.748751,0.440573,0.705882,0.274149,0.751988,0.436601,0.709804,0.281477,0.755203,0.432552,0.713725,0.288921,0.758394,0.428426,0.717647,0.296479,0.761561,0.424223,0.721569,0.304148,0.764704,0.419943,0.72549,0.311925,0.767822,0.415586,0.729412,0.319809,0.770914,0.411152,0.733333,0.327796,0.77398,0.40664,0.737255,0.335885,0.777018,0.402049,0.741176,0.344074,0.780029,0.397381,0.745098,0.35236,0.783011,0.392636,0.74902,0.360741,0.785964,0.387814,0.752941,0.369214,0.788888,0.382914,0.756863,0.377779,0.791781,0.377939,0.760784,0.386433,0.794644,0.372886,0.764706,0.395174,0.797475,0.367757,0.768627,0.404001,0.800275,0.362552,0.772549,0.412913,0.803041,0.357269,0.776471,0.421908,0.805774,0.35191,0.780392,0.430983,0.808473,0.346476,0.784314,0.440137,0.811138,0.340967,0.788235,0.449368,0.813768,0.335384,0.792157,0.458674,0.816363,0.329727,0.796078,0.468053,0.818921,0.323998,0.8,0.477504,0.821444,0.318195,0.803922,0.487026,0.823929,0.312321,0.807843,0.496615,0.826376,0.306377,0.811765,0.506271,0.828786,0.300362,0.815686,0.515992,0.831158,0.294279,0.819608,0.525776,0.833491,0.288127,0.823529,0.535621,0.835785,0.281908,0.827451,0.545524,0.838039,0.275626,0.831373,0.555484,0.840254,0.269281,0.835294,0.565498,0.84243,0.262877,0.839216,0.575563,0.844566,0.256415,0.843137,0.585678,0.846661,0.249897,0.847059,0.595839,0.848717,0.243329,0.85098,0.606045,0.850733,0.236712,0.854902,0.616293,0.852709,0.230052,0.858824,0.626579,0.854645,0.223353,0.862745,0.636902,0.856542,0.21662,0.866667,0.647257,0.8584,0.209861,0.870588,0.657642,0.860219,0.203082,0.87451,0.668054,0.861999,0.196293,0.878431,0.678489,0.863742,0.189503,0.882353,0.688944,0.865448,0.182725,0.886275,0.699415,0.867117,0.175971,0.890196,0.709898,0.868751,0.169257,0.894118,0.720391,0.87035,0.162603,0.898039,0.730889,0.871916,0.156029,0.901961,0.741388,0.873449,0.149561,0.905882,0.751884,0.874951,0.143228,0.909804,0.762373,0.876424,0.137064,0.913725,0.772852,0.877868,0.131109,0.917647,0.783315,0.879285,0.125405,0.921569,0.79376,0.880678,0.120005,0.92549,0.804182,0.882046,0.114965,0.929412,0.814576,0.883393,0.110347,0.933333,0.82494,0.88472,0.106217,0.937255,0.83527,0.886029,0.102646,0.941176,0.845561,0.887322,0.099702,0.945098,0.85581,0.888601,0.097452,0.94902,0.866013,0.889868,0.095953,0.952941,0.876168,0.891125,0.09525,0.956863,0.886271,0.892374,0.095374,0.960784,0.89632,0.893616,0.096335,0.964706,0.906311,0.894855,0.098125,0.968627,0.916242,0.896091,0.100717,0.972549,0.926106,0.89733,0.104071,0.976471,0.935904,0.89857,0.108131,0.980392,0.945636,0.899815,0.112838,0.984314,0.9553,0.901065,0.118128,0.988235,0.964894,0.902323,0.123941,0.992157,0.974417,0.90359,0.130215,0.996078,0.983868,0.904867,0.136897,1,0.993248,0.906157,0.143936]},{\"ShowIndexedColorActiveValues\":1,\"IndexedColors\":[0.07,0.5,0.7,1,1,1,0.85,1,1,0.8,0.5,1,0.76,1,0,1,0.71,0.71,0.5,0.5,0.5,0.05,0.05,1,1,0.05,0.05,0.7,1,1,0.7,0.89,0.96,0.67,0.36,0.95,0.54,1,0,0.75,0.65,0.65,0.5,0.6,0.6,1,0.5,0,1,1,0.19,0.12,0.94,0.12,0.5,0.82,0.89,0.56,0.25,0.83,0.24,1,0,0.9,0.9,0.9,0.75,0.76,0.78,0.65,0.65,0.67,0.54,0.6,0.78,0.61,0.48,0.78,0.5,0.48,0.78,0.44,0.48,0.78,0.36,0.48,0.76,1,0.48,0.38,0.49,0.5,0.69,0.76,0.56,0.56,0.4,0.56,0.56,0.74,0.5,0.89,1,0.63,0,0.65,0.16,0.16,0.36,0.72,0.82,0.44,0.18,0.69,0,1,0,0.58,1,1,0.58,0.88,0.88,0.45,0.76,0.79,0.33,0.71,0.71,0.23,0.62,0.62,0.14,0.56,0.56,0.04,0.49,0.55,0,0.41,0.52,0.88,0.88,1,1,0.85,0.56,0.65,0.46,0.45,0.4,0.5,0.5,0.62,0.39,0.71,0.83,0.48,0,0.58,0,0.58,0.26,0.62,0.69,0.34,0.09,0.56,0,0.79,0,0.44,0.83,1,1,1,0.78,0.85,1,0.78,0.78,1,0.78,0.64,1,0.78,0.56,1,0.78,0.38,1,0.78,0.27,1,0.78,0.19,1,0.78,0.12,1,0.78,0,1,0.61,0,0.9,0.46,0,0.83,0.32,0,0.75,0.22,0,0.67,0.14,0.3,0.76,1,0.3,0.65,1,0.13,0.58,0.84,0.15,0.49,0.67,0.15,0.4,0.59,0.09,0.33,0.53,0.96,0.93,0.82,0.8,0.82,0.12,0.71,0.71,0.76,0.65,0.33,0.3,0.34,0.35,0.38,0.62,0.31,0.71,0.67,0.36,0,0.46,0.31,0.27,0.26,0.51,0.59,0.26,0,0.4,0,0.49,0,0.44,0.67,0.98,0,0.73,1,0,0.63,1,0,0.56,1,0,0.5,1,0,0.42,1,0.33,0.36,0.95,0.47,0.36,0.89,0.54,0.31,0.89,0.63,0.21,0.83,0.7,0.12,0.83,0.7,0.12,0.73,0.7,0.05,0.65,0.74,0.05,0.53,0.78,0,0.4,0.8,0,0.35,0.82,0,0.31,0.85,0,0.27,0.88,0,0.22,0.9,0,0.18,0.91,0,0.15,0.92,0,0.14,0.93,0,0.13,0.94,0,0.12,0.95,0,0.11,0.96,0,0.1,0.97,0,0.09,0.98,0,0.08,0.99,0,0.07,1,0,0.06],\"Annotations\":[0,\"Xx\",1,\"H\",2,\"He\",3,\"Li\",4,\"Be\",5,\"B\",6,\"C\",7,\"N\",8,\"O\",9,\"F\",10,\"Ne\",11,\"Na\",12,\"Mg\",13,\"Al\",14,\"Si\",15,\"P\",16,\"S\",17,\"Cl\",18,\"Ar\",19,\"K\",20,\"Ca\",21,\"Sc\",22,\"Ti\",23,\"V\",24,\"Cr\",25,\"Mn\",26,\"Fe\",27,\"Co\",28,\"Ni\",29,\"Cu\",30,\"Zn\",31,\"Ga\",32,\"Ge\",33,\"As\",34,\"Se\",35,\"Br\",36,\"Kr\",37,\"Rb\",38,\"Sr\",39,\"Y\",40,\"Zr\",41,\"Nb\",42,\"Mo\",43,\"Tc\",44,\"Ru\",45,\"Rh\",46,\"Pd\",47,\"Ag\",48,\"Cd\",49,\"In\",50,\"Sn\",51,\"Sb\",52,\"Te\",53,\"I\",54,\"Xe\",55,\"Cs\",56,\"Ba\",57,\"La\",58,\"Ce\",59,\"Pr\",60,\"Nd\",61,\"Pm\",62,\"Sm\",63,\"Eu\",64,\"Gd\",65,\"Tb\",66,\"Dy\",67,\"Ho\",68,\"Er\",69,\"Tm\",70,\"Yb\",71,\"Lu\",72,\"Hf\",73,\"Ta\",74,\"W\",75,\"Re\",76,\"Os\",77,\"Ir\",78,\"Pt\",79,\"Au\",80,\"Hg\",81,\"Tl\",82,\"Pb\",83,\"Bi\",84,\"Po\",85,\"At\",86,\"Rn\",87,\"Fr\",88,\"Ra\",89,\"Ac\",90,\"Th\",91,\"Pa\",92,\"U\",93,\"Np\",94,\"Pu\",95,\"Am\",96,\"Cm\",97,\"Bk\",98,\"Cf\",99,\"Es\",100,\"Fm\",101,\"Md\",102,\"No\",103,\"Lr\",104,\"Rf\",105,\"Db\",106,\"Sg\",107,\"Bh\",108,\"Hs\",109,\"Mt\",110,\"Ds\",111,\"Rg\",112,\"Cn\",113,\"Uut\",114,\"Uuq\",115,\"Uup\",116,\"Uuh\",117,\"Uus\",118,\"Uuo\"],\"Name\":\"BlueObeliskElements\"}];\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/Constants.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/Constants.js ***! - \***************************************************************************************/ -/*! exports provided: ColorSpace, Scale, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ColorSpace\", function() { return ColorSpace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Scale\", function() { return Scale; });\nvar ColorSpace = {\n RGB: 0,\n HSV: 1,\n LAB: 2,\n DIVERGING: 3\n};\nvar Scale = {\n LINEAR: 0,\n LOG10: 1\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ColorSpace: ColorSpace,\n Scale: Scale\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/index.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/index.js ***! - \***********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_ScalarsToColors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/ScalarsToColors */ \"./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ColorTransferFunction_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ColorTransferFunction/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\nvar ColorSpace = vtk_js_Sources_Rendering_Core_ColorTransferFunction_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ColorSpace,\n Scale = vtk_js_Sources_Rendering_Core_ColorTransferFunction_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"].Scale;\nvar ScalarMappingTarget = vtk_js_Sources_Common_Core_ScalarsToColors__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ScalarMappingTarget;\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkDebugMacro,\n vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro,\n vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkWarningMacro; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\n/* eslint-disable no-continue */\n// Convert to and from a special polar version of CIELAB (useful for creating\n// continuous diverging color maps).\n\nfunction vtkColorTransferFunctionLabToMsh(lab, msh) {\n var L = lab[0];\n var a = lab[1];\n var b = lab[2];\n var M = Math.sqrt(L * L + a * a + b * b);\n var s = M > 0.001 ? Math.acos(L / M) : 0.0;\n var h = s > 0.001 ? Math.atan2(b, a) : 0.0;\n msh[0] = M;\n msh[1] = s;\n msh[2] = h;\n}\n\nfunction vtkColorTransferFunctionMshToLab(msh, lab) {\n var M = msh[0];\n var s = msh[1];\n var h = msh[2];\n lab[0] = M * Math.cos(s);\n lab[1] = M * Math.sin(s) * Math.cos(h);\n lab[2] = M * Math.sin(s) * Math.sin(h);\n} // For the case when interpolating from a saturated color to an unsaturated\n// color, find a hue for the unsaturated color that makes sense.\n\n\nfunction vtkColorTransferFunctionAdjustHue(msh, unsatM) {\n if (msh[0] >= unsatM - 0.1) {\n // The best we can do is hold hue constant.\n return msh[2];\n } // This equation is designed to make the perceptual change of the\n // interpolation to be close to constant.\n\n\n var hueSpin = msh[1] * Math.sqrt(unsatM * unsatM - msh[0] * msh[0]) / (msh[0] * Math.sin(msh[1])); // Spin hue away from 0 except in purple hues.\n\n if (msh[2] > -0.3 * Math.PI) {\n return msh[2] + hueSpin;\n }\n\n return msh[2] - hueSpin;\n}\n\nfunction vtkColorTransferFunctionAngleDiff(a1, a2) {\n var adiff = a1 - a2;\n\n if (adiff < 0.0) {\n adiff = -adiff;\n }\n\n while (adiff >= 2.0 * Math.PI) {\n adiff -= 2.0 * Math.PI;\n }\n\n if (adiff > Math.PI) {\n adiff = 2.0 * Math.PI - adiff;\n }\n\n return adiff;\n} // Interpolate a diverging color map.\n\n\nfunction vtkColorTransferFunctionInterpolateDiverging(s, rgb1, rgb2, result) {\n var lab1 = [];\n var lab2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2lab\"](rgb1, lab1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2lab\"](rgb2, lab2);\n var msh1 = [];\n var msh2 = [];\n vtkColorTransferFunctionLabToMsh(lab1, msh1);\n vtkColorTransferFunctionLabToMsh(lab2, msh2); // If the endpoints are distinct saturated colors, then place white in between\n // them.\n\n var localS = s;\n\n if (msh1[1] > 0.05 && msh2[1] > 0.05 && vtkColorTransferFunctionAngleDiff(msh1[2], msh2[2]) > 0.33 * Math.PI) {\n // Insert the white midpoint by setting one end to white and adjusting the\n // scalar value.\n var Mmid = Math.max(msh1[0], msh2[0]);\n Mmid = Math.max(88.0, Mmid);\n\n if (s < 0.5) {\n msh2[0] = Mmid;\n msh2[1] = 0.0;\n msh2[2] = 0.0;\n localS *= 2.0;\n } else {\n msh1[0] = Mmid;\n msh1[1] = 0.0;\n msh1[2] = 0.0;\n localS = 2.0 * localS - 1.0;\n }\n } // If one color has no saturation, then its hue value is invalid. In this\n // case, we want to set it to something logical so that the interpolation of\n // hue makes sense.\n\n\n if (msh1[1] < 0.05 && msh2[1] > 0.05) {\n msh1[2] = vtkColorTransferFunctionAdjustHue(msh2, msh1[0]);\n } else if (msh2[1] < 0.05 && msh1[1] > 0.05) {\n msh2[2] = vtkColorTransferFunctionAdjustHue(msh1, msh2[0]);\n }\n\n var mshTmp = [];\n mshTmp[0] = (1 - localS) * msh1[0] + localS * msh2[0];\n mshTmp[1] = (1 - localS) * msh1[1] + localS * msh2[1];\n mshTmp[2] = (1 - localS) * msh1[2] + localS * msh2[2]; // Now convert back to RGB\n\n var labTmp = [];\n vtkColorTransferFunctionMshToLab(mshTmp, labTmp);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"lab2rgb\"](labTmp, result);\n} // ----------------------------------------------------------------------------\n// vtkColorTransferFunction methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkColorTransferFunction(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkColorTransferFunction'); // Return the number of points which specify this function\n\n publicAPI.getSize = function () {\n return model.nodes.length;\n }; //----------------------------------------------------------------------------\n // Add a point defined in RGB\n\n\n publicAPI.addRGBPoint = function (x, r, g, b) {\n return publicAPI.addRGBPointLong(x, r, g, b, 0.5, 0.0);\n }; //----------------------------------------------------------------------------\n // Add a point defined in RGB\n\n\n publicAPI.addRGBPointLong = function (x, r, g, b) {\n var midpoint = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0.5;\n var sharpness = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0.0;\n\n // Error check\n if (midpoint < 0.0 || midpoint > 1.0) {\n vtkErrorMacro('Midpoint outside range [0.0, 1.0]');\n return -1;\n }\n\n if (sharpness < 0.0 || sharpness > 1.0) {\n vtkErrorMacro('Sharpness outside range [0.0, 1.0]');\n return -1;\n } // remove any node already at this X location\n\n\n if (!model.allowDuplicateScalars) {\n publicAPI.removePoint(x);\n } // Create the new node\n\n\n var node = {\n x: x,\n r: r,\n g: g,\n b: b,\n midpoint: midpoint,\n sharpness: sharpness\n }; // Add it, then sort to get everything in order\n\n model.nodes.push(node);\n publicAPI.sortAndUpdateRange(); // We need to find the index of the node we just added in order\n // to return this value\n\n var i = 0;\n\n for (; i < model.nodes.length; i++) {\n if (model.nodes[i].x === x) {\n break;\n }\n } // If we didn't find it, something went horribly wrong so\n // return -1\n\n\n if (i < model.nodes.length) {\n return i;\n }\n\n return -1;\n }; //----------------------------------------------------------------------------\n // Add a point defined in HSV\n\n\n publicAPI.addHSVPoint = function (x, h, s, v) {\n return publicAPI.addHSVPointLong(x, h, s, v, 0.5, 0.0);\n }; //----------------------------------------------------------------------------\n // Add a point defined in HSV\n\n\n publicAPI.addHSVPointLong = function (x, h, s, v) {\n var midpoint = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0.5;\n var sharpness = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0.0;\n var rgb = [];\n var hsv = [h, s, v];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"hsv2rgb\"](hsv, rgb);\n return publicAPI.addRGBPoint(x, rgb[0], rgb[1], rgb[2], midpoint, sharpness);\n }; //----------------------------------------------------------------------------\n // Set nodes directly\n\n\n publicAPI.setNodes = function (nodes) {\n if (model.nodes !== nodes) {\n model.nodes = nodes;\n publicAPI.sortAndUpdateRange();\n }\n }; //----------------------------------------------------------------------------\n // Sort the vector in increasing order, then fill in\n // the Range\n\n\n publicAPI.sortAndUpdateRange = function () {\n model.nodes.sort(function (a, b) {\n return a.x - b.x;\n });\n var modifiedInvoked = publicAPI.updateRange(); // If range is updated, Modified() has been called, don't call it again.\n\n if (!modifiedInvoked) {\n publicAPI.modified();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.updateRange = function () {\n var oldRange = [2];\n oldRange[0] = model.mappingRange[0];\n oldRange[1] = model.mappingRange[1];\n var size = model.nodes.length;\n\n if (size) {\n model.mappingRange[0] = model.nodes[0].x;\n model.mappingRange[1] = model.nodes[size - 1].x;\n } else {\n model.mappingRange[0] = 0;\n model.mappingRange[1] = 0;\n } // If the range is the same, then no need to call Modified()\n\n\n if (oldRange[0] === model.mappingRange[0] && oldRange[1] === model.mappingRange[1]) {\n return false;\n }\n\n publicAPI.modified();\n return true;\n }; //----------------------------------------------------------------------------\n // Remove a point\n\n\n publicAPI.removePoint = function (x) {\n // First find the node since we need to know its\n // index as our return value\n var i = 0;\n\n for (; i < model.nodes.length; i++) {\n if (model.nodes[i].x === x) {\n break;\n }\n }\n\n var retVal = i; // If the node doesn't exist, we return -1\n\n if (i >= model.nodes.length) {\n return -1;\n } // If the first or last point has been removed, then we update the range\n // No need to sort here as the order of points hasn't changed.\n\n\n var modifiedInvoked = false;\n model.nodes.splice(i, 1);\n\n if (i === 0 || i === model.nodes.length) {\n modifiedInvoked = publicAPI.updateRange();\n }\n\n if (!modifiedInvoked) {\n publicAPI.modified();\n }\n\n return retVal;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.movePoint = function (oldX, newX) {\n if (oldX === newX) {\n // Nothing to do.\n return;\n }\n\n publicAPI.removePoint(newX);\n\n for (var i = 0; i < model.nodes.length; i++) {\n if (model.nodes[i].x === oldX) {\n model.nodes[i].x = newX;\n publicAPI.sortAndUpdateRange();\n break;\n }\n }\n }; //----------------------------------------------------------------------------\n // Remove all points\n\n\n publicAPI.removeAllPoints = function () {\n model.nodes = [];\n publicAPI.sortAndUpdateRange();\n }; //----------------------------------------------------------------------------\n // Add a line defined in RGB\n\n\n publicAPI.addRGBSegment = function (x1, r1, g1, b1, x2, r2, g2, b2) {\n // First, find all points in this range and remove them\n publicAPI.sortAndUpdateRange();\n\n for (var i = 0; i < model.nodes.length;) {\n if (model.nodes[i].x >= x1 && model.nodes[i].x <= x2) {\n model.nodes.splice(i, 1);\n } else {\n i++;\n }\n } // Now add the points\n\n\n publicAPI.addRGBPointLong(x1, r1, g1, b1, 0.5, 0.0);\n publicAPI.addRGBPointLong(x2, r2, g2, b2, 0.5, 0.0);\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n // Add a line defined in HSV\n\n\n publicAPI.addHSVSegment = function (x1, h1, s1, v1, x2, h2, s2, v2) {\n var hsv1 = [h1, s1, v1];\n var hsv2 = [h2, s2, v2];\n var rgb1 = [];\n var rgb2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"hsv2rgb\"](hsv1, rgb1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"hsv2rgb\"](hsv2, rgb2);\n publicAPI.addRGBSegment(x1, rgb1[0], rgb1[1], rgb1[2], x2, rgb2[0], rgb2[1], rgb2[2]);\n }; //----------------------------------------------------------------------------\n // Returns the RGBA color evaluated at the specified location\n\n\n publicAPI.mapValue = function (x) {\n var rgb = [];\n publicAPI.getColor(x, rgb);\n return [Math.floor(255.0 * rgb[0] + 0.5), Math.floor(255.0 * rgb[1] + 0.5), Math.floor(255.0 * rgb[2] + 0.5), 255];\n }; //----------------------------------------------------------------------------\n // Returns the RGB color evaluated at the specified location\n\n\n publicAPI.getColor = function (x, rgb) {\n if (model.indexedLookup) {\n var numNodes = publicAPI.getSize(); // todo\n\n var idx = publicAPI.getAnnotatedValueIndexInternal(x);\n\n if (idx < 0 || numNodes === 0) {\n publicAPI.getNanColor(rgb);\n } else {\n var nodeVal = [];\n publicAPI.getNodeValue(idx % numNodes, nodeVal);\n rgb[0] = nodeVal.r;\n rgb[1] = nodeVal.g;\n rgb[2] = nodeVal.b;\n }\n\n return;\n }\n\n publicAPI.getTable(x, x, 1, rgb);\n }; //----------------------------------------------------------------------------\n // Returns the red color evaluated at the specified location\n\n\n publicAPI.getRedValue = function (x) {\n var rgb = [];\n publicAPI.getColor(x, rgb);\n return rgb[0];\n }; //----------------------------------------------------------------------------\n // Returns the green color evaluated at the specified location\n\n\n publicAPI.getGreenValue = function (x) {\n var rgb = [];\n publicAPI.getColor(x, rgb);\n return rgb[1];\n }; //----------------------------------------------------------------------------\n // Returns the blue color evaluated at the specified location\n\n\n publicAPI.getBlueValue = function (x) {\n var rgb = [];\n publicAPI.getColor(x, rgb);\n return rgb[2];\n }; //----------------------------------------------------------------------------\n // Returns a table of RGB colors at regular intervals along the function\n\n\n publicAPI.getTable = function (xStart, xEnd, size, table) {\n // Special case: If either the start or end is a NaN, then all any\n // interpolation done on them is also a NaN. Therefore, fill the table with\n // the NaN color.\n if (vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"isNan\"](xStart) || vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"isNan\"](xEnd)) {\n for (var i = 0; i < size; i++) {\n table[i * 3 + 0] = model.nanColor[0];\n table[i * 3 + 1] = model.nanColor[1];\n table[i * 3 + 2] = model.nanColor[2];\n }\n\n return;\n }\n\n var idx = 0;\n var numNodes = model.nodes.length; // Need to keep track of the last value so that\n // we can fill in table locations past this with\n // this value if Clamping is On.\n\n var lastR = 0.0;\n var lastG = 0.0;\n var lastB = 0.0;\n\n if (numNodes !== 0) {\n lastR = model.nodes[numNodes - 1].r;\n lastG = model.nodes[numNodes - 1].g;\n lastB = model.nodes[numNodes - 1].b;\n }\n\n var x = 0.0;\n var x1 = 0.0;\n var x2 = 0.0;\n var rgb1 = [0.0, 0.0, 0.0];\n var rgb2 = [0.0, 0.0, 0.0];\n var midpoint = 0.0;\n var sharpness = 0.0;\n var tmpVec = []; // If the scale is logarithmic, make sure the range is valid.\n\n var usingLogScale = model.scale === Scale.LOG10;\n\n if (usingLogScale) {\n // Note: This requires range[0] <= range[1].\n usingLogScale = model.mappingRange[0] > 0.0;\n }\n\n var logStart = 0.0;\n var logEnd = 0.0;\n var logX = 0.0;\n\n if (usingLogScale) {\n logStart = Math.log10(xStart);\n logEnd = Math.log10(xEnd);\n } // For each table entry\n\n\n for (var _i = 0; _i < size; _i++) {\n // Find our location in the table\n var tidx = 3 * _i; // Find our X location. If we are taking only 1 sample, make\n // it halfway between start and end (usually start and end will\n // be the same in this case)\n\n if (size > 1) {\n if (usingLogScale) {\n logX = logStart + _i / (size - 1.0) * (logEnd - logStart);\n x = Math.pow(10.0, logX);\n } else {\n x = xStart + _i / (size - 1.0) * (xEnd - xStart);\n }\n } else if (usingLogScale) {\n logX = 0.5 * (logStart + logEnd);\n x = Math.pow(10.0, logX);\n } else {\n x = 0.5 * (xStart + xEnd);\n } // Linearly map x from mappingRange to [0, numberOfValues-1],\n // discretize (round down to the closest integer),\n // then map back to mappingRange\n\n\n if (model.discretize) {\n var range = model.mappingRange;\n\n if (x >= range[0] && x <= range[1]) {\n var numberOfValues = model.numberOfValues;\n var deltaRange = range[1] - range[0];\n\n if (numberOfValues <= 1) {\n x = range[0] + deltaRange / 2.0;\n } else {\n // normalize x\n var xn = (x - range[0]) / deltaRange; // discretize\n\n var discretizeIndex = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"floor\"](numberOfValues * xn); // get discretized x\n\n x = range[0] + discretizeIndex / (numberOfValues - 1) * deltaRange;\n }\n }\n } // Do we need to move to the next node?\n\n\n while (idx < numNodes && x > model.nodes[idx].x) {\n idx++; // If we are at a valid point index, fill in\n // the value at this node, and the one before (the\n // two that surround our current sample location)\n // idx cannot be 0 since we just incremented it.\n\n if (idx < numNodes) {\n x1 = model.nodes[idx - 1].x;\n x2 = model.nodes[idx].x;\n\n if (usingLogScale) {\n x1 = Math.log10(x1);\n x2 = Math.log10(x2);\n }\n\n rgb1[0] = model.nodes[idx - 1].r;\n rgb2[0] = model.nodes[idx].r;\n rgb1[1] = model.nodes[idx - 1].g;\n rgb2[1] = model.nodes[idx].g;\n rgb1[2] = model.nodes[idx - 1].b;\n rgb2[2] = model.nodes[idx].b; // We only need the previous midpoint and sharpness\n // since these control this region\n\n midpoint = model.nodes[idx - 1].midpoint;\n sharpness = model.nodes[idx - 1].sharpness; // Move midpoint away from extreme ends of range to avoid\n // degenerate math\n\n if (midpoint < 0.00001) {\n midpoint = 0.00001;\n }\n\n if (midpoint > 0.99999) {\n midpoint = 0.99999;\n }\n }\n } // Are we at or past the end? If so, just use the last value\n\n\n if (x > model.mappingRange[1]) {\n table[tidx] = 0.0;\n table[tidx + 1] = 0.0;\n table[tidx + 2] = 0.0;\n\n if (model.clamping) {\n if (publicAPI.getUseAboveRangeColor()) {\n table[tidx] = model.aboveRangeColor[0];\n table[tidx + 1] = model.aboveRangeColor[1];\n table[tidx + 2] = model.aboveRangeColor[2];\n } else {\n table[tidx] = lastR;\n table[tidx + 1] = lastG;\n table[tidx + 2] = lastB;\n }\n }\n } else if (x < model.mappingRange[0] || vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"isInf\"](x) && x < 0) {\n // we are before the first node? If so, duplicate this node's values.\n // We have to deal with -inf here\n table[tidx] = 0.0;\n table[tidx + 1] = 0.0;\n table[tidx + 2] = 0.0;\n\n if (model.clamping) {\n if (publicAPI.getUseBelowRangeColor()) {\n table[tidx] = model.belowRangeColor[0];\n table[tidx + 1] = model.belowRangeColor[1];\n table[tidx + 2] = model.belowRangeColor[2];\n } else if (numNodes > 0) {\n table[tidx] = model.nodes[0].r;\n table[tidx + 1] = model.nodes[0].g;\n table[tidx + 2] = model.nodes[0].b;\n }\n }\n } else if (idx === 0 && (Math.abs(x - xStart) < 1e-6 || model.discretize)) {\n if (numNodes > 0) {\n table[tidx] = model.nodes[0].r;\n table[tidx + 1] = model.nodes[0].g;\n table[tidx + 2] = model.nodes[0].b;\n } else {\n table[tidx] = 0.0;\n table[tidx + 1] = 0.0;\n table[tidx + 2] = 0.0;\n }\n } else {\n // OK, we are between two nodes - interpolate\n // Our first attempt at a normalized location [0,1] -\n // we will be modifying this based on midpoint and\n // sharpness to get the curve shape we want and to have\n // it pass through (y1+y2)/2 at the midpoint.\n var s = 0.0;\n\n if (usingLogScale) {\n s = (logX - x1) / (x2 - x1);\n } else {\n s = (x - x1) / (x2 - x1);\n } // Readjust based on the midpoint - linear adjustment\n\n\n if (s < midpoint) {\n s = 0.5 * s / midpoint;\n } else {\n s = 0.5 + 0.5 * (s - midpoint) / (1.0 - midpoint);\n } // override for sharpness > 0.99\n // In this case we just want piecewise constant\n\n\n if (sharpness > 0.99) {\n // Use the first value since we are below the midpoint\n if (s < 0.5) {\n table[tidx] = rgb1[0];\n table[tidx + 1] = rgb1[1];\n table[tidx + 2] = rgb1[2];\n continue;\n } else {\n // Use the second value at or above the midpoint\n table[tidx] = rgb2[0];\n table[tidx + 1] = rgb2[1];\n table[tidx + 2] = rgb2[2];\n continue;\n }\n } // Override for sharpness < 0.01\n // In this case we want piecewise linear\n\n\n if (sharpness < 0.01) {\n // Simple linear interpolation\n if (model.colorSpace === ColorSpace.RGB) {\n table[tidx] = (1 - s) * rgb1[0] + s * rgb2[0];\n table[tidx + 1] = (1 - s) * rgb1[1] + s * rgb2[1];\n table[tidx + 2] = (1 - s) * rgb1[2] + s * rgb2[2];\n } else if (model.colorSpace === ColorSpace.HSV) {\n var hsv1 = [];\n var hsv2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2hsv\"](rgb1, hsv1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2hsv\"](rgb2, hsv2);\n\n if (model.hSVWrap && (hsv1[0] - hsv2[0] > 0.5 || hsv2[0] - hsv1[0] > 0.5)) {\n if (hsv1[0] > hsv2[0]) {\n hsv1[0] -= 1.0;\n } else {\n hsv2[0] -= 1.0;\n }\n }\n\n var hsvTmp = [];\n hsvTmp[0] = (1.0 - s) * hsv1[0] + s * hsv2[0];\n\n if (hsvTmp[0] < 0.0) {\n hsvTmp[0] += 1.0;\n }\n\n hsvTmp[1] = (1.0 - s) * hsv1[1] + s * hsv2[1];\n hsvTmp[2] = (1.0 - s) * hsv1[2] + s * hsv2[2]; // Now convert this back to RGB\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"hsv2rgb\"](hsvTmp, tmpVec);\n table[tidx] = tmpVec[0];\n table[tidx + 1] = tmpVec[1];\n table[tidx + 2] = tmpVec[2];\n } else if (model.colorSpace === ColorSpace.LAB) {\n var lab1 = [];\n var lab2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2lab\"](rgb1, lab1);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2lab\"](rgb2, lab2);\n var labTmp = [];\n labTmp[0] = (1 - s) * lab1[0] + s * lab2[0];\n labTmp[1] = (1 - s) * lab1[1] + s * lab2[1];\n labTmp[2] = (1 - s) * lab1[2] + s * lab2[2]; // Now convert back to RGB\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"lab2rgb\"](labTmp, tmpVec);\n table[tidx] = tmpVec[0];\n table[tidx + 1] = tmpVec[1];\n table[tidx + 2] = tmpVec[2];\n } else if (model.colorSpace === ColorSpace.DIVERGING) {\n vtkColorTransferFunctionInterpolateDiverging(s, rgb1, rgb2, tmpVec);\n table[tidx] = tmpVec[0];\n table[tidx + 1] = tmpVec[1];\n table[tidx + 2] = tmpVec[2];\n } else {\n vtkErrorMacro('ColorSpace set to invalid value.', model.colorSpace);\n }\n\n continue;\n } // We have a sharpness between [0.01, 0.99] - we will\n // used a modified hermite curve interpolation where we\n // derive the slope based on the sharpness, and we compress\n // the curve non-linearly based on the sharpness\n // First, we will adjust our position based on sharpness in\n // order to make the curve sharper (closer to piecewise constant)\n\n\n if (s < 0.5) {\n s = 0.5 * Math.pow(s * 2.0, 1.0 + 10.0 * sharpness);\n } else if (s > 0.5) {\n s = 1.0 - 0.5 * Math.pow((1.0 - s) * 2, 1 + 10.0 * sharpness);\n } // Compute some coefficients we will need for the hermite curve\n\n\n var ss = s * s;\n var sss = ss * s;\n var h1 = 2.0 * sss - 3 * ss + 1;\n var h2 = -2 * sss + 3 * ss;\n var h3 = sss - 2 * ss + s;\n var h4 = sss - ss;\n var slope = void 0;\n var t = void 0;\n\n if (model.colorSpace === ColorSpace.RGB) {\n for (var j = 0; j < 3; j++) {\n // Use one slope for both end points\n slope = rgb2[j] - rgb1[j];\n t = (1.0 - sharpness) * slope; // Compute the value\n\n table[tidx + j] = h1 * rgb1[j] + h2 * rgb2[j] + h3 * t + h4 * t;\n }\n } else if (model.colorSpace === ColorSpace.HSV) {\n var _hsv = [];\n var _hsv2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2hsv\"](rgb1, _hsv);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2hsv\"](rgb2, _hsv2);\n\n if (model.hSVWrap && (_hsv[0] - _hsv2[0] > 0.5 || _hsv2[0] - _hsv[0] > 0.5)) {\n if (_hsv[0] > _hsv2[0]) {\n _hsv[0] -= 1.0;\n } else {\n _hsv2[0] -= 1.0;\n }\n }\n\n var _hsvTmp = [];\n\n for (var _j = 0; _j < 3; _j++) {\n // Use one slope for both end points\n slope = _hsv2[_j] - _hsv[_j];\n t = (1.0 - sharpness) * slope; // Compute the value\n\n _hsvTmp[_j] = h1 * _hsv[_j] + h2 * _hsv2[_j] + h3 * t + h4 * t;\n\n if (_j === 0 && _hsvTmp[_j] < 0.0) {\n _hsvTmp[_j] += 1.0;\n }\n } // Now convert this back to RGB\n\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"hsv2rgb\"](_hsvTmp, tmpVec);\n table[tidx] = tmpVec[0];\n table[tidx + 1] = tmpVec[1];\n table[tidx + 2] = tmpVec[2];\n } else if (model.colorSpace === ColorSpace.LAB) {\n var _lab = [];\n var _lab2 = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2lab\"](rgb1, _lab);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"rgb2lab\"](rgb2, _lab2);\n var _labTmp = [];\n\n for (var _j2 = 0; _j2 < 3; _j2++) {\n // Use one slope for both end points\n slope = _lab2[_j2] - _lab[_j2];\n t = (1.0 - sharpness) * slope; // Compute the value\n\n _labTmp[_j2] = h1 * _lab[_j2] + h2 * _lab2[_j2] + h3 * t + h4 * t;\n } // Now convert this back to RGB\n\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"lab2rgb\"](_labTmp, tmpVec);\n table[tidx] = tmpVec[0];\n table[tidx + 1] = tmpVec[1];\n table[tidx + 2] = tmpVec[2];\n } else if (model.colorSpace === ColorSpace.DIVERGING) {\n // I have not implemented proper interpolation by a hermite curve for\n // the diverging color map, but I cannot think of a good use case for\n // that anyway.\n vtkColorTransferFunctionInterpolateDiverging(s, rgb1, rgb2, tmpVec);\n table[tidx] = tmpVec[0];\n table[tidx + 1] = tmpVec[1];\n table[tidx + 2] = tmpVec[2];\n } else {\n vtkErrorMacro('ColorSpace set to invalid value.');\n } // Final error check to make sure we don't go outside [0,1]\n\n\n for (var _j3 = 0; _j3 < 3; _j3++) {\n table[tidx + _j3] = table[tidx + _j3] < 0.0 ? 0.0 : table[tidx + _j3];\n table[tidx + _j3] = table[tidx + _j3] > 1.0 ? 1.0 : table[tidx + _j3];\n }\n }\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getUint8Table = function (xStart, xEnd, size) {\n var withAlpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n if (publicAPI.getMTime() <= model.buildTime && model.tableSize === size && model.tableWithAlpha !== withAlpha) {\n return model.table;\n }\n\n if (model.nodes.length === 0) {\n vtkErrorMacro('Attempting to lookup a value with no points in the function');\n return model.table;\n }\n\n var nbChannels = withAlpha ? 4 : 3;\n\n if (model.tableSize !== size || model.tableWithAlpha !== withAlpha) {\n model.table = new Uint8Array(size * nbChannels);\n model.tableSize = size;\n model.tableWithAlpha = withAlpha;\n }\n\n var tmpTable = [];\n publicAPI.getTable(xStart, xEnd, size, tmpTable);\n\n for (var i = 0; i < size; i++) {\n model.table[i * nbChannels + 0] = Math.floor(tmpTable[i * 3 + 0] * 255.0 + 0.5);\n model.table[i * nbChannels + 1] = Math.floor(tmpTable[i * 3 + 1] * 255.0 + 0.5);\n model.table[i * nbChannels + 2] = Math.floor(tmpTable[i * 3 + 2] * 255.0 + 0.5);\n\n if (withAlpha) {\n model.table[i * nbChannels + 3] = 255;\n }\n }\n\n model.buildTime.modified();\n return model.table;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.buildFunctionFromTable = function (xStart, xEnd, size, table) {\n var inc = 0.0;\n publicAPI.removeAllPoints();\n\n if (size > 1) {\n inc = (xEnd - xStart) / (size - 1.0);\n }\n\n for (var i = 0; i < size; i++) {\n var node = {\n x: xStart + inc * i,\n r: table[i * 3],\n g: table[i * 3 + 1],\n b: table[i * 3 + 2],\n sharpness: 0.0,\n midpoint: 0.5\n };\n model.nodes.push(node);\n }\n\n publicAPI.sortAndUpdateRange();\n }; //----------------------------------------------------------------------------\n // For a specified index value, get the node parameters\n\n\n publicAPI.getNodeValue = function (index, val) {\n if (index < 0 || index >= model.nodes.length) {\n vtkErrorMacro('Index out of range!');\n return -1;\n }\n\n val[0] = model.nodes[index].x;\n val[1] = model.nodes[index].r;\n val[2] = model.nodes[index].g;\n val[3] = model.nodes[index].b;\n val[4] = model.nodes[index].midpoint;\n val[5] = model.nodes[index].sharpness;\n return 1;\n }; //----------------------------------------------------------------------------\n // For a specified index value, get the node parameters\n\n\n publicAPI.setNodeValue = function (index, val) {\n if (index < 0 || index >= model.nodes.length) {\n vtkErrorMacro('Index out of range!');\n return -1;\n }\n\n var oldX = model.nodes[index].x;\n model.nodes[index].x = val[0];\n model.nodes[index].r = val[1];\n model.nodes[index].g = val[2];\n model.nodes[index].b = val[3];\n model.nodes[index].midpoint = val[4];\n model.nodes[index].sharpness = val[5];\n\n if (oldX !== val[0]) {\n // The point has been moved, the order of points or the range might have\n // been modified.\n publicAPI.sortAndUpdateRange(); // No need to call Modified() here because SortAndUpdateRange() has done it\n // already.\n } else {\n publicAPI.modified();\n }\n\n return 1;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getNumberOfAvailableColors = function () {\n if (model.indexedLookup && publicAPI.getSize()) {\n return publicAPI.getSize();\n }\n\n if (model.tableSize) {\n // Not sure if this is correct since it is only set if\n // \"const unsigned char *::GetTable(double xStart, double xEnd,int size)\"\n // has been called.\n return model.tableSize;\n }\n\n return 16777216; // 2^24\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getIndexedColor = function (idx, rgba) {\n var n = publicAPI.getSize();\n\n if (n > 0 && idx >= 0) {\n var nodeValue = [];\n publicAPI.getNodeValue(idx % n, nodeValue);\n\n for (var j = 0; j < 3; ++j) {\n rgba[j] = nodeValue[j + 1];\n }\n\n rgba[3] = 1.0; // NodeColor is RGB-only.\n\n return;\n }\n\n publicAPI.getNanColor(rgba);\n rgba[3] = 1.0; // NanColor is RGB-only.\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.fillFromDataPointer = function (nb, ptr) {\n if (nb <= 0 || !ptr) {\n return;\n }\n\n publicAPI.removeAllPoints();\n\n for (var i = 0; i < nb; i++) {\n publicAPI.addRGBPoint(ptr[i * 4], ptr[i * 4 + 1], ptr[i * 4 + 2], ptr[i * 4 + 3]);\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.setMappingRange = function (min, max) {\n var range = [min, max];\n var originalRange = publicAPI.getRange();\n\n if (originalRange[1] === range[1] && originalRange[0] === range[0]) {\n return;\n }\n\n if (range[1] === range[0]) {\n vtkErrorMacro('attempt to set zero width color range');\n return;\n }\n\n var scale = (range[1] - range[0]) / (originalRange[1] - originalRange[0]);\n var shift = range[0] - originalRange[0] * scale;\n\n for (var i = 0; i < model.nodes.length; ++i) {\n model.nodes[i].x = model.nodes[i].x * scale + shift;\n }\n\n model.mappingRange[0] = range[0];\n model.mappingRange[1] = range[1];\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.adjustRange = function (range) {\n var functionRange = publicAPI.getRange(); // Make sure we have points at each end of the range\n\n var rgb = [];\n\n if (functionRange[0] < range[0]) {\n publicAPI.getColor(range[0], rgb);\n publicAPI.addRGBPoint(range[0], rgb[0], rgb[1], rgb[2]);\n } else {\n publicAPI.getColor(functionRange[0], rgb);\n publicAPI.addRGBPoint(range[0], rgb[0], rgb[1], rgb[2]);\n }\n\n if (functionRange[1] > range[1]) {\n publicAPI.getColor(range[1], rgb);\n publicAPI.addRGBPoint(range[1], rgb[0], rgb[1], rgb[2]);\n } else {\n publicAPI.getColor(functionRange[1], rgb);\n publicAPI.addRGBPoint(range[1], rgb[0], rgb[1], rgb[2]);\n } // Remove all points out-of-range\n\n\n publicAPI.sortAndUpdateRange();\n\n for (var i = 0; i < model.nodes.length;) {\n if (model.nodes[i].x >= range[0] && model.nodes[i].x <= range[1]) {\n model.nodes.splice(i, 1);\n } else {\n ++i;\n }\n }\n\n return 1;\n }; //--------------------------------------------------------------------------\n\n\n publicAPI.estimateMinNumberOfSamples = function (x1, x2) {\n var d = publicAPI.findMinimumXDistance();\n return Math.ceil((x2 - x1) / d);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.findMinimumXDistance = function () {\n if (model.nodes.length < 2) {\n return -1.0;\n }\n\n var distance = Number.MAX_VALUE;\n\n for (var i = 0; i < model.nodes.length - 1; i++) {\n var currentDist = model.nodes[i + 1].x - model.nodes[i].x;\n\n if (currentDist < distance) {\n distance = currentDist;\n }\n }\n\n return distance;\n };\n\n publicAPI.mapScalarsThroughTable = function (input, output, outFormat, inputOffset) {\n if (publicAPI.getSize() === 0) {\n vtkDebugMacro('Transfer Function Has No Points!');\n return;\n }\n\n if (model.indexedLookup) {\n publicAPI.mapDataIndexed(input, output, outFormat, inputOffset);\n } else {\n publicAPI.mapData(input, output, outFormat, inputOffset);\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.mapData = function (input, output, outFormat, inputOffset) {\n if (publicAPI.getSize() === 0) {\n vtkWarningMacro('Transfer Function Has No Points!');\n return;\n }\n\n var alpha = Math.floor(publicAPI.getAlpha() * 255.0 + 0.5);\n var length = input.getNumberOfTuples();\n var inIncr = input.getNumberOfComponents();\n var outputV = output.getData();\n var inputV = input.getData();\n var rgb = [];\n\n if (outFormat === ScalarMappingTarget.RGBA) {\n for (var i = 0; i < length; i++) {\n var x = inputV[i * inIncr + inputOffset];\n publicAPI.getColor(x, rgb);\n outputV[i * 4] = Math.floor(rgb[0] * 255.0 + 0.5);\n outputV[i * 4 + 1] = Math.floor(rgb[1] * 255.0 + 0.5);\n outputV[i * 4 + 2] = Math.floor(rgb[2] * 255.0 + 0.5);\n outputV[i * 4 + 3] = alpha;\n }\n }\n\n if (outFormat === ScalarMappingTarget.RGB) {\n for (var _i2 = 0; _i2 < length; _i2++) {\n var _x = inputV[_i2 * inIncr + inputOffset];\n publicAPI.getColor(_x, rgb);\n outputV[_i2 * 3] = Math.floor(rgb[0] * 255.0 + 0.5);\n outputV[_i2 * 3 + 1] = Math.floor(rgb[1] * 255.0 + 0.5);\n outputV[_i2 * 3 + 2] = Math.floor(rgb[2] * 255.0 + 0.5);\n }\n }\n\n if (outFormat === ScalarMappingTarget.LUMINANCE) {\n for (var _i3 = 0; _i3 < length; _i3++) {\n var _x2 = inputV[_i3 * inIncr + inputOffset];\n publicAPI.getColor(_x2, rgb);\n outputV[_i3] = Math.floor(rgb[0] * 76.5 + rgb[1] * 150.45 + rgb[2] * 28.05 + 0.5);\n }\n }\n\n if (outFormat === ScalarMappingTarget.LUMINANCE_ALPHA) {\n for (var _i4 = 0; _i4 < length; _i4++) {\n var _x3 = inputV[_i4 * inIncr + inputOffset];\n publicAPI.getColor(_x3, rgb);\n outputV[_i4 * 2] = Math.floor(rgb[0] * 76.5 + rgb[1] * 150.45 + rgb[2] * 28.05 + 0.5);\n outputV[_i4 * 2 + 1] = alpha;\n }\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.applyColorMap = function (colorMap) {\n if (colorMap.ColorSpace) {\n model.colorSpace = ColorSpace[colorMap.ColorSpace.toUpperCase()];\n\n if (model.colorSpace === undefined) {\n vtkErrorMacro(\"ColorSpace \".concat(colorMap.ColorSpace, \" not supported, using RGB instead\"));\n model.colorSpace = ColorSpace.RGB;\n }\n }\n\n if (colorMap.NanColor) {\n model.nanColor = [].concat(colorMap.NanColor);\n\n while (model.nanColor.length < 4) {\n model.nanColor.push(1.0);\n }\n }\n\n if (colorMap.RGBPoints) {\n var size = colorMap.RGBPoints.length;\n model.nodes = [];\n var midpoint = 0.5;\n var sharpness = 0.0;\n\n for (var i = 0; i < size; i += 4) {\n model.nodes.push({\n x: colorMap.RGBPoints[i],\n r: colorMap.RGBPoints[i + 1],\n g: colorMap.RGBPoints[i + 2],\n b: colorMap.RGBPoints[i + 3],\n midpoint: midpoint,\n sharpness: sharpness\n });\n }\n } // FIXME: not supported ?\n // if (colorMap.IndexedColors) {\n // }\n // if (colorMap.Annotations) {\n // }\n\n\n publicAPI.sortAndUpdateRange();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n clamping: true,\n colorSpace: ColorSpace.RGB,\n hSVWrap: true,\n scale: Scale.LINEAR,\n nanColor: null,\n belowRangeColor: null,\n aboveRangeColor: null,\n useAboveRangeColor: false,\n useBelowRangeColor: false,\n allowDuplicateScalars: false,\n table: null,\n tableSize: 0,\n buildTime: null,\n nodes: null,\n discretize: false,\n numberOfValues: 256\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Common_Core_ScalarsToColors__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues); // Internal objects initialization\n\n model.table = [];\n model.nodes = [];\n model.nanColor = [0.5, 0.0, 0.0, 1.0];\n model.belowRangeColor = [0.0, 0.0, 0.0, 1.0];\n model.aboveRangeColor = [1.0, 1.0, 1.0, 1.0];\n model.buildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.buildTime); // Create get-only macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['buildTime', 'mappingRange']); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['useAboveRangeColor', 'useBelowRangeColor', 'colorSpace', 'discretize', 'numberOfValues']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setArray(publicAPI, model, ['nanColor', 'belowRangeColor', 'aboveRangeColor'], 4); // Create get macros for array\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['nanColor', 'belowRangeColor', 'aboveRangeColor']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkColorTransferFunction(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkColorTransferFunction'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_Core_ColorTransferFunction_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/Constants.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/Constants.js ***! - \****************************************************************************/ -/*! exports provided: Coordinate, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Coordinate\", function() { return Coordinate; });\nvar Coordinate = {\n DISPLAY: 0,\n NORMALIZED_DISPLAY: 1,\n VIEWPORT: 2,\n NORMALIZED_VIEWPORT: 3,\n PROJECTION: 4,\n VIEW: 5,\n WORLD: 6\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n Coordinate: Coordinate\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/index.js ***! - \************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Coordinate_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Coordinate/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\nvar Coordinate = vtk_js_Sources_Rendering_Core_Coordinate_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Coordinate;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkActor methods\n// ----------------------------------------------------------------------------\n\nfunction vtkCoordinate(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkCoordinate');\n\n publicAPI.setValue = function () {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return false;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var array = args; // allow an array passed as a single arg.\n\n if (array.length === 1 && Array.isArray(array[0])) {\n array = array[0];\n }\n\n if (array.length === 2) {\n publicAPI.setValue(array[0], array[1], 0.0);\n return true;\n }\n\n if (array.length !== 3) {\n throw new RangeError('Invalid number of values for array setter');\n }\n\n var changeDetected = false;\n model.value.forEach(function (item, index) {\n if (item !== array[index]) {\n if (changeDetected) {\n return;\n }\n\n changeDetected = true;\n }\n });\n\n if (changeDetected) {\n model.value = [].concat(array);\n publicAPI.modified();\n }\n\n return true;\n };\n\n publicAPI.setCoordinateSystemToDisplay = function () {\n publicAPI.setCoordinateSystem(Coordinate.DISPLAY);\n };\n\n publicAPI.setCoordinateSystemToNormalizedDisplay = function () {\n publicAPI.setCoordinateSystem(Coordinate.NORMALIZED_DISPLAY);\n };\n\n publicAPI.setCoordinateSystemToViewport = function () {\n publicAPI.setCoordinateSystem(Coordinate.VIEWPORT);\n };\n\n publicAPI.setCoordinateSystemToNormalizedViewport = function () {\n publicAPI.setCoordinateSystem(Coordinate.NORMALIZED_VIEWPORT);\n };\n\n publicAPI.setCoordinateSystemToProjection = function () {\n publicAPI.setCoordinateSystem(Coordinate.PROJECTION);\n };\n\n publicAPI.setCoordinateSystemToView = function () {\n publicAPI.setCoordinateSystem(Coordinate.VIEW);\n };\n\n publicAPI.setCoordinateSystemToWorld = function () {\n publicAPI.setCoordinateSystem(Coordinate.WORLD);\n };\n\n publicAPI.getCoordinateSystemAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(Coordinate, model.coordinateSystem);\n };\n\n publicAPI.getComputedWorldValue = function (ren) {\n var val = model.computedWorldValue;\n\n if (model.computing) {\n return val;\n }\n\n model.computing = 1;\n val[0] = model.value[0];\n val[1] = model.value[1];\n val[2] = model.value[2]; // Use our renderer if is defined\n\n var renderer = ren;\n\n if (model.renderer) {\n renderer = model.renderer;\n }\n\n if (!renderer) {\n if (model.coordinateSystem === Coordinate.WORLD) {\n if (model.referenceCoordinate) {\n var refValue = model.referenceCoordinate.getComputedWorldValue(renderer);\n val[0] += refValue[0];\n val[1] += refValue[1];\n val[2] += refValue[2];\n }\n\n model.computing = 0;\n } else {\n vtkErrorMacro('Attempt to compute world coordinates from another coordinate system without a renderer');\n }\n\n return val;\n } // convert to current coordinate system\n\n\n var view = null;\n\n if (renderer && renderer.getRenderWindow().getViews()) {\n view = renderer.getRenderWindow().getViews()[0];\n } else {\n return model.computedWorldValue;\n }\n\n var dims = view.getViewportSize(renderer);\n var aspect = dims[0] / dims[1];\n\n if (model.referenceCoordinate && model.coordinateSystem !== Coordinate.WORLD) {\n var fval = model.referenceCoordinate.getComputedDoubleDisplayValue(renderer);\n var _refValue = [fval[0], fval[1], 0.0];\n\n switch (model.coordinateSystem) {\n case Coordinate.NORMALIZED_DISPLAY:\n _refValue = view.displayToNormalizedDisplay(_refValue[0], _refValue[1], _refValue[2]);\n break;\n\n case Coordinate.VIEWPORT:\n _refValue = view.displayToNormalizedDisplay(_refValue[0], _refValue[1], _refValue[2]);\n _refValue = view.normalizedDisplayToViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n break;\n\n case Coordinate.NORMALIZED_VIEWPORT:\n _refValue = view.displayToNormalizedDisplay(_refValue[0], _refValue[1], _refValue[2]);\n _refValue = view.normalizedDisplayToViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n _refValue = view.viewportToNormalizedViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n break;\n\n case Coordinate.PROJECTION:\n _refValue = view.displayToNormalizedDisplay(_refValue[0], _refValue[1], _refValue[2]);\n _refValue = view.normalizedDisplayToViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n _refValue = view.viewportToNormalizedViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n _refValue = renderer.normalizedViewportToProjection(_refValue[0], _refValue[1], _refValue[2]);\n break;\n\n case Coordinate.VIEW:\n _refValue = view.displayToNormalizedDisplay(_refValue[0], _refValue[1], _refValue[2]);\n _refValue = view.normalizedDisplayToViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n _refValue = view.viewportToNormalizedViewport(_refValue[0], _refValue[1], _refValue[2], renderer);\n _refValue = renderer.normalizedViewportToProjection(_refValue[0], _refValue[1], _refValue[2]);\n _refValue = renderer.projectionToView(_refValue[0], _refValue[1], _refValue[2], aspect);\n break;\n\n default:\n break;\n }\n\n val[0] += _refValue[0];\n val[1] += _refValue[1];\n val[2] += _refValue[2];\n }\n\n switch (model.coordinateSystem) {\n case Coordinate.DISPLAY:\n val = view.displayToNormalizedDisplay(val[0], val[1], val[2]);\n val = view.normalizedDisplayToViewport(val[0], val[1], val[2], renderer);\n val = view.viewportToNormalizedViewport(val[0], val[1], val[2], renderer);\n val = renderer.normalizedViewportToProjection(val[0], val[1], val[2]);\n val = renderer.projectionToView(val[0], val[1], val[2], aspect);\n val = renderer.viewToWorld(val[0], val[1], val[2]);\n break;\n\n case Coordinate.NORMALIZED_DISPLAY:\n val = view.normalizedDisplayToViewport(val[0], val[1], val[2], renderer);\n val = view.viewportToNormalizedViewport(val[0], val[1], val[2], renderer);\n val = renderer.normalizedViewportToProjection(val[0], val[1], val[2]);\n val = renderer.projectionToView(val[0], val[1], val[2], aspect);\n val = renderer.viewToWorld(val[0], val[1], val[2]);\n break;\n\n case Coordinate.VIEWPORT:\n val = view.viewportToNormalizedViewport(val[0], val[1], val[2], renderer);\n val = renderer.normalizedViewportToProjection(val[0], val[1], val[2]);\n val = renderer.projectionToView(val[0], val[1], val[2], aspect);\n val = renderer.viewToWorld(val[0], val[1], val[2]);\n break;\n\n case Coordinate.NORMALIZED_VIEWPORT:\n val = renderer.normalizedViewportToProjection(val[0], val[1], val[2]);\n val = renderer.projectionToView(val[0], val[1], val[2], aspect);\n val = renderer.viewToWorld(val[0], val[1], val[2]);\n break;\n\n case Coordinate.PROJECTION:\n val = renderer.projectionToView(val[0], val[1], val[2], aspect);\n val = renderer.viewToWorld(val[0], val[1], val[2]);\n break;\n\n case Coordinate.VIEW:\n val = renderer.viewToWorld(val[0], val[1], val[2]);\n break;\n\n default:\n break;\n }\n\n if (model.referenceCoordinate && model.coordinateSystem === Coordinate.WORLD) {\n var _refValue2 = publicAPI.getComputedWorldValue(renderer);\n\n val[0] += _refValue2[0];\n val[1] += _refValue2[1];\n val[2] += _refValue2[2];\n }\n\n model.computing = 0;\n model.computedWorldValue = val.slice(0);\n return val;\n };\n\n publicAPI.getComputedViewportValue = function (ren) {\n var f = publicAPI.getComputedDoubleViewportValue(ren);\n return [vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"round\"](f[0]), vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"round\"](f[1])];\n };\n\n publicAPI.getComputedDisplayValue = function (ren) {\n var val = publicAPI.getComputedDoubleDisplayValue(ren);\n return [vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"floor\"](val[0]), vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"floor\"](val[1])];\n };\n\n publicAPI.getComputedLocalDisplayValue = function (ren) {\n // Use our renderer if it is defined\n var renderer = ren;\n\n if (model.renderer) {\n renderer = model.renderer;\n }\n\n var val = publicAPI.getComputedDisplayValue(renderer);\n\n if (!renderer) {\n vtkErrorMacro('Attempt to convert to local display coordinates without a renderer');\n return val;\n }\n\n var view = null;\n\n if (renderer && renderer.getRenderWindow().getViews()) {\n view = renderer.getRenderWindow().getViews()[0];\n } else {\n return val;\n }\n\n val = view.displayToLocalDisplay(val[0], val[1], val[2]);\n return [vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"round\"](val[0]), vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"round\"](val[1])];\n };\n\n publicAPI.getComputedDoubleViewportValue = function (ren) {\n var renderer = ren;\n\n if (model.renderer) {\n renderer = model.renderer;\n }\n\n var val = publicAPI.getComputedDoubleDisplayValue(renderer);\n\n if (!renderer) {\n return val;\n }\n\n var view = null;\n\n if (renderer && renderer.getRenderWindow().getViews()) {\n view = renderer.getRenderWindow().getViews()[0];\n } else {\n return val;\n }\n\n val = view.displayToNormalizedDisplay(val[0], val[1], val[2]);\n val = view.normalizedDisplayToViewport(val[0], val[1], val[2], renderer);\n return [val[0], val[1]];\n };\n\n publicAPI.getComputedDoubleDisplayValue = function (ren) {\n if (model.computing) {\n return model.computedDoubleDisplayValue;\n }\n\n model.computing = 1;\n var val = model.value.slice(0);\n var renderer = ren;\n\n if (model.renderer) {\n renderer = model.renderer;\n }\n\n if (!renderer) {\n if (model.coordinateSystem === Coordinate.DISPLAY) {\n model.computedDoubleDisplayValue[0] = val[0];\n model.computedDoubleDisplayValue[1] = val[1];\n\n if (model.referenceCoordinate) {\n var refValue = model.referenceCoordinate.getComputedDoubleDisplayValue();\n model.computedDoubleDisplayValue[0] += refValue[0];\n model.computedDoubleDisplayValue[1] += refValue[1];\n }\n } else {\n model.computedDoubleDisplayValue[0] = Number.MAX_VALUE;\n model.computedDoubleDisplayValue[1] = Number.MAX_VALUE;\n vtkErrorMacro('Request for coordinate transformation without required viewport');\n }\n\n return model.computedDoubleDisplayValue;\n }\n\n var view = null;\n\n if (renderer && renderer.getRenderWindow().getViews()) {\n view = renderer.getRenderWindow().getViews()[0];\n } else {\n return val;\n }\n\n var dims = view.getViewportSize(renderer);\n var aspect = dims[0] / dims[1];\n\n switch (model.coordinateSystem) {\n case Coordinate.WORLD:\n {\n if (model.referenceCoordinate) {\n var _refValue3 = model.referenceCoordinate.getComputedWorldValue(renderer);\n\n val[0] += _refValue3[0];\n val[1] += _refValue3[1];\n val[2] += _refValue3[2];\n }\n\n val = renderer.worldToView(val[0], val[1], val[2]);\n val = renderer.viewToProjection(val[0], val[1], val[2], aspect);\n val = renderer.projectionToNormalizedViewport(val[0], val[1], val[2]);\n val = view.normalizedViewportToViewport(val[0], val[1], val[2]);\n val = view.viewportToNormalizedDisplay(val[0], val[1], val[2], renderer);\n val = view.normalizedDisplayToDisplay(val[0], val[1], val[2]);\n break;\n }\n\n case Coordinate.VIEW:\n {\n val = renderer.viewToProjection(val[0], val[1], val[2], aspect);\n val = renderer.projectionToNormalizedViewport(val[0], val[1], val[2]);\n val = view.normalizedViewportToViewport(val[0], val[1], val[2]);\n val = view.viewportToNormalizedDisplay(val[0], val[1], val[2], renderer);\n val = view.normalizedDisplayToDisplay(val[0], val[1], val[2]);\n break;\n }\n\n case Coordinate.PROJECTION:\n {\n val = renderer.projectionToNormalizedViewport(val[0], val[1], val[2]);\n val = view.normalizedViewportToViewport(val[0], val[1], val[2]);\n val = view.viewportToNormalizedDisplay(val[0], val[1], val[2], renderer);\n val = view.normalizedDisplayToDisplay(val[0], val[1], val[2]);\n break;\n }\n\n case Coordinate.NORMALIZED_VIEWPORT:\n {\n val = view.normalizedViewportToViewport(val[0], val[1], val[2]);\n\n if (model.referenceCoordinate) {\n var _refValue4 = model.referenceCoordinate.getComputedDoubleViewportValue(renderer);\n\n val[0] += _refValue4[0];\n val[1] += _refValue4[1];\n }\n\n val = view.viewportToNormalizedDisplay(val[0], val[1], val[2], renderer);\n val = view.normalizedDisplayToDisplay(val[0], val[1], val[2]);\n break;\n }\n\n case Coordinate.VIEWPORT:\n {\n if (model.referenceCoordinate) {\n var _refValue5 = model.referenceCoordinate.getComputedDoubleViewportValue(renderer);\n\n val[0] += _refValue5[0];\n val[1] += _refValue5[1];\n }\n\n val = view.viewportToNormalizedDisplay(val[0], val[1], val[2], renderer);\n val = view.normalizedDisplayToDisplay(val[0], val[1], val[2]);\n break;\n }\n\n case Coordinate.NORMALIZED_DISPLAY:\n val = view.normalizedDisplayToDisplay(val[0], val[1], val[2]);\n break;\n\n case Coordinate.USERDEFINED:\n val = model.value.slice(0);\n break;\n\n default:\n break;\n } // if we have a reference coordinate and we haven't handled it yet\n\n\n if (model.referenceCoordinate && (model.coordinateSystem === Coordinate.DISPLAY || model.coordinateSystem === Coordinate.NORMALIZED_DISPLAY)) {\n var _refValue6 = model.referenceCoordinate.getComputedDoubleDisplayValue(renderer);\n\n val[0] += _refValue6[0];\n val[1] += _refValue6[1];\n }\n\n model.computedDoubleDisplayValue[0] = val[0];\n model.computedDoubleDisplayValue[1] = val[1];\n model.computing = 0;\n return model.computedDoubleDisplayValue;\n };\n\n publicAPI.getComputedValue = function (ren) {\n var renderer = ren;\n\n if (model.renderer) {\n renderer = model.renderer;\n }\n\n switch (model.coordinateSystem) {\n case Coordinate.WORLD:\n return publicAPI.getComputedWorldValue(renderer);\n\n case Coordinate.VIEW:\n case Coordinate.NORMALIZED_VIEWPORT:\n case Coordinate.VIEWPORT:\n {\n var val = publicAPI.getComputedViewportValue(renderer);\n model.computedWorldValue[0] = val[0];\n model.computedWorldValue[1] = val[1];\n break;\n }\n\n case Coordinate.NORMALIZED_DISPLAY:\n case Coordinate.DISPLAY:\n {\n var _val = model.getComputedDisplayValue(renderer);\n\n model.computedWorldValue[0] = _val[0];\n model.computedWorldValue[1] = _val[1];\n break;\n }\n\n default:\n break;\n }\n\n return model.computedWorldValue;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n coordinateSystem: Coordinate.WORLD,\n value: [0.0, 0.0, 0.0],\n renderer: null,\n referenceCoordinate: null,\n computing: 0,\n computedWorldValue: [0.0, 0.0, 0.0],\n computedDoubleDisplayValue: [0.0, 0.0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].set(publicAPI, model, ['property']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['value']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['coordinateSystem', 'referenceCoordinate', 'renderer']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['value'], 3); // Object methods\n\n vtkCoordinate(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkCoordinate'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_Core_Coordinate_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/Constants.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/Constants.js ***! - \*******************************************************************************/ -/*! exports provided: OrientationModes, ScaleModes, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OrientationModes\", function() { return OrientationModes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ScaleModes\", function() { return ScaleModes; });\nvar OrientationModes = {\n DIRECTION: 0,\n ROTATION: 1,\n MATRIX: 2\n};\nvar ScaleModes = {\n SCALE_BY_CONSTANT: 0,\n SCALE_BY_MAGNITUDE: 1,\n SCALE_BY_COMPONENTS: 2\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n OrientationModes: OrientationModes,\n ScaleModes: ScaleModes\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Glyph3DMapper_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Glyph3DMapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/Constants.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n\nvar OrientationModes = vtk_js_Sources_Rendering_Core_Glyph3DMapper_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].OrientationModes,\n ScaleModes = vtk_js_Sources_Rendering_Core_Glyph3DMapper_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ScaleModes;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// class methods\n// ----------------------------------------------------------------------------\n\nfunction vtkGlyph3DMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkGlyph3DMapper');\n /**\n * An orientation array is a vtkDataArray with 3 components. The first\n * component is the angle of rotation along the X axis. The second\n * component is the angle of rotation along the Y axis. The third\n * component is the angle of rotation along the Z axis. Orientation is\n * specified in X,Y,Z order but the rotations are performed in Z,X an Y.\n * This definition is compliant with SetOrientation method on vtkProp3D.\n * By using vector or normal there is a degree of freedom or rotation\n * left (underconstrained). With the orientation array, there is no degree of\n * freedom left.\n */\n\n publicAPI.getOrientationModeAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].enumToString(OrientationModes, model.orientationMode);\n };\n\n publicAPI.setOrientationModeToDirection = function () {\n return publicAPI.setOrientationMode(OrientationModes.DIRECTION);\n };\n\n publicAPI.setOrientationModeToRotation = function () {\n return publicAPI.setOrientationMode(OrientationModes.ROTATION);\n };\n\n publicAPI.setOrientationModeToMatrix = function () {\n return publicAPI.setOrientationMode(OrientationModes.MATRIX);\n };\n\n publicAPI.getOrientationArrayData = function () {\n var idata = publicAPI.getInputData(0);\n\n if (!idata || !idata.getPointData()) {\n return null;\n }\n\n if (!model.orientationArray) {\n return idata.getPointData().getVectors();\n }\n\n return idata.getPointData().getArray(model.orientationArray);\n };\n\n publicAPI.getScaleModeAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].enumToString(ScaleModes, model.scaleMode);\n };\n\n publicAPI.setScaleModeToScaleByMagnitude = function () {\n return publicAPI.setScaleMode(ScaleModes.SCALE_BY_MAGNITUDE);\n };\n\n publicAPI.setScaleModeToScaleByComponents = function () {\n return publicAPI.setScaleMode(ScaleModes.SCALE_BY_COMPONENTS);\n };\n\n publicAPI.setScaleModeToScaleByConstant = function () {\n return publicAPI.setScaleMode(ScaleModes.SCALE_BY_CONSTANT);\n };\n\n publicAPI.getScaleArrayData = function () {\n var idata = publicAPI.getInputData(0);\n\n if (!idata || !idata.getPointData()) {\n return null;\n }\n\n if (!model.scaleArray) {\n return idata.getPointData().getScalars();\n }\n\n return idata.getPointData().getArray(model.scaleArray);\n };\n\n publicAPI.getBounds = function () {\n var idata = publicAPI.getInputData(0);\n var gdata = publicAPI.getInputData(1);\n\n if (!idata || !gdata) {\n return vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"createUninitializedBounds\"]();\n } // first we build the arrays used for the glyphing\n\n\n publicAPI.buildArrays();\n return model.bounds;\n };\n\n publicAPI.buildArrays = function () {\n // if the mtgime requires it, rebuild\n var idata = publicAPI.getInputData(0);\n var gdata = publicAPI.getInputData(1);\n\n if (model.buildTime.getMTime() < gdata.getMTime() || model.buildTime.getMTime() < idata.getMTime() || model.buildTime.getMTime() < publicAPI.getMTime()) {\n var pts = idata.getPoints().getData();\n var sArray = publicAPI.getScaleArrayData();\n var sData = null;\n var numSComp = 0;\n\n if (sArray) {\n sData = sArray.getData();\n numSComp = sArray.getNumberOfComponents();\n }\n\n if (model.scaling && sArray && model.scaleMode === ScaleModes.SCALE_BY_COMPONENTS && sArray.getNumberOfComponents() !== 3) {\n vtkErrorMacro('Cannot scale by components since scale array does not have 3 components.');\n sArray = null;\n } // get the glyph bounds\n\n\n var gbounds = gdata.getBounds(); // convert them to 8 points so we can compute the\n // overall bounds while building the arrays\n\n var corners = [];\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].getCorners(gbounds, corners);\n model.bounds[0] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].INIT_BOUNDS[0];\n model.bounds[1] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].INIT_BOUNDS[1];\n model.bounds[2] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].INIT_BOUNDS[2];\n model.bounds[3] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].INIT_BOUNDS[3];\n model.bounds[4] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].INIT_BOUNDS[4];\n model.bounds[5] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_5__[\"default\"].INIT_BOUNDS[5];\n var tcorner = new Float64Array(3);\n var oArray = publicAPI.getOrientationArrayData();\n var identity = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n var trans = [];\n var scale = [];\n var numPts = pts.length / 3;\n model.matrixArray = new Float32Array(16 * numPts);\n var mbuff = model.matrixArray.buffer;\n model.normalArray = new Float32Array(9 * numPts);\n var nbuff = model.normalArray.buffer;\n var tuple = [];\n\n for (var i = 0; i < numPts; ++i) {\n var z = new Float32Array(mbuff, i * 64, 16);\n trans[0] = pts[i * 3];\n trans[1] = pts[i * 3 + 1];\n trans[2] = pts[i * 3 + 2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(z, identity, trans);\n\n if (oArray) {\n var orientation = [];\n oArray.getTuple(i, orientation);\n\n switch (model.orientationMode) {\n case OrientationModes.MATRIX:\n {\n // prettier-ignore\n var rotMat4 = [].concat(_toConsumableArray(orientation.slice(0, 3)), [0], _toConsumableArray(orientation.slice(3, 6)), [0], _toConsumableArray(orientation.slice(6, 9)), [0, 0, 0, 0, 1]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(z, z, rotMat4);\n break;\n }\n\n case OrientationModes.ROTATION:\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateZ(z, z, orientation[2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateX(z, z, orientation[0]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateY(z, z, orientation[1]);\n break;\n\n case OrientationModes.DIRECTION:\n if (orientation[1] === 0.0 && orientation[2] === 0.0) {\n if (orientation[0] < 0) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateY(z, z, 3.1415926);\n }\n } else {\n var vMag = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"norm\"](orientation);\n var vNew = [];\n vNew[0] = (orientation[0] + vMag) / 2.0;\n vNew[1] = orientation[1] / 2.0;\n vNew[2] = orientation[2] / 2.0;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotate(z, z, 3.1415926, vNew);\n }\n\n break;\n\n default:\n break;\n }\n } // scale data if appropriate\n\n\n if (model.scaling) {\n scale[0] = model.scaleFactor;\n scale[1] = model.scaleFactor;\n scale[2] = model.scaleFactor; // Get the scalar and vector data\n\n if (sArray) {\n switch (model.scaleMode) {\n case ScaleModes.SCALE_BY_MAGNITUDE:\n for (var t = 0; t < numSComp; ++t) {\n tuple[t] = sData[i * numSComp + t];\n }\n\n scale[0] *= vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"norm\"](tuple, numSComp);\n scale[1] = scale[0];\n scale[2] = scale[0];\n break;\n\n case ScaleModes.SCALE_BY_COMPONENTS:\n for (var _t = 0; _t < numSComp; ++_t) {\n tuple[_t] = sData[i * numSComp + _t];\n }\n\n scale[0] *= tuple[0];\n scale[1] *= tuple[1];\n scale[2] *= tuple[2];\n break;\n\n case ScaleModes.SCALE_BY_CONSTANT:\n default:\n break;\n }\n }\n\n if (scale[0] === 0.0) {\n scale[0] = 1.0e-10;\n }\n\n if (scale[1] === 0.0) {\n scale[1] = 1.0e-10;\n }\n\n if (scale[2] === 0.0) {\n scale[2] = 1.0e-10;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].scale(z, z, scale);\n } // update bounds\n\n\n for (var p = 0; p < 8; ++p) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(tcorner, corners[p], z);\n\n if (tcorner[0] < model.bounds[0]) {\n model.bounds[0] = tcorner[0];\n }\n\n if (tcorner[1] < model.bounds[2]) {\n model.bounds[2] = tcorner[1];\n }\n\n if (tcorner[2] < model.bounds[4]) {\n model.bounds[4] = tcorner[2];\n }\n\n if (tcorner[0] > model.bounds[1]) {\n model.bounds[1] = tcorner[0];\n }\n\n if (tcorner[1] > model.bounds[3]) {\n model.bounds[3] = tcorner[1];\n }\n\n if (tcorner[2] > model.bounds[5]) {\n model.bounds[5] = tcorner[2];\n }\n }\n\n var n = new Float32Array(nbuff, i * 36, 9);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromMat4(n, z);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].invert(n, n);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].transpose(n, n);\n } // map scalars as well\n\n\n var scalars = publicAPI.getAbstractScalars(idata, model.scalarMode, model.arrayAccessMode, model.arrayId, model.colorByArrayName).scalars;\n\n if (!model.useLookupTableScalarRange) {\n publicAPI.getLookupTable().setRange(model.scalarRange[0], model.scalarRange[1]);\n }\n\n model.colorArray = null;\n var lut = publicAPI.getLookupTable();\n\n if (lut && scalars) {\n // Ensure that the lookup table is built\n lut.build();\n model.colorArray = lut.mapScalars(scalars, model.colorMode, 0);\n }\n\n model.buildTime.modified();\n }\n };\n\n publicAPI.getPrimitiveCount = function () {\n var glyph = publicAPI.getInputData(1);\n var mult = publicAPI.getInputData().getPoints().getNumberOfValues() / 3;\n var pcount = {\n points: mult * glyph.getPoints().getNumberOfValues() / 3,\n verts: mult * (glyph.getVerts().getNumberOfValues() - glyph.getVerts().getNumberOfCells()),\n lines: mult * (glyph.getLines().getNumberOfValues() - 2 * glyph.getLines().getNumberOfCells()),\n triangles: mult * (glyph.getPolys().getNumberOfValues() - 3 * glyph.getLines().getNumberOfCells())\n };\n return pcount;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n orient: true,\n orientationMode: OrientationModes.DIRECTION,\n orientationArray: null,\n scaling: true,\n scaleFactor: 1.0,\n scaleMode: ScaleModes.SCALE_BY_MAGNITUDE,\n scaleArray: null,\n matrixArray: null,\n normalArray: null,\n colorArray: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].algo(publicAPI, model, 2, 0);\n model.buildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].obj(model.buildTime, {\n mtime: 0\n });\n model.boundsTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].obj(model.boundsTime, {\n mtime: 0\n });\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].setGet(publicAPI, model, ['orient', 'orientationMode', 'orientationArray', 'scaleArray', 'scaleFactor', 'scaleMode', 'scaling']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].get(publicAPI, model, ['colorArray', 'matrixArray', 'normalArray', 'buildTime']); // Object methods\n\n vtkGlyph3DMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance(extend, 'vtkGlyph3DMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_Core_Glyph3DMapper_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/HardwareSelector/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/HardwareSelector/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSet */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js\");\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\n\n\nvar FieldAssociations = vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_1__[\"default\"].FieldAssociations; // ----------------------------------------------------------------------------\n// vtkHardwareSelector methods\n// ----------------------------------------------------------------------------\n\nfunction vtkHardwareSelector(publicAPI, model) {\n model.classHierarchy.push('vtkHardwareSelector'); // get the source data that is used for generating a selection. This\n // must be called at least once before calling generateSelection. In\n // raster based backends this method will capture the buffers. You can\n // call this once and then make multiple calls to generateSelection.\n\n publicAPI.getSourceDataAsync = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(renderer, fx1, fy1, fx2, fy2) {\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x, _x2, _x3, _x4, _x5) {\n return _ref.apply(this, arguments);\n };\n }();\n\n publicAPI.selectAsync = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(renderer, fx1, fy1, fx2, fy2) {\n var srcData;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return publicAPI.getSourceDataAsync(renderer, fx1, fy1, fx2, fy2);\n\n case 2:\n srcData = _context2.sent;\n\n if (!srcData) {\n _context2.next = 5;\n break;\n }\n\n return _context2.abrupt(\"return\", srcData.generateSelection(fx1, fy1, fx2, fy2));\n\n case 5:\n return _context2.abrupt(\"return\", []);\n\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function (_x6, _x7, _x8, _x9, _x10) {\n return _ref2.apply(this, arguments);\n };\n }();\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n fieldAssociation: FieldAssociations.FIELD_ASSOCIATION_CELLS,\n captureZValues: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['fieldAssociation', 'captureZValues']); // Object methods\n\n vtkHardwareSelector(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkHardwareSelector'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/HardwareSelector/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/ImageMapper/Constants.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/ImageMapper/Constants.js ***! - \*****************************************************************************/ -/*! exports provided: SlicingMode, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SlicingMode\", function() { return SlicingMode; });\nvar SlicingMode = {\n NONE: -1,\n I: 0,\n J: 1,\n K: 2,\n X: 3,\n Y: 4,\n Z: 5\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n SlicingMode: SlicingMode\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/ImageMapper/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/ImageProperty/Constants.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/ImageProperty/Constants.js ***! - \*******************************************************************************/ -/*! exports provided: InterpolationType, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InterpolationType\", function() { return InterpolationType; });\nvar InterpolationType = {\n NEAREST: 0,\n LINEAR: 1\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n InterpolationType: InterpolationType\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/ImageProperty/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/InteractorObserver/index.js": -/*!********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/InteractorObserver/index.js ***! - \********************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_RenderWindowInteractor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/RenderWindowInteractor */ \"./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro,\n VOID = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].VOID; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n//----------------------------------------------------------------------------\n// Description:\n// Transform from world to display coordinates.\n\nfunction computeWorldToDisplay(renderer, x, y, z) {\n var view = renderer.getRenderWindow().getViews()[0];\n return view.worldToDisplay(x, y, z, renderer);\n} //----------------------------------------------------------------------------\n// Description:\n// Transform from display to world coordinates.\n\n\nfunction computeDisplayToWorld(renderer, x, y, z) {\n var view = renderer.getRenderWindow().getViews()[0];\n return view.displayToWorld(x, y, z, renderer);\n} // ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\n\nvar STATIC = {\n computeWorldToDisplay: computeWorldToDisplay,\n computeDisplayToWorld: computeDisplayToWorld\n}; // ----------------------------------------------------------------------------\n// vtkInteractorObserver methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorObserver(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkInteractorObserver');\n\n var superClass = _objectSpread({}, publicAPI); //----------------------------------------------------------------------------\n\n\n function unsubscribeFromEvents() {\n while (model.subscribedEvents.length) {\n model.subscribedEvents.pop().unsubscribe();\n }\n } //----------------------------------------------------------------------------\n // Check what events we can handle and register callbacks\n\n\n function subscribeToEvents() {\n vtk_js_Sources_Rendering_Core_RenderWindowInteractor__WEBPACK_IMPORTED_MODULE_1__[\"default\"].handledEvents.forEach(function (eventName) {\n if (publicAPI[\"handle\".concat(eventName)]) {\n model.subscribedEvents.push(model.interactor[\"on\".concat(eventName)](function (callData) {\n if (model.processEvents) {\n return publicAPI[\"handle\".concat(eventName)](callData);\n }\n\n return VOID;\n }, model.priority));\n }\n });\n } //----------------------------------------------------------------------------\n // Public API methods\n //----------------------------------------------------------------------------\n\n\n publicAPI.setInteractor = function (i) {\n if (i === model.interactor) {\n return;\n }\n\n unsubscribeFromEvents();\n model.interactor = i;\n\n if (i && model.enabled) {\n subscribeToEvents();\n }\n\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.setEnabled = function (enable) {\n if (enable === model.enabled) {\n return;\n }\n\n unsubscribeFromEvents();\n\n if (enable) {\n if (model.interactor) {\n subscribeToEvents();\n } else {\n vtkErrorMacro(\"\\n The interactor must be set before subscribing to events\\n \");\n }\n }\n\n model.enabled = enable;\n publicAPI.modified();\n }; //----------------------------------------------------------------------------\n // Description:\n // Transform from display to world coordinates.\n\n\n publicAPI.computeDisplayToWorld = function (renderer, x, y, z) {\n if (!renderer) {\n return null;\n }\n\n return model.interactor.getView().displayToWorld(x, y, z, renderer);\n }; //----------------------------------------------------------------------------\n // Description:\n // Transform from world to display coordinates.\n\n\n publicAPI.computeWorldToDisplay = function (renderer, x, y, z) {\n if (!renderer) {\n return null;\n }\n\n return model.interactor.getView().worldToDisplay(x, y, z, renderer);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.setPriority = function (priority) {\n var modified = superClass.setPriority(priority);\n\n if (modified && model.interactor) {\n unsubscribeFromEvents();\n subscribeToEvents();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n enabled: true,\n interactor: null,\n priority: 0.0,\n processEvents: true,\n subscribedEvents: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'InteractionEvent');\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'StartInteractionEvent');\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'EndInteractionEvent'); // Create get-only macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['interactor', 'enabled']); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['priority', 'processEvents']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkInteractorObserver(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkInteractorObserver'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/InteractorObserver/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js ***! - \*********************************************************************************/ -/*! exports provided: States, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"States\", function() { return States; });\nvar States = {\n IS_START: 0,\n IS_NONE: 0,\n IS_ROTATE: 1,\n IS_PAN: 2,\n IS_SPIN: 3,\n IS_DOLLY: 4,\n IS_CAMERA_POSE: 11,\n IS_WINDOW_LEVEL: 1024,\n IS_SLICE: 1025\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n States: States\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/index.js ***! - \*****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorObserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorObserver */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorObserver/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\nvar States = vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].States; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n// Add module-level functions or api that you want to expose statically via\n// the next section...\n\nvar stateNames = {\n Rotate: States.IS_ROTATE,\n Pan: States.IS_PAN,\n Spin: States.IS_SPIN,\n Dolly: States.IS_DOLLY,\n CameraPose: States.IS_CAMERA_POSE,\n WindowLevel: States.IS_WINDOW_LEVEL,\n Slice: States.IS_SLICE\n}; // ----------------------------------------------------------------------------\n// vtkInteractorStyle methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyle(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkInteractorStyle'); // Public API methods\n // create bunch of Start/EndState methods\n\n Object.keys(stateNames).forEach(function (key) {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, \"Start\".concat(key, \"Event\"));\n\n publicAPI[\"start\".concat(key)] = function () {\n if (model.state !== States.IS_NONE) {\n return;\n }\n\n model.state = stateNames[key];\n model.interactor.requestAnimation(publicAPI);\n publicAPI.invokeStartInteractionEvent({\n type: 'StartInteractionEvent'\n });\n publicAPI[\"invokeStart\".concat(key, \"Event\")]({\n type: \"Start\".concat(key, \"Event\")\n });\n };\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, \"End\".concat(key, \"Event\"));\n\n publicAPI[\"end\".concat(key)] = function () {\n if (model.state !== stateNames[key]) {\n return;\n }\n\n model.state = States.IS_NONE;\n model.interactor.cancelAnimation(publicAPI);\n publicAPI.invokeEndInteractionEvent({\n type: 'EndInteractionEvent'\n });\n publicAPI[\"invokeEnd\".concat(key, \"Event\")]({\n type: \"End\".concat(key, \"Event\")\n });\n model.interactor.render();\n };\n }); //----------------------------------------------------------------------------\n\n publicAPI.handleKeyPress = function (callData) {\n var rwi = model.interactor;\n var ac = null;\n\n switch (callData.key) {\n case 'r':\n case 'R':\n callData.pokedRenderer.resetCamera();\n rwi.render();\n break;\n\n case 'w':\n case 'W':\n ac = callData.pokedRenderer.getActors();\n ac.forEach(function (anActor) {\n var prop = anActor.getProperty();\n\n if (prop.setRepresentationToWireframe) {\n prop.setRepresentationToWireframe();\n }\n });\n rwi.render();\n break;\n\n case 's':\n case 'S':\n ac = callData.pokedRenderer.getActors();\n ac.forEach(function (anActor) {\n var prop = anActor.getProperty();\n\n if (prop.setRepresentationToSurface) {\n prop.setRepresentationToSurface();\n }\n });\n rwi.render();\n break;\n\n case 'v':\n case 'V':\n ac = callData.pokedRenderer.getActors();\n ac.forEach(function (anActor) {\n var prop = anActor.getProperty();\n\n if (prop.setRepresentationToPoints) {\n prop.setRepresentationToPoints();\n }\n });\n rwi.render();\n break;\n\n default:\n break;\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n state: States.IS_NONE,\n handleObservers: 1,\n autoAdjustCameraClippingRange: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_InteractorObserver__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object specific methods\n\n vtkInteractorStyle(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkInteractorStyle'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Light/index.js": -/*!*******************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Light/index.js ***! - \*******************************************************************/ -/*! exports provided: LIGHT_TYPES, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LIGHT_TYPES\", function() { return LIGHT_TYPES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n // ----------------------------------------------------------------------------\n\nvar LIGHT_TYPES = ['HeadLight', 'CameraLight', 'SceneLight']; // ----------------------------------------------------------------------------\n// vtkLight methods\n// ----------------------------------------------------------------------------\n\nfunction vtkLight(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkLight');\n\n publicAPI.getTransformedPosition = function () {\n if (model.transformMatrix) {\n return []; // FIXME !!!!\n }\n\n return [].concat(model.position);\n };\n\n publicAPI.getTransformedFocalPoint = function () {\n if (model.transformMatrix) {\n return []; // FIXME !!!!\n }\n\n return [].concat(model.focalPoint);\n };\n\n publicAPI.getDirection = function () {\n if (model.directionMTime < model.mtime) {\n model.direction[0] = model.focalPoint[0] - model.position[0];\n model.direction[1] = model.focalPoint[1] - model.position[1];\n model.direction[2] = model.focalPoint[2] - model.position[2];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"normalize\"](model.direction);\n model.directionMTime = model.mtime;\n }\n\n return model.direction;\n };\n\n publicAPI.setDirectionAngle = function (elevation, azimuth) {\n var elevationRadians = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"radiansFromDegrees\"](elevation);\n var azimuthRadians = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"radiansFromDegrees\"](azimuth);\n publicAPI.setPosition(Math.cos(elevationRadians) * Math.sin(azimuthRadians), Math.sin(elevationRadians), Math.cos(elevationRadians) * Math.cos(azimuthRadians));\n publicAPI.setFocalPoint(0, 0, 0);\n publicAPI.setPositional(0);\n };\n\n publicAPI.setLightTypeToHeadLight = function () {\n publicAPI.setLightType('HeadLight');\n };\n\n publicAPI.setLightTypeToCameraLight = function () {\n publicAPI.setLightType('CameraLight');\n };\n\n publicAPI.setLightTypeToSceneLight = function () {\n publicAPI.setTransformMatrix(null);\n publicAPI.setLightType('SceneLight');\n };\n\n publicAPI.lightTypeIsHeadLight = function () {\n return model.lightType === 'HeadLight';\n };\n\n publicAPI.lightTypeIsSceneLight = function () {\n return model.lightType === 'SceneLight';\n };\n\n publicAPI.lightTypeIsCameraLight = function () {\n return model.lightType === 'CameraLight';\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n switch: true,\n intensity: 1,\n color: [1, 1, 1],\n position: [0, 0, 1],\n focalPoint: [0, 0, 0],\n positional: false,\n exponent: 1,\n coneAngle: 30,\n attenuationValues: [1, 0, 0],\n transformMatrix: null,\n lightType: 'SceneLight',\n shadowAttenuation: 1,\n direction: [0, 0, 0],\n directionMTime: 0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['intensity', 'switch', 'positional', 'exponent', 'coneAngle', 'transformMatrix', 'lightType', 'shadowAttenuation']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['color', 'position', 'focalPoint', 'attenuationValues'], 3); // Object methods\n\n vtkLight(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkLight'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n LIGHT_TYPES: LIGHT_TYPES\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Light/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper.js ***! - \***************************************************************************************/ -/*! exports provided: CATEGORIES, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CATEGORIES\", function() { return CATEGORIES; });\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper_Static__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper/Static */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Static.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* eslint-disable arrow-body-style */\n\n\n\nfunction addCoincidentTopologyMethods(publicAPI, model, nameList) {\n nameList.forEach(function (item) {\n publicAPI[\"get\".concat(item.method)] = function () {\n return model[item.key];\n };\n\n publicAPI[\"set\".concat(item.method)] = function (factor, offset) {\n model[item.key] = {\n factor: factor,\n offset: offset\n };\n };\n });\n}\n\nvar CATEGORIES = ['Polygon', 'Line', 'Point']; // CoincidentTopology static methods ------------------------------------------\n\nvar staticOffsetModel = {\n Polygon: {\n factor: 2,\n offset: 0\n },\n Line: {\n factor: 1,\n offset: -1\n },\n Point: {\n factor: 0,\n offset: -2\n }\n};\nvar staticOffsetAPI = {};\naddCoincidentTopologyMethods(staticOffsetAPI, staticOffsetModel, CATEGORIES.map(function (key) {\n return {\n key: key,\n method: \"ResolveCoincidentTopology\".concat(key, \"OffsetParameters\")\n };\n}));\n\nfunction implementCoincidentTopologyMethods(publicAPI, model) {\n if (model.resolveCoincidentTopology === undefined) {\n model.resolveCoincidentTopology = false;\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['resolveCoincidentTopology']); // Relative methods\n\n model.topologyOffset = {\n Polygon: {\n factor: 0,\n offset: 0\n },\n Line: {\n factor: 0,\n offset: 0\n },\n Point: {\n factor: 0,\n offset: 0\n }\n }; // Add Static methods to our instance\n\n Object.keys(vtk_js_Sources_Rendering_Core_Mapper_Static__WEBPACK_IMPORTED_MODULE_0__[\"default\"]).forEach(function (methodName) {\n publicAPI[methodName] = vtk_js_Sources_Rendering_Core_Mapper_Static__WEBPACK_IMPORTED_MODULE_0__[\"default\"][methodName];\n });\n Object.keys(staticOffsetAPI).forEach(function (methodName) {\n publicAPI[methodName] = staticOffsetAPI[methodName];\n });\n addCoincidentTopologyMethods(publicAPI, model.topologyOffset, CATEGORIES.map(function (key) {\n return {\n key: key,\n method: \"RelativeCoincidentTopology\".concat(key, \"OffsetParameters\")\n };\n }));\n\n publicAPI.getCoincidentTopologyPolygonOffsetParameters = function () {\n var globalValue = staticOffsetAPI.getResolveCoincidentTopologyPolygonOffsetParameters();\n var localValue = publicAPI.getRelativeCoincidentTopologyPolygonOffsetParameters();\n return {\n factor: globalValue.factor + localValue.factor,\n offset: globalValue.offset + localValue.offset\n };\n };\n\n publicAPI.getCoincidentTopologyLineOffsetParameters = function () {\n var globalValue = staticOffsetAPI.getResolveCoincidentTopologyLineOffsetParameters();\n var localValue = publicAPI.getRelativeCoincidentTopologyLineOffsetParameters();\n return {\n factor: globalValue.factor + localValue.factor,\n offset: globalValue.offset + localValue.offset\n };\n };\n\n publicAPI.getCoincidentTopologyPointOffsetParameter = function () {\n var globalValue = staticOffsetAPI.getResolveCoincidentTopologyPointOffsetParameters();\n var localValue = publicAPI.getRelativeCoincidentTopologyPointOffsetParameters();\n return {\n factor: globalValue.factor + localValue.factor,\n offset: globalValue.offset + localValue.offset\n };\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n implementCoincidentTopologyMethods: implementCoincidentTopologyMethods,\n staticOffsetAPI: staticOffsetAPI,\n otherStaticMethods: vtk_js_Sources_Rendering_Core_Mapper_Static__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n CATEGORIES: CATEGORIES\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Constants.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Constants.js ***! - \************************************************************************/ -/*! exports provided: ColorMode, ScalarMode, GetArray, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ColorMode\", function() { return ColorMode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ScalarMode\", function() { return ScalarMode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GetArray\", function() { return GetArray; });\nvar ColorMode = {\n DEFAULT: 0,\n MAP_SCALARS: 1,\n DIRECT_SCALARS: 2\n};\nvar ScalarMode = {\n DEFAULT: 0,\n USE_POINT_DATA: 1,\n USE_CELL_DATA: 2,\n USE_POINT_FIELD_DATA: 3,\n USE_CELL_FIELD_DATA: 4,\n USE_FIELD_DATA: 5\n};\nvar GetArray = {\n BY_ID: 0,\n BY_NAME: 1\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ColorMode: ColorMode,\n GetArray: GetArray,\n ScalarMode: ScalarMode\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Static.js": -/*!*********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Static.js ***! - \*********************************************************************/ -/*! exports provided: RESOLVE_COINCIDENT_TOPOLOGY_MODE, getResolveCoincidentTopologyPolygonOffsetFaces, setResolveCoincidentTopologyPolygonOffsetFaces, getResolveCoincidentTopology, setResolveCoincidentTopology, setResolveCoincidentTopologyToDefault, setResolveCoincidentTopologyToOff, setResolveCoincidentTopologyToPolygonOffset, getResolveCoincidentTopologyAsString, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RESOLVE_COINCIDENT_TOPOLOGY_MODE\", function() { return RESOLVE_COINCIDENT_TOPOLOGY_MODE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getResolveCoincidentTopologyPolygonOffsetFaces\", function() { return getResolveCoincidentTopologyPolygonOffsetFaces; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setResolveCoincidentTopologyPolygonOffsetFaces\", function() { return setResolveCoincidentTopologyPolygonOffsetFaces; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getResolveCoincidentTopology\", function() { return getResolveCoincidentTopology; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setResolveCoincidentTopology\", function() { return setResolveCoincidentTopology; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setResolveCoincidentTopologyToDefault\", function() { return setResolveCoincidentTopologyToDefault; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setResolveCoincidentTopologyToOff\", function() { return setResolveCoincidentTopologyToOff; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setResolveCoincidentTopologyToPolygonOffset\", function() { return setResolveCoincidentTopologyToPolygonOffset; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getResolveCoincidentTopologyAsString\", function() { return getResolveCoincidentTopologyAsString; });\nvar resolveCoincidentTopologyPolygonOffsetFaces = 1;\nvar resolveCoincidentTopology = 0;\nvar RESOLVE_COINCIDENT_TOPOLOGY_MODE = ['VTK_RESOLVE_OFF', 'VTK_RESOLVE_POLYGON_OFFSET'];\nfunction getResolveCoincidentTopologyPolygonOffsetFaces() {\n return resolveCoincidentTopologyPolygonOffsetFaces;\n}\nfunction setResolveCoincidentTopologyPolygonOffsetFaces(value) {\n resolveCoincidentTopologyPolygonOffsetFaces = value;\n}\nfunction getResolveCoincidentTopology() {\n return resolveCoincidentTopology;\n}\nfunction setResolveCoincidentTopology() {\n var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n resolveCoincidentTopology = mode;\n}\nfunction setResolveCoincidentTopologyToDefault() {\n setResolveCoincidentTopology(0); // VTK_RESOLVE_OFF\n}\nfunction setResolveCoincidentTopologyToOff() {\n setResolveCoincidentTopology(0); // VTK_RESOLVE_OFF\n}\nfunction setResolveCoincidentTopologyToPolygonOffset() {\n setResolveCoincidentTopology(1); // VTK_RESOLVE_POLYGON_OFFSET\n}\nfunction getResolveCoincidentTopologyAsString() {\n return RESOLVE_COINCIDENT_TOPOLOGY_MODE[resolveCoincidentTopology];\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getResolveCoincidentTopologyAsString: getResolveCoincidentTopologyAsString,\n getResolveCoincidentTopologyPolygonOffsetFaces: getResolveCoincidentTopologyPolygonOffsetFaces,\n getResolveCoincidentTopology: getResolveCoincidentTopology,\n setResolveCoincidentTopology: setResolveCoincidentTopology,\n setResolveCoincidentTopologyPolygonOffsetFaces: setResolveCoincidentTopologyPolygonOffsetFaces,\n setResolveCoincidentTopologyToDefault: setResolveCoincidentTopologyToDefault,\n setResolveCoincidentTopologyToOff: setResolveCoincidentTopologyToOff,\n setResolveCoincidentTopologyToPolygonOffset: setResolveCoincidentTopologyToPolygonOffset\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Static.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js ***! - \********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_AbstractMapper3D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/AbstractMapper3D */ \"./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper3D/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/ImageData */ \"./node_modules/vtk.js/Sources/Common/DataModel/ImageData/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_LookupTable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/LookupTable */ \"./node_modules/vtk.js/Sources/Common/Core/LookupTable/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/ScalarsToColors/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/ScalarsToColors/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper_CoincidentTopologyHelper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n\n // Need to go inside Constants otherwise dependency loop\n\n\n\nvar staticOffsetAPI = vtk_js_Sources_Rendering_Core_Mapper_CoincidentTopologyHelper__WEBPACK_IMPORTED_MODULE_7__[\"default\"].staticOffsetAPI,\n otherStaticMethods = vtk_js_Sources_Rendering_Core_Mapper_CoincidentTopologyHelper__WEBPACK_IMPORTED_MODULE_7__[\"default\"].otherStaticMethods;\nvar ColorMode = vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__[\"default\"].ColorMode,\n ScalarMode = vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__[\"default\"].ScalarMode,\n GetArray = vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__[\"default\"].GetArray;\nvar VectorMode = vtk_js_Sources_Common_Core_ScalarsToColors_Constants__WEBPACK_IMPORTED_MODULE_6__[\"default\"].VectorMode;\nvar VtkDataTypes = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].VtkDataTypes; // ----------------------------------------------------------------------------\n\nfunction notImplemented(method) {\n return function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro(\"vtkMapper::\".concat(method, \" - NOT IMPLEMENTED\"));\n };\n} // ----------------------------------------------------------------------------\n// vtkMapper methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkMapper');\n\n publicAPI.getBounds = function () {\n var input = publicAPI.getInputData();\n\n if (!input) {\n model.bounds = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_5__[\"createUninitializedBounds\"]();\n } else {\n if (!model.static) {\n publicAPI.update();\n }\n\n model.bounds = input.getBounds();\n }\n\n return model.bounds;\n };\n\n publicAPI.setForceCompileOnly = function (v) {\n model.forceCompileOnly = v; // make sure we do NOT call modified()\n };\n\n publicAPI.createDefaultLookupTable = function () {\n model.lookupTable = vtk_js_Sources_Common_Core_LookupTable__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n };\n\n publicAPI.getColorModeAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(ColorMode, model.colorMode);\n };\n\n publicAPI.setColorModeToDefault = function () {\n return publicAPI.setColorMode(0);\n };\n\n publicAPI.setColorModeToMapScalars = function () {\n return publicAPI.setColorMode(1);\n };\n\n publicAPI.setColorModeToDirectScalars = function () {\n return publicAPI.setColorMode(2);\n };\n\n publicAPI.getScalarModeAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(ScalarMode, model.scalarMode);\n };\n\n publicAPI.setScalarModeToDefault = function () {\n return publicAPI.setScalarMode(0);\n };\n\n publicAPI.setScalarModeToUsePointData = function () {\n return publicAPI.setScalarMode(1);\n };\n\n publicAPI.setScalarModeToUseCellData = function () {\n return publicAPI.setScalarMode(2);\n };\n\n publicAPI.setScalarModeToUsePointFieldData = function () {\n return publicAPI.setScalarMode(3);\n };\n\n publicAPI.setScalarModeToUseCellFieldData = function () {\n return publicAPI.setScalarMode(4);\n };\n\n publicAPI.setScalarModeToUseFieldData = function () {\n return publicAPI.setScalarMode(5);\n };\n\n publicAPI.getAbstractScalars = function (input, scalarMode, arrayAccessMode, arrayId, arrayName) {\n // make sure we have an input\n if (!input || !model.scalarVisibility) {\n return {\n scalars: null,\n cellFLag: false\n };\n }\n\n var scalars = null;\n var cellFlag = false; // get and scalar data according to scalar mode\n\n if (scalarMode === ScalarMode.DEFAULT) {\n scalars = input.getPointData().getScalars();\n\n if (!scalars) {\n scalars = input.getCellData().getScalars();\n cellFlag = true;\n }\n } else if (scalarMode === ScalarMode.USE_POINT_DATA) {\n scalars = input.getPointData().getScalars();\n } else if (scalarMode === ScalarMode.USE_CELL_DATA) {\n scalars = input.getCellData().getScalars();\n cellFlag = true;\n } else if (scalarMode === ScalarMode.USE_POINT_FIELD_DATA) {\n var pd = input.getPointData();\n\n if (arrayAccessMode === GetArray.BY_ID) {\n scalars = pd.getArrayByIndex(arrayId);\n } else {\n scalars = pd.getArrayByName(arrayName);\n }\n } else if (scalarMode === ScalarMode.USE_CELL_FIELD_DATA) {\n var cd = input.getCellData();\n cellFlag = true;\n\n if (arrayAccessMode === GetArray.BY_ID) {\n scalars = cd.getArrayByIndex(arrayId);\n } else {\n scalars = cd.getArrayByName(arrayName);\n }\n } else if (scalarMode === ScalarMode.USE_FIELD_DATA) {\n var fd = input.getFieldData();\n\n if (arrayAccessMode === GetArray.BY_ID) {\n scalars = fd.getArrayByIndex(arrayId);\n } else {\n scalars = fd.getArrayByName(arrayName);\n }\n }\n\n return {\n scalars: scalars,\n cellFlag: cellFlag\n };\n };\n\n publicAPI.mapScalars = function (input, alpha) {\n var scalars = publicAPI.getAbstractScalars(input, model.scalarMode, model.arrayAccessMode, model.arrayId, model.colorByArrayName).scalars;\n\n if (!scalars) {\n model.colorCoordinates = null;\n model.colorTextureMap = null;\n model.colorMapColors = null;\n return;\n } // we want to only recompute when something has changed\n\n\n var toString = \"\".concat(publicAPI.getMTime()).concat(scalars.getMTime()).concat(alpha);\n if (model.colorBuildString === toString) return;\n\n if (!model.useLookupTableScalarRange) {\n publicAPI.getLookupTable().setRange(model.scalarRange[0], model.scalarRange[1]);\n } // Decide between texture color or vertex color.\n // Cell data always uses vertex color.\n // Only point data can use both texture and vertex coloring.\n\n\n if (publicAPI.canUseTextureMapForColoring(input)) {\n publicAPI.mapScalarsToTexture(scalars, alpha);\n } else {\n model.colorCoordinates = null;\n model.colorTextureMap = null;\n var lut = publicAPI.getLookupTable();\n\n if (lut) {\n // Ensure that the lookup table is built\n lut.build();\n model.colorMapColors = lut.mapScalars(scalars, model.colorMode, -1);\n }\n }\n\n model.colorBuildString = \"\".concat(publicAPI.getMTime()).concat(scalars.getMTime()).concat(alpha);\n }; //-----------------------------------------------------------------------------\n\n\n publicAPI.scalarToTextureCoordinate = function (scalarValue, // Input scalar\n rangeMin, // range[0]\n invRangeWidth) {\n // 1/(range[1]-range[0])\n var texCoordS = 0.5; // Scalar value is arbitrary when NaN\n\n var texCoordT = 1.0; // 1.0 in t coordinate means NaN\n\n if (!vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_5__[\"isNan\"](scalarValue)) {\n // 0.0 in t coordinate means not NaN. So why am I setting it to 0.49?\n // Because when you are mapping scalars and you have a NaN adjacent to\n // anything else, the interpolation everywhere should be NaN. Thus, I\n // want the NaN color everywhere except right on the non-NaN neighbors.\n // To simulate this, I set the t coord for the real numbers close to\n // the threshold so that the interpolation almost immediately looks up\n // the NaN value.\n texCoordT = 0.49;\n texCoordS = (scalarValue - rangeMin) * invRangeWidth; // Some implementations apparently don't handle relatively large\n // numbers (compared to the range [0.0, 1.0]) very well. In fact,\n // values above 1122.0f appear to cause texture wrap-around on\n // some systems even when edge clamping is enabled. Why 1122.0f? I\n // don't know. For safety, we'll clamp at +/- 1000. This will\n // result in incorrect images when the texture value should be\n // above or below 1000, but I don't have a better solution.\n\n if (texCoordS > 1000.0) {\n texCoordS = 1000.0;\n } else if (texCoordS < -1000.0) {\n texCoordS = -1000.0;\n }\n }\n\n return {\n texCoordS: texCoordS,\n texCoordT: texCoordT\n };\n }; //-----------------------------------------------------------------------------\n\n\n publicAPI.createColorTextureCoordinates = function (input, output, numScalars, numComps, component, range, tableRange, tableNumberOfColors, useLogScale) {\n // We have to change the range used for computing texture\n // coordinates slightly to accommodate the special above- and\n // below-range colors that are the first and last texels,\n // respectively.\n var scalarTexelWidth = (range[1] - range[0]) / tableNumberOfColors;\n var paddedRange = [];\n paddedRange[0] = range[0] - scalarTexelWidth;\n paddedRange[1] = range[1] + scalarTexelWidth;\n var invRangeWidth = 1.0 / (paddedRange[1] - paddedRange[0]);\n var outputV = output.getData();\n var inputV = input.getData();\n var count = 0;\n var outputCount = 0;\n\n if (component < 0 || component >= numComps) {\n for (var scalarIdx = 0; scalarIdx < numScalars; ++scalarIdx) {\n var sum = 0;\n\n for (var compIdx = 0; compIdx < numComps; ++compIdx) {\n sum += inputV[count] * inputV[count];\n count++;\n }\n\n var magnitude = Math.sqrt(sum);\n\n if (useLogScale) {\n magnitude = vtk_js_Sources_Common_Core_LookupTable__WEBPACK_IMPORTED_MODULE_4__[\"default\"].applyLogScale(magnitude, tableRange, range);\n }\n\n var outputs = publicAPI.scalarToTextureCoordinate(magnitude, paddedRange[0], invRangeWidth);\n outputV[outputCount] = outputs.texCoordS;\n outputV[outputCount + 1] = outputs.texCoordT;\n outputCount += 2;\n }\n } else {\n count += component;\n\n for (var _scalarIdx = 0; _scalarIdx < numScalars; ++_scalarIdx) {\n var inputValue = inputV[count];\n\n if (useLogScale) {\n inputValue = vtk_js_Sources_Common_Core_LookupTable__WEBPACK_IMPORTED_MODULE_4__[\"default\"].applyLogScale(inputValue, tableRange, range);\n }\n\n var _outputs = publicAPI.scalarToTextureCoordinate(inputValue, paddedRange[0], invRangeWidth);\n\n outputV[outputCount] = _outputs.texCoordS;\n outputV[outputCount + 1] = _outputs.texCoordT;\n outputCount += 2;\n count += numComps;\n }\n }\n };\n\n publicAPI.mapScalarsToTexture = function (scalars, alpha) {\n var range = model.lookupTable.getRange();\n var useLogScale = model.lookupTable.usingLogScale();\n\n if (useLogScale) {\n // convert range to log.\n vtk_js_Sources_Common_Core_LookupTable__WEBPACK_IMPORTED_MODULE_4__[\"default\"].getLogRange(range, range);\n }\n\n var origAlpha = model.lookupTable.getAlpha(); // Get rid of vertex color array. Only texture or vertex coloring\n // can be active at one time. The existence of the array is the\n // signal to use that technique.\n\n model.colorMapColors = null; // If the lookup table has changed, then recreate the color texture map.\n // Set a new lookup table changes this->MTime.\n\n if (model.colorTextureMap == null || publicAPI.getMTime() > model.colorTextureMap.getMTime() || model.lookupTable.getMTime() > model.colorTextureMap.getMTime() || model.lookupTable.getAlpha() !== alpha) {\n model.lookupTable.setAlpha(alpha);\n model.colorTextureMap = null; // Get the texture map from the lookup table.\n // Create a dummy ramp of scalars.\n // In the future, we could extend vtkScalarsToColors.\n\n model.lookupTable.build();\n var numberOfColors = model.lookupTable.getNumberOfAvailableColors();\n\n if (numberOfColors > 4094) {\n numberOfColors = 4094;\n }\n\n numberOfColors += 2;\n var k = (range[1] - range[0]) / (numberOfColors - 1 - 2);\n var newArray = new Float64Array(numberOfColors * 2);\n\n for (var i = 0; i < numberOfColors; ++i) {\n newArray[i] = range[0] + i * k - k; // minus k to start at below range color\n\n if (useLogScale) {\n newArray[i] = Math.pow(10.0, newArray[i]);\n }\n } // Dimension on NaN.\n\n\n for (var _i = 0; _i < numberOfColors; ++_i) {\n newArray[_i + numberOfColors] = NaN;\n }\n\n model.colorTextureMap = vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.colorTextureMap.setExtent(0, numberOfColors - 1, 0, 1, 0, 0);\n var tmp = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 1,\n values: newArray\n });\n model.colorTextureMap.getPointData().setScalars(model.lookupTable.mapScalars(tmp, model.colorMode, 0));\n model.lookupTable.setAlpha(origAlpha);\n } // Create new coordinates if necessary.\n // Need to compare lookup table in case the range has changed.\n\n\n if (!model.colorCoordinates || publicAPI.getMTime() > model.colorCoordinates.getMTime() || publicAPI.getInputData(0).getMTime() > model.colorCoordinates.getMTime() || model.lookupTable.getMTime() > model.colorCoordinates.getMTime()) {\n // Get rid of old colors\n model.colorCoordinates = null; // Now create the color texture coordinates.\n\n var numComps = scalars.getNumberOfComponents();\n var num = scalars.getNumberOfTuples(); // const fArray = new FloatArray(num * 2);\n\n model.colorCoordinates = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 2,\n values: new Float32Array(num * 2)\n });\n var scalarComponent = model.lookupTable.getVectorComponent(); // Although I like the feature of applying magnitude to single component\n // scalars, it is not how the old MapScalars for vertex coloring works.\n\n if (model.lookupTable.getVectorMode() === VectorMode.MAGNITUDE && scalars.getNumberOfComponents() > 1) {\n scalarComponent = -1;\n }\n\n publicAPI.createColorTextureCoordinates(scalars, model.colorCoordinates, num, numComps, scalarComponent, range, model.lookupTable.getRange(), model.colorTextureMap.getPointData().getScalars().getNumberOfTuples() / 2 - 2, useLogScale);\n }\n };\n\n publicAPI.getIsOpaque = function () {\n var lut = publicAPI.getLookupTable();\n\n if (lut) {\n // Ensure that the lookup table is built\n lut.build();\n return lut.isOpaque();\n }\n\n return true;\n };\n\n publicAPI.canUseTextureMapForColoring = function (input) {\n if (!model.interpolateScalarsBeforeMapping) {\n return false; // user doesn't want us to use texture maps at all.\n } // index color does not use textures\n\n\n if (model.lookupTable && model.lookupTable.getIndexedLookup()) {\n return false;\n }\n\n var gasResult = publicAPI.getAbstractScalars(input, model.scalarMode, model.arrayAccessMode, model.arrayId, model.colorByArrayName);\n var scalars = gasResult.scalars;\n\n if (!scalars) {\n // no scalars on this dataset, we don't care if texture is used at all.\n return false;\n }\n\n if (gasResult.cellFlag) {\n return false; // cell data colors, don't use textures.\n }\n\n if (model.colorMode === ColorMode.DEFAULT && scalars.getDataType() === VtkDataTypes.UNSIGNED_CHAR || model.colorMode === ColorMode.DIRECT_SCALARS) {\n // Don't use texture is direct coloring using RGB unsigned chars is\n // requested.\n return false;\n }\n\n return true;\n };\n\n publicAPI.clearColorArrays = function () {\n model.colorMapColors = null;\n model.colorCoordinates = null;\n model.colorTextureMap = null;\n };\n\n publicAPI.getLookupTable = function () {\n if (!model.lookupTable) {\n publicAPI.createDefaultLookupTable();\n }\n\n return model.lookupTable;\n };\n\n publicAPI.getMTime = function () {\n var mt = model.mtime;\n\n if (model.lookupTable !== null) {\n var time = model.lookupTable.getMTime();\n mt = time > mt ? time : mt;\n }\n\n return mt;\n };\n\n publicAPI.getPrimitiveCount = function () {\n var input = publicAPI.getInputData();\n var pcount = {\n points: input.getPoints().getNumberOfValues() / 3,\n verts: input.getVerts().getNumberOfValues() - input.getVerts().getNumberOfCells(),\n lines: input.getLines().getNumberOfValues() - 2 * input.getLines().getNumberOfCells(),\n triangles: input.getPolys().getNumberOfValues() - 3 * input.getLines().getNumberOfCells()\n };\n return pcount;\n };\n\n publicAPI.acquireInvertibleLookupTable = notImplemented('AcquireInvertibleLookupTable');\n publicAPI.valueToColor = notImplemented('ValueToColor');\n publicAPI.colorToValue = notImplemented('ColorToValue');\n publicAPI.useInvertibleColorFor = notImplemented('UseInvertibleColorFor');\n publicAPI.clearInvertibleColor = notImplemented('ClearInvertibleColor');\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n colorMapColors: null,\n // Same as this->Colors\n static: false,\n lookupTable: null,\n scalarVisibility: true,\n scalarRange: [0, 1],\n useLookupTableScalarRange: false,\n colorMode: 0,\n scalarMode: 0,\n arrayAccessMode: 1,\n // By_NAME\n renderTime: 0,\n colorByArrayName: null,\n fieldDataTupleId: -1,\n interpolateScalarsBeforeMapping: false,\n colorCoordinates: null,\n colorTextureMap: null,\n forceCompileOnly: 0,\n useInvertibleColors: false,\n invertibleScalars: null,\n viewSpecificProperties: null,\n customShaderAttributes: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_AbstractMapper3D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['colorCoordinates', 'colorMapColors', 'colorTextureMap']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['colorByArrayName', 'arrayAccessMode', 'colorMode', 'fieldDataTupleId', 'interpolateScalarsBeforeMapping', 'lookupTable', 'renderTime', 'scalarMode', 'scalarVisibility', 'static', 'useLookupTableScalarRange', 'viewSpecificProperties', 'customShaderAttributes' // point data array names that will be transferred to the VBO\n ]);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['scalarRange'], 2);\n\n if (!model.viewSpecificProperties) {\n model.viewSpecificProperties = {};\n }\n\n vtk_js_Sources_Rendering_Core_Mapper_CoincidentTopologyHelper__WEBPACK_IMPORTED_MODULE_7__[\"default\"].implementCoincidentTopologyMethods(publicAPI, model); // Object methods\n\n vtkMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread(_objectSpread(_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, staticOffsetAPI), otherStaticMethods), vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Picker/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Picker/index.js ***! - \********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_AbstractPicker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/AbstractPicker */ \"./node_modules/vtk.js/Sources/Rendering/Core/AbstractPicker/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\nvar vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkWarningMacro; // ----------------------------------------------------------------------------\n// vtkPicker methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPicker(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPicker');\n\n var superClass = _objectSpread({}, publicAPI);\n\n function initialize() {\n superClass.initialize();\n model.actors = [];\n model.pickedPositions = [];\n model.mapperPosition[0] = 0.0;\n model.mapperPosition[1] = 0.0;\n model.mapperPosition[2] = 0.0;\n model.mapper = null;\n model.dataSet = null;\n model.globalTMin = Number.MAX_VALUE;\n } // Intersect data with specified ray.\n // Project the center point of the mapper onto the ray and determine its parametric value\n\n\n publicAPI.intersectWithLine = function (p1, p2, tol, mapper) {\n if (!mapper) {\n return Number.MAX_VALUE;\n }\n\n var center = mapper.getCenter();\n var ray = [];\n\n for (var i = 0; i < 3; i++) {\n ray[i] = p2[i] - p1[i];\n }\n\n var rayFactor = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](ray, ray);\n\n if (rayFactor === 0.0) {\n return 2.0;\n } // Project the center point onto the ray and determine its parametric value\n\n\n var t = (ray[0] * (center[0] - p1[0]) + ray[1] * (center[1] - p1[1]) + ray[2] * (center[2] - p1[2])) / rayFactor;\n return t;\n }; // To be overridden in subclasses\n\n\n publicAPI.pick = function (selection, renderer) {\n if (selection.length !== 3) {\n vtkWarningMacro('vtkPicker::pick: selectionPt needs three components');\n }\n\n var selectionX = selection[0];\n var selectionY = selection[1];\n var selectionZ = selection[2];\n var cameraPos = [];\n var cameraFP = [];\n var displayCoords = [];\n var worldCoords = [];\n var ray = [];\n var cameraDOP = [];\n var clipRange = [];\n var tF;\n var tB;\n var p1World = [];\n var p2World = [];\n var viewport = [];\n var winSize = [];\n var x;\n var y;\n var windowLowerLeft = [];\n var windowUpperRight = [];\n var tol = 0.0;\n var props = [];\n var pickable = false;\n var p1Mapper = new Float64Array(4);\n var p2Mapper = new Float64Array(4);\n var bbox = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n var t = [];\n var hitPosition = [];\n var view = renderer.getRenderWindow().getViews()[0];\n initialize();\n model.renderer = renderer;\n model.selectionPoint[0] = selectionX;\n model.selectionPoint[1] = selectionY;\n model.selectionPoint[2] = selectionZ;\n\n if (!renderer) {\n vtkErrorMacro('Picker::Pick Must specify renderer');\n return;\n } // Get camera focal point and position. Convert to display (screen)\n // coordinates. We need a depth value for z-buffer.\n\n\n var camera = renderer.getActiveCamera();\n cameraPos = camera.getPosition();\n cameraFP = camera.getFocalPoint();\n displayCoords = renderer.worldToNormalizedDisplay(cameraFP[0], cameraFP[1], cameraFP[2]);\n displayCoords = view.normalizedDisplayToDisplay(displayCoords[0], displayCoords[1], displayCoords[2]);\n selectionZ = displayCoords[2]; // Convert the selection point into world coordinates.\n\n var normalizedDisplay = view.displayToNormalizedDisplay(selectionX, selectionY, selectionZ);\n var dims = view.getViewportSize(renderer);\n var aspect = dims[0] / dims[1];\n worldCoords = renderer.normalizedDisplayToWorld(normalizedDisplay[0], normalizedDisplay[1], normalizedDisplay[2], aspect);\n\n for (var i = 0; i < 3; i++) {\n model.pickPosition[i] = worldCoords[i];\n } // Compute the ray endpoints. The ray is along the line running from\n // the camera position to the selection point, starting where this line\n // intersects the front clipping plane, and terminating where this\n // line intersects the back clipping plane.\n\n\n for (var _i = 0; _i < 3; _i++) {\n ray[_i] = model.pickPosition[_i] - cameraPos[_i];\n }\n\n for (var _i2 = 0; _i2 < 3; _i2++) {\n cameraDOP[_i2] = cameraFP[_i2] - cameraPos[_i2];\n }\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"normalize\"](cameraDOP);\n var rayLength = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"dot\"](cameraDOP, ray);\n\n if (rayLength === 0.0) {\n vtkWarningMacro('Picker::Pick Cannot process points');\n return;\n }\n\n clipRange = camera.getClippingRange();\n\n if (camera.getParallelProjection()) {\n tF = clipRange[0] - rayLength;\n tB = clipRange[1] - rayLength;\n\n for (var _i3 = 0; _i3 < 3; _i3++) {\n p1World[_i3] = model.pickPosition[_i3] + tF * cameraDOP[_i3];\n p2World[_i3] = model.pickPosition[_i3] + tB * cameraDOP[_i3];\n }\n } else {\n tF = clipRange[0] / rayLength;\n tB = clipRange[1] / rayLength;\n\n for (var _i4 = 0; _i4 < 3; _i4++) {\n p1World[_i4] = cameraPos[_i4] + tF * ray[_i4];\n p2World[_i4] = cameraPos[_i4] + tB * ray[_i4];\n }\n }\n\n p1World[3] = 1.0;\n p2World[3] = 1.0; // Compute the tolerance in world coordinates. Do this by\n // determining the world coordinates of the diagonal points of the\n // window, computing the width of the window in world coordinates, and\n // multiplying by the tolerance.\n\n viewport = renderer.getViewport();\n\n if (renderer.getRenderWindow()) {\n winSize = renderer.getRenderWindow().getViews()[0].getSize();\n }\n\n x = winSize[0] * viewport[0];\n y = winSize[1] * viewport[1];\n var normalizedLeftDisplay = view.displayToNormalizedDisplay(x, y, selectionZ);\n windowLowerLeft = renderer.normalizedDisplayToWorld(normalizedLeftDisplay[0], normalizedLeftDisplay[1], normalizedLeftDisplay[2], aspect);\n x = winSize[0] * viewport[2];\n y = winSize[1] * viewport[3];\n var normalizedRightDisplay = view.displayToNormalizedDisplay(x, y, selectionZ);\n windowUpperRight = renderer.normalizedDisplayToWorld(normalizedRightDisplay[0], normalizedRightDisplay[1], normalizedRightDisplay[2], aspect);\n\n for (var _i5 = 0; _i5 < 3; _i5++) {\n tol += (windowUpperRight[_i5] - windowLowerLeft[_i5]) * (windowUpperRight[_i5] - windowLowerLeft[_i5]);\n }\n\n tol = Math.sqrt(tol) * model.tolerance;\n\n if (model.pickFromList) {\n props = model.pickList;\n } else {\n props = renderer.getActors();\n }\n\n var scale = [];\n props.forEach(function (prop) {\n var mapper = prop.getMapper();\n pickable = prop.getPickable() && prop.getVisibility();\n\n if (prop.getProperty().getOpacity() <= 0.0) {\n pickable = false;\n }\n\n if (pickable) {\n model.transformMatrix = prop.getMatrix().slice(0); // Webgl need a transpose matrix but we need the untransposed one to project world points\n // into the right referential\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_4__[\"mat4\"].transpose(model.transformMatrix, model.transformMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_4__[\"mat4\"].invert(model.transformMatrix, model.transformMatrix); // Extract scale\n\n var col1 = [model.transformMatrix[0], model.transformMatrix[1], model.transformMatrix[2]];\n var col2 = [model.transformMatrix[4], model.transformMatrix[5], model.transformMatrix[6]];\n var col3 = [model.transformMatrix[8], model.transformMatrix[9], model.transformMatrix[10]];\n scale[0] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"norm\"](col1);\n scale[1] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"norm\"](col2);\n scale[2] = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"norm\"](col3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_4__[\"vec4\"].transformMat4(p1Mapper, p1World, model.transformMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_4__[\"vec4\"].transformMat4(p2Mapper, p2World, model.transformMatrix);\n p1Mapper[0] /= p1Mapper[3];\n p1Mapper[1] /= p1Mapper[3];\n p1Mapper[2] /= p1Mapper[3];\n p2Mapper[0] /= p2Mapper[3];\n p2Mapper[1] /= p2Mapper[3];\n p2Mapper[2] /= p2Mapper[3];\n\n for (var _i6 = 0; _i6 < 3; _i6++) {\n ray[_i6] = p2Mapper[_i6] - p1Mapper[_i6];\n }\n\n if (mapper) {\n bbox.setBounds(mapper.getBounds());\n bbox.inflate(tol);\n } else {\n bbox.reset();\n }\n\n if (bbox.intersectBox(p1Mapper, ray, hitPosition, t)) {\n t[0] = publicAPI.intersectWithLine(p1Mapper, p2Mapper, tol * 0.333 * (scale[0] + scale[1] + scale[2]), mapper);\n\n if (t[0] < Number.MAX_VALUE) {\n var p = [];\n p[0] = (1.0 - t[0]) * p1World[0] + t[0] * p2World[0];\n p[1] = (1.0 - t[0]) * p1World[1] + t[0] * p2World[1];\n p[2] = (1.0 - t[0]) * p1World[2] + t[0] * p2World[2]; // Check if the current actor is already in the list\n\n var actorID = -1;\n\n for (var _i7 = 0; _i7 < model.actors.length; _i7++) {\n if (model.actors[_i7] === prop) {\n actorID = _i7;\n break;\n }\n }\n\n if (actorID === -1) {\n model.actors.push(prop);\n model.pickedPositions.push(p);\n } else {\n var oldPoint = model.pickedPositions[actorID];\n var distOld = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"distance2BetweenPoints\"](p1World, oldPoint);\n var distCurrent = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"distance2BetweenPoints\"](p1World, p);\n\n if (distCurrent < distOld) {\n model.pickedPositions[actorID] = p;\n }\n }\n }\n }\n }\n\n publicAPI.invokePickChange(model.pickedPositions);\n return 1;\n });\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n tolerance: 0.025,\n mapperPosition: [0.0, 0.0, 0.0],\n mapper: null,\n dataSet: null,\n actors: [],\n pickedPositions: [],\n transformMatrix: null,\n globalTMin: Number.MAX_VALUE\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_AbstractPicker__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['tolerance']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['mapperPosition'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['mapper', 'dataSet', 'actors', 'pickedPositions']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'pickChange');\n vtkPicker(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPicker'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Picker/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.js ***! - \**************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkPixelSpaceCallbackMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPixelSpaceCallbackMapper(publicAPI, model) {\n model.classHierarchy.push('vtkPixelSpaceCallbackMapper');\n\n if (!model.callback) {\n model.callback = function () {};\n }\n\n publicAPI.invokeCallback = function (dataset, camera, aspect, windowSize, depthValues) {\n if (!model.callback) {\n return;\n }\n\n var matrix = camera.getCompositeProjectionMatrix(aspect, -1, 1);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(matrix, matrix);\n var dataPoints = dataset.getPoints();\n var result = new Float64Array(3);\n var width = windowSize.usize;\n var height = windowSize.vsize;\n var hw = width / 2;\n var hh = height / 2;\n var coords = [];\n\n for (var pidx = 0; pidx < dataPoints.getNumberOfPoints(); pidx += 1) {\n var point = dataPoints.getPoint(pidx);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(result, point, matrix);\n var coord = [result[0] * hw + hw, result[1] * hh + hh, result[2], 0];\n\n if (depthValues) {\n var linIdx = Math.floor(coord[1]) * width + Math.floor(coord[0]);\n var idx = linIdx * 4;\n var r = depthValues[idx] / 255;\n var g = depthValues[idx + 1] / 255;\n var z = (r * 256 + g) / 257;\n coord[3] = z * 2 - 1;\n }\n\n coords.push(coord);\n }\n\n model.callback(coords, camera, aspect, depthValues, [width, height]);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n callback: null,\n useZValues: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['callback', 'useZValues']); // Object methods\n\n vtkPixelSpaceCallbackMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkPixelSpaceCallbackMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/PointPicker/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/PointPicker/index.js ***! - \*************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Picker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Picker */ \"./node_modules/vtk.js/Sources/Rendering/Core/Picker/index.js\");\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkPointPicker methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPointPicker(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPointPicker');\n\n publicAPI.intersectWithLine = function (p1, p2, tol, mapper) {\n var tMin = Number.MAX_VALUE;\n\n if (mapper.isA('vtkImageMapper')) {\n var pickData = mapper.intersectWithLineForPointPicking(p1, p2);\n\n if (pickData) {\n tMin = pickData.t;\n model.pointIJK = pickData.ijk;\n }\n } else if (mapper.isA('vtkMapper')) {\n tMin = publicAPI.intersectActorWithLine(p1, p2, tol, mapper);\n }\n\n return tMin;\n };\n\n publicAPI.intersectActorWithLine = function (p1, p2, tol, mapper) {\n // Get dataset\n var input = mapper.getInputData(); // Determine appropriate info\n\n var ptId = 0;\n var numPts = input.getPoints().getNumberOfPoints();\n\n if (numPts <= ptId) {\n return 2.0;\n }\n\n var ray = [];\n\n for (var i = 0; i < 3; i++) {\n ray[i] = p2[i] - p1[i];\n }\n\n var rayFactor = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"dot\"](ray, ray);\n\n if (rayFactor === 0.0) {\n vtkErrorMacro('Cannot process points');\n return 2.0;\n }\n\n var t;\n var minPtId = -1;\n var tMin = Number.MAX_VALUE;\n var minPtDist = Number.MAX_VALUE;\n var projXYZ = [];\n var minXYZ = [];\n var x = [];\n var points = input.getPoints();\n\n if (model.useCells) {\n var cellData = input.getPolys().getData();\n var nbPointsPerCell = cellData[0];\n var nbCells = input.getPolys().getNumberOfCells();\n\n for (var cellID = 0; cellID < nbCells; cellID++) {\n var firstPointIndex = cellID * nbPointsPerCell + 1;\n var lastPointIndex = firstPointIndex + nbPointsPerCell;\n\n for (var pointIndex = firstPointIndex; pointIndex < lastPointIndex; pointIndex++) {\n var pointDataIndex = cellData[pointIndex];\n points.getPoint(pointDataIndex, x);\n t = (ray[0] * (x[0] - p1[0]) + ray[1] * (x[1] - p1[1]) + ray[2] * (x[2] - p1[2])) / rayFactor; // If we find a point closer than we currently have, see whether it\n // lies within the pick tolerance and clipping planes. We keep track\n // of the point closest to the line (use a fudge factor for points\n // nearly the same distance away.)\n\n if (t >= 0.0 && t <= 1.0 && t <= tMin + model.tolerance) {\n var maxDist = 0.0;\n\n for (var _i = 0; _i < 3; _i++) {\n projXYZ[_i] = p1[_i] + t * ray[_i];\n var dist = Math.abs(x[_i] - projXYZ[_i]);\n\n if (dist > maxDist) {\n maxDist = dist;\n }\n } // end for i\n\n\n if (maxDist <= tol && maxDist < minPtDist) {\n // within tolerance\n minPtId = ptId;\n minXYZ[0] = x[0];\n minXYZ[1] = x[1];\n minXYZ[2] = x[2];\n minPtDist = maxDist;\n tMin = t;\n }\n }\n } // end for pointIndex\n\n } // end for cellID\n\n } else {\n // end if model.useCells\n for (ptId = 0; ptId < numPts; ptId++) {\n points.getPoint(ptId, x);\n t = (ray[0] * (x[0] - p1[0]) + ray[1] * (x[1] - p1[1]) + ray[2] * (x[2] - p1[2])) / rayFactor; // If we find a point closer than we currently have, see whether it\n // lies within the pick tolerance and clipping planes. We keep track\n // of the point closest to the line (use a fudge factor for points\n // nearly the same distance away.)\n\n if (t >= 0.0 && t <= 1.0 && t <= tMin + model.tolerance) {\n var _maxDist = 0.0;\n\n for (var _i2 = 0; _i2 < 3; _i2++) {\n projXYZ[_i2] = p1[_i2] + t * ray[_i2];\n\n var _dist = Math.abs(x[_i2] - projXYZ[_i2]);\n\n if (_dist > _maxDist) {\n _maxDist = _dist;\n }\n } // end for i\n\n\n if (_maxDist <= tol && _maxDist < minPtDist) {\n // within tolerance\n minPtId = ptId;\n minXYZ[0] = x[0];\n minXYZ[1] = x[1];\n minXYZ[2] = x[2];\n minPtDist = _maxDist;\n tMin = t;\n }\n }\n }\n }\n\n model.pointId = minPtId;\n return tMin;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n pointId: -1,\n pointIJK: [],\n useCells: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Picker__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['pointIJK']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['pointId']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['useCells']);\n vtkPointPicker(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPointPicker'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/PointPicker/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Prop/index.js": -/*!******************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Prop/index.js ***! - \******************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\n\nfunction notImplemented(method) {\n return function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro(\"vtkProp::\".concat(method, \" - NOT IMPLEMENTED\"));\n };\n} // ----------------------------------------------------------------------------\n// vtkProp methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkProp(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkProp');\n\n publicAPI.getMTime = function () {\n var m1 = model.mtime;\n\n for (var index = 0; index < model.textures.length; ++index) {\n var m2 = model.textures[index].getMTime();\n\n if (m2 > m1) {\n m1 = m2;\n }\n }\n\n return m1;\n };\n\n publicAPI.getNestedProps = function () {\n return null;\n };\n\n publicAPI.getActors = function () {\n return [];\n };\n\n publicAPI.getActors2D = function () {\n return [];\n };\n\n publicAPI.getVolumes = function () {\n return [];\n };\n\n publicAPI.pick = notImplemented('pick');\n publicAPI.hasKey = notImplemented('hasKey');\n\n publicAPI.getRedrawMTime = function () {\n return model.mtime;\n };\n\n publicAPI.setEstimatedRenderTime = function (t) {\n model.estimatedRenderTime = t;\n model.savedEstimatedRenderTime = t;\n };\n\n publicAPI.restoreEstimatedRenderTime = function () {\n model.estimatedRenderTime = model.savedEstimatedRenderTime;\n };\n\n publicAPI.addEstimatedRenderTime = function (t) {\n model.estimatedRenderTime += t;\n };\n\n publicAPI.setAllocatedRenderTime = function (t) {\n model.allocatedRenderTime = t;\n model.savedEstimatedRenderTime = model.estimatedRenderTime;\n model.estimatedRenderTime = 0;\n };\n\n publicAPI.getSupportsSelection = function () {\n return false;\n };\n\n publicAPI.getTextures = function () {\n return model.textures;\n };\n\n publicAPI.hasTexture = function (texture) {\n return model.textures.indexOf(texture) !== -1;\n };\n\n publicAPI.addTexture = function (texture) {\n if (texture && !publicAPI.hasTexture(texture)) {\n model.textures = model.textures.concat(texture);\n publicAPI.modified();\n }\n };\n\n publicAPI.removeTexture = function (texture) {\n var newTextureList = model.textures.filter(function (item) {\n return item !== texture;\n });\n\n if (model.textures.length !== newTextureList.length) {\n model.textures = newTextureList;\n publicAPI.modified();\n }\n };\n\n publicAPI.removeAllTextures = function () {\n model.textures = [];\n publicAPI.modified();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n visibility: true,\n pickable: true,\n dragable: true,\n useBounds: true,\n allocatedRenderTime: 10,\n estimatedRenderTime: 0,\n savedEstimatedRenderTime: 0,\n renderTimeMultiplier: 1,\n paths: null,\n textures: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['estimatedRenderTime', 'allocatedRenderTime']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['visibility', 'pickable', 'dragable', 'useBounds', 'renderTimeMultiplier']); // Object methods\n\n vtkProp(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkProp'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Prop/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Prop3D/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Prop3D/index.js ***! - \********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Prop__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Prop */ \"./node_modules/vtk.js/Sources/Rendering/Core/Prop/index.js\");\n\n\n\n\n // ----------------------------------------------------------------------------\n// vtkProp3D methods\n// ----------------------------------------------------------------------------\n\nfunction vtkProp3D(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkProp3D');\n\n publicAPI.addPosition = function (deltaXYZ) {\n model.position = model.position.map(function (value, index) {\n return value + deltaXYZ[index];\n });\n publicAPI.modified();\n };\n\n publicAPI.getOrientationWXYZ = function () {\n var q = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].getRotation(q, model.rotation);\n var oaxis = new Float64Array(3);\n var w = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].getAxisAngle(oaxis, q);\n return [vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"degreesFromRadians\"](w), oaxis[0], oaxis[1], oaxis[2]];\n };\n\n publicAPI.rotateX = function (val) {\n if (val === 0.0) {\n return;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateX(model.rotation, model.rotation, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"radiansFromDegrees\"](val));\n publicAPI.modified();\n };\n\n publicAPI.rotateY = function (val) {\n if (val === 0.0) {\n return;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateY(model.rotation, model.rotation, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"radiansFromDegrees\"](val));\n publicAPI.modified();\n };\n\n publicAPI.rotateZ = function (val) {\n if (val === 0.0) {\n return;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].rotateZ(model.rotation, model.rotation, vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"radiansFromDegrees\"](val));\n publicAPI.modified();\n };\n\n publicAPI.rotateWXYZ = function (degrees, x, y, z) {\n if (degrees === 0.0 || x === 0.0 && y === 0.0 && z === 0.0) {\n return;\n } // convert to radians\n\n\n var angle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"radiansFromDegrees\"](degrees);\n var q = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].setAxisAngle(q, [x, y, z], angle);\n var quatMat = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].fromQuat(quatMat, q);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.rotation, model.rotation, quatMat);\n publicAPI.modified();\n };\n\n publicAPI.setOrientation = function (x, y, z) {\n if (x === model.orientation[0] && y === model.orientation[1] && z === model.orientation[2]) {\n return false;\n }\n\n model.orientation = [x, y, z];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(model.rotation);\n publicAPI.rotateZ(z);\n publicAPI.rotateX(x);\n publicAPI.rotateY(y);\n publicAPI.modified();\n return true;\n };\n\n publicAPI.setUserMatrix = function (matrix) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.userMatrix, matrix);\n publicAPI.modified();\n };\n\n publicAPI.getMatrix = function () {\n publicAPI.computeMatrix();\n return model.matrix;\n };\n\n publicAPI.computeMatrix = function () {\n // check whether or not need to rebuild the matrix\n if (publicAPI.getMTime() > model.matrixMTime.getMTime()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(model.matrix);\n\n if (model.userMatrix) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.matrix, model.matrix, model.userMatrix);\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.matrix, model.matrix, model.origin);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.matrix, model.matrix, model.position);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.matrix, model.matrix, model.rotation);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].scale(model.matrix, model.matrix, model.scale);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.matrix, model.matrix, [-model.origin[0], -model.origin[1], -model.origin[2]]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.matrix, model.matrix); // check for identity\n\n model.isIdentity = true;\n\n for (var i = 0; i < 4; ++i) {\n for (var j = 0; j < 4; ++j) {\n if ((i === j ? 1.0 : 0.0) !== model.matrix[i + j * 4]) {\n model.isIdentity = false;\n }\n }\n }\n\n model.matrixMTime.modified();\n }\n };\n\n publicAPI.getCenter = function () {\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getCenter(model.bounds);\n };\n\n publicAPI.getLength = function () {\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getLength(model.bounds);\n };\n\n publicAPI.getXRange = function () {\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getXRange(model.bounds);\n };\n\n publicAPI.getYRange = function () {\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getYRange(model.bounds);\n };\n\n publicAPI.getZRange = function () {\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getZRange(model.bounds);\n };\n\n publicAPI.getUserMatrix = function () {\n return model.userMatrix;\n };\n\n function updateIdentityFlag() {\n publicAPI.computeMatrix();\n }\n\n publicAPI.onModified(updateIdentityFlag);\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n origin: [0, 0, 0],\n position: [0, 0, 0],\n orientation: [0, 0, 0],\n rotation: null,\n scale: [1, 1, 1],\n bounds: [1, -1, 1, -1, 1, -1],\n userMatrix: null,\n userMatrixMTime: null,\n cachedProp3D: null,\n isIdentity: true,\n matrixMTime: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Prop__WEBPACK_IMPORTED_MODULE_4__[\"default\"].extend(publicAPI, model, initialValues);\n model.matrixMTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(model.matrixMTime); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get(publicAPI, model, ['bounds', 'isIdentity']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getArray(publicAPI, model, ['orientation']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGetArray(publicAPI, model, ['origin', 'position', 'scale'], 3); // Object internal instance\n\n model.matrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.rotation = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.userMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.transform = null; // FIXME\n // Object methods\n\n vtkProp3D(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkProp3D'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Prop3D/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js ***! - \**************************************************************************/ -/*! exports provided: Shading, Representation, Interpolation, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Shading\", function() { return Shading; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Representation\", function() { return Representation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Interpolation\", function() { return Interpolation; });\nvar Shading = {\n FLAT: 0,\n GOURAUD: 1,\n PHONG: 2\n};\nvar Representation = {\n POINTS: 0,\n WIREFRAME: 1,\n SURFACE: 2\n};\nvar Interpolation = Shading;\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n Shading: Shading,\n Representation: Representation,\n Interpolation: Interpolation\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar Representation = vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Representation,\n Interpolation = vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Interpolation;\n\nfunction notImplemented(method) {\n return function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro(\"vtkProperty::\".concat(method, \" - NOT IMPLEMENTED\"));\n };\n} // ----------------------------------------------------------------------------\n// vtkProperty methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkProperty(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkProperty');\n\n publicAPI.setColor = function (r, g, b) {\n if (Array.isArray(r)) {\n if (model.color[0] !== r[0] || model.color[1] !== r[1] || model.color[2] !== r[2]) {\n model.color[0] = r[0];\n model.color[1] = r[1];\n model.color[2] = r[2];\n publicAPI.modified();\n }\n } else if (model.color[0] !== r || model.color[1] !== g || model.color[2] !== b) {\n model.color[0] = r;\n model.color[1] = g;\n model.color[2] = b;\n publicAPI.modified();\n }\n\n publicAPI.setDiffuseColor(model.color);\n publicAPI.setAmbientColor(model.color);\n publicAPI.setSpecularColor(model.color);\n };\n\n publicAPI.computeCompositeColor = notImplemented('ComputeCompositeColor');\n\n publicAPI.getColor = function () {\n // Inline computeCompositeColor\n var norm = 0.0;\n\n if (model.ambient + model.diffuse + model.specular > 0) {\n norm = 1.0 / (model.ambient + model.diffuse + model.specular);\n }\n\n for (var i = 0; i < 3; i++) {\n model.color[i] = norm * (model.ambient * model.ambientColor[i] + model.diffuse * model.diffuseColor[i] + model.specular * model.specularColor[i]);\n }\n\n return [].concat(model.color);\n };\n\n publicAPI.addShaderVariable = notImplemented('AddShaderVariable');\n\n publicAPI.setInterpolationToFlat = function () {\n return publicAPI.setInterpolation(Interpolation.FLAT);\n };\n\n publicAPI.setInterpolationToGouraud = function () {\n return publicAPI.setInterpolation(Interpolation.GOURAUD);\n };\n\n publicAPI.setInterpolationToPhong = function () {\n return publicAPI.setInterpolation(Interpolation.PHONG);\n };\n\n publicAPI.getInterpolationAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(Interpolation, model.interpolation);\n };\n\n publicAPI.setRepresentationToWireframe = function () {\n return publicAPI.setRepresentation(Representation.WIREFRAME);\n };\n\n publicAPI.setRepresentationToSurface = function () {\n return publicAPI.setRepresentation(Representation.SURFACE);\n };\n\n publicAPI.setRepresentationToPoints = function () {\n return publicAPI.setRepresentation(Representation.POINTS);\n };\n\n publicAPI.getRepresentationAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(Representation, model.representation);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n color: [1, 1, 1],\n ambientColor: [1, 1, 1],\n diffuseColor: [1, 1, 1],\n specularColor: [1, 1, 1],\n edgeColor: [0, 0, 0],\n ambient: 0,\n diffuse: 1,\n specular: 0,\n specularPower: 1,\n opacity: 1,\n interpolation: Interpolation.GOURAUD,\n representation: Representation.SURFACE,\n edgeVisibility: false,\n backfaceCulling: false,\n frontfaceCulling: false,\n pointSize: 1,\n lineWidth: 1,\n lighting: true,\n shading: false,\n materialName: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['lighting', 'interpolation', 'ambient', 'diffuse', 'specular', 'specularPower', 'opacity', 'edgeVisibility', 'lineWidth', 'pointSize', 'backfaceCulling', 'frontfaceCulling', 'representation']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['ambientColor', 'specularColor', 'diffuseColor', 'edgeColor'], 3); // Object methods\n\n vtkProperty(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkProperty'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/RenderWindow/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/RenderWindow/index.js ***! - \**************************************************************************/ -/*! exports provided: registerViewConstructor, listViewAPIs, newAPISpecificView, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerViewConstructor\", function() { return registerViewConstructor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"listViewAPIs\", function() { return listViewAPIs; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newAPISpecificView\", function() { return newAPISpecificView; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VIEW_API = navigator.gpu ? 'WebGPU' : 'WebGL';\nvar VIEW_CONSTRUCTORS = Object.create(null); // ----------------------------------------------------------------------------\n// static methods\n// ----------------------------------------------------------------------------\n\nfunction registerViewConstructor(name, constructor) {\n VIEW_CONSTRUCTORS[name] = constructor;\n}\nfunction listViewAPIs() {\n return Object.keys(VIEW_CONSTRUCTORS);\n}\nfunction newAPISpecificView(name) {\n var initialValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return VIEW_CONSTRUCTORS[name] && VIEW_CONSTRUCTORS[name](initialValues);\n} // ----------------------------------------------------------------------------\n// vtkRenderWindow methods\n// ----------------------------------------------------------------------------\n\nfunction vtkRenderWindow(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkRenderWindow'); // Add renderer\n\n publicAPI.addRenderer = function (renderer) {\n if (publicAPI.hasRenderer(renderer)) {\n return;\n }\n\n renderer.setRenderWindow(publicAPI);\n model.renderers.push(renderer); // for (this->Renderers->InitTraversal(rsit);\n // (aren = this->Renderers->GetNextRenderer(rsit)); )\n // {\n // aren->SetAllocatedRenderTime\n // (1.0/(this->DesiredUpdateRate*this->Renderers->GetNumberOfItems()));\n // }\n\n publicAPI.modified();\n }; // Remove renderer\n\n\n publicAPI.removeRenderer = function (renderer) {\n model.renderers = model.renderers.filter(function (r) {\n return r !== renderer;\n });\n publicAPI.modified();\n };\n\n publicAPI.hasRenderer = function (ren) {\n return model.renderers.indexOf(ren) !== -1;\n }; // get an API specific view of this data\n\n\n publicAPI.newAPISpecificView = function (name) {\n var initialValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return newAPISpecificView(name || model.defaultViewAPI, initialValues);\n }; // Add renderer\n\n\n publicAPI.addView = function (view) {\n if (publicAPI.hasView(view)) {\n return;\n }\n\n view.setRenderable(publicAPI);\n model.views.push(view);\n publicAPI.modified();\n }; // Remove renderer\n\n\n publicAPI.removeView = function (view) {\n model.views = model.views.filter(function (r) {\n return r !== view;\n });\n publicAPI.modified();\n };\n\n publicAPI.hasView = function (view) {\n return model.views.indexOf(view) !== -1;\n };\n\n publicAPI.render = function () {\n if (model.interactor) {\n model.interactor.render();\n } else {\n model.views.forEach(function (view) {\n return view.traverseAllPasses();\n });\n }\n };\n\n publicAPI.getStatistics = function () {\n var results = {\n propCount: 0,\n invisiblePropCount: 0\n };\n model.renderers.forEach(function (ren) {\n var props = ren.getViewProps();\n props.forEach(function (prop) {\n if (prop.getVisibility()) {\n results.propCount += 1;\n var mpr = prop.getMapper && prop.getMapper();\n\n if (mpr && mpr.getPrimitiveCount) {\n var pcount = mpr.getPrimitiveCount();\n Object.keys(pcount).forEach(function (keyName) {\n if (!results[keyName]) {\n results[keyName] = 0;\n }\n\n results[keyName] += pcount[keyName];\n });\n }\n } else {\n results.invisiblePropCount += 1;\n }\n });\n });\n results.str = Object.keys(results).map(function (keyName) {\n return \"\".concat(keyName, \": \").concat(results[keyName]);\n }).join('\\n');\n return results;\n };\n\n publicAPI.captureImages = function () {\n var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'image/png';\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setImmediate(publicAPI.render);\n return model.views.map(function (view) {\n return view.captureNextImage ? view.captureNextImage(format, opts) : undefined;\n }).filter(function (i) {\n return !!i;\n });\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n defaultViewAPI: DEFAULT_VIEW_API,\n renderers: [],\n views: [],\n interactor: null,\n neverRendered: true,\n numberOfLayers: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['interactor', 'numberOfLayers', 'views', 'defaultViewAPI']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['neverRendered']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['renderers']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'completion'); // Object methods\n\n vtkRenderWindow(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkRenderWindow'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n registerViewConstructor: registerViewConstructor,\n listViewAPIs: listViewAPIs,\n newAPISpecificView: newAPISpecificView\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/RenderWindow/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants.js ***! - \****************************************************************************************/ -/*! exports provided: Device, Input, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Device\", function() { return Device; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Input\", function() { return Input; });\nvar Device = {\n Unknown: 0,\n LeftController: 1,\n RightController: 2\n};\nvar Input = {\n Unknown: 0,\n Trigger: 1,\n TrackPad: 2,\n Grip: 3,\n ApplicationMenu: 4\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n Device: Device,\n Input: Input\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/index.js": -/*!************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/index.js ***! - \************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\nvar Device = vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Device,\n Input = vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Input;\nvar vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkWarningMacro,\n vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro,\n normalizeWheel = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].normalizeWheel,\n vtkOnceErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkOnceErrorMacro; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nvar deviceInputMap = {\n 'OpenVR Gamepad': [Input.TrackPad, Input.Trigger, Input.Grip, Input.ApplicationMenu]\n};\nvar handledEvents = ['StartAnimation', 'Animation', 'EndAnimation', 'MouseEnter', 'MouseLeave', 'StartMouseMove', 'MouseMove', 'EndMouseMove', 'LeftButtonPress', 'LeftButtonRelease', 'MiddleButtonPress', 'MiddleButtonRelease', 'RightButtonPress', 'RightButtonRelease', 'KeyPress', 'KeyDown', 'KeyUp', 'StartMouseWheel', 'MouseWheel', 'EndMouseWheel', 'StartPinch', 'Pinch', 'EndPinch', 'StartPan', 'Pan', 'EndPan', 'StartRotate', 'Rotate', 'EndRotate', 'Button3D', 'Move3D', 'StartPointerLock', 'EndPointerLock', 'StartInteraction', 'Interaction', 'EndInteraction'];\n\nfunction preventDefault(event) {\n event.stopPropagation();\n event.preventDefault();\n return false;\n} // ----------------------------------------------------------------------------\n// vtkRenderWindowInteractor methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkRenderWindowInteractor(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkRenderWindowInteractor'); // Initialize list of requesters\n\n var animationRequesters = new Set(); // track active event listeners to handle simultaneous button tracking\n\n var activeListenerCount = 0; // Public API methods\n //----------------------------------------------------------------------\n\n publicAPI.start = function () {\n // Let the compositing handle the event loop if it wants to.\n // if (publicAPI.HasObserver(vtkCommand::StartEvent) && !publicAPI.HandleEventLoop) {\n // publicAPI.invokeEvent({ type: 'StartEvent' });\n // return;\n // }\n // As a convenience, initialize if we aren't initialized yet.\n if (!model.initialized) {\n publicAPI.initialize();\n\n if (!model.initialized) {\n return;\n }\n } // Pass execution to the subclass which will run the event loop,\n // this will not return until TerminateApp is called.\n\n\n publicAPI.startEventLoop();\n }; //----------------------------------------------------------------------\n\n\n publicAPI.setRenderWindow = function (aren) {\n vtkErrorMacro('you want to call setView(view) instead of setRenderWindow on a vtk.js interactor');\n }; //----------------------------------------------------------------------\n\n\n publicAPI.setInteractorStyle = function (style) {\n if (model.interactorStyle !== style) {\n if (model.interactorStyle != null) {\n model.interactorStyle.setInteractor(null);\n }\n\n model.interactorStyle = style;\n\n if (model.interactorStyle != null) {\n if (model.interactorStyle.getInteractor() !== publicAPI) {\n model.interactorStyle.setInteractor(publicAPI);\n }\n }\n }\n }; //---------------------------------------------------------------------\n\n\n publicAPI.initialize = function () {\n model.initialized = true;\n publicAPI.enable();\n publicAPI.render();\n };\n\n publicAPI.enable = function () {\n return publicAPI.setEnabled(true);\n };\n\n publicAPI.disable = function () {\n return publicAPI.setEnabled(false);\n };\n\n publicAPI.startEventLoop = function () {\n return vtkWarningMacro('empty event loop');\n };\n\n function updateCurrentRenderer(x, y) {\n model.currentRenderer = publicAPI.findPokedRenderer(x, y);\n }\n\n publicAPI.getCurrentRenderer = function () {\n if (model.currentRenderer) {\n return model.currentRenderer;\n }\n\n updateCurrentRenderer(0, 0);\n return model.currentRenderer;\n };\n\n function getScreenEventPositionFor(source) {\n var bounds = model.container.getBoundingClientRect();\n var canvas = model.view.getCanvas();\n var scaleX = canvas.width / bounds.width;\n var scaleY = canvas.height / bounds.height;\n var position = {\n x: scaleX * (source.clientX - bounds.left),\n y: scaleY * (bounds.height - source.clientY + bounds.top),\n z: 0\n };\n updateCurrentRenderer(position.x, position.y);\n return position;\n }\n\n function getTouchEventPositionsFor(touches) {\n var positions = {};\n\n for (var i = 0; i < touches.length; i++) {\n var touch = touches[i];\n positions[touch.identifier] = getScreenEventPositionFor(touch);\n }\n\n return positions;\n }\n\n function getModifierKeysFor(event) {\n return {\n controlKey: event.ctrlKey,\n altKey: event.altKey,\n shiftKey: event.shiftKey\n };\n }\n\n function getKeysFor(event) {\n var modifierKeys = getModifierKeysFor(event);\n\n var keys = _objectSpread({\n key: event.key,\n keyCode: event.charCode\n }, modifierKeys);\n\n return keys;\n }\n\n function interactionRegistration(addListeners) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var rootElm = document;\n var method = addListeners ? 'addEventListener' : 'removeEventListener';\n var invMethod = addListeners ? 'removeEventListener' : 'addEventListener';\n\n if (!force && !addListeners && activeListenerCount > 0) {\n --activeListenerCount;\n } // only add/remove listeners when there are no registered listeners\n\n\n if (!activeListenerCount || force) {\n activeListenerCount = 0;\n\n if (model.container) {\n model.container[invMethod]('mousemove', publicAPI.handleMouseMove);\n }\n\n rootElm[method]('mouseup', publicAPI.handleMouseUp);\n rootElm[method]('mousemove', publicAPI.handleMouseMove);\n rootElm[method]('touchend', publicAPI.handleTouchEnd, false);\n rootElm[method]('touchcancel', publicAPI.handleTouchEnd, false);\n rootElm[method]('touchmove', publicAPI.handleTouchMove, false);\n }\n\n if (!force && addListeners) {\n ++activeListenerCount;\n }\n }\n\n publicAPI.bindEvents = function (container) {\n model.container = container;\n container.addEventListener('contextmenu', preventDefault); // container.addEventListener('click', preventDefault); // Avoid stopping event propagation\n\n container.addEventListener('wheel', publicAPI.handleWheel);\n container.addEventListener('DOMMouseScroll', publicAPI.handleWheel);\n container.addEventListener('mouseenter', publicAPI.handleMouseEnter);\n container.addEventListener('mouseleave', publicAPI.handleMouseLeave);\n container.addEventListener('mousemove', publicAPI.handleMouseMove);\n container.addEventListener('mousedown', publicAPI.handleMouseDown);\n document.addEventListener('keypress', publicAPI.handleKeyPress);\n document.addEventListener('keydown', publicAPI.handleKeyDown);\n document.addEventListener('keyup', publicAPI.handleKeyUp);\n document.addEventListener('pointerlockchange', publicAPI.handlePointerLockChange);\n container.addEventListener('touchstart', publicAPI.handleTouchStart, false);\n };\n\n publicAPI.unbindEvents = function () {\n // force unbinding listeners\n interactionRegistration(false, true);\n model.container.removeEventListener('contextmenu', preventDefault); // model.container.removeEventListener('click', preventDefault); // Avoid stopping event propagation\n\n model.container.removeEventListener('wheel', publicAPI.handleWheel);\n model.container.removeEventListener('DOMMouseScroll', publicAPI.handleWheel);\n model.container.removeEventListener('mouseenter', publicAPI.handleMouseEnter);\n model.container.removeEventListener('mouseleave', publicAPI.handleMouseLeave);\n model.container.removeEventListener('mousemove', publicAPI.handleMouseMove);\n model.container.removeEventListener('mousedown', publicAPI.handleMouseDown);\n document.removeEventListener('keypress', publicAPI.handleKeyPress);\n document.removeEventListener('keydown', publicAPI.handleKeyDown);\n document.removeEventListener('keyup', publicAPI.handleKeyUp);\n document.removeEventListener('pointerlockchange', publicAPI.handlePointerLockChange);\n model.container.removeEventListener('touchstart', publicAPI.handleTouchStart);\n model.container = null;\n };\n\n publicAPI.handleKeyPress = function (event) {\n var data = getKeysFor(event);\n publicAPI.keyPressEvent(data);\n };\n\n publicAPI.handleKeyDown = function (event) {\n var data = getKeysFor(event);\n publicAPI.keyDownEvent(data);\n };\n\n publicAPI.handleKeyUp = function (event) {\n var data = getKeysFor(event);\n publicAPI.keyUpEvent(data);\n };\n\n publicAPI.handleMouseDown = function (event) {\n if (event.button > 2) {\n // ignore events from extra mouse buttons such as `back` and `forward`\n return;\n }\n\n interactionRegistration(true);\n event.stopPropagation();\n event.preventDefault();\n\n var callData = _objectSpread(_objectSpread({}, getModifierKeysFor(event)), {}, {\n position: getScreenEventPositionFor(event)\n });\n\n switch (event.button) {\n case 0:\n publicAPI.leftButtonPressEvent(callData);\n break;\n\n case 1:\n publicAPI.middleButtonPressEvent(callData);\n break;\n\n case 2:\n publicAPI.rightButtonPressEvent(callData);\n break;\n\n default:\n vtkErrorMacro(\"Unknown mouse button pressed: \".concat(event.button));\n break;\n }\n }; //----------------------------------------------------------------------\n\n\n publicAPI.requestPointerLock = function () {\n var canvas = publicAPI.getView().getCanvas();\n canvas.requestPointerLock();\n }; //----------------------------------------------------------------------\n\n\n publicAPI.exitPointerLock = function () {\n return document.exitPointerLock();\n }; //----------------------------------------------------------------------\n\n\n publicAPI.isPointerLocked = function () {\n return !!document.pointerLockElement;\n }; //----------------------------------------------------------------------\n\n\n publicAPI.handlePointerLockChange = function () {\n if (publicAPI.isPointerLocked()) {\n publicAPI.startPointerLockEvent();\n } else {\n publicAPI.endPointerLockEvent();\n }\n }; //----------------------------------------------------------------------\n\n\n function forceRender() {\n if (model.view && model.enabled && model.enableRender) {\n model.inRender = true;\n model.view.traverseAllPasses();\n model.inRender = false;\n } // outside the above test so that third-party code can redirect\n // the render to the appropriate class\n\n\n publicAPI.invokeRenderEvent();\n }\n\n publicAPI.requestAnimation = function (requestor) {\n if (requestor === undefined) {\n vtkErrorMacro(\"undefined requester, can not start animating\");\n return;\n }\n\n if (animationRequesters.has(requestor)) {\n vtkWarningMacro(\"requester is already registered for animating\");\n return;\n }\n\n animationRequesters.add(requestor);\n\n if (animationRequesters.size === 1) {\n model.lastFrameTime = 0.1;\n model.lastFrameStart = Date.now();\n model.animationRequest = requestAnimationFrame(publicAPI.handleAnimation);\n publicAPI.startAnimationEvent();\n }\n };\n\n publicAPI.isAnimating = function () {\n return model.vrAnimation || model.animationRequest !== null;\n };\n\n publicAPI.cancelAnimation = function (requestor) {\n var skipWarning = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!animationRequesters.has(requestor)) {\n if (!skipWarning) {\n var requestStr = requestor && requestor.getClassName ? requestor.getClassName() : requestor;\n vtkWarningMacro(\"\".concat(requestStr, \" did not request an animation\"));\n }\n\n return;\n }\n\n animationRequesters.delete(requestor);\n\n if (model.animationRequest && animationRequesters.size === 0) {\n cancelAnimationFrame(model.animationRequest);\n model.animationRequest = null;\n publicAPI.endAnimationEvent();\n publicAPI.render();\n }\n };\n\n publicAPI.switchToVRAnimation = function () {\n // cancel existing animation if any\n if (model.animationRequest) {\n cancelAnimationFrame(model.animationRequest);\n model.animationRequest = null;\n }\n\n model.vrAnimation = true;\n };\n\n publicAPI.returnFromVRAnimation = function () {\n model.vrAnimation = false;\n\n if (animationRequesters.size !== 0) {\n model.FrameTime = -1;\n model.animationRequest = requestAnimationFrame(publicAPI.handleAnimation);\n }\n };\n\n publicAPI.updateGamepads = function (displayId) {\n var gamepads = navigator.getGamepads(); // watch for when buttons change state and fire events\n\n for (var i = 0; i < gamepads.length; ++i) {\n var gp = gamepads[i];\n\n if (gp && gp.displayId === displayId) {\n if (!(gp.index in model.lastGamepadValues)) {\n model.lastGamepadValues[gp.index] = {\n buttons: {}\n };\n }\n\n for (var b = 0; b < gp.buttons.length; ++b) {\n if (!(b in model.lastGamepadValues[gp.index].buttons)) {\n model.lastGamepadValues[gp.index].buttons[b] = false;\n }\n\n if (model.lastGamepadValues[gp.index].buttons[b] !== gp.buttons[b].pressed) {\n publicAPI.button3DEvent({\n gamepad: gp,\n position: gp.pose.position,\n orientation: gp.pose.orientation,\n pressed: gp.buttons[b].pressed,\n device: gp.hand === 'left' ? Device.LeftController : Device.RightController,\n input: deviceInputMap[gp.id] && deviceInputMap[gp.id][b] ? deviceInputMap[gp.id][b] : Input.Trigger\n });\n model.lastGamepadValues[gp.index].buttons[b] = gp.buttons[b].pressed;\n }\n\n if (model.lastGamepadValues[gp.index].buttons[b]) {\n publicAPI.move3DEvent({\n gamepad: gp,\n position: gp.pose.position,\n orientation: gp.pose.orientation,\n device: gp.hand === 'left' ? Device.LeftController : Device.RightController\n });\n }\n }\n }\n }\n };\n\n publicAPI.handleMouseMove = function (event) {\n // Do not consume event for move\n // event.stopPropagation();\n // event.preventDefault();\n var callData = _objectSpread(_objectSpread({}, getModifierKeysFor(event)), {}, {\n position: getScreenEventPositionFor(event)\n });\n\n if (model.moveTimeoutID === 0) {\n publicAPI.startMouseMoveEvent(callData);\n } else {\n publicAPI.mouseMoveEvent(callData);\n clearTimeout(model.moveTimeoutID);\n } // start a timer to keep us animating while we get mouse move events\n\n\n model.moveTimeoutID = setTimeout(function () {\n publicAPI.endMouseMoveEvent();\n model.moveTimeoutID = 0;\n }, 200);\n };\n\n publicAPI.handleAnimation = function () {\n var currTime = Date.now();\n\n if (model.FrameTime === -1.0) {\n model.lastFrameTime = 0.1;\n } else {\n model.lastFrameTime = (currTime - model.lastFrameStart) / 1000.0;\n }\n\n model.lastFrameTime = Math.max(0.01, model.lastFrameTime);\n model.lastFrameStart = currTime;\n publicAPI.animationEvent();\n forceRender();\n model.animationRequest = requestAnimationFrame(publicAPI.handleAnimation);\n };\n\n publicAPI.handleWheel = function (event) {\n event.stopPropagation();\n event.preventDefault();\n /**\n * wheel event values can vary significantly across browsers, platforms\n * and devices [1]. `normalizeWheel` uses facebook's solution from their\n * fixed-data-table repository [2].\n *\n * [1] https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel\n * [2] https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js\n *\n * This code will return an object with properties:\n *\n * spinX -- normalized spin speed (use for zoom) - x plane\n * spinY -- \" - y plane\n * pixelX -- normalized distance (to pixels) - x plane\n * pixelY -- \" - y plane\n *\n */\n\n var callData = _objectSpread(_objectSpread(_objectSpread({}, normalizeWheel(event)), getModifierKeysFor(event)), {}, {\n position: getScreenEventPositionFor(event)\n });\n\n if (model.wheelTimeoutID === 0) {\n publicAPI.startMouseWheelEvent(callData);\n } else {\n publicAPI.mouseWheelEvent(callData);\n clearTimeout(model.wheelTimeoutID);\n } // start a timer to keep us animating while we get wheel events\n\n\n model.wheelTimeoutID = setTimeout(function () {\n publicAPI.endMouseWheelEvent();\n model.wheelTimeoutID = 0;\n }, 200);\n };\n\n publicAPI.handleMouseEnter = function (event) {\n var callData = _objectSpread(_objectSpread({}, getModifierKeysFor(event)), {}, {\n position: getScreenEventPositionFor(event)\n });\n\n publicAPI.mouseEnterEvent(callData);\n };\n\n publicAPI.handleMouseLeave = function (event) {\n var callData = _objectSpread(_objectSpread({}, getModifierKeysFor(event)), {}, {\n position: getScreenEventPositionFor(event)\n });\n\n publicAPI.mouseLeaveEvent(callData);\n };\n\n publicAPI.handleMouseUp = function (event) {\n interactionRegistration(false);\n event.stopPropagation();\n event.preventDefault();\n\n var callData = _objectSpread(_objectSpread({}, getModifierKeysFor(event)), {}, {\n position: getScreenEventPositionFor(event)\n });\n\n switch (event.button) {\n case 0:\n publicAPI.leftButtonReleaseEvent(callData);\n break;\n\n case 1:\n publicAPI.middleButtonReleaseEvent(callData);\n break;\n\n case 2:\n publicAPI.rightButtonReleaseEvent(callData);\n break;\n\n default:\n vtkErrorMacro(\"Unknown mouse button released: \".concat(event.button));\n break;\n }\n };\n\n publicAPI.handleTouchStart = function (event) {\n interactionRegistration(true);\n event.stopPropagation();\n event.preventDefault(); // If multitouch\n\n if (model.recognizeGestures && event.touches.length > 1) {\n var positions = getTouchEventPositionsFor(event.touches); // did we just transition to multitouch?\n\n if (event.touches.length === 2) {\n var touch = event.touches[0];\n var callData = {\n position: getScreenEventPositionFor(touch),\n shiftKey: false,\n altKey: false,\n controlKey: false\n };\n publicAPI.leftButtonReleaseEvent(callData);\n } // handle the gesture\n\n\n publicAPI.recognizeGesture('TouchStart', positions);\n } else {\n var _touch = event.touches[0];\n var _callData = {\n position: getScreenEventPositionFor(_touch),\n shiftKey: false,\n altKey: false,\n controlKey: false\n };\n publicAPI.leftButtonPressEvent(_callData);\n }\n };\n\n publicAPI.handleTouchMove = function (event) {\n event.stopPropagation();\n event.preventDefault();\n\n if (model.recognizeGestures && event.touches.length > 1) {\n var positions = getTouchEventPositionsFor(event.touches);\n publicAPI.recognizeGesture('TouchMove', positions);\n } else {\n var touch = event.touches[0];\n var callData = {\n position: getScreenEventPositionFor(touch),\n shiftKey: false,\n altKey: false,\n controlKey: false\n };\n publicAPI.mouseMoveEvent(callData);\n }\n };\n\n publicAPI.handleTouchEnd = function (event) {\n event.stopPropagation();\n event.preventDefault();\n\n if (model.recognizeGestures) {\n // No more fingers down\n if (event.touches.length === 0) {\n // If just one finger released, consider as left button\n if (event.changedTouches.length === 1) {\n var touch = event.changedTouches[0];\n var callData = {\n position: getScreenEventPositionFor(touch),\n shiftKey: false,\n altKey: false,\n controlKey: false\n };\n publicAPI.leftButtonReleaseEvent(callData);\n interactionRegistration(false);\n } else {\n // If more than one finger released, recognize touchend\n var positions = getTouchEventPositionsFor(event.changedTouches);\n publicAPI.recognizeGesture('TouchEnd', positions);\n interactionRegistration(false);\n }\n } else if (event.touches.length === 1) {\n // If one finger left, end touch and start button press\n var _positions = getTouchEventPositionsFor(event.changedTouches);\n\n publicAPI.recognizeGesture('TouchEnd', _positions);\n var _touch2 = event.touches[0];\n var _callData2 = {\n position: getScreenEventPositionFor(_touch2),\n shiftKey: false,\n altKey: false,\n controlKey: false\n };\n publicAPI.leftButtonPressEvent(_callData2);\n } else {\n // If more than one finger left, keep touch move\n var _positions2 = getTouchEventPositionsFor(event.touches);\n\n publicAPI.recognizeGesture('TouchMove', _positions2);\n }\n } else {\n var _touch3 = event.changedTouches[0];\n var _callData3 = {\n position: getScreenEventPositionFor(_touch3),\n shiftKey: false,\n altKey: false,\n controlKey: false\n };\n publicAPI.leftButtonReleaseEvent(_callData3);\n interactionRegistration(false);\n }\n };\n\n publicAPI.setView = function (val) {\n if (model.view === val) {\n return;\n }\n\n model.view = val;\n model.view.getRenderable().setInteractor(publicAPI);\n publicAPI.modified();\n };\n\n publicAPI.getFirstRenderer = function () {\n return model.view.getRenderable().getRenderersByReference()[0];\n };\n\n publicAPI.findPokedRenderer = function () {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (!model.view) {\n return null;\n } // The original order of renderers needs to remain as\n // the first one is the one we want to manipulate the camera on.\n\n\n var rc = model.view.getRenderable().getRenderers();\n rc.sort(function (a, b) {\n return a.getLayer() - b.getLayer();\n });\n var interactiveren = null;\n var viewportren = null;\n var currentRenderer = null;\n var count = rc.length;\n\n while (count--) {\n var aren = rc[count];\n\n if (model.view.isInViewport(x, y, aren) && aren.getInteractive()) {\n currentRenderer = aren;\n break;\n }\n\n if (interactiveren === null && aren.getInteractive()) {\n // Save this renderer in case we can't find one in the viewport that\n // is interactive.\n interactiveren = aren;\n }\n\n if (viewportren === null && model.view.isInViewport(x, y, aren)) {\n // Save this renderer in case we can't find one in the viewport that\n // is interactive.\n viewportren = aren;\n }\n } // We must have a value. If we found an interactive renderer before, that's\n // better than a non-interactive renderer.\n\n\n if (currentRenderer === null) {\n currentRenderer = interactiveren;\n } // We must have a value. If we found a renderer that is in the viewport,\n // that is better than any old viewport (but not as good as an interactive\n // one).\n\n\n if (currentRenderer === null) {\n currentRenderer = viewportren;\n } // We must have a value - take anything.\n\n\n if (currentRenderer == null) {\n currentRenderer = rc[0];\n }\n\n return currentRenderer;\n }; // only render if we are not animating. If we are animating\n // then renders will happen naturally anyhow and we definitely\n // do not want extra renders as the make the apparent interaction\n // rate slower.\n\n\n publicAPI.render = function () {\n if (model.animationRequest === null && !model.inRender) {\n forceRender();\n }\n }; // create the generic Event methods\n\n\n handledEvents.forEach(function (eventName) {\n var lowerFirst = eventName.charAt(0).toLowerCase() + eventName.slice(1);\n\n publicAPI[\"\".concat(lowerFirst, \"Event\")] = function (arg) {\n // Check that interactor enabled\n if (!model.enabled) {\n return;\n } // Check that a poked renderer exists\n\n\n var renderer = publicAPI.getCurrentRenderer();\n\n if (!renderer) {\n vtkOnceErrorMacro(\"\\n Can not forward events without a current renderer on the interactor.\\n \");\n return;\n } // Pass the eventName and the poked renderer\n\n\n var callData = _objectSpread({\n type: eventName,\n pokedRenderer: model.currentRenderer,\n firstRenderer: publicAPI.getFirstRenderer()\n }, arg); // Call invoke\n\n\n publicAPI[\"invoke\".concat(eventName)](callData);\n };\n }); // we know we are in multitouch now, so start recognizing\n\n publicAPI.recognizeGesture = function (event, positions) {\n // more than two pointers we ignore\n if (Object.keys(positions).length > 2) {\n return;\n }\n\n if (!model.startingEventPositions) {\n model.startingEventPositions = {};\n } // store the initial positions\n\n\n if (event === 'TouchStart') {\n Object.keys(positions).forEach(function (key) {\n model.startingEventPositions[key] = positions[key];\n }); // we do not know what the gesture is yet\n\n model.currentGesture = 'Start';\n return;\n } // end the gesture if needed\n\n\n if (event === 'TouchEnd') {\n if (model.currentGesture === 'Pinch') {\n publicAPI.render();\n publicAPI.endPinchEvent();\n }\n\n if (model.currentGesture === 'Rotate') {\n publicAPI.render();\n publicAPI.endRotateEvent();\n }\n\n if (model.currentGesture === 'Pan') {\n publicAPI.render();\n publicAPI.endPanEvent();\n }\n\n model.currentGesture = 'Start';\n model.startingEventPositions = {};\n return;\n } // what are the two pointers we are working with\n\n\n var count = 0;\n var posVals = [];\n var startVals = [];\n Object.keys(positions).forEach(function (key) {\n posVals[count] = positions[key];\n startVals[count] = model.startingEventPositions[key];\n count++;\n }); // The meat of the algorithm\n // on move events we analyze them to determine what type\n // of movement it is and then deal with it.\n // calculate the distances\n\n var originalDistance = Math.sqrt((startVals[0].x - startVals[1].x) * (startVals[0].x - startVals[1].x) + (startVals[0].y - startVals[1].y) * (startVals[0].y - startVals[1].y));\n var newDistance = Math.sqrt((posVals[0].x - posVals[1].x) * (posVals[0].x - posVals[1].x) + (posVals[0].y - posVals[1].y) * (posVals[0].y - posVals[1].y)); // calculate rotations\n\n var originalAngle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"degreesFromRadians\"](Math.atan2(startVals[1].y - startVals[0].y, startVals[1].x - startVals[0].x));\n var newAngle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"degreesFromRadians\"](Math.atan2(posVals[1].y - posVals[0].y, posVals[1].x - posVals[0].x)); // angles are cyclic so watch for that, 1 and 359 are only 2 apart :)\n\n var angleDeviation = newAngle - originalAngle;\n newAngle = newAngle + 180.0 >= 360.0 ? newAngle - 180.0 : newAngle + 180.0;\n originalAngle = originalAngle + 180.0 >= 360.0 ? originalAngle - 180.0 : originalAngle + 180.0;\n\n if (Math.abs(newAngle - originalAngle) < Math.abs(angleDeviation)) {\n angleDeviation = newAngle - originalAngle;\n } // calculate the translations\n\n\n var trans = [];\n trans[0] = (posVals[0].x - startVals[0].x + posVals[1].x - startVals[1].x) / 2.0;\n trans[1] = (posVals[0].y - startVals[0].y + posVals[1].y - startVals[1].y) / 2.0;\n\n if (event === 'TouchMove') {\n // OK we want to\n // - immediately respond to the user\n // - allow the user to zoom without panning (saves focal point)\n // - allow the user to rotate without panning (saves focal point)\n // do we know what gesture we are doing yet? If not\n // see if we can figure it out\n if (model.currentGesture === 'Start') {\n // pinch is a move to/from the center point\n // rotate is a move along the circumference\n // pan is a move of the center point\n // compute the distance along each of these axes in pixels\n // the first to break thresh wins\n var thresh = 0.01 * Math.sqrt(model.container.clientWidth * model.container.clientWidth + model.container.clientHeight * model.container.clientHeight);\n\n if (thresh < 15.0) {\n thresh = 15.0;\n }\n\n var pinchDistance = Math.abs(newDistance - originalDistance);\n var rotateDistance = newDistance * 3.1415926 * Math.abs(angleDeviation) / 360.0;\n var panDistance = Math.sqrt(trans[0] * trans[0] + trans[1] * trans[1]);\n\n if (pinchDistance > thresh && pinchDistance > rotateDistance && pinchDistance > panDistance) {\n model.currentGesture = 'Pinch';\n var callData = {\n scale: 1.0,\n touches: positions\n };\n publicAPI.startPinchEvent(callData);\n } else if (rotateDistance > thresh && rotateDistance > panDistance) {\n model.currentGesture = 'Rotate';\n var _callData4 = {\n rotation: 0.0,\n touches: positions\n };\n publicAPI.startRotateEvent(_callData4);\n } else if (panDistance > thresh) {\n model.currentGesture = 'Pan';\n var _callData5 = {\n translation: [0, 0],\n touches: positions\n };\n publicAPI.startPanEvent(_callData5);\n }\n } else {\n // if we have found a specific type of movement then\n // handle it\n if (model.currentGesture === 'Rotate') {\n var _callData6 = {\n rotation: angleDeviation,\n touches: positions\n };\n publicAPI.rotateEvent(_callData6);\n }\n\n if (model.currentGesture === 'Pinch') {\n var _callData7 = {\n scale: newDistance / originalDistance,\n touches: positions\n };\n publicAPI.pinchEvent(_callData7);\n }\n\n if (model.currentGesture === 'Pan') {\n var _callData8 = {\n translation: trans,\n touches: positions\n };\n publicAPI.panEvent(_callData8);\n }\n }\n }\n };\n\n publicAPI.handleVisibilityChange = function () {\n model.lastFrameStart = Date.now();\n }; // Stop animating if the renderWindowInteractor is deleted.\n\n\n var superDelete = publicAPI.delete;\n\n publicAPI.delete = function () {\n while (animationRequesters.size) {\n publicAPI.cancelAnimation(animationRequesters.values().next().value);\n }\n\n if (typeof document.hidden !== 'undefined') {\n document.removeEventListener('visibilitychange', publicAPI.handleVisibilityChange);\n }\n\n superDelete();\n }; // Use the Page Visibility API to detect when we switch away from or back to\n // this tab, and reset the lastFrameStart. When tabs are not active, browsers\n // will stop calling requestAnimationFrame callbacks.\n\n\n if (typeof document.hidden !== 'undefined') {\n document.addEventListener('visibilitychange', publicAPI.handleVisibilityChange, false);\n }\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n renderWindow: null,\n interactorStyle: null,\n picker: null,\n pickingManager: null,\n initialized: false,\n enabled: false,\n enableRender: true,\n currentRenderer: null,\n lightFollowCamera: true,\n desiredUpdateRate: 30.0,\n stillUpdateRate: 2.0,\n container: null,\n view: null,\n recognizeGestures: true,\n currentGesture: 'Start',\n animationRequest: null,\n lastFrameTime: 0.1,\n wheelTimeoutID: 0,\n moveTimeoutID: 0,\n lastGamepadValues: {}\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'RenderEvent');\n handledEvents.forEach(function (eventName) {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, eventName);\n }); // Create get-only macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['initialized', 'container', 'interactorStyle', 'lastFrameTime', 'view']); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['lightFollowCamera', 'enabled', 'enableRender', 'recognizeGestures', 'desiredUpdateRate', 'stillUpdateRate', 'picker']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkRenderWindowInteractor(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkRenderWindowInteractor'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend,\n handledEvents: handledEvents\n}, vtk_js_Sources_Rendering_Core_RenderWindowInteractor_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Renderer/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Renderer/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Camera__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Camera */ \"./node_modules/vtk.js/Sources/Rendering/Core/Camera/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Light__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Light */ \"./node_modules/vtk.js/Sources/Rendering/Core/Light/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Viewport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Viewport */ \"./node_modules/vtk.js/Sources/Rendering/Core/Viewport/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\n\n\n\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkDebugMacro\"],\n vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"],\n vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkWarningMacro\"];\n\nfunction notImplemented(method) {\n return function () {\n return vtkErrorMacro(\"vtkRenderer::\".concat(method, \" - NOT IMPLEMENTED\"));\n };\n} // ----------------------------------------------------------------------------\n// vtkRenderer methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkRenderer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkRenderer'); // make sure background has 4 entries. Default to opaque black\n\n if (!model.background) model.background = [0, 0, 0, 1];\n\n while (model.background.length < 3) {\n model.background.push(0);\n }\n\n if (model.background.length === 3) model.background.push(1); // Events\n\n var COMPUTE_VISIBLE_PROP_BOUNDS_EVENT = {\n type: 'ComputeVisiblePropBoundsEvent',\n renderer: publicAPI\n };\n var RESET_CAMERA_CLIPPING_RANGE_EVENT = {\n type: 'ResetCameraClippingRangeEvent',\n renderer: publicAPI\n };\n var RESET_CAMERA_EVENT = {\n type: 'ResetCameraEvent',\n renderer: publicAPI\n };\n\n publicAPI.updateCamera = function () {\n if (!model.activeCamera) {\n vtkDebugMacro('No cameras are on, creating one.'); // the get method will automagically create a camera\n // and reset it since one hasn't been specified yet.\n\n publicAPI.getActiveCameraAndResetIfCreated();\n } // update the viewing transformation\n\n\n model.activeCamera.render(publicAPI);\n return true;\n };\n\n publicAPI.updateLightsGeometryToFollowCamera = function () {\n // only update the light's geometry if this Renderer is tracking\n // this lights. That allows one renderer to view the lights that\n // another renderer is setting up.\n var camera = publicAPI.getActiveCameraAndResetIfCreated();\n model.lights.forEach(function (light) {\n if (light.lightTypeIsSceneLight() || light.lightTypeIsCameraLight()) {// Do nothing. Don't reset the transform matrix because applications\n // may have set a custom matrix. Only reset the transform matrix in\n // vtkLight::SetLightTypeToSceneLight()\n } else if (light.lightTypeIsHeadLight()) {\n // update position and orientation of light to match camera.\n light.setPositionFrom(camera.getPositionByReference());\n light.setFocalPointFrom(camera.getFocalPointByReference());\n light.modified(camera.getMTime());\n } else {\n vtkErrorMacro('light has unknown light type', light.get());\n }\n });\n };\n\n publicAPI.updateLightGeometry = function () {\n if (model.lightFollowCamera) {\n // only update the light's geometry if this Renderer is tracking\n // this lights. That allows one renderer to view the lights that\n // another renderer is setting up.\n return publicAPI.updateLightsGeometryToFollowCamera();\n }\n\n return true;\n };\n\n publicAPI.allocateTime = notImplemented('allocateTime');\n publicAPI.updateGeometry = notImplemented('updateGeometry');\n\n publicAPI.getVTKWindow = function () {\n return model.renderWindow;\n };\n\n publicAPI.setLayer = function (layer) {\n vtkDebugMacro(publicAPI.getClassName(), publicAPI, 'setting Layer to ', layer);\n\n if (model.layer !== layer) {\n model.layer = layer;\n publicAPI.modified();\n }\n\n publicAPI.setPreserveColorBuffer(!!layer);\n };\n\n publicAPI.setActiveCamera = function (camera) {\n if (model.activeCamera === camera) {\n return false;\n }\n\n model.activeCamera = camera;\n publicAPI.modified();\n publicAPI.invokeEvent({\n type: 'ActiveCameraEvent',\n camera: camera\n });\n return true;\n };\n\n publicAPI.makeCamera = function () {\n var camera = vtk_js_Sources_Rendering_Core_Camera__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n publicAPI.invokeEvent({\n type: 'CreateCameraEvent',\n camera: camera\n });\n return camera;\n }; // Replace the set/get macro method\n\n\n publicAPI.getActiveCamera = function () {\n if (!model.activeCamera) {\n model.activeCamera = publicAPI.makeCamera();\n }\n\n return model.activeCamera;\n };\n\n publicAPI.getActiveCameraAndResetIfCreated = function () {\n if (!model.activeCamera) {\n publicAPI.getActiveCamera();\n publicAPI.resetCamera();\n }\n\n return model.activeCamera;\n };\n\n publicAPI.getActors = function () {\n model.actors = [];\n model.props.forEach(function (prop) {\n model.actors = model.actors.concat(prop.getActors());\n });\n return model.actors;\n };\n\n publicAPI.addActor = publicAPI.addViewProp;\n\n publicAPI.removeActor = function (actor) {\n model.actors = model.actors.filter(function (a) {\n return a !== actor;\n });\n publicAPI.removeViewProp(actor);\n publicAPI.modified();\n };\n\n publicAPI.removeAllActors = function () {\n var actors = publicAPI.getActors();\n actors.forEach(function (actor) {\n publicAPI.removeViewProp(actor);\n });\n model.actors = [];\n publicAPI.modified();\n };\n\n publicAPI.getVolumes = function () {\n model.volumes = [];\n model.props.forEach(function (prop) {\n model.volumes = model.volumes.concat(prop.getVolumes());\n });\n return model.volumes;\n };\n\n publicAPI.addVolume = publicAPI.addViewProp;\n\n publicAPI.removeVolume = function (volume) {\n model.volumes = model.volumes.filter(function (v) {\n return v !== volume;\n });\n publicAPI.removeViewProp(volume);\n publicAPI.modified();\n };\n\n publicAPI.removeAllVolumes = function () {\n var volumes = publicAPI.getVolumes();\n volumes.forEach(function (volume) {\n publicAPI.removeViewProp(volume);\n });\n model.volumes = [];\n publicAPI.modified();\n };\n\n publicAPI.addLight = function (light) {\n model.lights = [].concat(model.lights, light);\n publicAPI.modified();\n };\n\n publicAPI.removeLight = function (light) {\n model.lights = model.lights.filter(function (l) {\n return l !== light;\n });\n publicAPI.modified();\n };\n\n publicAPI.removeAllLights = function () {\n model.lights = [];\n publicAPI.modified();\n };\n\n publicAPI.setLightCollection = function (lights) {\n model.lights = lights;\n publicAPI.modified();\n };\n\n publicAPI.makeLight = vtk_js_Sources_Rendering_Core_Light__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance;\n\n publicAPI.createLight = function () {\n if (!model.automaticLightCreation) {\n return;\n }\n\n if (model.createdLight) {\n publicAPI.removeLight(model.createdLight);\n model.createdLight.delete();\n model.createdLight = null;\n }\n\n model.createdLight = publicAPI.makeLight();\n publicAPI.addLight(model.createdLight);\n model.createdLight.setLightTypeToHeadLight(); // set these values just to have a good default should LightFollowCamera\n // be turned off.\n\n model.createdLight.setPosition(publicAPI.getActiveCamera().getPosition());\n model.createdLight.setFocalPoint(publicAPI.getActiveCamera().getFocalPoint());\n }; // requires the aspect ratio of the viewport as X/Y\n\n\n publicAPI.normalizedDisplayToWorld = function (x, y, z, aspect) {\n var vpd = publicAPI.normalizedDisplayToProjection(x, y, z);\n vpd = publicAPI.projectionToView(vpd[0], vpd[1], vpd[2], aspect);\n return publicAPI.viewToWorld(vpd[0], vpd[1], vpd[2]);\n }; // requires the aspect ratio of the viewport as X/Y\n\n\n publicAPI.worldToNormalizedDisplay = function (x, y, z, aspect) {\n var vpd = publicAPI.worldToView(x, y, z);\n vpd = publicAPI.viewToProjection(vpd[0], vpd[1], vpd[2], aspect);\n return publicAPI.projectionToNormalizedDisplay(vpd[0], vpd[1], vpd[2]);\n }; // requires the aspect ratio of the viewport as X/Y\n\n\n publicAPI.viewToWorld = function (x, y, z) {\n if (model.activeCamera === null) {\n vtkErrorMacro('ViewToWorld: no active camera, cannot compute view to world, returning 0,0,0');\n return [0, 0, 0];\n } // get the view matrix from the active camera\n\n\n var matrix = model.activeCamera.getViewMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(matrix, matrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(matrix, matrix); // Transform point to world coordinates\n\n var result = new Float64Array([x, y, z]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(result, result, matrix);\n return result;\n };\n\n publicAPI.projectionToView = function (x, y, z, aspect) {\n if (model.activeCamera === null) {\n vtkErrorMacro('ProjectionToView: no active camera, cannot compute projection to view, returning 0,0,0');\n return [0, 0, 0];\n } // get the projection transformation from the active camera\n\n\n var matrix = model.activeCamera.getProjectionMatrix(aspect, -1.0, 1.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(matrix, matrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(matrix, matrix); // Transform point to world coordinates\n\n var result = new Float64Array([x, y, z]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(result, result, matrix);\n return result;\n }; // Convert world point coordinates to view coordinates.\n\n\n publicAPI.worldToView = function (x, y, z) {\n if (model.activeCamera === null) {\n vtkErrorMacro('WorldToView: no active camera, cannot compute view to world, returning 0,0,0');\n return [0, 0, 0];\n } // get the view transformation from the active camera\n\n\n var matrix = model.activeCamera.getViewMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(matrix, matrix);\n var result = new Float64Array([x, y, z]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(result, result, matrix);\n return result;\n }; // Convert world point coordinates to view coordinates.\n // requires the aspect ratio of the viewport as X/Y\n\n\n publicAPI.viewToProjection = function (x, y, z, aspect) {\n if (model.activeCamera === null) {\n vtkErrorMacro('ViewToProjection: no active camera, cannot compute view to projection, returning 0,0,0');\n return [0, 0, 0];\n } // get the projeciton transformation from the active camera\n\n\n var matrix = model.activeCamera.getProjectionMatrix(aspect, -1.0, 1.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(matrix, matrix);\n var result = new Float64Array([x, y, z]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(result, result, matrix);\n return result;\n };\n\n publicAPI.computeVisiblePropBounds = function () {\n model.allBounds[0] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INIT_BOUNDS[0];\n model.allBounds[1] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INIT_BOUNDS[1];\n model.allBounds[2] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INIT_BOUNDS[2];\n model.allBounds[3] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INIT_BOUNDS[3];\n model.allBounds[4] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INIT_BOUNDS[4];\n model.allBounds[5] = vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INIT_BOUNDS[5];\n var nothingVisible = true;\n publicAPI.invokeEvent(COMPUTE_VISIBLE_PROP_BOUNDS_EVENT); // loop through all props\n\n for (var index = 0; index < model.props.length; ++index) {\n var prop = model.props[index];\n\n if (prop.getVisibility() && prop.getUseBounds()) {\n var bounds = prop.getBounds();\n\n if (bounds && vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"areBoundsInitialized\"](bounds)) {\n nothingVisible = false;\n\n if (bounds[0] < model.allBounds[0]) {\n model.allBounds[0] = bounds[0];\n }\n\n if (bounds[1] > model.allBounds[1]) {\n model.allBounds[1] = bounds[1];\n }\n\n if (bounds[2] < model.allBounds[2]) {\n model.allBounds[2] = bounds[2];\n }\n\n if (bounds[3] > model.allBounds[3]) {\n model.allBounds[3] = bounds[3];\n }\n\n if (bounds[4] < model.allBounds[4]) {\n model.allBounds[4] = bounds[4];\n }\n\n if (bounds[5] > model.allBounds[5]) {\n model.allBounds[5] = bounds[5];\n }\n }\n }\n }\n\n if (nothingVisible) {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"uninitializeBounds\"](model.allBounds);\n vtkDebugMacro(\"Can't compute bounds, no 3D props are visible\");\n }\n\n return model.allBounds;\n };\n\n publicAPI.resetCamera = function () {\n var bounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var boundsToUse = bounds || publicAPI.computeVisiblePropBounds();\n var center = [0, 0, 0];\n\n if (!vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"areBoundsInitialized\"](boundsToUse)) {\n vtkDebugMacro('Cannot reset camera!');\n return false;\n }\n\n var vn = null;\n\n if (publicAPI.getActiveCamera()) {\n vn = model.activeCamera.getViewPlaneNormal();\n } else {\n vtkErrorMacro('Trying to reset non-existent camera');\n return false;\n } // Reset the perspective zoom factors, otherwise subsequent zooms will cause\n // the view angle to become very small and cause bad depth sorting.\n\n\n model.activeCamera.setViewAngle(30.0);\n center[0] = (boundsToUse[0] + boundsToUse[1]) / 2.0;\n center[1] = (boundsToUse[2] + boundsToUse[3]) / 2.0;\n center[2] = (boundsToUse[4] + boundsToUse[5]) / 2.0;\n var w1 = boundsToUse[1] - boundsToUse[0];\n var w2 = boundsToUse[3] - boundsToUse[2];\n var w3 = boundsToUse[5] - boundsToUse[4];\n w1 *= w1;\n w2 *= w2;\n w3 *= w3;\n var radius = w1 + w2 + w3; // If we have just a single point, pick a radius of 1.0\n\n radius = radius === 0 ? 1.0 : radius; // compute the radius of the enclosing sphere\n\n radius = Math.sqrt(radius) * 0.5; // default so that the bounding sphere fits within the view fustrum\n // compute the distance from the intersection of the view frustum with the\n // bounding sphere. Basically in 2D draw a circle representing the bounding\n // sphere in 2D then draw a horizontal line going out from the center of\n // the circle. That is the camera view. Then draw a line from the camera\n // position to the point where it intersects the circle. (it will be tangent\n // to the circle at this point, this is important, only go to the tangent\n // point, do not draw all the way to the view plane). Then draw the radius\n // from the tangent point to the center of the circle. You will note that\n // this forms a right triangle with one side being the radius, another being\n // the target distance for the camera, then just find the target dist using\n // a sin.\n\n var angle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"radiansFromDegrees\"](model.activeCamera.getViewAngle());\n var parallelScale = radius;\n var distance = radius / Math.sin(angle * 0.5); // check view-up vector against view plane normal\n\n var vup = model.activeCamera.getViewUp();\n\n if (Math.abs(vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"dot\"](vup, vn)) > 0.999) {\n vtkWarningMacro('Resetting view-up since view plane normal is parallel');\n model.activeCamera.setViewUp(-vup[2], vup[0], vup[1]);\n } // update the camera\n\n\n model.activeCamera.setFocalPoint(center[0], center[1], center[2]);\n model.activeCamera.setPosition(center[0] + distance * vn[0], center[1] + distance * vn[1], center[2] + distance * vn[2]);\n publicAPI.resetCameraClippingRange(boundsToUse); // setup default parallel scale\n\n model.activeCamera.setParallelScale(parallelScale); // update reasonable world to physical values\n\n model.activeCamera.setPhysicalScale(radius);\n model.activeCamera.setPhysicalTranslation(-center[0], -center[1], -center[2]); // Here to let parallel/distributed compositing intercept\n // and do the right thing.\n\n publicAPI.invokeEvent(RESET_CAMERA_EVENT);\n return true;\n };\n\n publicAPI.resetCameraClippingRange = function () {\n var bounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var boundsToUse = bounds || publicAPI.computeVisiblePropBounds();\n\n if (!vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"areBoundsInitialized\"](boundsToUse)) {\n vtkDebugMacro('Cannot reset camera clipping range!');\n return false;\n } // Make sure we have an active camera\n\n\n publicAPI.getActiveCameraAndResetIfCreated();\n\n if (!model.activeCamera) {\n vtkErrorMacro('Trying to reset clipping range of non-existent camera');\n return false;\n } // Get the exact range for the bounds\n\n\n var range = model.activeCamera.computeClippingRange(boundsToUse); // do not let far - near be less than 0.1 of the window height\n // this is for cases such as 2D images which may have zero range\n\n var minGap = 0.0;\n\n if (model.activeCamera.getParallelProjection()) {\n minGap = 0.1 * model.activeCamera.getParallelScale();\n } else {\n var angle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"radiansFromDegrees\"](model.activeCamera.getViewAngle());\n minGap = 0.2 * Math.tan(angle / 2.0) * range[1];\n }\n\n if (range[1] - range[0] < minGap) {\n minGap = minGap - range[1] + range[0];\n range[1] += minGap / 2.0;\n range[0] -= minGap / 2.0;\n } // Do not let the range behind the camera throw off the calculation.\n\n\n if (range[0] < 0.0) {\n range[0] = 0.0;\n } // Give ourselves a little breathing room\n\n\n range[0] = 0.99 * range[0] - (range[1] - range[0]) * model.clippingRangeExpansion;\n range[1] = 1.01 * range[1] + (range[1] - range[0]) * model.clippingRangeExpansion; // Make sure near is not bigger than far\n\n range[0] = range[0] >= range[1] ? 0.01 * range[1] : range[0]; // Make sure near is at least some fraction of far - this prevents near\n // from being behind the camera or too close in front. How close is too\n // close depends on the resolution of the depth buffer\n\n if (!model.nearClippingPlaneTolerance) {\n model.nearClippingPlaneTolerance = 0.01;\n } // make sure the front clipping range is not too far from the far clippnig\n // range, this is to make sure that the zbuffer resolution is effectively\n // used\n\n\n if (range[0] < model.nearClippingPlaneTolerance * range[1]) {\n range[0] = model.nearClippingPlaneTolerance * range[1];\n }\n\n model.activeCamera.setClippingRange(range[0], range[1]); // Here to let parallel/distributed compositing intercept\n // and do the right thing.\n\n publicAPI.invokeEvent(RESET_CAMERA_CLIPPING_RANGE_EVENT);\n return false;\n };\n\n publicAPI.setRenderWindow = function (renderWindow) {\n if (renderWindow !== model.renderWindow) {\n model.vtkWindow = renderWindow;\n model.renderWindow = renderWindow;\n }\n };\n\n publicAPI.visibleActorCount = function () {\n return model.props.filter(function (prop) {\n return prop.getVisibility();\n }).length;\n };\n\n publicAPI.visibleVolumeCount = publicAPI.visibleActorCount;\n\n publicAPI.getMTime = function () {\n var m1 = model.mtime;\n var m2 = model.activeCamera ? model.activeCamera.getMTime() : 0;\n\n if (m2 > m1) {\n m1 = m2;\n }\n\n var m3 = model.createdLight ? model.createdLight.getMTime() : 0;\n\n if (m3 > m1) {\n m1 = m3;\n }\n\n return m1;\n };\n\n publicAPI.getTransparent = function () {\n return !!model.preserveColorBuffer;\n };\n\n publicAPI.isActiveCameraCreated = function () {\n return !!model.activeCamera;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n pickedProp: null,\n activeCamera: null,\n allBounds: [],\n ambient: [1, 1, 1],\n allocatedRenderTime: 100,\n timeFactor: 1,\n createdLight: null,\n automaticLightCreation: true,\n twoSidedLighting: true,\n lastRenderTimeInSeconds: -1,\n renderWindow: null,\n lights: [],\n actors: [],\n volumes: [],\n lightFollowCamera: true,\n numberOfPropsRendered: 0,\n propArray: null,\n pathArray: null,\n layer: 0,\n preserveColorBuffer: false,\n preserveDepthBuffer: false,\n computeVisiblePropBounds: vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"createUninitializedBounds\"](),\n interactive: true,\n nearClippingPlaneTolerance: 0,\n clippingRangeExpansion: 0.05,\n erase: true,\n draw: true,\n useShadows: false,\n useDepthPeeling: false,\n occlusionRatio: 0,\n maximumNumberOfPeels: 4,\n selector: null,\n delegate: null,\n texturedBackground: false,\n backgroundTexture: null,\n pass: 0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Viewport__WEBPACK_IMPORTED_MODULE_5__[\"default\"].extend(publicAPI, model, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"get\"](publicAPI, model, ['renderWindow', 'allocatedRenderTime', 'timeFactor', 'lastRenderTimeInSeconds', 'numberOfPropsRendered', 'lastRenderingUsedDepthPeeling', 'selector']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['twoSidedLighting', 'lightFollowCamera', 'automaticLightCreation', 'erase', 'draw', 'nearClippingPlaneTolerance', 'clippingRangeExpansion', 'backingStore', 'interactive', 'layer', 'preserveColorBuffer', 'preserveDepthBuffer', 'useDepthPeeling', 'occlusionRatio', 'maximumNumberOfPeels', 'delegate', 'backgroundTexture', 'texturedBackground', 'useShadows', 'pass']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"getArray\"](publicAPI, model, ['actors', 'volumes', 'lights']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGetArray\"](publicAPI, model, ['background'], 4, 1.0); // Object methods\n\n vtkRenderer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkRenderer'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Renderer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Texture/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Texture/index.js ***! - \*********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkTexture methods\n// ----------------------------------------------------------------------------\n\nfunction vtkTexture(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkTexture');\n\n publicAPI.imageLoaded = function () {\n model.image.removeEventListener('load', publicAPI.imageLoaded);\n model.imageLoaded = true;\n publicAPI.modified();\n };\n\n publicAPI.setImage = function (image) {\n if (model.image === image) {\n return;\n }\n\n if (image !== null) {\n publicAPI.setInputData(null);\n publicAPI.setInputConnection(null);\n }\n\n model.image = image;\n model.imageLoaded = false;\n\n if (image.complete) {\n publicAPI.imageLoaded();\n } else {\n image.addEventListener('load', publicAPI.imageLoaded);\n }\n\n publicAPI.modified();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n repeat: false,\n interpolate: false,\n edgeClamp: false,\n image: null,\n imageLoaded: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].algo(publicAPI, model, 6, 0);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['imageLoaded']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['repeat', 'edgeClamp', 'interpolate', 'image']);\n vtkTexture(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkTexture'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Texture/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Viewport/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Viewport/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\n\nfunction notImplemented(method) {\n return function () {\n return vtkErrorMacro(\"vtkViewport::\".concat(method, \" - NOT IMPLEMENTED\"));\n };\n} // ----------------------------------------------------------------------------\n// vtkViewport methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkViewport(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkViewport'); // Public API methods\n\n publicAPI.getViewProps = function () {\n return model.props;\n };\n\n publicAPI.hasViewProp = function (prop) {\n return !!model.props.filter(function (item) {\n return item === prop;\n }).length;\n };\n\n publicAPI.addViewProp = function (prop) {\n if (prop && !publicAPI.hasViewProp(prop)) {\n model.props = model.props.concat(prop);\n }\n };\n\n publicAPI.removeViewProp = function (prop) {\n var newPropList = model.props.filter(function (item) {\n return item !== prop;\n });\n\n if (model.props.length !== newPropList.length) {\n model.props = newPropList;\n }\n };\n\n publicAPI.removeAllViewProps = function () {\n model.props = [];\n }; // this method get all the props including any nested props\n\n\n function gatherProps(prop) {\n var allProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n allProps.push(prop);\n var children = prop.getNestedProps();\n\n if (children && children.length) {\n for (var i = 0; i < children.length; i++) {\n gatherProps(children[i], allProps);\n }\n }\n\n return allProps;\n }\n\n publicAPI.getViewPropsWithNestedProps = function () {\n var allPropsArray = [];\n\n for (var i = 0; i < model.props.length; i++) {\n gatherProps(model.props[i], allPropsArray);\n }\n\n return allPropsArray;\n };\n\n publicAPI.addActor2D = publicAPI.addViewProp;\n\n publicAPI.removeActor2D = function (prop) {\n // VTK way: model.actors2D.RemoveItem(prop);\n publicAPI.removeViewProp(prop);\n };\n\n publicAPI.getActors2D = function () {\n model.actors2D = [];\n model.props.forEach(function (prop) {\n model.actors2D = model.actors2D.concat(prop.getActors2D());\n });\n return model.actors2D;\n };\n\n publicAPI.displayToView = function () {\n return vtkErrorMacro('call displayToView on your view instead');\n };\n\n publicAPI.viewToDisplay = function () {\n return vtkErrorMacro('callviewtodisplay on your view instead');\n };\n\n publicAPI.getSize = function () {\n return vtkErrorMacro('call getSize on your View instead');\n };\n\n publicAPI.normalizedDisplayToProjection = function (x, y, z) {\n // first to normalized viewport\n var nvp = publicAPI.normalizedDisplayToNormalizedViewport(x, y, z); // then to view\n\n return publicAPI.normalizedViewportToProjection(nvp[0], nvp[1], nvp[2]);\n };\n\n publicAPI.normalizedDisplayToNormalizedViewport = function (x, y, z) {\n var scale = [model.viewport[2] - model.viewport[0], model.viewport[3] - model.viewport[1]];\n return [(x - model.viewport[0]) / scale[0], (y - model.viewport[1]) / scale[1], z];\n };\n\n publicAPI.normalizedViewportToProjection = function (x, y, z) {\n return [x * 2.0 - 1.0, y * 2.0 - 1.0, z * 2.0 - 1.0];\n };\n\n publicAPI.projectionToNormalizedDisplay = function (x, y, z) {\n // first to nvp\n var nvp = publicAPI.projectionToNormalizedViewport(x, y, z); // then to ndp\n\n return publicAPI.normalizedViewportToNormalizedDisplay(nvp[0], nvp[1], nvp[2]);\n };\n\n publicAPI.normalizedViewportToNormalizedDisplay = function (x, y, z) {\n var scale = [model.viewport[2] - model.viewport[0], model.viewport[3] - model.viewport[1]];\n return [x * scale[0] + model.viewport[0], y * scale[1] + model.viewport[1], z];\n };\n\n publicAPI.projectionToNormalizedViewport = function (x, y, z) {\n return [(x + 1.0) * 0.5, (y + 1.0) * 0.5, (z + 1.0) * 0.5];\n };\n\n publicAPI.PickPropFrom = notImplemented('PickPropFrom');\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n vtkWindow: null,\n background: [0, 0, 0],\n background2: [0.2, 0.2, 0.2],\n gradientBackground: false,\n viewport: [0, 0, 1, 1],\n aspect: [1, 1],\n pixelAspect: [1, 1],\n props: [],\n actors2D: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'event');\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['viewport'], 4);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['background', 'background2'], 3);\n vtkViewport(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkViewport'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Viewport/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/Volume/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/Volume/index.js ***! - \********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Prop3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Prop3D */ \"./node_modules/vtk.js/Sources/Rendering/Core/Prop3D/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_VolumeProperty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/VolumeProperty */ \"./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/index.js\");\n\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkDebugMacro; // ----------------------------------------------------------------------------\n// vtkVolume methods\n// ----------------------------------------------------------------------------\n\nfunction vtkVolume(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkVolume');\n\n publicAPI.getVolumes = function () {\n return publicAPI;\n };\n\n publicAPI.makeProperty = vtk_js_Sources_Rendering_Core_VolumeProperty__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance;\n\n publicAPI.getProperty = function () {\n if (model.property === null) {\n model.property = publicAPI.makeProperty();\n }\n\n return model.property;\n };\n\n publicAPI.getBounds = function () {\n if (model.mapper === null) {\n return model.bounds;\n } // Check for the special case when the mapper's bounds are unknown\n\n\n var bds = model.mapper.getBounds();\n\n if (!bds || bds.length !== 6) {\n return bds;\n } // Check for the special case when the actor is empty.\n\n\n if (bds[0] > bds[1]) {\n model.mapperBounds = bds.concat(); // copy the mapper's bounds\n\n model.bounds = [1, -1, 1, -1, 1, -1];\n model.boundsMTime.modified();\n return bds;\n } // Check if we have cached values for these bounds - we cache the\n // values returned by model.mapper.getBounds() and we store the time\n // of caching. If the values returned this time are different, or\n // the modified time of this class is newer than the cached time,\n // then we need to rebuild.\n\n\n var zip = function zip(rows) {\n return rows[0].map(function (_, c) {\n return rows.map(function (row) {\n return row[c];\n });\n });\n };\n\n if (!model.mapperBounds || !zip([bds, model.mapperBounds]).reduce(function (a, b) {\n return a && b[0] === b[1];\n }, true) || publicAPI.getMTime() > model.boundsMTime.getMTime()) {\n vtkDebugMacro('Recomputing bounds...');\n model.mapperBounds = bds.map(function (x) {\n return x;\n });\n var bbox = [];\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getCorners(bds, bbox);\n publicAPI.computeMatrix();\n var tmp4 = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(tmp4, model.matrix);\n bbox.forEach(function (pt) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(pt, pt, tmp4);\n });\n /* eslint-disable no-multi-assign */\n\n model.bounds[0] = model.bounds[2] = model.bounds[4] = Number.MAX_VALUE;\n model.bounds[1] = model.bounds[3] = model.bounds[5] = -Number.MAX_VALUE;\n /* eslint-enable no-multi-assign */\n\n model.bounds = model.bounds.map(function (d, i) {\n return i % 2 === 0 ? bbox.reduce(function (a, b) {\n return a > b[i / 2] ? b[i / 2] : a;\n }, d) : bbox.reduce(function (a, b) {\n return a < b[(i - 1) / 2] ? b[(i - 1) / 2] : a;\n }, d);\n });\n model.boundsMTime.modified();\n }\n\n return model.bounds;\n };\n\n publicAPI.getMTime = function () {\n var mt = model.mtime;\n\n if (model.property !== null) {\n var time = model.property.getMTime();\n mt = time > mt ? time : mt;\n }\n\n return mt;\n };\n\n publicAPI.getRedrawMTime = function () {\n var mt = model.mtime;\n\n if (model.mapper !== null) {\n var time = model.mapper.getMTime();\n mt = time > mt ? time : mt;\n\n if (model.mapper.getInput() !== null) {\n // FIXME !!! getInputAlgorithm / getInput\n model.mapper.getInputAlgorithm().update();\n time = model.mapper.getInput().getMTime();\n mt = time > mt ? time : mt;\n }\n }\n\n return mt;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n mapper: null,\n property: null,\n bounds: [1, -1, 1, -1, 1, -1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_Core_Prop3D__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues); // vtkTimeStamp\n\n model.boundsMTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(model.boundsMTime); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].set(publicAPI, model, ['property']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['mapper']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getArray(publicAPI, model, ['bounds'], 6); // Object methods\n\n vtkVolume(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkVolume'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/Volume/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/Constants.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/Constants.js ***! - \******************************************************************************/ -/*! exports provided: BlendMode, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BlendMode\", function() { return BlendMode; });\nvar BlendMode = {\n COMPOSITE_BLEND: 0,\n MAXIMUM_INTENSITY_BLEND: 1,\n MINIMUM_INTENSITY_BLEND: 2,\n AVERAGE_INTENSITY_BLEND: 3\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n BlendMode: BlendMode\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/index.js ***! - \**************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_VolumeMapper_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/VolumeMapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_AbstractMapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/AbstractMapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/AbstractMapper/index.js\");\n\n\n\n\nvar BlendMode = vtk_js_Sources_Rendering_Core_VolumeMapper_Constants__WEBPACK_IMPORTED_MODULE_2__[\"default\"].BlendMode; // ----------------------------------------------------------------------------\n// vtkVolumeMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkVolumeMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkVolumeMapper');\n\n publicAPI.getBounds = function () {\n var input = publicAPI.getInputData();\n\n if (!input) {\n model.bounds = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"createUninitializedBounds\"]();\n } else {\n if (!model.static) {\n publicAPI.update();\n }\n\n model.bounds = input.getBounds();\n }\n\n return model.bounds;\n };\n\n publicAPI.update = function () {\n publicAPI.getInputData();\n };\n\n publicAPI.setBlendModeToComposite = function () {\n publicAPI.setBlendMode(BlendMode.COMPOSITE_BLEND);\n };\n\n publicAPI.setBlendModeToMaximumIntensity = function () {\n publicAPI.setBlendMode(BlendMode.MAXIMUM_INTENSITY_BLEND);\n };\n\n publicAPI.setBlendModeToMinimumIntensity = function () {\n publicAPI.setBlendMode(BlendMode.MINIMUM_INTENSITY_BLEND);\n };\n\n publicAPI.setBlendModeToAverageIntensity = function () {\n publicAPI.setBlendMode(BlendMode.AVERAGE_INTENSITY_BLEND);\n };\n\n publicAPI.getBlendModeAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(BlendMode, model.blendMode);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n// TODO: what values to use for averageIPScalarRange to get GLSL to use max / min values like [-Math.inf, Math.inf]?\n\n\nvar DEFAULT_VALUES = {\n bounds: [1, -1, 1, -1, 1, -1],\n sampleDistance: 1.0,\n imageSampleDistance: 1.0,\n maximumSamplesPerRay: 1000,\n autoAdjustSampleDistances: true,\n blendMode: BlendMode.COMPOSITE_BLEND,\n averageIPScalarRange: [-1000000.0, 1000000.0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Rendering_Core_AbstractMapper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].algo(publicAPI, model, 1, 0);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['sampleDistance', 'imageSampleDistance', 'maximumSamplesPerRay', 'autoAdjustSampleDistances', 'blendMode']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['averageIPScalarRange'], 2);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'lightingActivated'); // Object methods\n\n vtkVolumeMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkVolumeMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/Constants.js": -/*!********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/Constants.js ***! - \********************************************************************************/ -/*! exports provided: InterpolationType, OpacityMode, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InterpolationType\", function() { return InterpolationType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OpacityMode\", function() { return OpacityMode; });\nvar InterpolationType = {\n NEAREST: 0,\n LINEAR: 1,\n FAST_LINEAR: 2\n};\nvar OpacityMode = {\n FRACTIONAL: 0,\n PROPORTIONAL: 1\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n InterpolationType: InterpolationType,\n OpacityMode: OpacityMode\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/index.js ***! - \****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ColorTransferFunction */ \"./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PiecewiseFunction */ \"./node_modules/vtk.js/Sources/Common/DataModel/PiecewiseFunction/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/VolumeProperty/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\nvar InterpolationType = vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"].InterpolationType,\n OpacityMode = vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"].OpacityMode;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\nvar VTK_MAX_VRCOMP = 4; // ----------------------------------------------------------------------------\n// vtkVolumeProperty methods\n// ----------------------------------------------------------------------------\n\nfunction vtkVolumeProperty(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkVolumeProperty');\n\n publicAPI.getMTime = function () {\n var mTime = model.mtime;\n var time;\n\n for (var index = 0; index < VTK_MAX_VRCOMP; index++) {\n // Color MTimes\n if (model.componentData[index].colorChannels === 1) {\n if (model.componentData[index].grayTransferFunction) {\n // time that Gray transfer function was last modified\n time = model.componentData[index].grayTransferFunction.getMTime();\n mTime = mTime > time ? mTime : time;\n }\n } else if (model.componentData[index].colorChannels === 3) {\n if (model.componentData[index].rGBTransferFunction) {\n // time that RGB transfer function was last modified\n time = model.componentData[index].rGBTransferFunction.getMTime();\n mTime = mTime > time ? mTime : time;\n }\n } // Opacity MTimes\n\n\n if (model.componentData[index].scalarOpacity) {\n // time that Scalar opacity transfer function was last modified\n time = model.componentData[index].scalarOpacity.getMTime();\n mTime = mTime > time ? mTime : time;\n }\n\n if (model.componentData[index].gradientOpacity) {\n if (!model.componentData[index].disableGradientOpacity) {\n // time that Gradient opacity transfer function was last modified\n time = model.componentData[index].gradientOpacity.getMTime();\n mTime = mTime > time ? mTime : time;\n }\n }\n }\n\n return mTime;\n };\n\n publicAPI.getColorChannels = function (index) {\n if (index < 0 || index > 3) {\n vtkErrorMacro('Bad index - must be between 0 and 3');\n return 0;\n }\n\n return model.componentData[index].colorChannels;\n }; // Set the color of a volume to a gray transfer function\n\n\n publicAPI.setGrayTransferFunction = function (index, func) {\n var modified = false;\n\n if (model.componentData[index].grayTransferFunction !== func) {\n model.componentData[index].grayTransferFunction = func;\n modified = true;\n }\n\n if (model.componentData[index].colorChannels !== 1) {\n model.componentData[index].colorChannels = 1;\n modified = true;\n }\n\n if (modified) {\n publicAPI.modified();\n }\n\n return modified;\n }; // Get the currently set gray transfer function. Create one if none set.\n\n\n publicAPI.getGrayTransferFunction = function (index) {\n if (model.componentData[index].grayTransferFunction === null) {\n model.componentData[index].grayTransferFunction = vtk_js_Sources_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.componentData[index].grayTransferFunction.addPoint(0, 0.0);\n model.componentData[index].grayTransferFunction.addPoint(1024, 1.0);\n\n if (model.componentData[index].colorChannels !== 1) {\n model.componentData[index].colorChannels = 1;\n }\n\n publicAPI.modified();\n }\n\n return model.componentData[index].grayTransferFunction;\n }; // Set the color of a volume to an RGB transfer function\n\n\n publicAPI.setRGBTransferFunction = function (index, func) {\n var modified = false;\n\n if (model.componentData[index].rGBTransferFunction !== func) {\n model.componentData[index].rGBTransferFunction = func;\n modified = true;\n }\n\n if (model.componentData[index].colorChannels !== 3) {\n model.componentData[index].colorChannels = 3;\n modified = true;\n }\n\n if (modified) {\n publicAPI.modified();\n }\n\n return modified;\n }; // Get the currently set RGB transfer function. Create one if none set.\n\n\n publicAPI.getRGBTransferFunction = function (index) {\n if (model.componentData[index].rGBTransferFunction === null) {\n model.componentData[index].rGBTransferFunction = vtk_js_Sources_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.componentData[index].rGBTransferFunction.addRGBPoint(0, 0.0, 0.0, 0.0);\n model.componentData[index].rGBTransferFunction.addRGBPoint(1024, 1.0, 1.0, 1.0);\n\n if (model.componentData[index].colorChannels !== 3) {\n model.componentData[index].colorChannels = 3;\n }\n\n publicAPI.modified();\n }\n\n return model.componentData[index].rGBTransferFunction;\n }; // Set the scalar opacity of a volume to a transfer function\n\n\n publicAPI.setScalarOpacity = function (index, func) {\n if (model.componentData[index].scalarOpacity !== func) {\n model.componentData[index].scalarOpacity = func;\n publicAPI.modified();\n return true;\n }\n\n return false;\n }; // Get the scalar opacity transfer function. Create one if none set.\n\n\n publicAPI.getScalarOpacity = function (index) {\n if (model.componentData[index].scalarOpacity === null) {\n model.componentData[index].scalarOpacity = vtk_js_Sources_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.componentData[index].scalarOpacity.addPoint(0, 1.0);\n model.componentData[index].scalarOpacity.addPoint(1024, 1.0);\n publicAPI.modified();\n }\n\n return model.componentData[index].scalarOpacity;\n };\n\n publicAPI.setComponentWeight = function (index, value) {\n if (index < 0 || index >= VTK_MAX_VRCOMP) {\n vtkErrorMacro('Invalid index');\n return false;\n }\n\n var val = Math.min(1, Math.max(0, value));\n\n if (model.componentData[index].componentWeight !== val) {\n model.componentData[index].componentWeight = val;\n publicAPI.modified();\n return true;\n }\n\n return false;\n };\n\n publicAPI.getComponentWeight = function (index) {\n if (index < 0 || index >= VTK_MAX_VRCOMP) {\n vtkErrorMacro('Invalid index');\n return 0.0;\n }\n\n return model.componentData[index].componentWeight;\n };\n\n publicAPI.setInterpolationTypeToNearest = function () {\n return publicAPI.setInterpolationType(InterpolationType.NEAREST);\n };\n\n publicAPI.setInterpolationTypeToLinear = function () {\n return publicAPI.setInterpolationType(InterpolationType.LINEAR);\n };\n\n publicAPI.setInterpolationTypeToFastLinear = function () {\n return publicAPI.setInterpolationType(InterpolationType.FAST_LINEAR);\n };\n\n publicAPI.getInterpolationTypeAsString = function () {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(InterpolationType, model.interpolationType);\n };\n\n var sets = ['useGradientOpacity', 'scalarOpacityUnitDistance', 'gradientOpacityMinimumValue', 'gradientOpacityMinimumOpacity', 'gradientOpacityMaximumValue', 'gradientOpacityMaximumOpacity', 'opacityMode'];\n sets.forEach(function (val) {\n var cap = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(val);\n\n publicAPI[\"set\".concat(cap)] = function (index, value) {\n if (model.componentData[index][\"\".concat(val)] !== value) {\n model.componentData[index][\"\".concat(val)] = value;\n publicAPI.modified();\n return true;\n }\n\n return false;\n };\n });\n var gets = ['useGradientOpacity', 'scalarOpacityUnitDistance', 'gradientOpacityMinimumValue', 'gradientOpacityMinimumOpacity', 'gradientOpacityMaximumValue', 'gradientOpacityMaximumOpacity', 'opacityMode'];\n gets.forEach(function (val) {\n var cap = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(val);\n\n publicAPI[\"get\".concat(cap)] = function (index) {\n return model.componentData[index][\"\".concat(val)];\n };\n });\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n independentComponents: true,\n interpolationType: InterpolationType.FAST_LINEAR,\n shade: 0,\n ambient: 0.1,\n diffuse: 0.7,\n specular: 0.2,\n specularPower: 10.0,\n useLabelOutline: false,\n labelOutlineThickness: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n\n if (!model.componentData) {\n model.componentData = [];\n\n for (var i = 0; i < VTK_MAX_VRCOMP; ++i) {\n model.componentData.push({\n colorChannels: 1,\n grayTransferFunction: null,\n rGBTransferFunction: null,\n scalarOpacity: null,\n scalarOpacityUnitDistance: 1.0,\n opacityMode: OpacityMode.FRACTIONAL,\n gradientOpacityMinimumValue: 0,\n gradientOpacityMinimumOpacity: 0.0,\n gradientOpacityMaximumValue: 1.0,\n gradientOpacityMaximumOpacity: 1.0,\n useGradientOpacity: false,\n componentWeight: 1.0\n });\n }\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['independentComponents', 'interpolationType', 'shade', 'ambient', 'diffuse', 'specular', 'specularPower', 'useLabelOutline', 'labelOutlineThickness']); // Object methods\n\n vtkVolumeProperty(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkVolumeProperty'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Misc/GenericRenderWindow/index.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Misc/GenericRenderWindow/index.js ***! - \*********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_RenderWindow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/RenderWindow */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/RenderWindow/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Renderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Renderer */ \"./node_modules/vtk.js/Sources/Rendering/Core/Renderer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_RenderWindow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/RenderWindow */ \"./node_modules/vtk.js/Sources/Rendering/Core/RenderWindow/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_RenderWindowInteractor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/RenderWindowInteractor */ \"./node_modules/vtk.js/Sources/Rendering/Core/RenderWindowInteractor/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Style_InteractorStyleTrackballCamera__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Style/InteractorStyleTrackballCamera */ \"./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleTrackballCamera/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Points__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Points */ \"./node_modules/vtk.js/Sources/Common/Core/Points/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Actor */ \"./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n // Load basic classes for vtk() factory\n\n\n\n\n\n\n\nfunction vtkGenericRenderWindow(publicAPI, model) {\n // Capture resize trigger method to remove from publicAPI\n var invokeResize = publicAPI.invokeResize;\n delete publicAPI.invokeResize; // VTK renderWindow/renderer\n\n model.renderWindow = vtk_js_Sources_Rendering_Core_RenderWindow__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.renderer = vtk_js_Sources_Rendering_Core_Renderer__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.renderWindow.addRenderer(model.renderer); // OpenGLRenderWindow\n\n model.openGLRenderWindow = vtk_js_Sources_Rendering_OpenGL_RenderWindow__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.renderWindow.addView(model.openGLRenderWindow); // Interactor\n\n model.interactor = vtk_js_Sources_Rendering_Core_RenderWindowInteractor__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n model.interactor.setInteractorStyle(vtk_js_Sources_Interaction_Style_InteractorStyleTrackballCamera__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance());\n model.interactor.setView(model.openGLRenderWindow);\n model.interactor.initialize(); // Expose background\n\n publicAPI.setBackground = model.renderer.setBackground; // Update BG color\n\n publicAPI.setBackground.apply(publicAPI, _toConsumableArray(model.background)); // Handle window resize\n\n publicAPI.resize = function () {\n if (model.container) {\n var dims = model.container.getBoundingClientRect();\n var devicePixelRatio = window.devicePixelRatio || 1;\n model.openGLRenderWindow.setSize(Math.floor(dims.width * devicePixelRatio), Math.floor(dims.height * devicePixelRatio));\n invokeResize();\n model.renderWindow.render();\n }\n }; // Handle DOM container relocation\n\n\n publicAPI.setContainer = function (el) {\n if (model.container) {\n model.interactor.unbindEvents(model.container);\n } // Switch container\n\n\n model.container = el;\n model.openGLRenderWindow.setContainer(model.container); // Bind to new container\n\n if (model.container) {\n model.interactor.bindEvents(model.container);\n }\n }; // Properly release GL context\n\n\n publicAPI.delete = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.setContainer, model.openGLRenderWindow.delete, publicAPI.delete); // Handle size\n\n if (model.listenWindowResize) {\n window.addEventListener('resize', publicAPI.resize);\n }\n\n publicAPI.resize();\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n background: [0.32, 0.34, 0.43],\n listenWindowResize: true,\n container: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['renderWindow', 'renderer', 'openGLRenderWindow', 'interactor', 'container']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'resize'); // Object specific methods\n\n vtkGenericRenderWindow(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Misc/GenericRenderWindow/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor/index.js ***! - \*********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLActor methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLActor(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLActor'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.openGLRenderWindow = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow');\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n model.context = model.openGLRenderWindow.getContext();\n publicAPI.prepareNodes();\n publicAPI.addMissingNodes(model.renderable.getTextures());\n publicAPI.addMissingNode(model.renderable.getMapper());\n publicAPI.removeUnusedNodes(); // we store textures and mapper\n\n model.ogltextures = null;\n model.activeTextures = null;\n\n for (var index = 0; index < model.children.length; index++) {\n var child = model.children[index];\n\n if (child.isA('vtkOpenGLTexture')) {\n if (!model.ogltextures) {\n model.ogltextures = [];\n }\n\n model.ogltextures.push(child);\n } else {\n model.oglmapper = child;\n }\n }\n }\n };\n\n publicAPI.traverseOpaqueZBufferPass = function (renderPass) {\n publicAPI.traverseOpaquePass(renderPass);\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseOpaquePass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || !model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.oglmapper.traverse(renderPass);\n publicAPI.apply(renderPass, false);\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseTranslucentPass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.oglmapper.traverse(renderPass);\n publicAPI.apply(renderPass, false);\n };\n\n publicAPI.activateTextures = function () {\n // always traverse textures first, then mapper\n if (!model.ogltextures) {\n return;\n }\n\n model.activeTextures = [];\n\n for (var index = 0; index < model.ogltextures.length; index++) {\n var child = model.ogltextures[index];\n child.render();\n\n if (child.getHandle()) {\n model.activeTextures.push(child);\n }\n }\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (model.renderable.getIsOpaque()) {\n renderPass.incrementOpaqueActorCount();\n } else {\n renderPass.incrementTranslucentActorCount();\n }\n }\n };\n\n publicAPI.opaqueZBufferPass = function (prepass, renderPass) {\n return publicAPI.opaquePass(prepass, renderPass);\n };\n\n publicAPI.opaquePass = function (prepass, renderPass) {\n if (prepass) {\n model.openGLRenderWindow.enableDepthMask();\n publicAPI.activateTextures();\n } else if (model.activeTextures) {\n for (var index = 0; index < model.activeTextures.length; index++) {\n model.activeTextures[index].deactivate();\n }\n }\n }; // Renders myself\n\n\n publicAPI.translucentPass = function (prepass, renderPass) {\n if (prepass) {\n model.openGLRenderWindow.disableDepthMask();\n publicAPI.activateTextures();\n } else if (model.activeTextures) {\n for (var index = 0; index < model.activeTextures.length; index++) {\n model.activeTextures[index].deactivate();\n }\n }\n };\n\n publicAPI.getKeyMatrices = function () {\n // has the actor changed?\n if (model.renderable.getMTime() > model.keyMatrixTime.getMTime()) {\n model.renderable.computeMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.keyMatrices.mcwc, model.renderable.getMatrix());\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.mcwc, model.keyMatrices.mcwc);\n\n if (model.renderable.getIsIdentity()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(model.keyMatrices.normalMatrix);\n } else {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromMat4(model.keyMatrices.normalMatrix, model.keyMatrices.mcwc);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].invert(model.keyMatrices.normalMatrix, model.keyMatrices.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].transpose(model.keyMatrices.normalMatrix, model.keyMatrices.normalMatrix);\n }\n\n model.keyMatrixTime.modified();\n }\n\n return model.keyMatrices;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n keyMatrixTime: null,\n keyMatrices: null,\n activeTextures: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatrixTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.keyMatrixTime, {\n mtime: 0\n });\n model.keyMatrices = {\n normalMatrix: gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(new Float64Array(9)),\n mcwc: gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16))\n }; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['context']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"get\"](publicAPI, model, ['activeTextures']); // Object methods\n\n vtkOpenGLActor(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkActor', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor2D/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor2D/index.js ***! - \***********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLActor methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLActor2D(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLActor2D'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n if (!model.renderable) {\n return;\n }\n\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n publicAPI.prepareNodes();\n publicAPI.addMissingNodes(model.renderable.getTextures());\n publicAPI.addMissingNode(model.renderable.getMapper());\n publicAPI.removeUnusedNodes();\n }\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseOpaquePass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || !model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.children.forEach(function (child) {\n if (!child.isA('vtkOpenGLTexture')) {\n child.traverse(renderPass);\n }\n });\n publicAPI.apply(renderPass, false);\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseTranslucentPass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.children.forEach(function (child) {\n if (!child.isA('vtkOpenGLTexture')) {\n child.traverse(renderPass);\n }\n });\n publicAPI.apply(renderPass, false);\n };\n\n publicAPI.activateTextures = function () {\n // always traverse textures first, then mapper\n model.activeTextures = [];\n model.children.forEach(function (child) {\n if (child.isA('vtkOpenGLTexture')) {\n child.render();\n\n if (child.getHandle()) {\n model.activeTextures.push(child);\n }\n }\n });\n }; // Renders myself\n\n\n publicAPI.opaquePass = function (prepass, renderPass) {\n if (prepass) {\n model.context = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow').getContext();\n model.context.depthMask(true);\n publicAPI.activateTextures();\n } else {\n // deactivate textures\n model.activeTextures.forEach(function (child) {\n child.deactivate();\n });\n }\n }; // Renders myself\n\n\n publicAPI.translucentPass = function (prepass, renderPass) {\n if (prepass) {\n model.context = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow').getContext();\n model.context.depthMask(false);\n publicAPI.activateTextures();\n } else {\n // deactivate textures\n model.activeTextures.forEach(function (child) {\n child.deactivate();\n });\n model.context.depthMask(true);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n activeTextures: []\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['context']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"get\"](publicAPI, model, ['activeTextures']); // Object methods\n\n vtkOpenGLActor2D(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__[\"registerOverride\"])('vtkActor2D', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor2D/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants.js": -/*!********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants.js ***! - \********************************************************************************/ -/*! exports provided: ObjectType, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObjectType\", function() { return ObjectType; });\nvar ObjectType = {\n ARRAY_BUFFER: 0,\n ELEMENT_ARRAY_BUFFER: 1,\n TEXTURE_BUFFER: 2\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ObjectType: ObjectType\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/index.js ***! - \****************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar ObjectType = vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ObjectType; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n// ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\nvar STATIC = {}; // ----------------------------------------------------------------------------\n// vtkOpenGLBufferObject methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLBufferObject(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLBufferObject'); // Class-specific private functions\n\n function convertType(type) {\n switch (type) {\n case ObjectType.ELEMENT_ARRAY_BUFFER:\n return model.context.ELEMENT_ARRAY_BUFFER;\n\n case ObjectType.TEXTURE_BUFFER:\n if ('TEXTURE_BUFFER' in model.context) {\n return model.context.TEXTURE_BUFFER;\n }\n\n /* eslint-disable no-fallthrough */\n // Intentional fallthrough in case there is no TEXTURE_BUFFER in WebGL\n\n default:\n /* eslint-enable no-fallthrough */\n\n case ObjectType.ARRAY_BUFFER:\n return model.context.ARRAY_BUFFER;\n }\n }\n\n var internalType = null;\n var internalHandle = null;\n var dirty = true;\n var error = ''; // Public API methods\n\n publicAPI.getType = function () {\n return internalType;\n };\n\n publicAPI.setType = function (value) {\n internalType = value;\n };\n\n publicAPI.getHandle = function () {\n return internalHandle;\n };\n\n publicAPI.isReady = function () {\n return dirty === false;\n };\n\n publicAPI.generateBuffer = function (type) {\n var objectTypeGL = convertType(type);\n\n if (internalHandle === null) {\n internalHandle = model.context.createBuffer();\n internalType = type;\n }\n\n return convertType(internalType) === objectTypeGL;\n };\n\n publicAPI.upload = function (data, type) {\n // buffer, size, type\n var alreadyGenerated = publicAPI.generateBuffer(type);\n\n if (!alreadyGenerated) {\n error = 'Trying to upload array buffer to incompatible buffer.';\n return false;\n }\n\n model.context.bindBuffer(convertType(internalType), internalHandle);\n model.context.bufferData(convertType(internalType), data, model.context.STATIC_DRAW);\n dirty = false;\n return true;\n };\n\n publicAPI.bind = function () {\n if (!internalHandle) {\n return false;\n }\n\n model.context.bindBuffer(convertType(internalType), internalHandle);\n return true;\n };\n\n publicAPI.release = function () {\n if (!internalHandle) {\n return false;\n }\n\n model.context.bindBuffer(convertType(internalType), null);\n return true;\n };\n\n publicAPI.releaseGraphicsResources = function () {\n if (internalHandle !== null) {\n model.context.bindBuffer(convertType(internalType), null);\n model.context.deleteBuffer(internalHandle);\n internalHandle = null;\n }\n };\n\n publicAPI.setOpenGLRenderWindow = function (rw) {\n if (model.openGLRenderWindow === rw) {\n return;\n }\n\n publicAPI.releaseGraphicsResources();\n model.openGLRenderWindow = rw;\n model.context = null;\n\n if (rw) {\n model.context = model.openGLRenderWindow.getContext();\n }\n };\n\n publicAPI.getError = function () {\n return error;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n objectType: ObjectType.ARRAY_BUFFER,\n openGLRenderWindow: null,\n context: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['openGLRenderWindow']);\n vtkOpenGLBufferObject(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread(_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC), vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Camera/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Camera/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLCamera methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLCamera(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLCamera');\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n model.openGLRenderWindow = model.openGLRenderer.getParent();\n model.context = model.openGLRenderWindow.getContext();\n }\n }; // Renders myself\n\n\n publicAPI.opaquePass = function (prepass) {\n if (prepass) {\n var tsize = model.openGLRenderer.getTiledSizeAndOrigin();\n model.context.viewport(tsize.lowerLeftU, tsize.lowerLeftV, tsize.usize, tsize.vsize);\n model.context.scissor(tsize.lowerLeftU, tsize.lowerLeftV, tsize.usize, tsize.vsize);\n }\n };\n\n publicAPI.translucentPass = publicAPI.opaquePass;\n publicAPI.opaqueZBufferPass = publicAPI.opaquePass;\n publicAPI.volumePass = publicAPI.opaquePass;\n\n publicAPI.getKeyMatrices = function (ren) {\n // has the camera changed?\n if (ren !== model.lastRenderer || model.openGLRenderWindow.getMTime() > model.keyMatrixTime.getMTime() || publicAPI.getMTime() > model.keyMatrixTime.getMTime() || ren.getMTime() > model.keyMatrixTime.getMTime() || model.renderable.getMTime() > model.keyMatrixTime.getMTime()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.keyMatrices.wcvc, model.renderable.getViewMatrix());\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromMat4(model.keyMatrices.normalMatrix, model.keyMatrices.wcvc);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].invert(model.keyMatrices.normalMatrix, model.keyMatrices.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.wcvc, model.keyMatrices.wcvc);\n var aspectRatio = model.openGLRenderer.getAspectRatio();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.keyMatrices.vcpc, model.renderable.getProjectionMatrix(aspectRatio, -1, 1));\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.vcpc, model.keyMatrices.vcpc);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.keyMatrices.wcpc, model.keyMatrices.vcpc, model.keyMatrices.wcvc);\n model.keyMatrixTime.modified();\n model.lastRenderer = ren;\n }\n\n return model.keyMatrices;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n lastRenderer: null,\n keyMatrixTime: null,\n keyMatrices: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatrixTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.keyMatrixTime); // values always get set by the get method\n\n model.keyMatrices = {\n normalMatrix: new Float64Array(9),\n vcpc: new Float64Array(16),\n wcvc: new Float64Array(16),\n wcpc: new Float64Array(16)\n }; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['context', 'keyMatrixTime']); // Object methods\n\n vtkOpenGLCamera(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkCamera', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Camera/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/CellArrayBufferObject/index.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/CellArrayBufferObject/index.js ***! - \*************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/BufferObject */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js\");\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// Static functions\n// ----------------------------------------------------------------------------\n\nfunction computeInverseShiftAndScaleMatrix(coordShift, coordScale) {\n var inverseScale = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].inverse(inverseScale, coordScale);\n var matrix = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].fromRotationTranslationScale(matrix, gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"quat\"].create(), coordShift, inverseScale);\n return matrix;\n}\n\nfunction shouldApplyCoordShiftAndScale(coordShift, coordScale) {\n if (coordShift === null || coordScale === null) {\n return false;\n }\n\n return !(gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].exactEquals(coordShift, [0, 0, 0]) && gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].exactEquals(coordScale, [1, 1, 1]));\n} // ----------------------------------------------------------------------------\n// vtkOpenGLCellArrayBufferObject methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkOpenGLCellArrayBufferObject(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLCellArrayBufferObject');\n publicAPI.setType(vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_3__[\"ObjectType\"].ARRAY_BUFFER);\n\n publicAPI.createVBO = function (cellArray, inRep, outRep, options) {\n if (!cellArray.getData() || !cellArray.getData().length) {\n model.elementCount = 0;\n return 0;\n } // Figure out how big each block will be, currently 6 or 7 floats.\n\n\n model.blockSize = 3;\n model.vertexOffset = 0;\n model.normalOffset = 0;\n model.tCoordOffset = 0;\n model.tCoordComponents = 0;\n model.colorComponents = 0;\n model.colorOffset = 0;\n model.customData = [];\n var pointData = options.points.getData();\n var normalData = null;\n var tcoordData = null;\n var colorData = null;\n var colorComponents = options.colors ? options.colors.getNumberOfComponents() : 0;\n var textureComponents = options.tcoords ? options.tcoords.getNumberOfComponents() : 0; // the values of 4 below are because floats are 4 bytes\n\n if (options.normals) {\n model.normalOffset = 4 * model.blockSize;\n model.blockSize += 3;\n normalData = options.normals.getData();\n }\n\n if (options.customAttributes) {\n options.customAttributes.forEach(function (a) {\n if (a) {\n model.customData.push({\n data: a.getData(),\n offset: 4 * model.blockSize,\n components: a.getNumberOfComponents(),\n name: a.getName()\n });\n model.blockSize += a.getNumberOfComponents();\n }\n });\n }\n\n if (options.tcoords) {\n model.tCoordOffset = 4 * model.blockSize;\n model.tCoordComponents = textureComponents;\n model.blockSize += textureComponents;\n tcoordData = options.tcoords.getData();\n }\n\n if (options.colors) {\n model.colorComponents = options.colors.getNumberOfComponents();\n model.colorOffset = 0;\n colorData = options.colors.getData();\n\n if (!model.colorBO) {\n model.colorBO = vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n }\n\n model.colorBO.setOpenGLRenderWindow(model.openGLRenderWindow);\n } else {\n model.colorBO = null;\n }\n\n model.stride = 4 * model.blockSize;\n var pointIdx = 0;\n var normalIdx = 0;\n var tcoordIdx = 0;\n var colorIdx = 0;\n var custIdx = 0;\n var cellCount = 0;\n var addAPoint;\n var cellBuilders = {\n // easy, every input point becomes an output point\n anythingToPoints: function anythingToPoints(numPoints, cellPts, offset) {\n for (var i = 0; i < numPoints; ++i) {\n addAPoint(cellPts[offset + i]);\n }\n },\n linesToWireframe: function linesToWireframe(numPoints, cellPts, offset) {\n // for lines we add a bunch of segments\n for (var i = 0; i < numPoints - 1; ++i) {\n addAPoint(cellPts[offset + i]);\n addAPoint(cellPts[offset + i + 1]);\n }\n },\n polysToWireframe: function polysToWireframe(numPoints, cellPts, offset) {\n // for polys we add a bunch of segments and close it\n if (numPoints > 2) {\n for (var i = 0; i < numPoints; ++i) {\n addAPoint(cellPts[offset + i]);\n addAPoint(cellPts[offset + (i + 1) % numPoints]);\n }\n }\n },\n stripsToWireframe: function stripsToWireframe(numPoints, cellPts, offset) {\n if (numPoints > 2) {\n // for strips we add a bunch of segments and close it\n for (var i = 0; i < numPoints - 1; ++i) {\n addAPoint(cellPts[offset + i]);\n addAPoint(cellPts[offset + i + 1]);\n }\n\n for (var _i = 0; _i < numPoints - 2; _i++) {\n addAPoint(cellPts[offset + _i]);\n addAPoint(cellPts[offset + _i + 2]);\n }\n }\n },\n polysToSurface: function polysToSurface(npts, cellPts, offset) {\n for (var i = 0; i < npts - 2; i++) {\n addAPoint(cellPts[offset + 0]);\n addAPoint(cellPts[offset + i + 1]);\n addAPoint(cellPts[offset + i + 2]);\n }\n },\n stripsToSurface: function stripsToSurface(npts, cellPts, offset) {\n for (var i = 0; i < npts - 2; i++) {\n addAPoint(cellPts[offset + i]);\n addAPoint(cellPts[offset + i + 1 + i % 2]);\n addAPoint(cellPts[offset + i + 1 + (i + 1) % 2]);\n }\n }\n };\n var cellCounters = {\n // easy, every input point becomes an output point\n anythingToPoints: function anythingToPoints(numPoints, cellPts) {\n return numPoints;\n },\n linesToWireframe: function linesToWireframe(numPoints, cellPts) {\n if (numPoints > 1) {\n return (numPoints - 1) * 2;\n }\n\n return 0;\n },\n polysToWireframe: function polysToWireframe(numPoints, cellPts) {\n if (numPoints > 2) {\n return numPoints * 2;\n }\n\n return 0;\n },\n stripsToWireframe: function stripsToWireframe(numPoints, cellPts) {\n if (numPoints > 2) {\n return numPoints * 4 - 6;\n }\n\n return 0;\n },\n polysToSurface: function polysToSurface(npts, cellPts) {\n if (npts > 2) {\n return (npts - 2) * 3;\n }\n\n return 0;\n },\n stripsToSurface: function stripsToSurface(npts, cellPts, offset) {\n if (npts > 2) {\n return (npts - 2) * 3;\n }\n\n return 0;\n }\n };\n var func = null;\n var countFunc = null;\n\n if (outRep === vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_4__[\"Representation\"].POINTS || inRep === 'verts') {\n func = cellBuilders.anythingToPoints;\n countFunc = cellCounters.anythingToPoints;\n } else if (outRep === vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_4__[\"Representation\"].WIREFRAME || inRep === 'lines') {\n func = cellBuilders[\"\".concat(inRep, \"ToWireframe\")];\n countFunc = cellCounters[\"\".concat(inRep, \"ToWireframe\")];\n } else {\n func = cellBuilders[\"\".concat(inRep, \"ToSurface\")];\n countFunc = cellCounters[\"\".concat(inRep, \"ToSurface\")];\n }\n\n var array = cellArray.getData();\n var size = array.length;\n var caboCount = 0;\n\n for (var index = 0; index < size;) {\n caboCount += countFunc(array[index], array);\n index += array[index] + 1;\n }\n\n var packedUCVBO = null;\n var packedVBO = new Float32Array(caboCount * model.blockSize);\n\n if (colorData) {\n packedUCVBO = new Uint8Array(caboCount * 4);\n }\n\n var vboidx = 0;\n var ucidx = 0; // Find out if shift scale should be used\n // Compute squares of diagonal size and distance from the origin\n\n var diagSq = 0.0;\n var distSq = 0.0;\n\n for (var i = 0; i < 3; ++i) {\n var range = options.points.getRange(i);\n var delta = range[1] - range[0];\n diagSq += delta * delta;\n var distShift = 0.5 * (range[1] + range[0]);\n distSq += distShift * distShift;\n }\n\n var useShiftAndScale = diagSq > 0 && (Math.abs(distSq) / diagSq > 1.0e6 || // If data is far from the origin relative to its size\n Math.abs(Math.log10(diagSq)) > 3.0 || // If the size is huge when not far from the origin\n diagSq === 0 && distSq > 1.0e6); // If data is a point, but far from the origin\n\n if (useShiftAndScale) {\n // Compute shift and scale vectors\n var coordShift = new Float64Array(3);\n var coordScale = new Float64Array(3);\n\n for (var _i2 = 0; _i2 < 3; ++_i2) {\n var _range = options.points.getRange(_i2);\n\n var _delta = _range[1] - _range[0];\n\n coordShift[_i2] = 0.5 * (_range[1] + _range[0]);\n coordScale[_i2] = _delta > 0 ? 1.0 / _delta : 1.0;\n }\n\n publicAPI.setCoordShiftAndScale(coordShift, coordScale);\n } else if (model.coordShiftAndScaleEnabled === true) {\n // Make sure to reset\n publicAPI.setCoordShiftAndScale(null, null);\n }\n\n addAPoint = function addAPointFunc(i) {\n // Vertices\n pointIdx = i * 3;\n\n if (!model.coordShiftAndScaleEnabled) {\n packedVBO[vboidx++] = pointData[pointIdx++];\n packedVBO[vboidx++] = pointData[pointIdx++];\n packedVBO[vboidx++] = pointData[pointIdx++];\n } else {\n // Apply shift and scale\n packedVBO[vboidx++] = (pointData[pointIdx++] - model.coordShift[0]) * model.coordScale[0];\n packedVBO[vboidx++] = (pointData[pointIdx++] - model.coordShift[1]) * model.coordScale[1];\n packedVBO[vboidx++] = (pointData[pointIdx++] - model.coordShift[2]) * model.coordScale[2];\n }\n\n if (normalData !== null) {\n if (options.haveCellNormals) {\n normalIdx = (cellCount + options.cellOffset) * 3;\n } else {\n normalIdx = i * 3;\n }\n\n packedVBO[vboidx++] = normalData[normalIdx++];\n packedVBO[vboidx++] = normalData[normalIdx++];\n packedVBO[vboidx++] = normalData[normalIdx++];\n }\n\n model.customData.forEach(function (attr) {\n custIdx = i * attr.components;\n\n for (var j = 0; j < attr.components; ++j) {\n packedVBO[vboidx++] = attr.data[custIdx++];\n }\n });\n\n if (tcoordData !== null) {\n tcoordIdx = i * textureComponents;\n\n for (var j = 0; j < textureComponents; ++j) {\n packedVBO[vboidx++] = tcoordData[tcoordIdx++];\n }\n }\n\n if (colorData !== null) {\n if (options.haveCellScalars) {\n colorIdx = (cellCount + options.cellOffset) * colorComponents;\n } else {\n colorIdx = i * colorComponents;\n }\n\n packedUCVBO[ucidx++] = colorData[colorIdx++];\n packedUCVBO[ucidx++] = colorData[colorIdx++];\n packedUCVBO[ucidx++] = colorData[colorIdx++];\n packedUCVBO[ucidx++] = colorComponents === 4 ? colorData[colorIdx++] : 255;\n }\n };\n\n for (var _index = 0; _index < size;) {\n func(array[_index], array, _index + 1);\n _index += array[_index] + 1;\n cellCount++;\n }\n\n model.elementCount = caboCount;\n publicAPI.upload(packedVBO, vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_3__[\"ObjectType\"].ARRAY_BUFFER);\n\n if (model.colorBO) {\n model.colorBOStride = 4;\n model.colorBO.upload(packedUCVBO, vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_3__[\"ObjectType\"].ARRAY_BUFFER);\n }\n\n return cellCount;\n };\n\n publicAPI.setCoordShiftAndScale = function (coordShift, coordScale) {\n if (coordShift !== null && (coordShift.constructor !== Float64Array || coordShift.length !== 3)) {\n vtkErrorMacro('Wrong type for coordShift, expected vec3 or null');\n return;\n }\n\n if (coordScale !== null && (coordScale.constructor !== Float64Array || coordScale.length !== 3)) {\n vtkErrorMacro('Wrong type for coordScale, expected vec3 or null');\n return;\n }\n\n if (model.coordShift === null || coordShift === null || !gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].equals(coordShift, model.coordShift)) {\n model.coordShift = coordShift;\n }\n\n if (model.coordScale === null || coordScale === null || !gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].equals(coordScale, model.coordScale)) {\n model.coordScale = coordScale;\n }\n\n model.coordShiftAndScaleEnabled = shouldApplyCoordShiftAndScale(model.coordShift, model.coordScale);\n\n if (model.coordShiftAndScaleEnabled) {\n model.inverseShiftAndScaleMatrix = computeInverseShiftAndScaleMatrix(model.coordShift, model.coordScale);\n } else {\n model.inverseShiftAndScaleMatrix = null;\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n elementCount: 0,\n stride: 0,\n colorBOStride: 0,\n vertexOffset: 0,\n normalOffset: 0,\n tCoordOffset: 0,\n tCoordComponents: 0,\n colorOffset: 0,\n colorComponents: 0,\n tcoordBO: null,\n customData: [],\n coordShift: null,\n coordScale: null,\n coordShiftAndScaleEnabled: false,\n inverseShiftAndScaleMatrix: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['colorBO', 'elementCount', 'stride', 'colorBOStride', 'vertexOffset', 'normalOffset', 'tCoordOffset', 'tCoordComponents', 'colorOffset', 'colorComponents', 'customData']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get(publicAPI, model, ['coordShift', 'coordScale', 'coordShiftAndScaleEnabled', 'inverseShiftAndScaleMatrix']); // Object specific methods\n\n vtkOpenGLCellArrayBufferObject(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/CellArrayBufferObject/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ForwardPass/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ForwardPass/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Framebuffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Framebuffer */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Framebuffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_RenderPass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/RenderPass */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderPass/index.js\");\n\n\n // ----------------------------------------------------------------------------\n\nfunction vtkForwardPass(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkForwardPass'); // this pass implements a forward rendering pipeline\n // if both volumes and opaque geometry are present\n // it will mix the two together by capturing a zbuffer\n // first\n\n publicAPI.traverse = function (viewNode) {\n var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (model.deleted) {\n return;\n } // we just render our delegates in order\n\n\n model.currentParent = parent; // build\n\n publicAPI.setCurrentOperation('buildPass');\n viewNode.traverse(publicAPI);\n var numlayers = viewNode.getRenderable().getNumberOfLayers(); // iterate over renderers\n\n var renderers = viewNode.getChildren();\n\n for (var i = 0; i < numlayers; i++) {\n for (var index = 0; index < renderers.length; index++) {\n var renNode = renderers[index];\n var ren = viewNode.getRenderable().getRenderers()[index];\n\n if (ren.getDraw() && ren.getLayer() === i) {\n // check for both opaque and volume actors\n model.opaqueActorCount = 0;\n model.translucentActorCount = 0;\n model.volumeCount = 0;\n publicAPI.setCurrentOperation('queryPass');\n renNode.traverse(publicAPI); // do we need to capture a zbuffer?\n\n if (model.opaqueActorCount > 0 && model.volumeCount > 0 || model.depthRequested) {\n var size = viewNode.getFramebufferSize(); // make sure the framebuffer is setup\n\n if (model.framebuffer === null) {\n model.framebuffer = vtk_js_Sources_Rendering_OpenGL_Framebuffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n }\n\n model.framebuffer.setOpenGLRenderWindow(viewNode);\n model.framebuffer.saveCurrentBindingsAndBuffers();\n var fbSize = model.framebuffer.getSize();\n\n if (fbSize === null || fbSize[0] !== size[0] || fbSize[1] !== size[1]) {\n model.framebuffer.create(size[0], size[1]);\n model.framebuffer.populateFramebuffer();\n }\n\n model.framebuffer.bind();\n publicAPI.setCurrentOperation('opaqueZBufferPass');\n renNode.traverse(publicAPI);\n model.framebuffer.restorePreviousBindingsAndBuffers(); // reset now that we have done it\n\n model.depthRequested = false;\n }\n\n publicAPI.setCurrentOperation('cameraPass');\n renNode.traverse(publicAPI);\n\n if (model.opaqueActorCount > 0) {\n publicAPI.setCurrentOperation('opaquePass');\n renNode.traverse(publicAPI);\n }\n\n if (model.translucentActorCount > 0) {\n publicAPI.setCurrentOperation('translucentPass');\n renNode.traverse(publicAPI);\n }\n\n if (model.volumeCount > 0) {\n publicAPI.setCurrentOperation('volumePass');\n renNode.traverse(publicAPI);\n }\n }\n }\n }\n };\n\n publicAPI.getZBufferTexture = function () {\n if (model.framebuffer) {\n return model.framebuffer.getColorTexture();\n }\n\n return null;\n };\n\n publicAPI.requestDepth = function () {\n model.depthRequested = true;\n };\n\n publicAPI.incrementOpaqueActorCount = function () {\n return model.opaqueActorCount++;\n };\n\n publicAPI.incrementTranslucentActorCount = function () {\n return model.translucentActorCount++;\n };\n\n publicAPI.incrementVolumeCount = function () {\n return model.volumeCount++;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n opaqueActorCount: 0,\n translucentActorCount: 0,\n volumeCount: 0,\n framebuffer: null,\n depthRequested: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_Rendering_SceneGraph_RenderPass__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['framebuffer']); // Object methods\n\n vtkForwardPass(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkForwardPass'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ForwardPass/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Framebuffer/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Framebuffer/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkFramebuffer methods\n// ----------------------------------------------------------------------------\n\nfunction vtkFramebuffer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkFramebuffer');\n\n publicAPI.getBothMode = function () {\n return model.context.FRAMEBUFFER;\n }; // publicAPI.getDrawMode = () => model.context.DRAW_FRAMEBUFFER;\n // publicAPI.getReadMode = () => model.context.READ_FRAMEBUFFER;\n\n\n publicAPI.saveCurrentBindingsAndBuffers = function (modeIn) {\n var mode = typeof modeIn !== 'undefined' ? modeIn : publicAPI.getBothMode();\n publicAPI.saveCurrentBindings(mode);\n publicAPI.saveCurrentBuffers(mode);\n };\n\n publicAPI.saveCurrentBindings = function (modeIn) {\n var gl = model.context;\n model.previousDrawBinding = gl.getParameter(model.context.FRAMEBUFFER_BINDING);\n model.previousActiveFramebuffer = model.openGLRenderWindow.getActiveFramebuffer();\n };\n\n publicAPI.saveCurrentBuffers = function (modeIn) {// noop on webgl 1\n };\n\n publicAPI.restorePreviousBindingsAndBuffers = function (modeIn) {\n var mode = typeof modeIn !== 'undefined' ? modeIn : publicAPI.getBothMode();\n publicAPI.restorePreviousBindings(mode);\n publicAPI.restorePreviousBuffers(mode);\n };\n\n publicAPI.restorePreviousBindings = function (modeIn) {\n var gl = model.context;\n gl.bindFramebuffer(gl.FRAMEBUFFER, model.previousDrawBinding);\n model.openGLRenderWindow.setActiveFramebuffer(model.previousActiveFramebuffer);\n };\n\n publicAPI.restorePreviousBuffers = function (modeIn) {// currently a noop on webgl1\n };\n\n publicAPI.bind = function () {\n model.context.bindFramebuffer(model.context.FRAMEBUFFER, model.glFramebuffer);\n\n if (model.colorTexture) {\n model.colorTexture.bind();\n }\n\n model.openGLRenderWindow.setActiveFramebuffer(publicAPI);\n };\n\n publicAPI.create = function (width, height) {\n model.glFramebuffer = model.context.createFramebuffer();\n model.glFramebuffer.width = width;\n model.glFramebuffer.height = height;\n };\n\n publicAPI.setColorBuffer = function (texture) {\n var attachment = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var gl = model.context;\n var glAttachment = gl.COLOR_ATTACHMENT0;\n\n if (attachment > 0) {\n if (model.openGLRenderWindow.getWebgl2()) {\n glAttachment += attachment;\n } else {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"]('Using multiple framebuffer attachments requires WebGL 2');\n return;\n }\n }\n\n model.colorTexture = texture;\n gl.framebufferTexture2D(gl.FRAMEBUFFER, glAttachment, gl.TEXTURE_2D, texture.getHandle(), 0);\n };\n\n publicAPI.removeColorBuffer = function () {\n var attachment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var gl = model.context;\n var glAttachment = gl.COLOR_ATTACHMENT0;\n\n if (attachment > 0) {\n if (model.openGLRenderWindow.getWebgl2()) {\n glAttachment += attachment;\n } else {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"]('Using multiple framebuffer attachments requires WebGL 2');\n return;\n }\n }\n\n gl.framebufferTexture2D(gl.FRAMEBUFFER, glAttachment, gl.TEXTURE_2D, null, 0);\n };\n\n publicAPI.setDepthBuffer = function (texture) {\n if (model.openGLRenderWindow.getWebgl2()) {\n var gl = model.context;\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, texture.getHandle(), 0);\n } else {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"]('Attaching depth buffer textures to fbo requires WebGL 2');\n }\n };\n\n publicAPI.removeDepthBuffer = function () {\n if (model.openGLRenderWindow.getWebgl2()) {\n var gl = model.context;\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, null, 0);\n } else {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"]('Attaching depth buffer textures to framebuffers requires WebGL 2');\n }\n };\n\n publicAPI.getGLFramebuffer = function () {\n return model.glFramebuffer;\n };\n\n publicAPI.setOpenGLRenderWindow = function (rw) {\n if (model.openGLRenderWindow === rw) {\n return;\n }\n\n publicAPI.releaseGraphicsResources();\n model.openGLRenderWindow = rw;\n model.context = null;\n\n if (rw) {\n model.context = model.openGLRenderWindow.getContext();\n }\n };\n\n publicAPI.releaseGraphicsResources = function () {\n if (model.glFramebuffer) {\n model.context.deleteFramebuffer(model.glFramebuffer);\n }\n\n if (model.colorTexture) {\n model.colorTexture.releaseGraphicsResources();\n }\n };\n\n publicAPI.getSize = function () {\n var size = [0, 0];\n\n if (model.glFramebuffer !== null) {\n size[0] = model.glFramebuffer.width;\n size[1] = model.glFramebuffer.height;\n }\n\n return size;\n };\n\n publicAPI.populateFramebuffer = function () {\n publicAPI.bind();\n var gl = model.context;\n var texture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n texture.setOpenGLRenderWindow(model.openGLRenderWindow);\n texture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_3__[\"Filter\"].LINEAR);\n texture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_3__[\"Filter\"].LINEAR);\n texture.create2DFromRaw(model.glFramebuffer.width, model.glFramebuffer.height, 4, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__[\"VtkDataTypes\"].UNSIGNED_CHAR, null);\n publicAPI.setColorBuffer(texture); // for now do not count on having a depth buffer texture\n // as they are not standard webgl 1\n\n model.depthTexture = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, model.depthTexture);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, model.glFramebuffer.width, model.glFramebuffer.height);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, model.depthTexture);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n openGLRenderWindow: null,\n glFramebuffer: null,\n colorTexture: null,\n depthTexture: null,\n previousDrawBinding: 0,\n previousReadBinding: 0,\n previousDrawBuffer: 0,\n previousReadBuffer: 0,\n previousActiveFramebuffer: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"obj\"](publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['colorTexture']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkFramebuffer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkFramebuffer'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Framebuffer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Glyph3DMapper/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Glyph3DMapper/index.js ***! - \*****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/BufferObject */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_HardwareSelector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/HardwareSelector */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_PolyDataMapper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/PolyDataMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/PolyDataMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"];\nvar Representation = vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Representation;\nvar ObjectType = vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ObjectType;\nvar PassTypes = vtk_js_Sources_Rendering_OpenGL_HardwareSelector__WEBPACK_IMPORTED_MODULE_3__[\"default\"].PassTypes;\nvar StartEvent = {\n type: 'StartEvent'\n};\nvar EndEvent = {\n type: 'EndEvent'\n}; // ----------------------------------------------------------------------------\n// vtkOpenGLSphereMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLGlyph3DMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLGlyph3DMapper'); // Capture 'parentClass' api for internal use\n\n var superClass = _objectSpread({}, publicAPI);\n\n publicAPI.renderPiece = function (ren, actor) {\n publicAPI.invokeEvent(StartEvent);\n\n if (!model.renderable.getStatic()) {\n model.renderable.update();\n }\n\n model.currentInput = model.renderable.getInputData(1);\n publicAPI.invokeEvent(EndEvent);\n\n if (!model.currentInput) {\n vtkErrorMacro('No input!');\n return;\n } // if there are no points then we are done\n\n\n if (!model.currentInput.getPoints || !model.currentInput.getPoints().getNumberOfValues()) {\n return;\n } // apply faceCulling\n\n\n var gl = model.context;\n\n if (model.openGLRenderWindow.getWebgl2()) {\n model.hardwareSupport = true;\n model.extension = null;\n } else if (!model.extension) {\n model.extension = model.context.getExtension('ANGLE_instanced_arrays');\n model.hardwareSupport = !!model.extension;\n } // to test without extension support uncomment the next two lines\n // model.extension = null;\n // model.hardwareSupport = !!model.extension;\n\n\n var backfaceCulling = actor.getProperty().getBackfaceCulling();\n var frontfaceCulling = actor.getProperty().getFrontfaceCulling();\n\n if (!backfaceCulling && !frontfaceCulling) {\n model.openGLRenderWindow.disableCullFace();\n } else if (frontfaceCulling) {\n model.openGLRenderWindow.enableCullFace();\n gl.cullFace(gl.FRONT);\n } else {\n model.openGLRenderWindow.enableCullFace();\n gl.cullFace(gl.BACK);\n }\n\n publicAPI.renderPieceStart(ren, actor);\n publicAPI.renderPieceDraw(ren, actor);\n publicAPI.renderPieceFinish(ren, actor);\n };\n\n publicAPI.multiply4x4WithOffset = function (out, a, b, off) {\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n var a30 = a[12];\n var a31 = a[13];\n var a32 = a[14];\n var a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[off];\n var b1 = b[off + 1];\n var b2 = b[off + 2];\n var b3 = b[off + 3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[off + 4];\n b1 = b[off + 5];\n b2 = b[off + 6];\n b3 = b[off + 7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[off + 8];\n b1 = b[off + 9];\n b2 = b[off + 10];\n b3 = b[off + 11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[off + 12];\n b1 = b[off + 13];\n b2 = b[off + 14];\n b3 = b[off + 15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n };\n\n publicAPI.replaceShaderNormal = function (shaders, ren, actor) {\n if (model.hardwareSupport) {\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (lastLightComplexity > 0) {\n var VSSource = shaders.Vertex;\n\n if (model.lastBoundBO.getCABO().getNormalOffset()) {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Normal::Dec', ['attribute vec3 normalMC;', 'attribute mat3 gNormal;', 'uniform mat3 normalMatrix;', 'varying vec3 normalVCVSOutput;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Normal::Impl', ['normalVCVSOutput = normalMatrix * gNormal * normalMC;']).result;\n }\n\n shaders.Vertex = VSSource;\n }\n }\n\n superClass.replaceShaderNormal(shaders, ren, actor);\n };\n\n publicAPI.replaceShaderColor = function (shaders, ren, actor) {\n if (model.hardwareSupport && model.renderable.getColorArray()) {\n var VSSource = shaders.Vertex;\n var GSSource = shaders.Geometry;\n var FSSource = shaders.Fragment;\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity'); // create the material/color property declarations, and VS implementation\n // these are always defined\n\n var colorDec = ['uniform float ambient;', 'uniform float diffuse;', 'uniform float specular;', 'uniform float opacityUniform; // the fragment opacity']; // add more for specular\n\n if (lastLightComplexity) {\n colorDec = colorDec.concat(['uniform vec3 specularColorUniform;', 'uniform float specularPowerUniform;']);\n } // now handle the more complex fragment shader implementation\n // the following are always defined variables. We start\n // by assigning a default value from the uniform\n\n\n var colorImpl = ['vec3 ambientColor;', ' vec3 diffuseColor;', ' float opacity;'];\n\n if (lastLightComplexity) {\n colorImpl = colorImpl.concat([' vec3 specularColor;', ' float specularPower;']);\n }\n\n colorImpl = colorImpl.concat([' opacity = opacityUniform;']);\n\n if (lastLightComplexity) {\n colorImpl = colorImpl.concat([' specularColor = specularColorUniform;', ' specularPower = specularPowerUniform;']);\n }\n\n if (!model.drawingEdges) {\n colorDec = colorDec.concat(['varying vec4 vertexColorVSOutput;']);\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Color::Dec', ['attribute vec4 gColor;', 'varying vec4 vertexColorVSOutput;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Color::Impl', ['vertexColorVSOutput = gColor;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(GSSource, '//VTK::Color::Dec', ['in vec4 vertexColorVSOutput[];', 'out vec4 vertexColorGSOutput;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(GSSource, '//VTK::Color::Impl', ['vertexColorGSOutput = vertexColorVSOutput[i];']).result;\n colorImpl = colorImpl.concat([' diffuseColor = vertexColorVSOutput.rgb;', ' ambientColor = vertexColorVSOutput.rgb;', ' opacity = opacity*vertexColorVSOutput.a;']);\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(FSSource, '//VTK::Color::Impl', colorImpl).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(FSSource, '//VTK::Color::Dec', colorDec).result;\n shaders.Vertex = VSSource;\n shaders.Geometry = GSSource;\n shaders.Fragment = FSSource;\n }\n\n superClass.replaceShaderColor(shaders, ren, actor);\n };\n\n publicAPI.replaceShaderPositionVC = function (shaders, ren, actor) {\n if (model.hardwareSupport) {\n var VSSource = shaders.Vertex; // do we need the vertex in the shader in View Coordinates\n\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (lastLightComplexity > 0) {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Impl', ['vec4 gVertexMC = gMatrix * vertexMC;', 'vertexVCVSOutput = MCVCMatrix * gVertexMC;', ' gl_Position = MCPCMatrix * gVertexMC;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Camera::Dec', ['attribute mat4 gMatrix;', 'uniform mat4 MCPCMatrix;', 'uniform mat4 MCVCMatrix;']).result;\n } else {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Camera::Dec', ['attribute mat4 gMatrix;', 'uniform mat4 MCPCMatrix;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Impl', ['vec4 gVertexMC = gMatrix * vertexMC;', ' gl_Position = MCPCMatrix * gVertexMC;']).result;\n }\n\n shaders.Vertex = VSSource;\n }\n\n superClass.replaceShaderPositionVC(shaders, ren, actor);\n };\n\n publicAPI.replaceShaderPicking = function (shaders, ren, actor) {\n if (model.hardwareSupport) {\n var FSSource = shaders.Fragment;\n var VSSource = shaders.Vertex;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Picking::Dec', ['attribute vec3 mapperIndexVS;', 'varying vec3 mapperIndexVSOutput;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(VSSource, '//VTK::Picking::Impl', ' mapperIndexVSOutput = mapperIndexVS;').result;\n shaders.Vertex = VSSource;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(FSSource, '//VTK::Picking::Dec', ['varying vec3 mapperIndexVSOutput;', 'uniform vec3 mapperIndex;', 'uniform int picking;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(FSSource, '//VTK::Picking::Impl', [' vec4 pickColor = picking == 2 ? vec4(mapperIndexVSOutput,1.0) : vec4(mapperIndex,1.0);', ' gl_FragData[0] = picking != 0 ? pickColor : gl_FragData[0];']).result;\n shaders.Fragment = FSSource;\n } else {\n superClass.replaceShaderPicking(shaders, ren, actor);\n }\n };\n\n publicAPI.updateGlyphShaderParameters = function (normalMatrixUsed, mcvcMatrixUsed, cellBO, carray, garray, narray, p, selector) {\n var program = cellBO.getProgram();\n\n if (normalMatrixUsed) {\n var a = model.normalMatrix;\n var b = narray;\n var ofs = p * 9;\n var out = model.tmpMat3;\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a10 = a[3];\n var a11 = a[4];\n var a12 = a[5];\n var a20 = a[6];\n var a21 = a[7];\n var a22 = a[8];\n var b00 = b[ofs];\n var b01 = b[ofs + 1];\n var b02 = b[ofs + 2];\n var b10 = b[ofs + 3];\n var b11 = b[ofs + 4];\n var b12 = b[ofs + 5];\n var b20 = b[ofs + 6];\n var b21 = b[ofs + 7];\n var b22 = b[ofs + 8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n program.setUniformMatrix3x3('normalMatrix', model.tmpMat3);\n }\n\n publicAPI.multiply4x4WithOffset(model.tmpMat4, model.mcpcMatrix, garray, p * 16);\n program.setUniformMatrix('MCPCMatrix', model.tmpMat4);\n\n if (mcvcMatrixUsed) {\n publicAPI.multiply4x4WithOffset(model.tmpMat4, model.mcvcMatrix, garray, p * 16);\n program.setUniformMatrix('MCVCMatrix', model.tmpMat4);\n } // set color\n\n\n if (carray) {\n var cdata = carray.getData();\n model.tmpColor[0] = cdata[p * 4] / 255.0;\n model.tmpColor[1] = cdata[p * 4 + 1] / 255.0;\n model.tmpColor[2] = cdata[p * 4 + 2] / 255.0;\n program.setUniform3fArray('ambientColorUniform', model.tmpColor);\n program.setUniform3fArray('diffuseColorUniform', model.tmpColor);\n }\n\n if (selector) {\n program.setUniform3fArray('mapperIndex', selector.getPropColorValue());\n }\n };\n\n publicAPI.renderPieceDraw = function (ren, actor) {\n var representation = actor.getProperty().getRepresentation();\n var gl = model.context;\n var drawSurfaceWithEdges = actor.getProperty().getEdgeVisibility() && representation === Representation.SURFACE; // [WMVP]C == {world, model, view, projection} coordinates\n // E.g., WCPC == world to projection coordinate transformation\n\n var keyMats = model.openGLCamera.getKeyMatrices(ren);\n var actMats = model.openGLActor.getKeyMatrices(); // precompute the actor+camera mats once\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(model.normalMatrix, keyMats.normalMatrix, actMats.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.mcpcMatrix, keyMats.wcpc, actMats.mcwc);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.mcvcMatrix, keyMats.wcvc, actMats.mcwc);\n var garray = model.renderable.getMatrixArray();\n var narray = model.renderable.getNormalArray();\n var carray = model.renderable.getColorArray();\n var numPts = garray.length / 16;\n var compositePass = false;\n\n if (model.openGLRenderer.getSelector()) {\n if (model.openGLRenderer.getSelector().getCurrentPass() === PassTypes.COMPOSITE_INDEX_PASS) {\n compositePass = true;\n }\n } // for every primitive type\n\n\n for (var i = model.primTypes.Start; i < model.primTypes.End; i++) {\n // if there are entries\n var cabo = model.primitives[i].getCABO();\n\n if (cabo.getElementCount()) {\n // are we drawing edges\n model.drawingEdges = drawSurfaceWithEdges && (i === model.primTypes.TrisEdges || i === model.primTypes.TriStripsEdges);\n publicAPI.updateShaders(model.primitives[i], ren, actor);\n var program = model.primitives[i].getProgram();\n var mode = publicAPI.getOpenGLMode(representation, i);\n var normalMatrixUsed = program.isUniformUsed('normalMatrix');\n var mcvcMatrixUsed = program.isUniformUsed('MCVCMatrix');\n\n if (model.hardwareSupport) {\n if (model.extension) {\n model.extension.drawArraysInstancedANGLE(mode, 0, cabo.getElementCount(), numPts);\n } else {\n gl.drawArraysInstanced(mode, 0, cabo.getElementCount(), numPts);\n }\n } else {\n // draw the array multiple times with different cam matrix\n for (var p = 0; p < numPts; ++p) {\n if (compositePass) {\n model.openGLRenderer.getSelector().renderCompositeIndex(p);\n }\n\n publicAPI.updateGlyphShaderParameters(normalMatrixUsed, mcvcMatrixUsed, model.primitives[i], carray, garray, narray, p, compositePass ? model.openGLRenderer.getSelector() : null);\n gl.drawArrays(mode, 0, cabo.getElementCount());\n }\n }\n }\n }\n };\n\n publicAPI.setMapperShaderParameters = function (cellBO, ren, actor) {\n if (cellBO.getCABO().getElementCount() && (model.glyphBOBuildTime.getMTime() > cellBO.getAttributeUpdateTime().getMTime() || cellBO.getShaderSourceTime().getMTime() > cellBO.getAttributeUpdateTime().getMTime())) {\n if (cellBO.getProgram().isAttributeUsed('gMatrix')) {\n if (!cellBO.getVAO().addAttributeMatrixWithDivisor(cellBO.getProgram(), model.matrixBuffer, 'gMatrix', 0, 64, model.context.FLOAT, 4, false, 1)) {\n vtkErrorMacro('Error setting gMatrix in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('gMatrix');\n }\n\n if (cellBO.getProgram().isAttributeUsed('gNormal')) {\n if (!cellBO.getVAO().addAttributeMatrixWithDivisor(cellBO.getProgram(), model.normalBuffer, 'gNormal', 0, 36, model.context.FLOAT, 3, false, 1)) {\n vtkErrorMacro('Error setting gNormal in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('gNormal');\n }\n\n if (cellBO.getProgram().isAttributeUsed('gColor')) {\n if (!cellBO.getVAO().addAttributeArrayWithDivisor(cellBO.getProgram(), model.colorBuffer, 'gColor', 0, 4, model.context.UNSIGNED_BYTE, 4, true, 1, false)) {\n vtkErrorMacro('Error setting gColor in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('gColor');\n }\n\n if (cellBO.getProgram().isAttributeUsed('mapperIndexVS')) {\n if (!cellBO.getVAO().addAttributeArrayWithDivisor(cellBO.getProgram(), model.pickBuffer, 'mapperIndexVS', 0, 4, model.context.UNSIGNED_BYTE, 4, true, 1, false)) {\n vtkErrorMacro('Error setting mapperIndexVS in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('mapperIndexVS');\n }\n\n superClass.setMapperShaderParameters(cellBO, ren, actor);\n cellBO.getAttributeUpdateTime().modified();\n return;\n }\n\n superClass.setMapperShaderParameters(cellBO, ren, actor);\n };\n\n publicAPI.getNeedToRebuildBufferObjects = function (ren, actor) {\n model.renderable.buildArrays(); // first do a coarse check\n // Note that the actor's mtime includes it's properties mtime\n\n var vmtime = model.VBOBuildTime.getMTime();\n\n if (vmtime < model.renderable.getBuildTime().getMTime()) {\n return true;\n }\n\n return superClass.getNeedToRebuildBufferObjects(ren, actor);\n };\n\n publicAPI.buildBufferObjects = function (ren, actor) {\n if (model.hardwareSupport) {\n // update the buffer objects if needed\n var garray = model.renderable.getMatrixArray();\n var narray = model.renderable.getNormalArray();\n var carray = model.renderable.getColorArray();\n\n if (!model.matrixBuffer) {\n model.matrixBuffer = vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.matrixBuffer.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.normalBuffer = vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.normalBuffer.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.colorBuffer = vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.colorBuffer.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.pickBuffer = vtk_js_Sources_Rendering_OpenGL_BufferObject__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.pickBuffer.setOpenGLRenderWindow(model.openGLRenderWindow);\n }\n\n if (model.renderable.getBuildTime().getMTime() > model.glyphBOBuildTime.getMTime()) {\n model.matrixBuffer.upload(garray, ObjectType.ARRAY_BUFFER);\n model.normalBuffer.upload(narray, ObjectType.ARRAY_BUFFER);\n\n if (carray) {\n model.colorBuffer.upload(carray.getData(), ObjectType.ARRAY_BUFFER);\n } else {\n model.colorBuffer.releaseGraphicsResources();\n }\n\n var numPts = garray.length / 16;\n var parray = new Uint8Array(4 * numPts);\n\n for (var i = 0; i < numPts; ++i) {\n var value = i + 1;\n var offset = i * 4;\n parray[offset] = value % 256;\n value -= parray[offset];\n value /= 256;\n parray[offset + 1] = value % 256;\n value -= parray[offset + 1];\n value /= 256;\n parray[offset + 2] = value % 256;\n parray[offset + 3] = 255;\n }\n\n model.pickBuffer.upload(parray, ObjectType.ARRAY_BUFFER);\n model.glyphBOBuildTime.modified();\n }\n }\n\n return superClass.buildBufferObjects(ren, actor);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n normalMatrix: null,\n mcpcMatrix: null,\n mcwcMatrix: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_OpenGL_PolyDataMapper__WEBPACK_IMPORTED_MODULE_5__[\"default\"].extend(publicAPI, model, initialValues);\n model.tmpMat3 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(new Float64Array(9));\n model.normalMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(new Float64Array(9));\n model.mcpcMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.mcvcMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.tmpColor = [];\n model.glyphBOBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.glyphBOBuildTime, {\n mtime: 0\n }); // Object methods\n\n vtkOpenGLGlyph3DMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkOpenGLGlyph3DMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_7__[\"registerOverride\"])('vtkGlyph3DMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Glyph3DMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/Constants.js": -/*!************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/Constants.js ***! - \************************************************************************************/ -/*! exports provided: PassTypes, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PassTypes\", function() { return PassTypes; });\nvar PassTypes = {\n MIN_KNOWN_PASS: 0,\n ACTOR_PASS: 0,\n COMPOSITE_INDEX_PASS: 1,\n ID_LOW24: 2,\n MAX_KNOWN_PASS: 2\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n PassTypes: PassTypes\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/index.js": -/*!********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/index.js ***! - \********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_HardwareSelector_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/HardwareSelector/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_HardwareSelector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/HardwareSelector */ \"./node_modules/vtk.js/Sources/Rendering/Core/HardwareSelector/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Framebuffer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Framebuffer */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Framebuffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_SelectionNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/SelectionNode */ \"./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSet */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSet/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\n\n\n\n\n\n\nvar PassTypes = vtk_js_Sources_Rendering_OpenGL_HardwareSelector_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].PassTypes;\nvar SelectionContent = vtk_js_Sources_Common_DataModel_SelectionNode__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SelectionContent,\n SelectionField = vtk_js_Sources_Common_DataModel_SelectionNode__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SelectionField;\nvar FieldAssociations = vtk_js_Sources_Common_DataModel_DataSet__WEBPACK_IMPORTED_MODULE_5__[\"default\"].FieldAssociations;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\nvar idOffset = 1;\n\nfunction getInfoHash(info) {\n return \"\".concat(info.propID, \" \").concat(info.compositeID);\n}\n\nfunction convert(xx, yy, pb, area) {\n if (!pb) {\n return 0;\n }\n\n var offset = (yy * (area[2] - area[0] + 1) + xx) * 4;\n var rgb = [];\n rgb[0] = pb[offset];\n rgb[1] = pb[offset + 1];\n rgb[2] = pb[offset + 2];\n var val = rgb[2];\n val *= 256;\n val += rgb[1];\n val *= 256;\n val += rgb[0];\n return val;\n}\n\nfunction getPixelInformationWithData(buffdata, inDisplayPosition, maxDistance, outSelectedPosition) {\n // Base case\n var maxDist = maxDistance < 0 ? 0 : maxDistance;\n\n if (maxDist === 0) {\n outSelectedPosition[0] = inDisplayPosition[0];\n outSelectedPosition[1] = inDisplayPosition[1];\n\n if (inDisplayPosition[0] < buffdata.area[0] || inDisplayPosition[0] > buffdata.area[2] || inDisplayPosition[1] < buffdata.area[1] || inDisplayPosition[1] > buffdata.area[3]) {\n return null;\n } // offset inDisplayPosition based on the lower-left-corner of the Area.\n\n\n var displayPosition = [inDisplayPosition[0] - buffdata.area[0], inDisplayPosition[1] - buffdata.area[1]];\n var actorid = convert(displayPosition[0], displayPosition[1], buffdata.pixBuffer[PassTypes.ACTOR_PASS], buffdata.area);\n\n if (actorid <= 0) {\n // the pixel did not hit any actor.\n return null;\n }\n\n var _info = {};\n _info.valid = true;\n _info.propID = actorid - idOffset;\n _info.prop = buffdata.props[_info.propID];\n var compositeID = convert(displayPosition[0], displayPosition[1], buffdata.pixBuffer[PassTypes.COMPOSITE_INDEX_PASS], buffdata.area);\n\n if (compositeID < 0 || compositeID > 0xffffff) {\n compositeID = 0;\n }\n\n _info.compositeID = compositeID - idOffset;\n\n if (buffdata.captureZValues) {\n var offset = (displayPosition[1] * (buffdata.area[2] - buffdata.area[0] + 1) + displayPosition[0]) * 4;\n _info.zValue = (256 * buffdata.zBuffer[offset] + buffdata.zBuffer[offset + 1]) / 65535.0;\n _info.displayPosition = inDisplayPosition;\n }\n\n return _info;\n } // Iterate over successively growing boxes.\n // They recursively call the base case to handle single pixels.\n\n\n var dispPos = [inDisplayPosition[0], inDisplayPosition[1]];\n var curPos = [0, 0];\n var info = getPixelInformationWithData(buffdata, inDisplayPosition, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n\n for (var dist = 1; dist < maxDist; ++dist) {\n // Vertical sides of box.\n for (var y = dispPos[1] > dist ? dispPos[1] - dist : 0; y <= dispPos[1] + dist; ++y) {\n curPos[1] = y;\n\n if (dispPos[0] >= dist) {\n curPos[0] = dispPos[0] - dist;\n info = getPixelInformationWithData(buffdata, curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n }\n\n curPos[0] = dispPos[0] + dist;\n info = getPixelInformationWithData(buffdata, curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n } // Horizontal sides of box.\n\n\n for (var x = dispPos[0] >= dist ? dispPos[0] - (dist - 1) : 0; x <= dispPos[0] + (dist - 1); ++x) {\n curPos[0] = x;\n\n if (dispPos[1] >= dist) {\n curPos[1] = dispPos[1] - dist;\n info = getPixelInformationWithData(buffdata, curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n }\n\n curPos[1] = dispPos[1] + dist;\n info = getPixelInformationWithData(buffdata, curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n }\n } // nothing hit.\n\n\n outSelectedPosition[0] = inDisplayPosition[0];\n outSelectedPosition[1] = inDisplayPosition[1];\n return null;\n} //-----------------------------------------------------------------------------\n\n\nfunction convertSelection(fieldassociation, dataMap, captureZValues, renderer, openGLRenderWindow) {\n var sel = [];\n var count = 0;\n dataMap.forEach(function (value, key) {\n var child = vtk_js_Sources_Common_DataModel_SelectionNode__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n child.setContentType(SelectionContent.INDICES);\n\n switch (fieldassociation) {\n case FieldAssociations.FIELD_ASSOCIATION_CELLS:\n child.setFieldType(SelectionField.CELL);\n break;\n\n case FieldAssociations.FIELD_ASSOCIATION_POINTS:\n child.setFieldType(SelectionField.POINT);\n break;\n\n default:\n vtkErrorMacro('Unknown field association');\n }\n\n child.getProperties().propID = value.info.propID;\n child.getProperties().prop = value.info.prop;\n child.getProperties().compositeID = value.info.compositeID;\n child.getProperties().pixelCount = value.pixelCount;\n\n if (captureZValues) {\n child.getProperties().displayPosition = [value.info.displayPosition[0], value.info.displayPosition[1], value.info.zValue];\n child.getProperties().worldPosition = openGLRenderWindow.displayToWorld(value.info.displayPosition[0], value.info.displayPosition[1], value.info.zValue, renderer);\n }\n\n child.setSelectionList(value.attributeIDs);\n sel[count] = child;\n count++;\n });\n return sel;\n} //----------------------------------------------------------------------------\n\n\nfunction generateSelectionWithData(buffdata, fx1, fy1, fx2, fy2) {\n var x1 = Math.floor(fx1);\n var y1 = Math.floor(fy1);\n var x2 = Math.floor(fx2);\n var y2 = Math.floor(fy2);\n var dataMap = new Map();\n var outSelectedPosition = [0, 0];\n\n for (var yy = y1; yy <= y2; yy++) {\n for (var xx = x1; xx <= x2; xx++) {\n var pos = [xx, yy];\n var info = getPixelInformationWithData(buffdata, pos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n var hash = getInfoHash(info);\n\n if (!dataMap.has(hash)) {\n dataMap.set(hash, {\n info: info,\n pixelCount: 1,\n attributeIDs: [info.attributeID]\n });\n } else {\n var dmv = dataMap.get(hash);\n dmv.pixelCount++;\n\n if (buffdata.captureZValues) {\n if (info.zValue < dmv.info.zValue) {\n dmv.info = info;\n }\n }\n\n if (dmv.attributeIDs.indexOf(info.attributeID) === -1) {\n dmv.attributeIDs.push(info.attributeID);\n }\n }\n }\n }\n }\n\n return convertSelection(buffdata.fieldAssociation, dataMap, buffdata.captureZValues, buffdata.renderer, buffdata.openGLRenderWindow);\n} // ----------------------------------------------------------------------------\n// vtkOpenGLHardwareSelector methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkOpenGLHardwareSelector(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLHardwareSelector'); //----------------------------------------------------------------------------\n\n publicAPI.releasePixBuffers = function () {\n model.pixBuffer = [];\n model.zBuffer = null;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.beginSelection = function () {\n model.openGLRenderer = model.openGLRenderWindow.getViewNodeFor(model.renderer);\n model.maxAttributeId = 0;\n var size = model.openGLRenderWindow.getSize();\n\n if (!model.framebuffer) {\n model.framebuffer = vtk_js_Sources_Rendering_OpenGL_Framebuffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.framebuffer.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.framebuffer.saveCurrentBindingsAndBuffers();\n model.framebuffer.create(size[0], size[1]); // this calls model.framebuffer.bind()\n\n model.framebuffer.populateFramebuffer();\n } else {\n model.framebuffer.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.framebuffer.saveCurrentBindingsAndBuffers();\n var fbSize = model.framebuffer.getSize();\n\n if (fbSize[0] !== size[0] || fbSize[1] !== size[1]) {\n model.framebuffer.create(size[0], size[1]); // this calls model.framebuffer.bind()\n\n model.framebuffer.populateFramebuffer();\n } else {\n model.framebuffer.bind();\n }\n }\n\n model.openGLRenderer.clear();\n model.openGLRenderer.setSelector(publicAPI);\n model.hitProps = {};\n model.props = [];\n publicAPI.releasePixBuffers();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.endSelection = function () {\n model.hitProps = {};\n model.openGLRenderer.setSelector(null);\n model.framebuffer.restorePreviousBindingsAndBuffers();\n };\n\n publicAPI.preCapturePass = function () {};\n\n publicAPI.postCapturePass = function () {}; //----------------------------------------------------------------------------\n\n\n publicAPI.select = function () {\n var sel = null;\n\n if (publicAPI.captureBuffers()) {\n sel = publicAPI.generateSelection(model.area[0], model.area[1], model.area[2], model.area[3]);\n publicAPI.releasePixBuffers();\n }\n\n return sel;\n };\n\n publicAPI.getSourceDataAsync = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(renderer, fx1, fy1, fx2, fy2) {\n var size, result;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // assign the renderer\n model.renderer = renderer; // set area to all if no arguments provided\n\n if (fx1 === undefined) {\n size = model.openGLRenderWindow.getSize();\n publicAPI.setArea(0, 0, size[0] - 1, size[1] - 1);\n } else {\n publicAPI.setArea(fx1, fy1, fx2, fy2);\n } // just do capture buffers and package up the result\n\n\n if (publicAPI.captureBuffers()) {\n _context.next = 4;\n break;\n }\n\n return _context.abrupt(\"return\", false);\n\n case 4:\n result = {\n area: _toConsumableArray(model.area),\n pixBuffer: _toConsumableArray(model.pixBuffer),\n captureZValues: model.captureZValues,\n zBuffer: model.zBuffer,\n props: _toConsumableArray(model.props),\n fieldAssociation: model.fieldAssociation,\n renderer: renderer,\n openGLRenderWindow: model.openGLRenderWindow\n };\n\n result.generateSelection = function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return generateSelectionWithData.apply(void 0, [result].concat(args));\n };\n\n return _context.abrupt(\"return\", result);\n\n case 7:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x, _x2, _x3, _x4, _x5) {\n return _ref.apply(this, arguments);\n };\n }(); //----------------------------------------------------------------------------\n\n\n publicAPI.captureBuffers = function () {\n if (!model.renderer || !model.openGLRenderWindow) {\n vtkErrorMacro('Renderer and view must be set before calling Select.');\n return false;\n }\n\n model.openGLRenderer = model.openGLRenderWindow.getViewNodeFor(model.renderer); // int rgba[4];\n // rwin.getColorBufferSizes(rgba);\n // if (rgba[0] < 8 || rgba[1] < 8 || rgba[2] < 8) {\n // vtkErrorMacro(\"Color buffer depth must be at least 8 bit. \"\n // \"Currently: \" << rgba[0] << \", \" << rgba[1] << \", \" < 0) {\n val--;\n\n if (!(val in model.hitProps)) {\n model.hitProps[val] = true;\n }\n }\n }\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.renderProp = function (prop) {\n if (model.currentPass === PassTypes.ACTOR_PASS) {\n publicAPI.setPropColorValueFromInt(model.props.length + idOffset);\n model.props.push(prop);\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.renderCompositeIndex = function (index) {\n if (model.currentPass === PassTypes.COMPOSITE_INDEX_PASS) {\n publicAPI.setPropColorValueFromInt(index + idOffset);\n }\n }; //----------------------------------------------------------------------------\n // TODO: make inline\n\n\n publicAPI.renderAttributeId = function (attribid) {\n if (attribid < 0) {\n // negative attribid is valid. It happens when rendering higher order\n // elements where new points are added for rendering smooth surfaces.\n return;\n }\n\n model.maxAttributeId = attribid > model.maxAttributeId ? attribid : model.maxAttributeId; // if (model.currentPass < PassTypes.ID_LOW24) {\n // return; // useless...\n // }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.passTypeToString = function (type) {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].enumToString(PassTypes, type);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.isPropHit = function (id) {\n return Boolean(model.hitProps[id]);\n };\n\n publicAPI.setPropColorValueFromInt = function (val) {\n model.propColorValue[0] = val % 256 / 255.0;\n model.propColorValue[1] = Math.floor(val / 256) % 256 / 255.0;\n model.propColorValue[2] = Math.floor(val / 65536) % 256 / 255.0;\n }; // info has\n // valid\n // propId\n // prop\n // compositeID\n // attributeID\n //----------------------------------------------------------------------------\n\n\n publicAPI.getPixelInformation = function (inDisplayPosition, maxDistance, outSelectedPosition) {\n // Base case\n var maxDist = maxDistance < 0 ? 0 : maxDistance;\n\n if (maxDist === 0) {\n outSelectedPosition[0] = inDisplayPosition[0];\n outSelectedPosition[1] = inDisplayPosition[1];\n\n if (inDisplayPosition[0] < model.area[0] || inDisplayPosition[0] > model.area[2] || inDisplayPosition[1] < model.area[1] || inDisplayPosition[1] > model.area[3]) {\n return null;\n } // offset inDisplayPosition based on the lower-left-corner of the Area.\n\n\n var displayPosition = [inDisplayPosition[0] - model.area[0], inDisplayPosition[1] - model.area[1]];\n var actorid = convert(displayPosition[0], displayPosition[1], model.pixBuffer[PassTypes.ACTOR_PASS], model.area);\n\n if (actorid <= 0) {\n // the pixel did not hit any actor.\n return null;\n }\n\n var _info2 = {};\n _info2.valid = true;\n _info2.propID = actorid - idOffset;\n _info2.prop = model.props[_info2.propID];\n var compositeID = convert(displayPosition[0], displayPosition[1], model.pixBuffer[PassTypes.COMPOSITE_INDEX_PASS], model.area);\n\n if (compositeID < 0 || compositeID > 0xffffff) {\n compositeID = 0;\n }\n\n _info2.compositeID = compositeID - idOffset;\n\n if (model.captureZValues) {\n var offset = (displayPosition[1] * (model.area[2] - model.area[0] + 1) + displayPosition[0]) * 4;\n _info2.zValue = (256 * model.zBuffer[offset] + model.zBuffer[offset + 1]) / 65535.0;\n _info2.displayPosition = inDisplayPosition;\n }\n\n return _info2;\n } // Iterate over successively growing boxes.\n // They recursively call the base case to handle single pixels.\n\n\n var dispPos = [inDisplayPosition[0], inDisplayPosition[1]];\n var curPos = [0, 0];\n var info = publicAPI.getPixelInformation(inDisplayPosition, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n\n for (var dist = 1; dist < maxDist; ++dist) {\n // Vertical sides of box.\n for (var y = dispPos[1] > dist ? dispPos[1] - dist : 0; y <= dispPos[1] + dist; ++y) {\n curPos[1] = y;\n\n if (dispPos[0] >= dist) {\n curPos[0] = dispPos[0] - dist;\n info = publicAPI.getPixelInformation(curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n }\n\n curPos[0] = dispPos[0] + dist;\n info = publicAPI.getPixelInformation(curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n } // Horizontal sides of box.\n\n\n for (var x = dispPos[0] >= dist ? dispPos[0] - (dist - 1) : 0; x <= dispPos[0] + (dist - 1); ++x) {\n curPos[0] = x;\n\n if (dispPos[1] >= dist) {\n curPos[1] = dispPos[1] - dist;\n info = publicAPI.getPixelInformation(curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n }\n\n curPos[1] = dispPos[1] + dist;\n info = publicAPI.getPixelInformation(curPos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n return info;\n }\n }\n } // nothing hit.\n\n\n outSelectedPosition[0] = inDisplayPosition[0];\n outSelectedPosition[1] = inDisplayPosition[1];\n return null;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.generateSelection = function (fx1, fy1, fx2, fy2) {\n var x1 = Math.floor(fx1);\n var y1 = Math.floor(fy1);\n var x2 = Math.floor(fx2);\n var y2 = Math.floor(fy2);\n var dataMap = new Map();\n var outSelectedPosition = [0, 0];\n\n for (var yy = y1; yy <= y2; yy++) {\n for (var xx = x1; xx <= x2; xx++) {\n var pos = [xx, yy];\n var info = publicAPI.getPixelInformation(pos, 0, outSelectedPosition);\n\n if (info && info.valid) {\n var hash = getInfoHash(info);\n\n if (!dataMap.has(hash)) {\n dataMap.set(hash, {\n info: info,\n pixelCount: 1,\n attributeIDs: [info.attributeID]\n });\n } else {\n var dmv = dataMap.get(hash);\n dmv.pixelCount++;\n\n if (model.captureZValues) {\n if (info.zValue < dmv.info.zValue) {\n dmv.info = info;\n }\n }\n\n if (dmv.attributeIDs.indexOf(info.attributeID) === -1) {\n dmv.attributeIDs.push(info.attributeID);\n }\n }\n }\n }\n }\n\n return convertSelection(model.fieldAssociation, dataMap, model.captureZValues, model.renderer, model.openGLRenderWindow);\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.attach = function (w, r) {\n model.openGLRenderWindow = w;\n model.renderer = r;\n }; // override\n\n\n var superSetArea = publicAPI.setArea;\n\n publicAPI.setArea = function () {\n if (superSetArea.apply(void 0, arguments)) {\n model.area[0] = Math.floor(model.area[0]);\n model.area[1] = Math.floor(model.area[1]);\n model.area[2] = Math.floor(model.area[2]);\n model.area[3] = Math.floor(model.area[3]);\n return true;\n }\n\n return false;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n area: undefined,\n renderer: null,\n openGLRenderWindow: null,\n openGLRenderer: null,\n currentPass: -1,\n propColorValue: null,\n props: null,\n idOffset: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_Rendering_Core_HardwareSelector__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.propColorValue = [0, 0, 0];\n model.props = [];\n\n if (!model.area) {\n model.area = [0, 0, 0, 0];\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['area'], 4);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['renderer', 'currentPass', 'openGLRenderWindow']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['propColorValue'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'event'); // Object methods\n\n vtkOpenGLHardwareSelector(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkOpenGLHardwareSelector'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_OpenGL_HardwareSelector_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_CellArrayBufferObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/CellArrayBufferObject */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/CellArrayBufferObject/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_VertexArrayObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/VertexArrayObject */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/VertexArrayObject/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLHelper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLHelper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLHelper');\n\n publicAPI.setOpenGLRenderWindow = function (win) {\n model.program.setContext(win.getContext());\n model.VAO.setOpenGLRenderWindow(win);\n model.CABO.setOpenGLRenderWindow(win);\n };\n\n publicAPI.releaseGraphicsResources = function (oglwin) {\n model.VAO.releaseGraphicsResources();\n model.CABO.releaseGraphicsResources();\n model.CABO.setElementCount(0);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n program: null,\n shaderSourceTime: null,\n VAO: null,\n attributeUpdateTime: null,\n CABO: null,\n primitiveType: 0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.shaderSourceTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.shaderSourceTime);\n model.attributeUpdateTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.attributeUpdateTime);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['program', 'shaderSourceTime', 'VAO', 'attributeUpdateTime', 'CABO', 'primitiveType']);\n model.program = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.VAO = vtk_js_Sources_Rendering_OpenGL_VertexArrayObject__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.CABO = vtk_js_Sources_Rendering_OpenGL_CellArrayBufferObject__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(); // Object methods\n\n vtkOpenGLHelper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageMapper/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageMapper/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ImageMapper_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ImageMapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/ImageMapper/Constants.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Helper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ImageProperty_Constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ImageProperty/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/ImageProperty/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ReplacementShaderMapper__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"vtkErrorMacro\"];\nvar SlicingMode = vtk_js_Sources_Rendering_Core_ImageMapper_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].SlicingMode; // ----------------------------------------------------------------------------\n// helper methods\n// ----------------------------------------------------------------------------\n\nfunction computeFnToString(property, fn, numberOfComponents) {\n var pwfun = fn.apply(property);\n\n if (pwfun) {\n var iComps = property.getIndependentComponents();\n return \"\".concat(property.getMTime(), \"-\").concat(iComps, \"-\").concat(numberOfComponents);\n }\n\n return '0';\n} // ----------------------------------------------------------------------------\n// vtkOpenGLImageMapper methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkOpenGLImageMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLImageMapper');\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.openGLImageSlice = publicAPI.getFirstAncestorOfType('vtkOpenGLImageSlice');\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n model.openGLRenderWindow = model.openGLRenderer.getParent();\n model.context = model.openGLRenderWindow.getContext();\n model.tris.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.openGLTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.colorTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.pwfTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n var ren = model.openGLRenderer.getRenderable();\n model.openGLCamera = model.openGLRenderer.getViewNodeFor(ren.getActiveCamera()); // is slice set by the camera\n\n if (model.renderable.getSliceAtFocalPoint()) {\n model.renderable.setSliceFromCamera(ren.getActiveCamera());\n }\n }\n };\n\n publicAPI.translucentPass = function (prepass) {\n if (prepass) {\n publicAPI.render();\n }\n };\n\n publicAPI.opaqueZBufferPass = function (prepass) {\n if (prepass) {\n model.haveSeenDepthRequest = true;\n model.renderDepth = true;\n publicAPI.render();\n model.renderDepth = false;\n }\n };\n\n publicAPI.opaquePass = function (prepass) {\n if (prepass) {\n publicAPI.render();\n }\n };\n\n publicAPI.getCoincidentParameters = function (ren, actor) {\n if (model.renderable.getResolveCoincidentTopology()) {\n return model.renderable.getCoincidentTopologyPolygonOffsetParameters();\n }\n\n return null;\n }; // Renders myself\n\n\n publicAPI.render = function () {\n var actor = model.openGLImageSlice.getRenderable();\n var ren = model.openGLRenderer.getRenderable();\n publicAPI.renderPiece(ren, actor);\n };\n\n publicAPI.buildShaders = function (shaders, ren, actor) {\n publicAPI.getShaderTemplate(shaders, ren, actor);\n publicAPI.replaceShaderValues(shaders, ren, actor);\n };\n\n publicAPI.getShaderTemplate = function (shaders, ren, actor) {\n shaders.Vertex = vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_13___default.a;\n shaders.Fragment = vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_14___default.a;\n shaders.Geometry = '';\n };\n\n publicAPI.replaceShaderValues = function (shaders, ren, actor) {\n var VSSource = shaders.Vertex;\n var FSSource = shaders.Fragment;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(VSSource, '//VTK::Camera::Dec', ['uniform mat4 MCPCMatrix;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Impl', [' gl_Position = MCPCMatrix * vertexMC;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(VSSource, '//VTK::TCoord::Impl', 'tcoordVCVSOutput = tcoordMC;').result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(VSSource, '//VTK::TCoord::Dec', 'attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;').result;\n var tNumComp = model.openGLTexture.getComponents();\n var iComps = actor.getProperty().getIndependentComponents();\n var tcoordDec = ['varying vec2 tcoordVCVSOutput;', // color shift and scale\n 'uniform float cshift0;', 'uniform float cscale0;', // pwf shift and scale\n 'uniform float pwfshift0;', 'uniform float pwfscale0;', 'uniform sampler2D texture1;', 'uniform sampler2D colorTexture1;', 'uniform sampler2D pwfTexture1;', 'uniform float opacity;'];\n\n if (iComps) {\n for (var comp = 1; comp < tNumComp; comp++) {\n tcoordDec = tcoordDec.concat([// color shift and scale\n \"uniform float cshift\".concat(comp, \";\"), \"uniform float cscale\".concat(comp, \";\"), // weighting shift and scale\n \"uniform float pwfshift\".concat(comp, \";\"), \"uniform float pwfscale\".concat(comp, \";\")]);\n } // the heights defined below are the locations\n // for the up to four components of the tfuns\n // the tfuns have a height of 2XnumComps pixels so the\n // values are computed to hit the middle of the two rows\n // for that component\n\n\n switch (tNumComp) {\n case 1:\n tcoordDec = tcoordDec.concat(['uniform float mix0;', '#define height0 0.5']);\n break;\n\n case 2:\n tcoordDec = tcoordDec.concat(['uniform float mix0;', 'uniform float mix1;', '#define height0 0.25', '#define height1 0.75']);\n break;\n\n case 3:\n tcoordDec = tcoordDec.concat(['uniform float mix0;', 'uniform float mix1;', 'uniform float mix2;', '#define height0 0.17', '#define height1 0.5', '#define height2 0.83']);\n break;\n\n case 4:\n tcoordDec = tcoordDec.concat(['uniform float mix0;', 'uniform float mix1;', 'uniform float mix2;', 'uniform float mix3;', '#define height0 0.125', '#define height1 0.375', '#define height2 0.625', '#define height3 0.875']);\n break;\n\n default:\n vtkErrorMacro('Unsupported number of independent coordinates.');\n }\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::TCoord::Dec', tcoordDec).result;\n\n if (iComps) {\n var rgba = ['r', 'g', 'b', 'a'];\n var tcoordImpl = ['vec4 tvalue = texture2D(texture1, tcoordVCVSOutput);'];\n\n for (var _comp = 0; _comp < tNumComp; _comp++) {\n tcoordImpl = tcoordImpl.concat([\"vec3 tcolor\".concat(_comp, \" = mix\").concat(_comp, \" * texture2D(colorTexture1, vec2(tvalue.\").concat(rgba[_comp], \" * cscale\").concat(_comp, \" + cshift\").concat(_comp, \", height\").concat(_comp, \")).rgb;\"), \"float compWeight\".concat(_comp, \" = mix\").concat(_comp, \" * texture2D(pwfTexture1, vec2(tvalue.\").concat(rgba[_comp], \" * pwfscale\").concat(_comp, \" + pwfshift\").concat(_comp, \", height\").concat(_comp, \")).r;\")]);\n }\n\n switch (tNumComp) {\n case 1:\n tcoordImpl = tcoordImpl.concat(['gl_FragData[0] = vec4(tcolor0.rgb, opacity);']);\n break;\n\n case 2:\n tcoordImpl = tcoordImpl.concat(['float weightSum = compWeight0 + compWeight1;', 'gl_FragData[0] = vec4(vec3((tcolor0.rgb * (compWeight0 / weightSum)) + (tcolor1.rgb * (compWeight1 / weightSum))), opacity);']);\n break;\n\n case 3:\n tcoordImpl = tcoordImpl.concat(['float weightSum = compWeight0 + compWeight1 + compWeight2;', 'gl_FragData[0] = vec4(vec3((tcolor0.rgb * (compWeight0 / weightSum)) + (tcolor1.rgb * (compWeight1 / weightSum)) + (tcolor2.rgb * (compWeight2 / weightSum))), opacity);']);\n break;\n\n case 4:\n tcoordImpl = tcoordImpl.concat(['float weightSum = compWeight0 + compWeight1 + compWeight2 + compWeight3;', 'gl_FragData[0] = vec4(vec3((tcolor0.rgb * (compWeight0 / weightSum)) + (tcolor1.rgb * (compWeight1 / weightSum)) + (tcolor2.rgb * (compWeight2 / weightSum)) + (tcolor3.rgb * (compWeight3 / weightSum))), opacity);']);\n break;\n\n default:\n vtkErrorMacro('Unsupported number of independent coordinates.');\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', tcoordImpl).result;\n } else {\n // dependent components\n switch (tNumComp) {\n case 1:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['float intensity = texture2D(texture1, tcoordVCVSOutput).r;', 'vec3 tcolor = texture2D(colorTexture1, vec2(intensity * cscale0 + cshift0, 0.5)).rgb;', 'float scalarOpacity = texture2D(pwfTexture1, vec2(intensity * pwfscale0 + pwfshift0, 0.5)).r;', 'gl_FragData[0] = vec4(tcolor, scalarOpacity * opacity);']).result;\n break;\n\n case 2:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);', 'float intensity = tcolor.r*cscale0 + cshift0;', 'gl_FragData[0] = vec4(texture2D(colorTexture1, vec2(intensity, 0.5)).rgb, pwfscale0*tcolor.g + pwfshift0);']).result;\n break;\n\n default:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = cscale0*texture2D(texture1, tcoordVCVSOutput.st) + cshift0;', 'gl_FragData[0] = vec4(texture2D(colorTexture1, vec2(tcolor.r,0.5)).r,', ' texture2D(colorTexture1, vec2(tcolor.g,0.5)).r,', ' texture2D(colorTexture1, vec2(tcolor.b,0.5)).r, tcolor.a);']).result;\n }\n }\n\n if (model.haveSeenDepthRequest) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ZBuffer::Dec', 'uniform int depthRequest;').result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ZBuffer::Impl', ['if (depthRequest == 1) {', 'float iz = floor(gl_FragCoord.z*65535.0 + 0.1);', 'float rf = floor(iz/256.0)/255.0;', 'float gf = mod(iz,256.0)/255.0;', 'gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }']).result;\n }\n\n shaders.Vertex = VSSource;\n shaders.Fragment = FSSource;\n publicAPI.replaceShaderCoincidentOffset(shaders, ren, actor);\n };\n\n publicAPI.getNeedToRebuildShaders = function (cellBO, ren, actor) {\n // has something changed that would require us to recreate the shader?\n // candidates are\n // property modified (representation interpolation and lighting)\n // input modified\n // light complexity changed\n var tNumComp = model.openGLTexture.getComponents();\n var iComp = actor.getProperty().getIndependentComponents();\n\n if (model.lastHaveSeenDepthRequest !== model.haveSeenDepthRequest || cellBO.getProgram() === 0 || model.lastTextureComponents !== tNumComp || model.lastIndependentComponents !== iComp) {\n model.lastHaveSeenDepthRequest = model.haveSeenDepthRequest;\n model.lastTextureComponents = tNumComp;\n model.lastIndependentComponents = iComp;\n return true;\n }\n\n return false;\n };\n\n publicAPI.updateShaders = function (cellBO, ren, actor) {\n model.lastBoundBO = cellBO; // has something changed that would require us to recreate the shader?\n\n if (publicAPI.getNeedToRebuildShaders(cellBO, ren, actor)) {\n var shaders = {\n Vertex: null,\n Fragment: null,\n Geometry: null\n };\n publicAPI.buildShaders(shaders, ren, actor); // compile and bind the program if needed\n\n var newShader = model.openGLRenderWindow.getShaderCache().readyShaderProgramArray(shaders.Vertex, shaders.Fragment, shaders.Geometry); // if the shader changed reinitialize the VAO\n\n if (newShader !== cellBO.getProgram()) {\n cellBO.setProgram(newShader); // reset the VAO as the shader has changed\n\n cellBO.getVAO().releaseGraphicsResources();\n }\n\n cellBO.getShaderSourceTime().modified();\n } else {\n model.openGLRenderWindow.getShaderCache().readyShaderProgram(cellBO.getProgram());\n }\n\n cellBO.getVAO().bind();\n publicAPI.setMapperShaderParameters(cellBO, ren, actor);\n publicAPI.setCameraShaderParameters(cellBO, ren, actor);\n publicAPI.setPropertyShaderParameters(cellBO, ren, actor);\n };\n\n publicAPI.setMapperShaderParameters = function (cellBO, ren, actor) {\n // Now to update the VAO too, if necessary.\n if (cellBO.getCABO().getElementCount() && (model.VBOBuildTime > cellBO.getAttributeUpdateTime().getMTime() || cellBO.getShaderSourceTime().getMTime() > cellBO.getAttributeUpdateTime().getMTime())) {\n if (cellBO.getProgram().isAttributeUsed('vertexMC')) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO(), 'vertexMC', cellBO.getCABO().getVertexOffset(), cellBO.getCABO().getStride(), model.context.FLOAT, 3, model.context.FALSE)) {\n vtkErrorMacro('Error setting vertexMC in shader VAO.');\n }\n }\n\n if (cellBO.getProgram().isAttributeUsed('tcoordMC') && cellBO.getCABO().getTCoordOffset()) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO(), 'tcoordMC', cellBO.getCABO().getTCoordOffset(), cellBO.getCABO().getStride(), model.context.FLOAT, cellBO.getCABO().getTCoordComponents(), model.context.FALSE)) {\n vtkErrorMacro('Error setting tcoordMC in shader VAO.');\n }\n }\n\n cellBO.getAttributeUpdateTime().modified();\n }\n\n var texUnit = model.openGLTexture.getTextureUnit();\n cellBO.getProgram().setUniformi('texture1', texUnit);\n var numComp = model.openGLTexture.getComponents();\n var iComps = actor.getProperty().getIndependentComponents();\n\n if (iComps) {\n for (var i = 0; i < numComp; i++) {\n cellBO.getProgram().setUniformf(\"mix\".concat(i), actor.getProperty().getComponentWeight(i));\n }\n }\n\n var oglShiftScale = model.openGLTexture.getShiftAndScale(); // three levels of shift scale combined into one\n // for performance in the fragment shader\n\n for (var _i = 0; _i < numComp; _i++) {\n var cw = actor.getProperty().getColorWindow();\n var cl = actor.getProperty().getColorLevel();\n var target = iComps ? _i : 0;\n var cfun = actor.getProperty().getRGBTransferFunction(target);\n\n if (cfun) {\n var cRange = cfun.getRange();\n cw = cRange[1] - cRange[0];\n cl = 0.5 * (cRange[1] + cRange[0]);\n }\n\n var scale = oglShiftScale.scale / cw;\n var shift = (oglShiftScale.shift - cl) / cw + 0.5;\n cellBO.getProgram().setUniformf(\"cshift\".concat(_i), shift);\n cellBO.getProgram().setUniformf(\"cscale\".concat(_i), scale);\n } // pwf shift/scale\n\n\n for (var _i2 = 0; _i2 < numComp; _i2++) {\n var pwfScale = 1.0;\n var pwfShift = 0.0;\n\n var _target = iComps ? _i2 : 0;\n\n var pwfun = actor.getProperty().getPiecewiseFunction(_target);\n\n if (pwfun) {\n var pwfRange = pwfun.getRange();\n var length = pwfRange[1] - pwfRange[0];\n var mid = 0.5 * (pwfRange[0] + pwfRange[1]);\n pwfScale = oglShiftScale.scale / length;\n pwfShift = (oglShiftScale.shift - mid) / length + 0.5;\n }\n\n cellBO.getProgram().setUniformf(\"pwfshift\".concat(_i2), pwfShift);\n cellBO.getProgram().setUniformf(\"pwfscale\".concat(_i2), pwfScale);\n }\n\n if (model.haveSeenDepthRequest) {\n cellBO.getProgram().setUniformi('depthRequest', model.renderDepth ? 1 : 0);\n } // handle coincident\n\n\n if (cellBO.getProgram().isUniformUsed('coffset')) {\n var cp = publicAPI.getCoincidentParameters(ren, actor);\n cellBO.getProgram().setUniformf('coffset', cp.offset); // cfactor isn't always used when coffset is.\n\n if (cellBO.getProgram().isUniformUsed('cfactor')) {\n cellBO.getProgram().setUniformf('cfactor', cp.factor);\n }\n }\n\n var texColorUnit = model.colorTexture.getTextureUnit();\n cellBO.getProgram().setUniformi('colorTexture1', texColorUnit);\n var texOpacityUnit = model.pwfTexture.getTextureUnit();\n cellBO.getProgram().setUniformi('pwfTexture1', texOpacityUnit);\n };\n\n publicAPI.setCameraShaderParameters = function (cellBO, ren, actor) {\n var program = cellBO.getProgram();\n var actMats = model.openGLImageSlice.getKeyMatrices();\n var image = model.currentInput;\n var i2wmat4 = image.getIndexToWorld();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.imagemat, actMats.mcwc, i2wmat4);\n var keyMats = model.openGLCamera.getKeyMatrices(ren);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.imagemat, keyMats.wcpc, model.imagemat);\n\n if (cellBO.getCABO().getCoordShiftAndScaleEnabled()) {\n var inverseShiftScaleMat = cellBO.getCABO().getInverseShiftAndScaleMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.imagemat, model.imagemat, inverseShiftScaleMat);\n }\n\n program.setUniformMatrix('MCPCMatrix', model.imagemat);\n };\n\n publicAPI.setPropertyShaderParameters = function (cellBO, ren, actor) {\n var program = cellBO.getProgram();\n var ppty = actor.getProperty();\n var opacity = ppty.getOpacity();\n program.setUniformf('opacity', opacity);\n };\n\n publicAPI.renderPieceStart = function (ren, actor) {\n // make sure the BOs are up to date\n publicAPI.updateBufferObjects(ren, actor); // Bind the OpenGL, this is shared between the different primitive/cell types.\n\n model.lastBoundBO = null;\n };\n\n publicAPI.renderPieceDraw = function (ren, actor) {\n var gl = model.context; // activate the texture\n\n model.openGLTexture.activate();\n model.colorTexture.activate();\n model.pwfTexture.activate(); // draw polygons\n\n if (model.tris.getCABO().getElementCount()) {\n // First we do the triangles, update the shader, set uniforms, etc.\n publicAPI.updateShaders(model.tris, ren, actor);\n gl.drawArrays(gl.TRIANGLES, 0, model.tris.getCABO().getElementCount());\n model.tris.getVAO().release();\n }\n\n model.openGLTexture.deactivate();\n model.colorTexture.deactivate();\n model.pwfTexture.deactivate();\n };\n\n publicAPI.renderPieceFinish = function (ren, actor) {};\n\n publicAPI.renderPiece = function (ren, actor) {\n // Make sure that we have been properly initialized.\n // if (ren.getRenderWindow().checkAbortStatus()) {\n // return;\n // }\n publicAPI.invokeEvent({\n type: 'StartEvent'\n });\n model.renderable.update();\n model.currentInput = model.renderable.getInputData();\n publicAPI.invokeEvent({\n type: 'EndEvent'\n });\n\n if (!model.currentInput) {\n vtkErrorMacro('No input!');\n return;\n }\n\n publicAPI.renderPieceStart(ren, actor);\n publicAPI.renderPieceDraw(ren, actor);\n publicAPI.renderPieceFinish(ren, actor);\n };\n\n publicAPI.computeBounds = function (ren, actor) {\n if (!publicAPI.getInput()) {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_6__[\"uninitializeBounds\"](model.bounds);\n return;\n }\n\n model.bounds = publicAPI.getInput().getBounds();\n };\n\n publicAPI.updateBufferObjects = function (ren, actor) {\n // Rebuild buffers if needed\n if (publicAPI.getNeedToRebuildBufferObjects(ren, actor)) {\n publicAPI.buildBufferObjects(ren, actor);\n }\n };\n\n publicAPI.getNeedToRebuildBufferObjects = function (ren, actor) {\n // first do a coarse check\n if (model.VBOBuildTime.getMTime() < publicAPI.getMTime() || model.VBOBuildTime.getMTime() < actor.getMTime() || model.VBOBuildTime.getMTime() < model.renderable.getMTime() || model.VBOBuildTime.getMTime() < actor.getProperty().getMTime() || model.VBOBuildTime.getMTime() < model.currentInput.getMTime()) {\n return true;\n }\n\n return false;\n };\n\n publicAPI.buildBufferObjects = function (ren, actor) {\n var image = model.currentInput;\n\n if (!image) {\n return;\n }\n\n var imgScalars = image.getPointData() && image.getPointData().getScalars();\n\n if (!imgScalars) {\n return;\n }\n\n var actorProperty = actor.getProperty(); // set interpolation on the texture based on property setting\n\n var iType = actorProperty.getInterpolationType();\n\n if (iType === vtk_js_Sources_Rendering_Core_ImageProperty_Constants__WEBPACK_IMPORTED_MODULE_12__[\"InterpolationType\"].NEAREST) {\n model.colorTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n model.colorTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n model.pwfTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n model.pwfTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n } else {\n model.colorTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR);\n model.colorTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR);\n model.pwfTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR);\n model.pwfTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR);\n }\n\n var numComp = imgScalars.getNumberOfComponents();\n var iComps = actorProperty.getIndependentComponents();\n var numIComps = iComps ? numComp : 1;\n var textureHeight = iComps ? 2 * numIComps : 1;\n var cfunToString = computeFnToString(actorProperty, actorProperty.getRGBTransferFunction, numIComps);\n\n if (model.colorTextureString !== cfunToString) {\n var cWidth = 1024;\n var cSize = cWidth * textureHeight * 3;\n var cTable = new Uint8Array(cSize);\n var cfun = actorProperty.getRGBTransferFunction();\n\n if (cfun) {\n var tmpTable = new Float32Array(cWidth * 3);\n\n for (var c = 0; c < numIComps; c++) {\n cfun = actorProperty.getRGBTransferFunction(c);\n var cRange = cfun.getRange();\n cfun.getTable(cRange[0], cRange[1], cWidth, tmpTable, 1);\n\n if (iComps) {\n for (var i = 0; i < cWidth * 3; i++) {\n cTable[c * cWidth * 6 + i] = 255.0 * tmpTable[i];\n cTable[c * cWidth * 6 + i + cWidth * 3] = 255.0 * tmpTable[i];\n }\n } else {\n for (var _i3 = 0; _i3 < cWidth * 3; _i3++) {\n cTable[c * cWidth * 6 + _i3] = 255.0 * tmpTable[_i3];\n }\n }\n }\n\n model.colorTexture.create2DFromRaw(cWidth, textureHeight, 3, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__[\"VtkDataTypes\"].UNSIGNED_CHAR, cTable);\n } else {\n for (var _i4 = 0; _i4 < cWidth * 3; ++_i4) {\n cTable[_i4] = 255.0 * _i4 / ((cWidth - 1) * 3);\n cTable[_i4 + 1] = 255.0 * _i4 / ((cWidth - 1) * 3);\n cTable[_i4 + 2] = 255.0 * _i4 / ((cWidth - 1) * 3);\n }\n\n model.colorTexture.create2DFromRaw(cWidth, 1, 3, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__[\"VtkDataTypes\"].UNSIGNED_CHAR, cTable);\n }\n\n model.colorTextureString = cfunToString;\n } // Build piecewise function buffer. This buffer is used either\n // for component weighting or opacity, depending on whether we're\n // rendering components independently or not.\n\n\n var pwfunToString = computeFnToString(actorProperty, actorProperty.getPiecewiseFunction, numIComps);\n\n if (model.pwfTextureString !== pwfunToString) {\n var pwfWidth = 1024;\n var pwfSize = pwfWidth * textureHeight;\n var pwfTable = new Uint8Array(pwfSize);\n var pwfun = actorProperty.getPiecewiseFunction(); // support case where pwfun is added/removed\n\n model.pwfTexture.resetFormatAndType();\n\n if (pwfun) {\n var pwfFloatTable = new Float32Array(pwfSize);\n\n var _tmpTable = new Float32Array(pwfWidth);\n\n for (var _c = 0; _c < numIComps; ++_c) {\n pwfun = actorProperty.getPiecewiseFunction(_c);\n\n if (pwfun === null) {\n // Piecewise constant max if no function supplied for this component\n pwfFloatTable.fill(1.0);\n } else {\n var pwfRange = pwfun.getRange();\n pwfun.getTable(pwfRange[0], pwfRange[1], pwfWidth, _tmpTable, 1); // adjust for sample distance etc\n\n if (iComps) {\n for (var _i5 = 0; _i5 < pwfWidth; _i5++) {\n pwfFloatTable[_c * pwfWidth * 2 + _i5] = _tmpTable[_i5];\n pwfFloatTable[_c * pwfWidth * 2 + _i5 + pwfWidth] = _tmpTable[_i5];\n }\n } else {\n for (var _i6 = 0; _i6 < pwfWidth; _i6++) {\n pwfFloatTable[_c * pwfWidth * 2 + _i6] = _tmpTable[_i6];\n }\n }\n }\n }\n\n model.pwfTexture.create2DFromRaw(pwfWidth, textureHeight, 1, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__[\"VtkDataTypes\"].FLOAT, pwfFloatTable);\n } else {\n // default is opaque\n pwfTable.fill(255.0);\n model.pwfTexture.create2DFromRaw(pwfWidth, 1, 1, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_4__[\"VtkDataTypes\"].UNSIGNED_CHAR, pwfTable);\n }\n\n model.pwfTextureString = pwfunToString;\n } // Find what IJK axis and what direction to slice along\n\n\n var _model$renderable$get = model.renderable.getClosestIJKAxis(),\n ijkMode = _model$renderable$get.ijkMode; // Find the IJK slice\n\n\n var nSlice = model.renderable.getSlice();\n\n if (ijkMode !== model.renderable.getSlicingMode()) {\n // If not IJK slicing, get the IJK slice from the XYZ position/slice\n nSlice = model.renderable.getSliceAtPosition(nSlice);\n } // Find sliceOffset\n\n\n var ext = image.getExtent();\n var sliceOffset;\n\n if (ijkMode === SlicingMode.I) {\n sliceOffset = nSlice - ext[0];\n }\n\n if (ijkMode === SlicingMode.J) {\n sliceOffset = nSlice - ext[2];\n }\n\n if (ijkMode === SlicingMode.K || ijkMode === SlicingMode.NONE) {\n sliceOffset = nSlice - ext[4];\n } // rebuild the VBO if the data has changed\n\n\n var toString = \"\".concat(nSlice, \"A\").concat(image.getMTime(), \"A\").concat(imgScalars.getMTime(), \"B\").concat(publicAPI.getMTime(), \"C\").concat(model.renderable.getSlicingMode(), \"D\").concat(actor.getProperty().getMTime());\n\n if (model.VBOBuildString !== toString) {\n // Build the VBOs\n var dims = image.getDimensions();\n\n if (iType === vtk_js_Sources_Rendering_Core_ImageProperty_Constants__WEBPACK_IMPORTED_MODULE_12__[\"InterpolationType\"].NEAREST) {\n if (numComp === 4) {\n model.openGLTexture.setGenerateMipmap(true);\n model.openGLTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n } else {\n model.openGLTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n }\n\n model.openGLTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].NEAREST);\n } else {\n if (numComp === 4) {\n model.openGLTexture.setGenerateMipmap(true);\n model.openGLTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR_MIPMAP_LINEAR);\n } else {\n model.openGLTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR);\n }\n\n model.openGLTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Filter\"].LINEAR);\n }\n\n model.openGLTexture.setWrapS(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Wrap\"].CLAMP_TO_EDGE);\n model.openGLTexture.setWrapT(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Wrap\"].CLAMP_TO_EDGE);\n var sliceSize = dims[0] * dims[1] * numComp;\n var ptsArray = new Float32Array(12);\n var tcoordArray = new Float32Array(8);\n\n for (var _i7 = 0; _i7 < 4; _i7++) {\n tcoordArray[_i7 * 2] = _i7 % 2 ? 1.0 : 0.0;\n tcoordArray[_i7 * 2 + 1] = _i7 > 1 ? 1.0 : 0.0;\n }\n\n var basicScalars = imgScalars.getData();\n var scalars = null; // Get right scalars according to slicing mode\n\n if (ijkMode === SlicingMode.I) {\n scalars = new basicScalars.constructor(dims[2] * dims[1] * numComp);\n var id = 0;\n\n for (var k = 0; k < dims[2]; k++) {\n for (var j = 0; j < dims[1]; j++) {\n var bsIdx = (sliceOffset + j * dims[0] + k * dims[0] * dims[1]) * numComp;\n id = (k * dims[1] + j) * numComp;\n scalars.set(basicScalars.subarray(bsIdx, bsIdx + numComp), id);\n }\n }\n\n dims[0] = dims[1];\n dims[1] = dims[2];\n ptsArray[0] = nSlice;\n ptsArray[1] = ext[2];\n ptsArray[2] = ext[4];\n ptsArray[3] = nSlice;\n ptsArray[4] = ext[3];\n ptsArray[5] = ext[4];\n ptsArray[6] = nSlice;\n ptsArray[7] = ext[2];\n ptsArray[8] = ext[5];\n ptsArray[9] = nSlice;\n ptsArray[10] = ext[3];\n ptsArray[11] = ext[5];\n } else if (ijkMode === SlicingMode.J) {\n scalars = new basicScalars.constructor(dims[2] * dims[0] * numComp);\n var _id = 0;\n\n for (var _k = 0; _k < dims[2]; _k++) {\n for (var _i8 = 0; _i8 < dims[0]; _i8++) {\n var _bsIdx = (_i8 + sliceOffset * dims[0] + _k * dims[0] * dims[1]) * numComp;\n\n _id = (_k * dims[0] + _i8) * numComp;\n scalars.set(basicScalars.subarray(_bsIdx, _bsIdx + numComp), _id);\n }\n }\n\n dims[1] = dims[2];\n ptsArray[0] = ext[0];\n ptsArray[1] = nSlice;\n ptsArray[2] = ext[4];\n ptsArray[3] = ext[1];\n ptsArray[4] = nSlice;\n ptsArray[5] = ext[4];\n ptsArray[6] = ext[0];\n ptsArray[7] = nSlice;\n ptsArray[8] = ext[5];\n ptsArray[9] = ext[1];\n ptsArray[10] = nSlice;\n ptsArray[11] = ext[5];\n } else if (ijkMode === SlicingMode.K || ijkMode === SlicingMode.NONE) {\n scalars = basicScalars.subarray(sliceOffset * sliceSize, (sliceOffset + 1) * sliceSize);\n ptsArray[0] = ext[0];\n ptsArray[1] = ext[2];\n ptsArray[2] = nSlice;\n ptsArray[3] = ext[1];\n ptsArray[4] = ext[2];\n ptsArray[5] = nSlice;\n ptsArray[6] = ext[0];\n ptsArray[7] = ext[3];\n ptsArray[8] = nSlice;\n ptsArray[9] = ext[1];\n ptsArray[10] = ext[3];\n ptsArray[11] = nSlice;\n } else {\n vtkErrorMacro('Reformat slicing not yet supported.');\n }\n\n model.openGLTexture.create2DFromRaw(dims[0], dims[1], numComp, imgScalars.getDataType(), scalars);\n model.openGLTexture.activate();\n model.openGLTexture.sendParameters();\n model.openGLTexture.deactivate();\n var points = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n numberOfComponents: 3,\n values: ptsArray\n });\n points.setName('points');\n var tcoords = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n numberOfComponents: 2,\n values: tcoordArray\n });\n tcoords.setName('tcoords');\n var cellArray = new Uint16Array(8);\n cellArray[0] = 3;\n cellArray[1] = 0;\n cellArray[2] = 1;\n cellArray[3] = 3;\n cellArray[4] = 3;\n cellArray[5] = 0;\n cellArray[6] = 3;\n cellArray[7] = 2;\n var cells = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n numberOfComponents: 1,\n values: cellArray\n });\n model.tris.getCABO().createVBO(cells, 'polys', vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_10__[\"Representation\"].SURFACE, {\n points: points,\n tcoords: tcoords,\n cellOffset: 0\n });\n model.VBOBuildTime.modified();\n model.VBOBuildString = toString;\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n VBOBuildTime: 0,\n VBOBuildString: null,\n openGLTexture: null,\n tris: null,\n imagemat: null,\n colorTexture: null,\n pwfTexture: null,\n lastHaveSeenDepthRequest: false,\n haveSeenDepthRequest: false,\n lastTextureComponents: 0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_9__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_Rendering_OpenGL_ReplacementShaderMapper__WEBPACK_IMPORTED_MODULE_15__[\"default\"].implementReplaceShaderCoincidentOffset(publicAPI, model, initialValues);\n model.tris = vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n model.openGLTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.colorTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.pwfTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.imagemat = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16)); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"setGet\"](publicAPI, model, []);\n model.VBOBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"obj\"](model.VBOBuildTime); // Object methods\n\n vtkOpenGLImageMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"newInstance\"](extend, 'vtkOpenGLImageMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_16__[\"registerOverride\"])('vtkImageMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageSlice/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageSlice/index.js ***! - \**************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLImageSlice methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLImageSlice(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLImageSlice'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (prepass) {\n if (!model.renderable) {\n return;\n }\n\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getMapper());\n publicAPI.removeUnusedNodes();\n }\n };\n\n publicAPI.traverseOpaqueZBufferPass = function (renderPass) {\n publicAPI.traverseOpaquePass(renderPass);\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseOpaquePass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || !model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.children.forEach(function (child) {\n child.traverse(renderPass);\n });\n publicAPI.apply(renderPass, false);\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseTranslucentPass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || model.renderable.getIsOpaque() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.children.forEach(function (child) {\n child.traverse(renderPass);\n });\n publicAPI.apply(renderPass, false);\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (model.renderable.getIsOpaque()) {\n renderPass.incrementOpaqueActorCount();\n } else {\n renderPass.incrementTranslucentActorCount();\n }\n }\n };\n\n publicAPI.opaqueZBufferPass = function (prepass, renderPass) {\n return publicAPI.opaquePass(prepass, renderPass);\n }; // Renders myself\n\n\n publicAPI.opaquePass = function (prepass, renderPass) {\n if (prepass) {\n model.context = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow').getContext();\n model.context.depthMask(true);\n }\n }; // Renders myself\n\n\n publicAPI.translucentPass = function (prepass, renderPass) {\n if (prepass) {\n model.context = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow').getContext();\n model.context.depthMask(false);\n } else {\n model.context.depthMask(true);\n }\n };\n\n publicAPI.getKeyMatrices = function () {\n // has the actor changed?\n if (model.renderable.getMTime() > model.keyMatrixTime.getMTime()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.keyMatrices.mcwc, model.renderable.getMatrix());\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.mcwc, model.keyMatrices.mcwc);\n model.keyMatrixTime.modified();\n }\n\n return model.keyMatrices;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n keyMatrixTime: null,\n keyMatrices: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatrixTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.keyMatrixTime, {\n mtime: 0\n });\n model.keyMatrices = {\n mcwc: gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16))\n }; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['context']); // Object methods\n\n vtkOpenGLImageSlice(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkOpenGLImageSlice'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkImageSlice', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageSlice/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper/index.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper/index.js ***! - \****************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n// import { mat4, vec3 } from 'gl-matrix';\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkDebugMacro\"]; // ----------------------------------------------------------------------------\n// vtkOpenGLPixelSpaceCallbackMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLPixelSpaceCallbackMapper(publicAPI, model) {\n model.classHierarchy.push('vtkOpenGLPixelSpaceCallbackMapper');\n\n publicAPI.opaquePass = function (prepass, renderPass) {\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n model.openGLRenderWindow = model.openGLRenderer.getParent();\n var aspectRatio = model.openGLRenderer.getAspectRatio();\n var camera = model.openGLRenderer ? model.openGLRenderer.getRenderable().getActiveCamera() : null;\n var tsize = model.openGLRenderer.getTiledSizeAndOrigin();\n var texels = null;\n\n if (model.renderable.getUseZValues()) {\n var zbt = renderPass.getZBufferTexture();\n var width = Math.floor(zbt.getWidth());\n var height = Math.floor(zbt.getHeight());\n var gl = model.openGLRenderWindow.getContext();\n zbt.bind(); // Here we need to use vtkFramebuffer to save current settings (bindings/buffers)\n\n var fb = renderPass.getFramebuffer();\n\n if (!fb) {\n vtkDebugMacro('No framebuffer to save/restore');\n } else {\n // save framebuffer settings\n fb.saveCurrentBindingsAndBuffers();\n }\n\n var framebuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, zbt.getHandle(), 0);\n\n if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE) {\n texels = new Uint8Array(width * height * 4);\n gl.viewport(0, 0, width, height);\n gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, texels);\n } // Now we need to restore framebuffer bindings/buffers\n\n\n if (fb) {\n fb.restorePreviousBindingsAndBuffers();\n }\n\n gl.deleteFramebuffer(framebuffer);\n }\n\n model.renderable.invokeCallback(model.renderable.getInputData(), camera, aspectRatio, tsize, texels);\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (model.renderable.getUseZValues()) {\n renderPass.requestDepth();\n }\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object methods\n\n vtkOpenGLPixelSpaceCallbackMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkOpenGLPixelSpaceCallbackMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__[\"registerOverride\"])('vtkPixelSpaceCallbackMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/PolyDataMapper/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/PolyDataMapper/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Helper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ReplacementShaderMapper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* eslint-disable no-lonely-if */\n\nvar primTypes = {\n Start: 0,\n Points: 0,\n Lines: 1,\n Tris: 2,\n TriStrips: 3,\n TrisEdges: 4,\n TriStripsEdges: 5,\n End: 6\n};\nvar Representation = vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_6__[\"default\"].Representation,\n Shading = vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_6__[\"default\"].Shading;\nvar ScalarMode = vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ScalarMode;\nvar Filter = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_5__[\"default\"].Filter,\n Wrap = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_5__[\"default\"].Wrap;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"];\nvar StartEvent = {\n type: 'StartEvent'\n};\nvar EndEvent = {\n type: 'EndEvent'\n}; // ----------------------------------------------------------------------------\n// vtkOpenGLPolyDataMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLPolyDataMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLPolyDataMapper');\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.openGLActor = publicAPI.getFirstAncestorOfType('vtkOpenGLActor');\n model.openGLRenderer = model.openGLActor.getFirstAncestorOfType('vtkOpenGLRenderer');\n model.openGLRenderWindow = model.openGLRenderer.getParent();\n model.openGLCamera = model.openGLRenderer.getViewNodeFor(model.openGLRenderer.getRenderable().getActiveCamera());\n }\n }; // Renders myself\n\n\n publicAPI.translucentPass = function (prepass) {\n if (prepass) {\n publicAPI.render();\n }\n };\n\n publicAPI.opaqueZBufferPass = function (prepass) {\n if (prepass) {\n model.haveSeenDepthRequest = true;\n model.renderDepth = true;\n publicAPI.render();\n model.renderDepth = false;\n }\n };\n\n publicAPI.opaquePass = function (prepass) {\n if (prepass) {\n publicAPI.render();\n }\n };\n\n publicAPI.render = function () {\n var ctx = model.openGLRenderWindow.getContext();\n\n if (model.context !== ctx) {\n model.context = ctx;\n\n for (var i = primTypes.Start; i < primTypes.End; i++) {\n model.primitives[i].setOpenGLRenderWindow(model.openGLRenderWindow);\n }\n }\n\n var actor = model.openGLActor.getRenderable();\n var ren = model.openGLRenderer.getRenderable();\n publicAPI.renderPiece(ren, actor);\n };\n\n publicAPI.buildShaders = function (shaders, ren, actor) {\n publicAPI.getShaderTemplate(shaders, ren, actor); // user specified pre replacements\n\n var openGLSpec = model.renderable.getViewSpecificProperties().OpenGL;\n var shaderReplacements = null;\n\n if (openGLSpec) {\n shaderReplacements = openGLSpec.ShaderReplacements;\n }\n\n if (shaderReplacements) {\n for (var i = 0; i < shaderReplacements.length; i++) {\n var currReplacement = shaderReplacements[i];\n\n if (currReplacement.replaceFirst) {\n var shaderType = currReplacement.shaderType;\n var ssrc = shaders[shaderType];\n var substituteRes = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(ssrc, currReplacement.originalValue, currReplacement.replacementValue, currReplacement.replaceAll);\n shaders[shaderType] = substituteRes.result;\n }\n }\n }\n\n publicAPI.replaceShaderValues(shaders, ren, actor); // user specified post replacements\n\n if (shaderReplacements) {\n for (var _i = 0; _i < shaderReplacements.length; _i++) {\n var _currReplacement = shaderReplacements[_i];\n\n if (!_currReplacement.replaceFirst) {\n var _shaderType = _currReplacement.shaderType;\n var _ssrc = shaders[_shaderType];\n\n var _substituteRes = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(_ssrc, _currReplacement.originalValue, _currReplacement.replacementValue, _currReplacement.replaceAll);\n\n shaders[_shaderType] = _substituteRes.result;\n }\n }\n }\n };\n\n publicAPI.getShaderTemplate = function (shaders, ren, actor) {\n var openGLSpecProp = model.renderable.getViewSpecificProperties().OpenGL;\n var vertexShaderCode = vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataVS_glsl__WEBPACK_IMPORTED_MODULE_9___default.a;\n\n if (openGLSpecProp) {\n var vertexSpecProp = openGLSpecProp.VertexShaderCode;\n\n if (vertexSpecProp !== undefined && vertexSpecProp !== '') {\n vertexShaderCode = vertexSpecProp;\n }\n }\n\n shaders.Vertex = vertexShaderCode;\n var fragmentShaderCode = vtk_js_Sources_Rendering_OpenGL_glsl_vtkPolyDataFS_glsl__WEBPACK_IMPORTED_MODULE_10___default.a;\n\n if (openGLSpecProp) {\n var fragmentSpecProp = openGLSpecProp.FragmentShaderCode;\n\n if (fragmentSpecProp !== undefined && fragmentSpecProp !== '') {\n fragmentShaderCode = fragmentSpecProp;\n }\n }\n\n shaders.Fragment = fragmentShaderCode;\n var geometryShaderCode = '';\n\n if (openGLSpecProp) {\n var geometrySpecProp = openGLSpecProp.GeometryShaderCode;\n\n if (geometrySpecProp !== undefined) {\n geometryShaderCode = geometrySpecProp;\n }\n }\n\n shaders.Geometry = geometryShaderCode;\n };\n\n publicAPI.replaceShaderColor = function (shaders, ren, actor) {\n var VSSource = shaders.Vertex;\n var GSSource = shaders.Geometry;\n var FSSource = shaders.Fragment;\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity'); // create the material/color property declarations, and VS implementation\n // these are always defined\n\n var colorDec = ['uniform float ambient;', 'uniform float diffuse;', 'uniform float specular;', 'uniform float opacityUniform; // the fragment opacity', 'uniform vec3 ambientColorUniform;', 'uniform vec3 diffuseColorUniform;']; // add more for specular\n\n if (lastLightComplexity) {\n colorDec = colorDec.concat(['uniform vec3 specularColorUniform;', 'uniform float specularPowerUniform;']);\n } // now handle the more complex fragment shader implementation\n // the following are always defined variables. We start\n // by assigning a default value from the uniform\n\n\n var colorImpl = ['vec3 ambientColor;', ' vec3 diffuseColor;', ' float opacity;'];\n\n if (lastLightComplexity) {\n colorImpl = colorImpl.concat([' vec3 specularColor;', ' float specularPower;']);\n }\n\n colorImpl = colorImpl.concat([' ambientColor = ambientColorUniform;', ' diffuseColor = diffuseColorUniform;', ' opacity = opacityUniform;']);\n\n if (lastLightComplexity) {\n colorImpl = colorImpl.concat([' specularColor = specularColorUniform;', ' specularPower = specularPowerUniform;']);\n } // add scalar vertex coloring\n\n\n if (model.lastBoundBO.getCABO().getColorComponents() !== 0 && !model.drawingEdges) {\n colorDec = colorDec.concat(['varying vec4 vertexColorVSOutput;']);\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Color::Dec', ['attribute vec4 scalarColor;', 'varying vec4 vertexColorVSOutput;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Color::Impl', ['vertexColorVSOutput = scalarColor;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::Color::Dec', ['in vec4 vertexColorVSOutput[];', 'out vec4 vertexColorGSOutput;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::Color::Impl', ['vertexColorGSOutput = vertexColorVSOutput[i];']).result;\n }\n\n if (model.lastBoundBO.getCABO().getColorComponents() !== 0 && !model.drawingEdges) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Color::Impl', colorImpl.concat([' diffuseColor = vertexColorVSOutput.rgb;', ' ambientColor = vertexColorVSOutput.rgb;', ' opacity = opacity*vertexColorVSOutput.a;'])).result;\n } else {\n if (model.renderable.getInterpolateScalarsBeforeMapping() && model.renderable.getColorCoordinates() && !model.drawingEdges) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Color::Impl', colorImpl.concat([' vec4 texColor = texture2D(texture1, tcoordVCVSOutput.st);', ' diffuseColor = texColor.rgb;', ' ambientColor = texColor.rgb;', ' opacity = opacity*texColor.a;'])).result;\n } else {\n if (actor.getBackfaceProperty() && !model.drawingEdges) {\n colorDec = colorDec.concat(['uniform float opacityUniformBF; // the fragment opacity', 'uniform float ambientIntensityBF; // the material ambient', 'uniform float diffuseIntensityBF; // the material diffuse', 'uniform vec3 ambientColorUniformBF; // ambient material color', 'uniform vec3 diffuseColorUniformBF; // diffuse material color']);\n\n if (lastLightComplexity) {\n colorDec = colorDec.concat(['uniform float specularIntensityBF; // the material specular intensity', 'uniform vec3 specularColorUniformBF; // intensity weighted color', 'uniform float specularPowerUniformBF;']);\n colorImpl = colorImpl.concat(['if (gl_FrontFacing == false) {', ' ambientColor = ambientIntensityBF * ambientColorUniformBF;', ' diffuseColor = diffuseIntensityBF * diffuseColorUniformBF;', ' specularColor = specularIntensityBF * specularColorUniformBF;', ' specularPower = specularPowerUniformBF;', ' opacity = opacityUniformBF; }']);\n } else {\n colorImpl = colorImpl.concat(['if (gl_FrontFacing == false) {', ' ambientColor = ambientIntensityBF * ambientColorUniformBF;', ' diffuseColor = diffuseIntensityBF * diffuseColorUniformBF;', ' opacity = opacityUniformBF; }']);\n }\n }\n\n if (model.haveCellScalars && !model.drawingEdges) {\n colorDec = colorDec.concat(['uniform samplerBuffer texture1;']);\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Color::Impl', colorImpl).result;\n }\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Color::Dec', colorDec).result;\n shaders.Vertex = VSSource;\n shaders.Geometry = GSSource;\n shaders.Fragment = FSSource;\n };\n\n publicAPI.replaceShaderLight = function (shaders, ren, actor) {\n var FSSource = shaders.Fragment; // check for shadow maps\n\n var shadowFactor = '';\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n var lastLightCount = model.lastBoundBO.getReferenceByName('lastLightCount');\n var sstring = [];\n\n switch (lastLightComplexity) {\n case 0:\n // no lighting or RENDER_VALUES\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Light::Impl', [' gl_FragData[0] = vec4(ambientColor * ambient + diffuseColor * diffuse, opacity);', ' //VTK::Light::Impl'], false).result;\n break;\n\n case 1:\n // headlight\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Light::Impl', [' float df = max(0.0, normalVCVSOutput.z);', ' float sf = pow(df, specularPower);', ' vec3 diffuseL = df * diffuseColor;', ' vec3 specularL = sf * specularColor;', ' gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);', ' //VTK::Light::Impl'], false).result;\n break;\n\n case 2:\n // light kit\n for (var lc = 0; lc < lastLightCount; ++lc) {\n sstring = sstring.concat([\"uniform vec3 lightColor\".concat(lc, \";\"), \"uniform vec3 lightDirectionVC\".concat(lc, \"; // normalized\"), \"uniform vec3 lightHalfAngleVC\".concat(lc, \"; // normalized\")]);\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Light::Dec', sstring).result;\n sstring = ['vec3 diffuseL = vec3(0,0,0);', ' vec3 specularL = vec3(0,0,0);', ' float df;'];\n\n for (var _lc = 0; _lc < lastLightCount; ++_lc) {\n sstring = sstring.concat([\" df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC\".concat(_lc, \"));\"), \" diffuseL += ((df\".concat(shadowFactor, \") * lightColor\").concat(_lc, \");\"), \" if (dot(normalVCVSOutput, lightDirectionVC\".concat(_lc, \") < 0.0)\"), ' {', \" float sf = pow( max(0.0, dot(lightHalfAngleVC\".concat(_lc, \",normalVCVSOutput)), specularPower);\"), \" specularL += ((sf\".concat(shadowFactor, \") * lightColor\").concat(_lc, \");\"), ' }']);\n }\n\n sstring = sstring.concat([' diffuseL = diffuseL * diffuseColor;', ' specularL = specularL * specularColor;', ' gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);', ' //VTK::Light::Impl']);\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Light::Impl', sstring, false).result;\n break;\n\n case 3:\n // positional\n for (var _lc2 = 0; _lc2 < lastLightCount; ++_lc2) {\n sstring = sstring.concat([\"uniform vec3 lightColor\".concat(_lc2, \";\"), \"uniform vec3 lightDirectionVC\".concat(_lc2, \"; // normalized\"), \"uniform vec3 lightHalfAngleVC\".concat(_lc2, \"; // normalized\"), \"uniform vec3 lightPositionVC\".concat(_lc2, \";\"), \"uniform vec3 lightAttenuation\".concat(_lc2, \";\"), \"uniform float lightConeAngle\".concat(_lc2, \";\"), \"uniform float lightExponent\".concat(_lc2, \";\"), \"uniform int lightPositional\".concat(_lc2, \";\")]);\n }\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Light::Dec', sstring).result;\n sstring = ['vec3 diffuseL = vec3(0,0,0);', ' vec3 specularL = vec3(0,0,0);', ' vec3 vertLightDirectionVC;', ' float attenuation;', ' float df;'];\n\n for (var _lc3 = 0; _lc3 < lastLightCount; ++_lc3) {\n sstring = sstring.concat([' attenuation = 1.0;', \" if (lightPositional\".concat(_lc3, \" == 0)\"), ' {', \" vertLightDirectionVC = lightDirectionVC\".concat(_lc3, \";\"), ' }', ' else', ' {', \" vertLightDirectionVC = vertexVC.xyz - lightPositionVC\".concat(_lc3, \";\"), ' float distanceVC = length(vertLightDirectionVC);', ' vertLightDirectionVC = normalize(vertLightDirectionVC);', ' attenuation = 1.0 /', \" (lightAttenuation\".concat(_lc3, \".x\"), \" + lightAttenuation\".concat(_lc3, \".y * distanceVC\"), \" + lightAttenuation\".concat(_lc3, \".z * distanceVC * distanceVC);\"), ' // per OpenGL standard cone angle is 90 or less for a spot light', \" if (lightConeAngle\".concat(_lc3, \" <= 90.0)\"), ' {', \" float coneDot = dot(vertLightDirectionVC, lightDirectionVC\".concat(_lc3, \");\"), ' // if inside the cone', \" if (coneDot >= cos(radians(lightConeAngle\".concat(_lc3, \")))\"), ' {', \" attenuation = attenuation * pow(coneDot, lightExponent\".concat(_lc3, \");\"), ' }', ' else', ' {', ' attenuation = 0.0;', ' }', ' }', ' }', ' df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));', \" diffuseL += ((df\".concat(shadowFactor, \") * lightColor\").concat(_lc3, \");\"), ' if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)', ' {', \" float sf = attenuation*pow( max(0.0, dot(lightHalfAngleVC\".concat(_lc3, \",normalVCVSOutput)), specularPower);\"), \" specularL += ((sf\".concat(shadowFactor, \") * lightColor\").concat(_lc3, \");\"), ' }']);\n }\n\n sstring = sstring.concat([' diffuseL = diffuseL * diffuseColor;', ' specularL = specularL * specularColor;', ' gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);', ' //VTK::Light::Impl']);\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Light::Impl', sstring, false).result;\n break;\n\n default:\n vtkErrorMacro('bad light complexity');\n }\n\n shaders.Fragment = FSSource;\n };\n\n publicAPI.replaceShaderNormal = function (shaders, ren, actor) {\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (lastLightComplexity > 0) {\n var VSSource = shaders.Vertex;\n var GSSource = shaders.Geometry;\n var FSSource = shaders.Fragment;\n\n if (model.lastBoundBO.getCABO().getNormalOffset()) {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Normal::Dec', ['attribute vec3 normalMC;', 'uniform mat3 normalMatrix;', 'varying vec3 normalVCVSOutput;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Normal::Impl', ['normalVCVSOutput = normalMatrix * normalMC;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::Normal::Dec', ['in vec3 normalVCVSOutput[];', 'out vec3 normalVCGSOutput;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::Normal::Impl', ['normalVCGSOutput = normalVCVSOutput[i];']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Dec', ['varying vec3 normalVCVSOutput;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Impl', ['vec3 normalVCVSOutput = normalize(normalVCVSOutput);', // if (!gl_FrontFacing) does not work in intel hd4000 mac\n // if (int(gl_FrontFacing) == 0) does not work on mesa\n ' if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }']).result;\n } else {\n if (model.haveCellNormals) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Dec', ['uniform mat3 normalMatrix;', 'uniform samplerBuffer textureN;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Impl', ['vec3 normalVCVSOutput = normalize(normalMatrix *', ' texelFetchBuffer(textureN, gl_PrimitiveID + PrimitiveIDOffset).xyz);', ' if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }']).result;\n } else {\n if (publicAPI.getOpenGLMode(actor.getProperty().getRepresentation(), model.lastBoundBO.getPrimitiveType()) === model.context.LINES) {\n // generate a normal for lines, it will be perpendicular to the line\n // and maximally aligned with the camera view direction\n // no clue if this is the best way to do this.\n // the code below has been optimized a bit so what follows is\n // an explanation of the basic approach. Compute the gradient of the line\n // with respect to x and y, the the larger of the two\n // cross that with the camera view direction. That gives a vector\n // orthogonal to the camera view and the line. Note that the line and the camera\n // view are probably not orthogonal. Which is why when we cross result that with\n // the line gradient again we get a reasonable normal. It will be othogonal to\n // the line (which is a plane but maximally aligned with the camera view.\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::UniformFlow::Impl', [' vec3 fdx = vec3(dFdx(vertexVC.x),dFdx(vertexVC.y),dFdx(vertexVC.z));', ' vec3 fdy = vec3(dFdy(vertexVC.x),dFdy(vertexVC.y),dFdy(vertexVC.z));', ' //VTK::UniformFlow::Impl'] // For further replacements\n ).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Impl', ['vec3 normalVCVSOutput;', ' fdx = normalize(fdx);', ' fdy = normalize(fdy);', ' if (abs(fdx.x) > 0.0)', ' { normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }', ' else { normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}']).result;\n } else {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Dec', ['uniform int cameraParallel;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::UniformFlow::Impl', [// ' vec3 fdx = vec3(dFdx(vertexVC.x),dFdx(vertexVC.y),dFdx(vertexVC.z));',\n // ' vec3 fdy = vec3(dFdy(vertexVC.x),dFdy(vertexVC.y),dFdy(vertexVC.z));',\n ' vec3 fdx = dFdx(vertexVC.xyz);', ' vec3 fdy = dFdy(vertexVC.xyz);', ' //VTK::UniformFlow::Impl'] // For further replacements\n ).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Normal::Impl', [' fdx = normalize(fdx);', ' fdy = normalize(fdy);', ' vec3 normalVCVSOutput = normalize(cross(fdx,fdy));', // the code below is faster, but does not work on some devices\n // 'vec3 normalVC = normalize(cross(dFdx(vertexVC.xyz), dFdy(vertexVC.xyz)));',\n ' if (cameraParallel == 1 && normalVCVSOutput.z < 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }', ' if (cameraParallel == 0 && dot(normalVCVSOutput,vertexVC.xyz) > 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }']).result;\n }\n }\n }\n\n shaders.Vertex = VSSource;\n shaders.Geometry = GSSource;\n shaders.Fragment = FSSource;\n }\n };\n\n publicAPI.replaceShaderPositionVC = function (shaders, ren, actor) {\n var VSSource = shaders.Vertex;\n var GSSource = shaders.Geometry;\n var FSSource = shaders.Fragment; // for points make sure to add in the point size\n\n if (actor.getProperty().getRepresentation() === Representation.POINTS || model.lastBoundBO.getPrimitiveType() === primTypes.Points) {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Impl', ['//VTK::PositionVC::Impl', \" gl_PointSize = \".concat(actor.getProperty().getPointSize(), \".0;\")], false).result;\n } // do we need the vertex in the shader in View Coordinates\n\n\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (lastLightComplexity > 0) {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Dec', ['varying vec4 vertexVCVSOutput;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Impl', ['vertexVCVSOutput = MCVCMatrix * vertexMC;', ' gl_Position = MCPCMatrix * vertexMC;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Camera::Dec', ['uniform mat4 MCPCMatrix;', 'uniform mat4 MCVCMatrix;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::PositionVC::Dec', ['in vec4 vertexVCVSOutput[];', 'out vec4 vertexVCGSOutput;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::PositionVC::Impl', ['vertexVCGSOutput = vertexVCVSOutput[i];']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::PositionVC::Dec', ['varying vec4 vertexVCVSOutput;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::PositionVC::Impl', ['vec4 vertexVC = vertexVCVSOutput;']).result;\n } else {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Camera::Dec', ['uniform mat4 MCPCMatrix;']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::PositionVC::Impl', [' gl_Position = MCPCMatrix * vertexMC;']).result;\n }\n\n shaders.Vertex = VSSource;\n shaders.Geometry = GSSource;\n shaders.Fragment = FSSource;\n };\n\n publicAPI.replaceShaderTCoord = function (shaders, ren, actor) {\n if (model.lastBoundBO.getCABO().getTCoordOffset()) {\n var VSSource = shaders.Vertex;\n var GSSource = shaders.Geometry;\n var FSSource = shaders.Fragment;\n\n if (model.drawingEdges) {\n return;\n }\n\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::TCoord::Impl', 'tcoordVCVSOutput = tcoordMC;').result; // we only handle the first texture by default\n // additional textures are activated and we set the uniform\n // for the texture unit they are assigned to, but you have to\n // add in the shader code to do something with them\n\n var tus = model.openGLActor.getActiveTextures();\n var tNumComp = 2;\n var tcdim = 2;\n\n if (tus && tus.length > 0) {\n tNumComp = tus[0].getComponents();\n\n if (tus[0].getTarget() === model.context.TEXTURE_CUBE_MAP) {\n tcdim = 3;\n }\n }\n\n if (model.renderable.getColorTextureMap()) {\n tNumComp = model.renderable.getColorTextureMap().getPointData().getScalars().getNumberOfComponents();\n tcdim = 2;\n }\n\n if (tcdim === 2) {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::TCoord::Dec', 'attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;').result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::TCoord::Dec', ['in vec2 tcoordVCVSOutput[];', 'out vec2 tcoordVCGSOutput;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::TCoord::Impl', 'tcoordVCGSOutput = tcoordVCVSOutput[i];').result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Dec', ['varying vec2 tcoordVCVSOutput;', 'uniform sampler2D texture1;']).result;\n\n if (tus && tus.length >= 1) {\n switch (tNumComp) {\n case 1:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);', 'gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*', ' vec4(tcolor.r,tcolor.r,tcolor.r,1.0);']).result;\n break;\n\n case 2:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);', 'gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*', ' vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);']).result;\n break;\n\n default:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', 'gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*texture2D(texture1, tcoordVCVSOutput.st);').result;\n }\n }\n } else {\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::TCoord::Dec', 'attribute vec3 tcoordMC; varying vec3 tcoordVCVSOutput;').result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::TCoord::Dec', ['in vec3 tcoordVCVSOutput[];', 'out vec3 tcoordVCGSOutput;']).result;\n GSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(GSSource, '//VTK::TCoord::Impl', 'tcoordVCGSOutput = tcoordVCVSOutput[i];').result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Dec', ['varying vec3 tcoordVCVSOutput;', 'uniform samplerCube texture1;']).result;\n\n switch (tNumComp) {\n case 1:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);', 'gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*', ' vec4(tcolor.r,tcolor.r,tcolor.r,1.0);']).result;\n break;\n\n case 2:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', ['vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);', 'gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*', ' vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);']).result;\n break;\n\n default:\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::TCoord::Impl', 'gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*textureCube(texture1, tcoordVCVSOutput);').result;\n }\n }\n\n shaders.Vertex = VSSource;\n shaders.Geometry = GSSource;\n shaders.Fragment = FSSource;\n }\n };\n\n publicAPI.replaceShaderClip = function (shaders, ren, actor) {\n var VSSource = shaders.Vertex;\n var FSSource = shaders.Fragment;\n\n if (model.renderable.getNumberOfClippingPlanes()) {\n var numClipPlanes = model.renderable.getNumberOfClippingPlanes();\n\n if (numClipPlanes > 6) {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"]('OpenGL has a limit of 6 clipping planes');\n numClipPlanes = 6;\n }\n\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Clip::Dec', ['uniform int numClipPlanes;', 'uniform vec4 clipPlanes[6];', 'varying float clipDistancesVSOutput[6];']).result;\n VSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(VSSource, '//VTK::Clip::Impl', ['for (int planeNum = 0; planeNum < 6; planeNum++)', ' {', ' if (planeNum >= numClipPlanes)', ' {', ' break;', ' }', ' clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);', ' }']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Clip::Dec', ['uniform int numClipPlanes;', 'varying float clipDistancesVSOutput[6];']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Clip::Impl', ['for (int planeNum = 0; planeNum < 6; planeNum++)', ' {', ' if (planeNum >= numClipPlanes)', ' {', ' break;', ' }', ' if (clipDistancesVSOutput[planeNum] < 0.0) discard;', ' }']).result;\n }\n\n shaders.Vertex = VSSource;\n shaders.Fragment = FSSource;\n };\n\n publicAPI.getCoincidentParameters = function (ren, actor) {\n // 1. ResolveCoincidentTopology is On and non zero for this primitive\n // type\n var cp = null;\n var prop = actor.getProperty();\n\n if (model.renderable.getResolveCoincidentTopology() || prop.getEdgeVisibility() && prop.getRepresentation() === Representation.SURFACE) {\n var primType = model.lastBoundBO.getPrimitiveType();\n\n if (primType === primTypes.Points || prop.getRepresentation() === Representation.POINTS) {\n cp = model.renderable.getCoincidentTopologyPointOffsetParameter();\n } else if (primType === primTypes.Lines || prop.getRepresentation() === Representation.WIREFRAME) {\n cp = model.renderable.getCoincidentTopologyLineOffsetParameters();\n } else if (primType === primTypes.Tris || primType === primTypes.TriStrips) {\n cp = model.renderable.getCoincidentTopologyPolygonOffsetParameters();\n }\n\n if (primType === primTypes.TrisEdges || primType === primTypes.TriStripsEdges) {\n cp = model.renderable.getCoincidentTopologyPolygonOffsetParameters();\n cp.factor /= 2.0;\n cp.offset /= 2.0;\n }\n } // hardware picking always offset due to saved zbuffer\n // This gets you above the saved surface depth buffer.\n // vtkHardwareSelector* selector = ren->GetSelector();\n // if (selector &&\n // selector->GetFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_POINTS)\n // {\n // offset -= 2.0;\n // return;\n // }\n\n\n return cp;\n };\n\n publicAPI.replaceShaderPicking = function (shaders, ren, actor) {\n var FSSource = shaders.Fragment;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Picking::Dec', ['uniform vec3 mapperIndex;', 'uniform int picking;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::Picking::Impl', ' gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];').result;\n shaders.Fragment = FSSource;\n };\n\n publicAPI.replaceShaderValues = function (shaders, ren, actor) {\n publicAPI.replaceShaderColor(shaders, ren, actor);\n publicAPI.replaceShaderNormal(shaders, ren, actor);\n publicAPI.replaceShaderLight(shaders, ren, actor);\n publicAPI.replaceShaderTCoord(shaders, ren, actor);\n publicAPI.replaceShaderPicking(shaders, ren, actor);\n publicAPI.replaceShaderClip(shaders, ren, actor);\n publicAPI.replaceShaderCoincidentOffset(shaders, ren, actor);\n publicAPI.replaceShaderPositionVC(shaders, ren, actor);\n\n if (model.haveSeenDepthRequest) {\n var FSSource = shaders.Fragment;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::ZBuffer::Dec', 'uniform int depthRequest;').result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_7__[\"default\"].substitute(FSSource, '//VTK::ZBuffer::Impl', ['if (depthRequest == 1) {', 'float iz = floor(gl_FragCoord.z*65535.0 + 0.1);', 'float rf = floor(iz/256.0)/255.0;', 'float gf = mod(iz,256.0)/255.0;', 'gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }']).result;\n shaders.Fragment = FSSource;\n }\n };\n\n publicAPI.getNeedToRebuildShaders = function (cellBO, ren, actor) {\n var lightComplexity = 0;\n var numberOfLights = 0;\n var primType = cellBO.getPrimitiveType();\n var poly = model.currentInput; // different algo from C++ as of 5/2019\n\n var needLighting = false;\n var pointNormals = poly.getPointData().getNormals();\n var cellNormals = poly.getCellData().getNormals();\n var flat = actor.getProperty().getInterpolation() === Shading.FLAT;\n var representation = actor.getProperty().getRepresentation();\n var mode = publicAPI.getOpenGLMode(representation, primType); // 1) all surfaces need lighting\n\n if (mode === model.context.TRIANGLES) {\n needLighting = true; // 2) all cell normals without point normals need lighting\n } else if (cellNormals && !pointNormals) {\n needLighting = true; // 3) Phong + pointNormals need lighting\n } else if (!flat && pointNormals) {\n needLighting = true; // 4) Phong Lines need lighting\n } else if (!flat && mode === model.context.LINES) {\n needLighting = true;\n } // 5) everything else is unlit\n // do we need lighting?\n\n\n if (actor.getProperty().getLighting() && needLighting) {\n // consider the lighting complexity to determine which case applies\n // simple headlight, Light Kit, the whole feature set of VTK\n lightComplexity = 0;\n var lights = ren.getLightsByReference();\n\n for (var index = 0; index < lights.length; ++index) {\n var light = lights[index];\n var status = light.getSwitch();\n\n if (status > 0) {\n numberOfLights++;\n\n if (lightComplexity === 0) {\n lightComplexity = 1;\n }\n }\n\n if (lightComplexity === 1 && (numberOfLights > 1 || light.getIntensity() !== 1.0 || !light.lightTypeIsHeadLight())) {\n lightComplexity = 2;\n }\n\n if (lightComplexity < 3 && light.getPositional()) {\n lightComplexity = 3;\n }\n }\n }\n\n var needRebuild = false;\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n var lastLightCount = model.lastBoundBO.getReferenceByName('lastLightCount');\n\n if (lastLightComplexity !== lightComplexity || lastLightCount !== numberOfLights) {\n model.lastBoundBO.set({\n lastLightComplexity: lightComplexity\n }, true);\n model.lastBoundBO.set({\n lastLightCount: numberOfLights\n }, true);\n needRebuild = true;\n } // has something changed that would require us to recreate the shader?\n // candidates are\n // property modified (representation interpolation and lighting)\n // input modified\n // light complexity changed\n\n\n if (model.lastHaveSeenDepthRequest !== model.haveSeenDepthRequest || cellBO.getProgram() === 0 || cellBO.getShaderSourceTime().getMTime() < publicAPI.getMTime() || cellBO.getShaderSourceTime().getMTime() < actor.getMTime() || cellBO.getShaderSourceTime().getMTime() < model.renderable.getMTime() || cellBO.getShaderSourceTime().getMTime() < model.currentInput.getMTime() || needRebuild) {\n model.lastHaveSeenDepthRequest = model.haveSeenDepthRequest;\n return true;\n }\n\n return false;\n };\n\n publicAPI.updateShaders = function (cellBO, ren, actor) {\n model.lastBoundBO = cellBO; // has something changed that would require us to recreate the shader?\n\n if (publicAPI.getNeedToRebuildShaders(cellBO, ren, actor)) {\n var shaders = {\n Vertex: null,\n Fragment: null,\n Geometry: null\n };\n publicAPI.buildShaders(shaders, ren, actor); // compile and bind the program if needed\n\n var newShader = model.openGLRenderWindow.getShaderCache().readyShaderProgramArray(shaders.Vertex, shaders.Fragment, shaders.Geometry); // if the shader changed reinitialize the VAO\n\n if (newShader !== cellBO.getProgram()) {\n cellBO.setProgram(newShader); // reset the VAO as the shader has changed\n\n cellBO.getVAO().releaseGraphicsResources();\n }\n\n cellBO.getShaderSourceTime().modified();\n } else {\n model.openGLRenderWindow.getShaderCache().readyShaderProgram(cellBO.getProgram());\n }\n\n cellBO.getVAO().bind();\n publicAPI.setMapperShaderParameters(cellBO, ren, actor);\n publicAPI.setPropertyShaderParameters(cellBO, ren, actor);\n publicAPI.setCameraShaderParameters(cellBO, ren, actor);\n publicAPI.setLightingShaderParameters(cellBO, ren, actor);\n var listCallbacks = model.renderable.getViewSpecificProperties().ShadersCallbacks;\n\n if (listCallbacks) {\n listCallbacks.forEach(function (object) {\n object.callback(object.userData, cellBO, ren, actor);\n });\n }\n };\n\n publicAPI.setMapperShaderParameters = function (cellBO, ren, actor) {\n // Now to update the VAO too, if necessary.\n if (cellBO.getProgram().isUniformUsed('PrimitiveIDOffset')) {\n cellBO.getProgram().setUniformi('PrimitiveIDOffset', model.primitiveIDOffset);\n }\n\n if (cellBO.getCABO().getElementCount() && (model.VBOBuildTime.getMTime() > cellBO.getAttributeUpdateTime().getMTime() || cellBO.getShaderSourceTime().getMTime() > cellBO.getAttributeUpdateTime().getMTime())) {\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (cellBO.getProgram().isAttributeUsed('vertexMC')) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO(), 'vertexMC', cellBO.getCABO().getVertexOffset(), cellBO.getCABO().getStride(), model.context.FLOAT, 3, false)) {\n vtkErrorMacro('Error setting vertexMC in shader VAO.');\n }\n }\n\n if (cellBO.getProgram().isAttributeUsed('normalMC') && cellBO.getCABO().getNormalOffset() && lastLightComplexity > 0) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO(), 'normalMC', cellBO.getCABO().getNormalOffset(), cellBO.getCABO().getStride(), model.context.FLOAT, 3, false)) {\n vtkErrorMacro('Error setting normalMC in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('normalMC');\n }\n\n model.renderable.getCustomShaderAttributes().forEach(function (attrName, idx) {\n if (cellBO.getProgram().isAttributeUsed(\"\".concat(attrName, \"MC\"))) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO(), \"\".concat(attrName, \"MC\"), cellBO.getCABO().getCustomData()[idx].offset, cellBO.getCABO().getStride(), model.context.FLOAT, cellBO.getCABO().getCustomData()[idx].components, false)) {\n vtkErrorMacro(\"Error setting \".concat(attrName, \"MC in shader VAO.\"));\n }\n }\n });\n\n if (cellBO.getProgram().isAttributeUsed('tcoordMC') && cellBO.getCABO().getTCoordOffset()) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO(), 'tcoordMC', cellBO.getCABO().getTCoordOffset(), cellBO.getCABO().getStride(), model.context.FLOAT, cellBO.getCABO().getTCoordComponents(), false)) {\n vtkErrorMacro('Error setting tcoordMC in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('tcoordMC');\n }\n\n if (cellBO.getProgram().isAttributeUsed('scalarColor') && cellBO.getCABO().getColorComponents()) {\n if (!cellBO.getVAO().addAttributeArray(cellBO.getProgram(), cellBO.getCABO().getColorBO(), 'scalarColor', cellBO.getCABO().getColorOffset(), cellBO.getCABO().getColorBOStride(), model.context.UNSIGNED_BYTE, 4, true)) {\n vtkErrorMacro('Error setting scalarColor in shader VAO.');\n }\n } else {\n cellBO.getVAO().removeAttributeArray('scalarColor');\n }\n\n cellBO.getAttributeUpdateTime().modified();\n }\n\n if (model.renderable.getNumberOfClippingPlanes()) {\n // add all the clipping planes\n var numClipPlanes = model.renderable.getNumberOfClippingPlanes();\n\n if (numClipPlanes > 6) {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"]('OpenGL has a limit of 6 clipping planes');\n numClipPlanes = 6;\n }\n\n var planeEquations = [];\n\n for (var i = 0; i < numClipPlanes; i++) {\n var planeEquation = [];\n model.renderable.getClippingPlaneInDataCoords(actor.getMatrix(), i, planeEquation);\n\n for (var j = 0; j < 4; j++) {\n planeEquations.push(planeEquation[j]);\n }\n }\n\n cellBO.getProgram().setUniformi('numClipPlanes', numClipPlanes);\n cellBO.getProgram().setUniform4fv('clipPlanes', 6, planeEquations);\n }\n\n if (model.internalColorTexture && cellBO.getProgram().isUniformUsed('texture1')) {\n cellBO.getProgram().setUniformi('texture1', model.internalColorTexture.getTextureUnit());\n }\n\n var tus = model.openGLActor.getActiveTextures();\n\n if (tus) {\n for (var index = 0; index < tus.length; ++index) {\n var tex = tus[index];\n var texUnit = tex.getTextureUnit();\n var tname = \"texture\".concat(texUnit + 1);\n\n if (cellBO.getProgram().isUniformUsed(tname)) {\n cellBO.getProgram().setUniformi(tname, texUnit);\n }\n }\n } // handle depth requests\n\n\n if (model.haveSeenDepthRequest) {\n cellBO.getProgram().setUniformi('depthRequest', model.renderDepth ? 1 : 0);\n } // handle coincident\n\n\n if (cellBO.getProgram().isUniformUsed('coffset')) {\n var cp = publicAPI.getCoincidentParameters(ren, actor);\n cellBO.getProgram().setUniformf('coffset', cp.offset); // cfactor isn't always used when coffset is.\n\n if (cellBO.getProgram().isUniformUsed('cfactor')) {\n cellBO.getProgram().setUniformf('cfactor', cp.factor);\n }\n }\n\n var selector = model.openGLRenderer.getSelector();\n cellBO.getProgram().setUniform3fArray('mapperIndex', selector ? selector.getPropColorValue() : [0.0, 0.0, 0.0]);\n cellBO.getProgram().setUniformi('picking', selector ? selector.getCurrentPass() + 1 : 0);\n };\n\n publicAPI.setLightingShaderParameters = function (cellBO, ren, actor) {\n // for unlit and headlight there are no lighting parameters\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (lastLightComplexity < 2) {\n return;\n }\n\n var program = cellBO.getProgram(); // bind some light settings\n\n var numberOfLights = 0;\n var lights = ren.getLightsByReference();\n\n for (var index = 0; index < lights.length; ++index) {\n var light = lights[index];\n var status = light.getSwitch();\n\n if (status > 0.0) {\n var dColor = light.getColorByReference();\n var intensity = light.getIntensity();\n model.lightColor[0] = dColor[0] * intensity;\n model.lightColor[1] = dColor[1] * intensity;\n model.lightColor[2] = dColor[2] * intensity; // get required info from light\n\n var ld = light.getDirection();\n var transform = ren.getActiveCamera().getViewMatrix();\n\n var newLightDirection = _toConsumableArray(ld);\n\n if (light.lightTypeIsSceneLight()) {\n newLightDirection[0] = transform[0] * ld[0] + transform[1] * ld[1] + transform[2] * ld[2];\n newLightDirection[1] = transform[4] * ld[0] + transform[5] * ld[1] + transform[6] * ld[2];\n newLightDirection[2] = transform[8] * ld[0] + transform[9] * ld[1] + transform[10] * ld[2];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"normalize\"](newLightDirection);\n }\n\n model.lightDirection[0] = newLightDirection[0];\n model.lightDirection[1] = newLightDirection[1];\n model.lightDirection[2] = newLightDirection[2];\n model.lightHalfAngle[0] = -model.lightDirection[0];\n model.lightHalfAngle[1] = -model.lightDirection[1];\n model.lightHalfAngle[2] = -model.lightDirection[2] + 1.0;\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"normalize\"](model.lightDirection);\n program.setUniform3fArray(\"lightColor\".concat(numberOfLights), model.lightColor);\n program.setUniform3fArray(\"lightDirectionVC\".concat(numberOfLights), model.lightDirection);\n program.setUniform3fArray(\"lightHalfAngleVC\".concat(numberOfLights), model.lightHalfAngle);\n numberOfLights++;\n }\n } // we are done unless we have positional lights\n\n\n if (lastLightComplexity < 3) {\n return;\n } // for lightkit case there are some parameters to set\n\n\n var cam = ren.getActiveCamera();\n var viewTF = cam.getViewMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(viewTF, viewTF);\n numberOfLights = 0;\n\n for (var _index = 0; _index < lights.length; ++_index) {\n var _light = lights[_index];\n\n var _status = _light.getSwitch();\n\n if (_status > 0.0) {\n var lp = _light.getTransformedPosition();\n\n var np = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(np, lp, viewTF);\n program.setUniform3fArray(\"lightAttenuation\".concat(numberOfLights), _light.getAttenuationValuesByReference());\n program.setUniformi(\"lightPositional\".concat(numberOfLights), _light.getPositional());\n program.setUniformf(\"lightExponent\".concat(numberOfLights), _light.getExponent());\n program.setUniformf(\"lightConeAngle\".concat(numberOfLights), _light.getConeAngle());\n program.setUniform3fArray(\"lightPositionVC\".concat(numberOfLights), [np[0], np[1], np[2]]);\n numberOfLights++;\n }\n }\n };\n\n function safeMatrixMultiply(matrixArray, matrixType, tmpMat) {\n matrixType.identity(tmpMat);\n return matrixArray.reduce(function (res, matrix, index) {\n if (index === 0) {\n return matrix ? matrixType.copy(res, matrix) : matrixType.identity(res);\n }\n\n return matrix ? matrixType.multiply(res, res, matrix) : res;\n }, tmpMat);\n }\n\n publicAPI.setCameraShaderParameters = function (cellBO, ren, actor) {\n var program = cellBO.getProgram(); // [WMVP]C == {world, model, view, projection} coordinates\n // E.g., WCPC == world to projection coordinate transformation\n\n var keyMats = model.openGLCamera.getKeyMatrices(ren);\n var cam = ren.getActiveCamera();\n var camm = model.openGLCamera.getKeyMatrixTime().getMTime();\n var progm = program.getLastCameraMTime();\n var shiftScaleEnabled = cellBO.getCABO().getCoordShiftAndScaleEnabled();\n var inverseShiftScaleMatrix = shiftScaleEnabled ? cellBO.getCABO().getInverseShiftAndScaleMatrix() : null;\n var actorIsIdentity = actor.getIsIdentity();\n var actMats = actorIsIdentity ? {\n mcwc: null,\n normalMatrix: null\n } : model.openGLActor.getKeyMatrices();\n program.setUniformMatrix('MCPCMatrix', safeMatrixMultiply([keyMats.wcpc, actMats.mcwc, inverseShiftScaleMatrix], gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"], model.tmpMat4));\n\n if (program.isUniformUsed('MCVCMatrix')) {\n program.setUniformMatrix('MCVCMatrix', safeMatrixMultiply([keyMats.wcvc, actMats.mcwc, inverseShiftScaleMatrix], gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"], model.tmpMat4));\n }\n\n if (program.isUniformUsed('normalMatrix')) {\n program.setUniformMatrix3x3('normalMatrix', safeMatrixMultiply([keyMats.normalMatrix, actMats.normalMatrix], gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"], model.tmpMat3));\n }\n\n if (progm !== camm) {\n if (program.isUniformUsed('cameraParallel')) {\n program.setUniformi('cameraParallel', cam.getParallelProjection());\n }\n\n program.setLastCameraMTime(camm);\n }\n\n if (!actorIsIdentity) {\n // reset the cam mtime as actor modified the shader values\n program.setLastCameraMTime(0);\n }\n };\n\n publicAPI.setPropertyShaderParameters = function (cellBO, ren, actor) {\n var program = cellBO.getProgram();\n var ppty = actor.getProperty();\n var opacity = ppty.getOpacity();\n var aColor = model.drawingEdges ? ppty.getEdgeColorByReference() : ppty.getAmbientColorByReference();\n var dColor = model.drawingEdges ? ppty.getEdgeColorByReference() : ppty.getDiffuseColorByReference();\n var aIntensity = model.drawingEdges ? 1.0 : ppty.getAmbient();\n var dIntensity = model.drawingEdges ? 0.0 : ppty.getDiffuse();\n var sIntensity = model.drawingEdges ? 0.0 : ppty.getSpecular();\n var specularPower = ppty.getSpecularPower();\n program.setUniformf('opacityUniform', opacity);\n program.setUniform3fArray('ambientColorUniform', aColor);\n program.setUniform3fArray('diffuseColorUniform', dColor);\n program.setUniformf('ambient', aIntensity);\n program.setUniformf('diffuse', dIntensity); // we are done unless we have lighting\n\n var lastLightComplexity = model.lastBoundBO.getReferenceByName('lastLightComplexity');\n\n if (lastLightComplexity < 1) {\n return;\n }\n\n var sColor = ppty.getSpecularColorByReference();\n program.setUniform3fArray('specularColorUniform', sColor);\n program.setUniformf('specularPowerUniform', specularPower); // now set the backface properties if we have them\n\n if (program.isUniformUsed('ambientIntensityBF')) {\n ppty = actor.getBackfaceProperty();\n opacity = ppty.getOpacity();\n aColor = ppty.getAmbientColor();\n aIntensity = ppty.getAmbient();\n dColor = ppty.getDiffuseColor();\n dIntensity = ppty.getDiffuse();\n sColor = ppty.getSpecularColor();\n sIntensity = ppty.getSpecular();\n program.setUniformf('ambientIntensityBF', aIntensity);\n program.setUniformf('diffuseIntensityBF', dIntensity);\n program.setUniformf('opacityUniformBF', opacity);\n program.setUniform3fArray('ambientColorUniformBF', aColor);\n program.setUniform3fArray('diffuseColorUniformBF', dColor); // we are done unless we have lighting\n\n if (lastLightComplexity < 1) {\n return;\n }\n\n program.setUniformf('specularIntensityBF', sIntensity);\n program.setUniform3fArray('specularColorUniformBF', sColor);\n program.setUniformf('specularPowerUniformBF', specularPower);\n }\n };\n\n publicAPI.renderPieceStart = function (ren, actor) {\n model.primitiveIDOffset = 0;\n\n if (model.openGLRenderer.getSelector()) {\n switch (model.openGLRenderer.getSelector().getCurrentPass()) {\n default:\n model.openGLRenderer.getSelector().renderProp(actor);\n }\n } // make sure the BOs are up to date\n\n\n publicAPI.updateBufferObjects(ren, actor); // If we are coloring by texture, then load the texture map.\n // Use Map as indicator, because texture hangs around.\n\n if (model.renderable.getColorTextureMap()) {\n model.internalColorTexture.activate();\n } // Bind the OpenGL, this is shared between the different primitive/cell types.\n\n\n model.lastBoundBO = null;\n };\n\n publicAPI.renderPieceDraw = function (ren, actor) {\n var representation = actor.getProperty().getRepresentation();\n var gl = model.context;\n var drawSurfaceWithEdges = actor.getProperty().getEdgeVisibility() && representation === Representation.SURFACE;\n gl.lineWidth(actor.getProperty().getLineWidth()); // for every primitive type\n\n for (var i = primTypes.Start; i < primTypes.End; i++) {\n // if there are entries\n var cabo = model.primitives[i].getCABO();\n\n if (cabo.getElementCount()) {\n // are we drawing edges\n model.drawingEdges = drawSurfaceWithEdges && (i === primTypes.TrisEdges || i === primTypes.TriStripsEdges);\n var mode = publicAPI.getOpenGLMode(representation, i);\n\n if (!model.drawingEdges || !model.renderDepth) {\n publicAPI.updateShaders(model.primitives[i], ren, actor);\n gl.drawArrays(mode, 0, cabo.getElementCount());\n }\n\n var stride = (mode === gl.POINTS ? 1 : 0) || (mode === gl.LINES ? 2 : 3);\n model.primitiveIDOffset += cabo.getElementCount() / stride;\n }\n } // reset the line width\n\n\n gl.lineWidth(1);\n };\n\n publicAPI.getOpenGLMode = function (rep, type) {\n if (rep === Representation.POINTS || type === primTypes.Points) {\n return model.context.POINTS;\n }\n\n if (rep === Representation.WIREFRAME || type === primTypes.Lines || type === primTypes.TrisEdges || type === primTypes.TriStripsEdges) {\n return model.context.LINES;\n }\n\n return model.context.TRIANGLES;\n };\n\n publicAPI.renderPieceFinish = function (ren, actor) {\n if (model.LastBoundBO) {\n model.LastBoundBO.getVAO().release();\n }\n\n if (model.renderable.getColorTextureMap()) {\n model.internalColorTexture.deactivate();\n }\n };\n\n publicAPI.renderPiece = function (ren, actor) {\n // Make sure that we have been properly initialized.\n // if (ren.getRenderWindow().checkAbortStatus()) {\n // return;\n // }\n publicAPI.invokeEvent(StartEvent);\n\n if (!model.renderable.getStatic()) {\n model.renderable.update();\n }\n\n model.currentInput = model.renderable.getInputData();\n publicAPI.invokeEvent(EndEvent);\n\n if (!model.currentInput) {\n vtkErrorMacro('No input!');\n return;\n } // if there are no points then we are done\n\n\n if (!model.currentInput.getPoints || !model.currentInput.getPoints().getNumberOfValues()) {\n return;\n } // apply faceCulling\n\n\n var gl = model.context;\n var backfaceCulling = actor.getProperty().getBackfaceCulling();\n var frontfaceCulling = actor.getProperty().getFrontfaceCulling();\n\n if (!backfaceCulling && !frontfaceCulling) {\n model.openGLRenderWindow.disableCullFace();\n } else if (frontfaceCulling) {\n model.openGLRenderWindow.enableCullFace();\n gl.cullFace(gl.FRONT);\n } else {\n model.openGLRenderWindow.enableCullFace();\n gl.cullFace(gl.BACK);\n }\n\n publicAPI.renderPieceStart(ren, actor);\n publicAPI.renderPieceDraw(ren, actor);\n publicAPI.renderPieceFinish(ren, actor);\n };\n\n publicAPI.computeBounds = function (ren, actor) {\n if (!publicAPI.getInput()) {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_4__[\"uninitializeBounds\"](model.bounds);\n return;\n }\n\n model.bounds = publicAPI.getInput().getBounds();\n };\n\n publicAPI.updateBufferObjects = function (ren, actor) {\n // Rebuild buffers if needed\n if (publicAPI.getNeedToRebuildBufferObjects(ren, actor)) {\n publicAPI.buildBufferObjects(ren, actor);\n }\n };\n\n publicAPI.getNeedToRebuildBufferObjects = function (ren, actor) {\n // first do a coarse check\n // Note that the actor's mtime includes it's properties mtime\n var vmtime = model.VBOBuildTime.getMTime();\n\n if (vmtime < publicAPI.getMTime() || vmtime < model.renderable.getMTime() || vmtime < actor.getMTime() || vmtime < model.currentInput.getMTime()) {\n return true;\n }\n\n return false;\n };\n\n publicAPI.buildBufferObjects = function (ren, actor) {\n var poly = model.currentInput;\n\n if (poly === null) {\n return;\n }\n\n model.renderable.mapScalars(poly, 1.0);\n var c = model.renderable.getColorMapColors();\n model.haveCellScalars = false;\n var scalarMode = model.renderable.getScalarMode();\n\n if (model.renderable.getScalarVisibility()) {\n // We must figure out how the scalars should be mapped to the polydata.\n if ((scalarMode === ScalarMode.USE_CELL_DATA || scalarMode === ScalarMode.USE_CELL_FIELD_DATA || scalarMode === ScalarMode.USE_FIELD_DATA || !poly.getPointData().getScalars()) && scalarMode !== ScalarMode.USE_POINT_FIELD_DATA && c) {\n model.haveCellScalars = true;\n }\n } // Do we have normals?\n\n\n var n = actor.getProperty().getInterpolation() !== Shading.FLAT ? poly.getPointData().getNormals() : null;\n\n if (n === null && poly.getCellData().getNormals()) {\n model.haveCellNormals = true;\n n = poly.getCellData().getNormals();\n } // rebuild the VBO if the data has changed we create a string for the VBO what\n // can change the VBO? points normals tcoords colors so what can change those?\n // the input data is clearly one as it can change all four items tcoords may\n // haveTextures or not colors may change based on quite a few mapping\n // parameters in the mapper\n\n\n var representation = actor.getProperty().getRepresentation();\n var tcoords = poly.getPointData().getTCoords();\n\n if (!model.openGLActor.getActiveTextures()) {\n tcoords = null;\n } // handle color mapping via texture\n\n\n if (model.renderable.getColorCoordinates()) {\n tcoords = model.renderable.getColorCoordinates();\n\n if (!model.internalColorTexture) {\n model.internalColorTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n }\n\n var tex = model.internalColorTexture; // the following 4 lines allow for NPOT textures\n\n tex.setMinificationFilter(Filter.NEAREST);\n tex.setMagnificationFilter(Filter.NEAREST);\n tex.setWrapS(Wrap.CLAMP_TO_EDGE);\n tex.setWrapT(Wrap.CLAMP_TO_EDGE);\n tex.setOpenGLRenderWindow(model.openGLRenderWindow);\n var input = model.renderable.getColorTextureMap();\n var ext = input.getExtent();\n var inScalars = input.getPointData().getScalars();\n tex.create2DFromRaw(ext[1] - ext[0] + 1, ext[3] - ext[2] + 1, inScalars.getNumberOfComponents(), inScalars.getDataType(), inScalars.getData());\n tex.activate();\n tex.sendParameters();\n tex.deactivate();\n }\n\n var toString = \"\".concat(poly.getMTime(), \"A\").concat(representation, \"B\").concat(poly.getMTime()) + \"C\".concat(n ? n.getMTime() : 1, \"D\").concat(c ? c.getMTime() : 1) + \"E\".concat(actor.getProperty().getEdgeVisibility()) + \"F\".concat(tcoords ? tcoords.getMTime() : 1);\n\n if (model.VBOBuildString !== toString) {\n // Build the VBOs\n var points = poly.getPoints();\n var options = {\n points: points,\n normals: n,\n tcoords: tcoords,\n colors: c,\n cellOffset: 0,\n haveCellScalars: model.haveCellScalars,\n haveCellNormals: model.haveCellNormals,\n customAttributes: model.renderable.getCustomShaderAttributes().map(function (arrayName) {\n return poly.getPointData().getArrayByName(arrayName);\n })\n };\n options.cellOffset += model.primitives[primTypes.Points].getCABO().createVBO(poly.getVerts(), 'verts', representation, options);\n options.cellOffset += model.primitives[primTypes.Lines].getCABO().createVBO(poly.getLines(), 'lines', representation, options);\n options.cellOffset += model.primitives[primTypes.Tris].getCABO().createVBO(poly.getPolys(), 'polys', representation, options);\n options.cellOffset += model.primitives[primTypes.TriStrips].getCABO().createVBO(poly.getStrips(), 'strips', representation, options);\n var drawSurfaceWithEdges = actor.getProperty().getEdgeVisibility() && representation === Representation.SURFACE; // if we have edge visibility build the edge VBOs\n\n if (drawSurfaceWithEdges) {\n model.primitives[primTypes.TrisEdges].getCABO().createVBO(poly.getPolys(), 'polys', Representation.WIREFRAME, {\n points: points,\n normals: n,\n tcoords: null,\n colors: null,\n cellOffset: 0,\n haveCellScalars: false,\n haveCellNormals: false\n });\n model.primitives[primTypes.TriStripsEdges].getCABO().createVBO(poly.getStrips(), 'strips', Representation.WIREFRAME, {\n points: points,\n normals: n,\n tcoords: null,\n colors: null,\n cellOffset: 0,\n haveCellScalars: false,\n haveCellNormals: false\n });\n } else {\n // otherwise free them\n model.primitives[primTypes.TrisEdges].releaseGraphicsResources(model.openGLRenderWindow);\n model.primitives[primTypes.TriStripsEdges].releaseGraphicsResources(model.openGLRenderWindow);\n }\n\n model.VBOBuildTime.modified();\n model.VBOBuildString = toString;\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n VBOBuildTime: 0,\n VBOBuildString: null,\n primitives: null,\n primTypes: null,\n shaderRebuildString: null,\n tmpMat4: null,\n ambientColor: [],\n // used internally\n diffuseColor: [],\n // used internally\n specularColor: [],\n // used internally\n lightColor: [],\n // used internally\n lightHalfAngle: [],\n // used internally\n lightDirection: [],\n // used internally\n lastHaveSeenDepthRequest: false,\n haveSeenDepthRequest: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_8__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_Rendering_OpenGL_ReplacementShaderMapper__WEBPACK_IMPORTED_MODULE_11__[\"default\"].implementReplaceShaderCoincidentOffset(publicAPI, model, initialValues);\n model.primitives = [];\n model.primTypes = primTypes;\n model.tmpMat3 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(new Float64Array(9));\n model.tmpMat4 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n\n for (var i = primTypes.Start; i < primTypes.End; i++) {\n model.primitives[i] = vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.primitives[i].setPrimitiveType(i);\n model.primitives[i].set({\n lastLightComplexity: 0,\n lastLightCount: 0,\n lastSelectionPass: false\n }, true);\n } // Build VTK API\n\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['context']);\n model.VBOBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.VBOBuildTime, {\n mtime: 0\n }); // Object methods\n\n vtkOpenGLPolyDataMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkOpenGLPolyDataMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_12__[\"registerOverride\"])('vtkMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/PolyDataMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Geometry.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Geometry.js ***! - \***************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Camera__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Camera */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Camera/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Renderer */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Renderer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Actor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Actor */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Actor2D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Actor2D */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Actor2D/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_PolyDataMapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/PolyDataMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/PolyDataMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Skybox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Skybox */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Skybox/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper/index.js\");\n// Common\n\n // Geometry\n\n\n\n\n\n // Pixel mapping\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Geometry.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Glyph.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Glyph.js ***! - \************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Glyph3DMapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Glyph3DMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Glyph3DMapper/index.js\");\n// Geometry advanced\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Glyph.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Volume.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Volume.js ***! - \*************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Camera__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Camera */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Camera/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Renderer */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Renderer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ImageMapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ImageMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ImageSlice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ImageSlice */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ImageSlice/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Volume__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Volume */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Volume/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_VolumeMapper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/VolumeMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/VolumeMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/PixelSpaceCallbackMapper/index.js\");\n// Common\n\n // Volume\n\n\n\n\n // Pixel mapping\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Volume.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/RenderWindow/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/RenderWindow/index.js ***! - \****************************************************************************/ -/*! exports provided: pushMonitorGLContextCount, popMonitorGLContextCount, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pushMonitorGLContextCount\", function() { return pushMonitorGLContextCount; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"popMonitorGLContextCount\", function() { return popMonitorGLContextCount; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_RenderWindow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/RenderWindow */ \"./node_modules/vtk.js/Sources/Rendering/Core/RenderWindow/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ForwardPass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ForwardPass */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ForwardPass/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_RenderPass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/RenderPass */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderPass/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderCache__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderCache */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderCache/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_RenderWindowViewNode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/RenderWindowViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderWindowViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_TextureUnitManager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/TextureUnitManager */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/TextureUnitManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_HardwareSelector__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/HardwareSelector */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/HardwareSelector/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkDebugMacro,\n vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\nvar IS_CHROME = navigator.userAgent.indexOf('Chrome') !== -1;\nvar SCREENSHOT_PLACEHOLDER = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%'\n};\n\nfunction checkRenderTargetSupport(gl, format, type) {\n // create temporary frame buffer and texture\n var framebuffer = gl.createFramebuffer();\n var texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, format, 2, 2, 0, format, type, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); // check frame buffer status\n\n var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER); // clean up\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.bindTexture(gl.TEXTURE_2D, null);\n return status === gl.FRAMEBUFFER_COMPLETE;\n} // ----------------------------------------------------------------------------\n// Monitor the usage of GL context across vtkOpenGLRenderWindow instances\n// ----------------------------------------------------------------------------\n\n\nvar GL_CONTEXT_COUNT = 0;\nvar GL_CONTEXT_LISTENERS = [];\n\nfunction createGLContext() {\n GL_CONTEXT_COUNT++;\n GL_CONTEXT_LISTENERS.forEach(function (cb) {\n return cb(GL_CONTEXT_COUNT);\n });\n}\n\nfunction deleteGLContext() {\n GL_CONTEXT_COUNT--;\n GL_CONTEXT_LISTENERS.forEach(function (cb) {\n return cb(GL_CONTEXT_COUNT);\n });\n}\n\nfunction pushMonitorGLContextCount(cb) {\n GL_CONTEXT_LISTENERS.push(cb);\n}\nfunction popMonitorGLContextCount(cb) {\n return GL_CONTEXT_LISTENERS.pop();\n} // ----------------------------------------------------------------------------\n// vtkOpenGLRenderWindow methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLRenderWindow(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLRenderWindow');\n\n publicAPI.getViewNodeFactory = function () {\n return model.myFactory;\n }; // Auto update style\n\n\n var previousSize = [0, 0];\n\n function updateWindow() {\n // Canvas size\n if (model.renderable) {\n if (model.size[0] !== previousSize[0] || model.size[1] !== previousSize[1]) {\n previousSize[0] = model.size[0];\n previousSize[1] = model.size[1];\n model.canvas.setAttribute('width', model.size[0]);\n model.canvas.setAttribute('height', model.size[1]);\n }\n } // ImageStream size\n\n\n if (model.viewStream) {\n // If same size that's a NoOp\n model.viewStream.setSize(model.size[0], model.size[1]);\n } // Offscreen ?\n\n\n model.canvas.style.display = model.useOffScreen ? 'none' : 'block'; // Cursor type\n\n if (model.el) {\n model.el.style.cursor = model.cursorVisibility ? model.cursor : 'none';\n } // Invalidate cached DOM container size\n\n\n model.containerSize = null;\n }\n\n publicAPI.onModified(updateWindow); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n if (!model.renderable) {\n return;\n }\n\n publicAPI.prepareNodes();\n publicAPI.addMissingNodes(model.renderable.getRenderersByReference());\n publicAPI.removeUnusedNodes();\n publicAPI.initialize();\n model.children.forEach(function (child) {\n child.setOpenGLRenderWindow(publicAPI);\n });\n }\n };\n\n publicAPI.initialize = function () {\n if (!model.initialized) {\n model.context = publicAPI.get3DContext();\n model.textureUnitManager = vtk_js_Sources_Rendering_OpenGL_TextureUnitManager__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.textureUnitManager.setContext(model.context);\n model.shaderCache.setContext(model.context); // initialize blending for transparency\n\n var gl = model.context;\n gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n gl.depthFunc(gl.LEQUAL);\n gl.enable(gl.BLEND);\n model.initialized = true;\n }\n };\n\n publicAPI.makeCurrent = function () {\n model.context.makeCurrent();\n };\n\n publicAPI.setContainer = function (el) {\n if (model.el && model.el !== el) {\n if (model.canvas.parentNode !== model.el) {\n vtkErrorMacro('Error: canvas parent node does not match container');\n } // Remove canvas from previous container\n\n\n model.el.removeChild(model.canvas); // If the renderer has previously added\n // a background image, remove it from the DOM.\n\n if (model.el.contains(model.bgImage)) {\n model.el.removeChild(model.bgImage);\n }\n }\n\n if (model.el !== el) {\n model.el = el;\n\n if (model.el) {\n model.el.appendChild(model.canvas); // If the renderer is set to use a background\n // image, attach it to the DOM.\n\n if (model.useBackgroundImage) {\n model.el.appendChild(model.bgImage);\n }\n } // Trigger modified()\n\n\n publicAPI.modified();\n }\n };\n\n publicAPI.getContainer = function () {\n return model.el;\n };\n\n publicAPI.getContainerSize = function () {\n if (!model.containerSize && model.el) {\n var _model$el$getBounding = model.el.getBoundingClientRect(),\n width = _model$el$getBounding.width,\n height = _model$el$getBounding.height;\n\n model.containerSize = [width, height];\n }\n\n return model.containerSize || model.size;\n };\n\n publicAPI.getFramebufferSize = function () {\n if (model.activeFramebuffer) {\n return model.activeFramebuffer.getSize();\n }\n\n return model.size;\n };\n\n publicAPI.getPixelData = function (x1, y1, x2, y2) {\n var pixels = new Uint8Array((x2 - x1 + 1) * (y2 - y1 + 1) * 4);\n model.context.readPixels(x1, y1, x2 - x1 + 1, y2 - y1 + 1, model.context.RGBA, model.context.UNSIGNED_BYTE, pixels);\n return pixels;\n };\n\n publicAPI.get3DContext = function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n preserveDrawingBuffer: false,\n depth: true,\n alpha: true\n };\n var result = null;\n var webgl2Supported = typeof WebGL2RenderingContext !== 'undefined';\n model.webgl2 = false;\n\n if (model.defaultToWebgl2 && webgl2Supported) {\n result = model.canvas.getContext('webgl2', options);\n\n if (result) {\n model.webgl2 = true;\n vtkDebugMacro('using webgl2');\n }\n }\n\n if (!result) {\n vtkDebugMacro('using webgl1');\n result = model.canvas.getContext('webgl', options) || model.canvas.getContext('experimental-webgl', options);\n } // Do we have webvr support\n\n\n if (navigator.getVRDisplays) {\n navigator.getVRDisplays().then(function (displays) {\n if (displays.length > 0) {\n // take the first display for now\n model.vrDisplay = displays[0]; // set the clipping ranges\n\n model.vrDisplay.depthNear = 0.01; // meters\n\n model.vrDisplay.depthFar = 100.0; // meters\n\n publicAPI.invokeHaveVRDisplay();\n }\n });\n } // prevent default context lost handler\n\n\n model.canvas.addEventListener('webglcontextlost', function (event) {\n event.preventDefault();\n }, false);\n model.canvas.addEventListener('webglcontextrestored', publicAPI.restoreContext, false);\n return result;\n };\n\n publicAPI.startVR = function () {\n model.oldCanvasSize = model.size.slice();\n\n if (model.vrDisplay.capabilities.canPresent) {\n model.vrDisplay.requestPresent([{\n source: model.canvas\n }]).then(function () {\n if (model.el && model.vrDisplay.capabilities.hasExternalDisplay && model.hideCanvasInVR) {\n model.el.style.display = 'none';\n }\n\n if (model.queryVRSize) {\n var leftEye = model.vrDisplay.getEyeParameters('left');\n var rightEye = model.vrDisplay.getEyeParameters('right');\n var width = Math.floor(leftEye.renderWidth + rightEye.renderWidth);\n var height = Math.floor(Math.max(leftEye.renderHeight, rightEye.renderHeight));\n publicAPI.setSize(width, height);\n } else {\n publicAPI.setSize(model.vrResolution);\n }\n\n var ren = model.renderable.getRenderers()[0];\n ren.resetCamera();\n model.vrFrameData = new VRFrameData();\n model.renderable.getInteractor().switchToVRAnimation();\n model.vrSceneFrame = model.vrDisplay.requestAnimationFrame(publicAPI.vrRender); // If Broswer is chrome we need to request animation again to canvas update\n\n if (IS_CHROME) {\n model.vrSceneFrame = model.vrDisplay.requestAnimationFrame(publicAPI.vrRender);\n }\n }).catch(function () {\n console.error('failed to requestPresent');\n });\n } else {\n vtkErrorMacro('vrDisplay is not connected');\n }\n };\n\n publicAPI.stopVR = function () {\n model.renderable.getInteractor().returnFromVRAnimation();\n model.vrDisplay.exitPresent();\n model.vrDisplay.cancelAnimationFrame(model.vrSceneFrame);\n publicAPI.setSize.apply(publicAPI, _toConsumableArray(model.oldCanvasSize));\n\n if (model.el && model.vrDisplay.capabilities.hasExternalDisplay) {\n model.el.style.display = 'block';\n }\n\n var ren = model.renderable.getRenderers()[0];\n ren.getActiveCamera().setProjectionMatrix(null);\n ren.setViewport(0.0, 0, 1.0, 1.0);\n publicAPI.traverseAllPasses();\n };\n\n publicAPI.vrRender = function () {\n // If not presenting for any reason, we do not submit frame\n if (!model.vrDisplay.isPresenting) {\n return;\n }\n\n model.renderable.getInteractor().updateGamepads(model.vrDisplay.displayId);\n model.vrSceneFrame = model.vrDisplay.requestAnimationFrame(publicAPI.vrRender);\n model.vrDisplay.getFrameData(model.vrFrameData); // get the first renderer\n\n var ren = model.renderable.getRenderers()[0]; // do the left eye\n\n ren.setViewport(0, 0, 0.5, 1.0);\n ren.getActiveCamera().computeViewParametersFromPhysicalMatrix(model.vrFrameData.leftViewMatrix);\n ren.getActiveCamera().setProjectionMatrix(model.vrFrameData.leftProjectionMatrix);\n publicAPI.traverseAllPasses();\n ren.setViewport(0.5, 0, 1.0, 1.0);\n ren.getActiveCamera().computeViewParametersFromPhysicalMatrix(model.vrFrameData.rightViewMatrix);\n ren.getActiveCamera().setProjectionMatrix(model.vrFrameData.rightProjectionMatrix);\n publicAPI.traverseAllPasses();\n model.vrDisplay.submitFrame();\n };\n\n publicAPI.restoreContext = function () {\n var rp = vtk_js_Sources_Rendering_SceneGraph_RenderPass__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n rp.setCurrentOperation('Release');\n rp.traverse(publicAPI, null);\n };\n\n publicAPI.activateTexture = function (texture) {\n // Only add if it isn't already there\n var result = model._textureResourceIds.get(texture);\n\n if (result !== undefined) {\n model.context.activeTexture(model.context.TEXTURE0 + result);\n return;\n }\n\n var activeUnit = publicAPI.getTextureUnitManager().allocate();\n\n if (activeUnit < 0) {\n vtkErrorMacro('Hardware does not support the number of textures defined.');\n return;\n }\n\n model._textureResourceIds.set(texture, activeUnit);\n\n model.context.activeTexture(model.context.TEXTURE0 + activeUnit);\n };\n\n publicAPI.deactivateTexture = function (texture) {\n // Only deactivate if it isn't already there\n var result = model._textureResourceIds.get(texture);\n\n if (result !== undefined) {\n publicAPI.getTextureUnitManager().free(result);\n delete model._textureResourceIds.delete(texture);\n }\n };\n\n publicAPI.getTextureUnitForTexture = function (texture) {\n var result = model._textureResourceIds.get(texture);\n\n if (result !== undefined) {\n return result;\n }\n\n return -1;\n };\n\n publicAPI.getDefaultTextureInternalFormat = function (vtktype, numComps, useFloat) {\n if (model.webgl2) {\n switch (vtktype) {\n case vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_9__[\"VtkDataTypes\"].UNSIGNED_CHAR:\n switch (numComps) {\n case 1:\n return model.context.R8;\n\n case 2:\n return model.context.RG8;\n\n case 3:\n return model.context.RGB8;\n\n case 4:\n default:\n return model.context.RGBA8;\n }\n\n default:\n case vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_9__[\"VtkDataTypes\"].FLOAT:\n switch (numComps) {\n case 1:\n return model.context.R16F;\n\n case 2:\n return model.context.RG16F;\n\n case 3:\n return model.context.RGB16F;\n\n case 4:\n default:\n return model.context.RGBA16F;\n }\n\n }\n } // webgl1 only supports four types\n\n\n switch (numComps) {\n case 1:\n return model.context.LUMINANCE;\n\n case 2:\n return model.context.LUMINANCE_ALPHA;\n\n case 3:\n return model.context.RGB;\n\n case 4:\n default:\n return model.context.RGBA;\n }\n };\n\n publicAPI.setBackgroundImage = function (img) {\n model.bgImage.src = img.src;\n };\n\n publicAPI.setUseBackgroundImage = function (value) {\n model.useBackgroundImage = value; // Add or remove the background image from the\n // DOM as specified.\n\n if (model.useBackgroundImage && !model.el.contains(model.bgImage)) {\n model.el.appendChild(model.bgImage);\n } else if (!model.useBackgroundImage && model.el.contains(model.bgImage)) {\n model.el.removeChild(model.bgImage);\n }\n };\n\n function getCanvasDataURL() {\n var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : model.imageFormat;\n // Copy current canvas to not modify the original\n var temporaryCanvas = document.createElement('canvas');\n var temporaryContext = temporaryCanvas.getContext('2d');\n temporaryCanvas.width = model.canvas.width;\n temporaryCanvas.height = model.canvas.height;\n temporaryContext.drawImage(model.canvas, 0, 0); // Get current client rect to place canvas\n\n var mainBoundingClientRect = model.canvas.getBoundingClientRect();\n var renderWindow = model.renderable;\n var renderers = renderWindow.getRenderers();\n renderers.forEach(function (renderer) {\n var viewProps = renderer.getViewProps();\n viewProps.forEach(function (viewProp) {\n // Check if the prop has a container that should have canvas\n if (viewProp.getContainer) {\n var container = viewProp.getContainer();\n var canvasList = container.getElementsByTagName('canvas'); // Go throughout all canvas and copy it into temporary main canvas\n\n for (var i = 0; i < canvasList.length; i++) {\n var currentCanvas = canvasList[i];\n var boundingClientRect = currentCanvas.getBoundingClientRect();\n var newXPosition = boundingClientRect.x - mainBoundingClientRect.x;\n var newYPosition = boundingClientRect.y - mainBoundingClientRect.y;\n temporaryContext.drawImage(currentCanvas, newXPosition, newYPosition);\n }\n }\n });\n });\n var screenshot = temporaryCanvas.toDataURL(format);\n temporaryCanvas.remove();\n publicAPI.invokeImageReady(screenshot);\n }\n\n publicAPI.captureNextImage = function () {\n var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'image/png';\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$resetCamera = _ref.resetCamera,\n resetCamera = _ref$resetCamera === void 0 ? false : _ref$resetCamera,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? null : _ref$size,\n _ref$scale = _ref.scale,\n scale = _ref$scale === void 0 ? 1 : _ref$scale;\n\n if (model.deleted) {\n return null;\n }\n\n model.imageFormat = format;\n var previous = model.notifyStartCaptureImage;\n model.notifyStartCaptureImage = true;\n model._screenshot = {\n size: !!size || scale !== 1 ? size || model.size.map(function (val) {\n return val * scale;\n }) : null\n };\n return new Promise(function (resolve, reject) {\n var subscription = publicAPI.onImageReady(function (imageURL) {\n if (model._screenshot.size === null) {\n model.notifyStartCaptureImage = previous;\n subscription.unsubscribe();\n\n if (model._screenshot.placeHolder) {\n // resize the main canvas back to its original size and show it\n model.size = model._screenshot.originalSize; // process the resize\n\n publicAPI.modified(); // restore the saved camera parameters, if applicable\n\n if (model._screenshot.cameras) {\n model._screenshot.cameras.forEach(function (_ref2) {\n var restoreParamsFn = _ref2.restoreParamsFn,\n arg = _ref2.arg;\n return restoreParamsFn(arg);\n });\n } // Trigger a render at the original size\n\n\n publicAPI.traverseAllPasses(); // Remove and clean up the placeholder, revealing the original\n\n model.el.removeChild(model._screenshot.placeHolder);\n\n model._screenshot.placeHolder.remove();\n\n model._screenshot = null;\n }\n\n resolve(imageURL);\n } else {\n // Create a placeholder image overlay while we resize and render\n var tmpImg = document.createElement('img');\n tmpImg.style = SCREENSHOT_PLACEHOLDER;\n tmpImg.src = imageURL;\n model._screenshot.placeHolder = model.el.appendChild(tmpImg); // hide the main canvas\n\n model.canvas.style.display = 'none'; // remember the main canvas original size, then resize it\n\n model._screenshot.originalSize = model.size;\n model.size = model._screenshot.size;\n model._screenshot.size = null; // process the resize\n\n publicAPI.modified();\n\n if (resetCamera) {\n // If resetCamera was requested, we first save camera parameters\n // from all the renderers, so we can restore them later\n model._screenshot.cameras = model.renderable.getRenderers().map(function (renderer) {\n var camera = renderer.getActiveCamera();\n var params = camera.get('focalPoint', 'position', 'parallelScale');\n return {\n resetCameraFn: renderer.resetCamera,\n restoreParamsFn: camera.set,\n // \"clone\" the params so we don't keep refs to properties\n arg: JSON.parse(JSON.stringify(params))\n };\n }); // Perform the resetCamera() on each renderer only after capturing\n // the params from all active cameras, in case there happen to be\n // linked cameras among the renderers.\n\n model._screenshot.cameras.forEach(function (_ref3) {\n var resetCameraFn = _ref3.resetCameraFn;\n return resetCameraFn();\n });\n } // Trigger a render at the custom size\n\n\n publicAPI.traverseAllPasses();\n }\n });\n });\n };\n\n publicAPI.getGLInformations = function () {\n var gl = publicAPI.get3DContext();\n var glTextureFloat = gl.getExtension('OES_texture_float');\n var glTextureHalfFloat = gl.getExtension('OES_texture_half_float');\n var glDebugRendererInfo = gl.getExtension('WEBGL_debug_renderer_info');\n var glDrawBuffers = gl.getExtension('WEBGL_draw_buffers');\n var glAnisotropic = gl.getExtension('EXT_texture_filter_anisotropic') || gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic');\n var params = [['Max Vertex Attributes', 'MAX_VERTEX_ATTRIBS', gl.getParameter(gl.MAX_VERTEX_ATTRIBS)], ['Max Varying Vectors', 'MAX_VARYING_VECTORS', gl.getParameter(gl.MAX_VARYING_VECTORS)], ['Max Vertex Uniform Vectors', 'MAX_VERTEX_UNIFORM_VECTORS', gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS)], ['Max Fragment Uniform Vectors', 'MAX_FRAGMENT_UNIFORM_VECTORS', gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS)], ['Max Fragment Texture Image Units', 'MAX_TEXTURE_IMAGE_UNITS', gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)], ['Max Vertex Texture Image Units', 'MAX_VERTEX_TEXTURE_IMAGE_UNITS', gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS)], ['Max Combined Texture Image Units', 'MAX_COMBINED_TEXTURE_IMAGE_UNITS', gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS)], ['Max 2D Texture Size', 'MAX_TEXTURE_SIZE', gl.getParameter(gl.MAX_TEXTURE_SIZE)], ['Max Cube Texture Size', 'MAX_CUBE_MAP_TEXTURE_SIZE', gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)], ['Max Texture Anisotropy', 'MAX_TEXTURE_MAX_ANISOTROPY_EXT', glAnisotropic && gl.getParameter(glAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)], ['Point Size Range', 'ALIASED_POINT_SIZE_RANGE', gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE).join(' - ')], ['Line Width Range', 'ALIASED_LINE_WIDTH_RANGE', gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE).join(' - ')], ['Max Viewport Dimensions', 'MAX_VIEWPORT_DIMS', gl.getParameter(gl.MAX_VIEWPORT_DIMS).join(' - ')], ['Max Renderbuffer Size', 'MAX_RENDERBUFFER_SIZE', gl.getParameter(gl.MAX_RENDERBUFFER_SIZE)], ['Framebuffer Red Bits', 'RED_BITS', gl.getParameter(gl.RED_BITS)], ['Framebuffer Green Bits', 'GREEN_BITS', gl.getParameter(gl.GREEN_BITS)], ['Framebuffer Blue Bits', 'BLUE_BITS', gl.getParameter(gl.BLUE_BITS)], ['Framebuffer Alpha Bits', 'ALPHA_BITS', gl.getParameter(gl.ALPHA_BITS)], ['Framebuffer Depth Bits', 'DEPTH_BITS', gl.getParameter(gl.DEPTH_BITS)], ['Framebuffer Stencil Bits', 'STENCIL_BITS', gl.getParameter(gl.STENCIL_BITS)], ['Framebuffer Subpixel Bits', 'SUBPIXEL_BITS', gl.getParameter(gl.SUBPIXEL_BITS)], ['MSAA Samples', 'SAMPLES', gl.getParameter(gl.SAMPLES)], ['MSAA Sample Buffers', 'SAMPLE_BUFFERS', gl.getParameter(gl.SAMPLE_BUFFERS)], ['Supported Formats for UByte Render Targets ', 'UNSIGNED_BYTE RENDER TARGET FORMATS', [glTextureFloat && checkRenderTargetSupport(gl, gl.RGBA, gl.UNSIGNED_BYTE) ? 'RGBA' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.RGB, gl.UNSIGNED_BYTE) ? 'RGB' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.LUMINANCE, gl.UNSIGNED_BYTE) ? 'LUMINANCE' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.ALPHA, gl.UNSIGNED_BYTE) ? 'ALPHA' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.LUMINANCE_ALPHA, gl.UNSIGNED_BYTE) ? 'LUMINANCE_ALPHA' : ''].join(' ')], ['Supported Formats for Half Float Render Targets', 'HALF FLOAT RENDER TARGET FORMATS', [glTextureHalfFloat && checkRenderTargetSupport(gl, gl.RGBA, glTextureHalfFloat.HALF_FLOAT_OES) ? 'RGBA' : '', glTextureHalfFloat && checkRenderTargetSupport(gl, gl.RGB, glTextureHalfFloat.HALF_FLOAT_OES) ? 'RGB' : '', glTextureHalfFloat && checkRenderTargetSupport(gl, gl.LUMINANCE, glTextureHalfFloat.HALF_FLOAT_OES) ? 'LUMINANCE' : '', glTextureHalfFloat && checkRenderTargetSupport(gl, gl.ALPHA, glTextureHalfFloat.HALF_FLOAT_OES) ? 'ALPHA' : '', glTextureHalfFloat && checkRenderTargetSupport(gl, gl.LUMINANCE_ALPHA, glTextureHalfFloat.HALF_FLOAT_OES) ? 'LUMINANCE_ALPHA' : ''].join(' ')], ['Supported Formats for Full Float Render Targets', 'FLOAT RENDER TARGET FORMATS', [glTextureFloat && checkRenderTargetSupport(gl, gl.RGBA, gl.FLOAT) ? 'RGBA' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.RGB, gl.FLOAT) ? 'RGB' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.LUMINANCE, gl.FLOAT) ? 'LUMINANCE' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.ALPHA, gl.FLOAT) ? 'ALPHA' : '', glTextureFloat && checkRenderTargetSupport(gl, gl.LUMINANCE_ALPHA, gl.FLOAT) ? 'LUMINANCE_ALPHA' : ''].join(' ')], ['Max Multiple Render Targets Buffers', 'MAX_DRAW_BUFFERS_WEBGL', glDrawBuffers ? gl.getParameter(glDrawBuffers.MAX_DRAW_BUFFERS_WEBGL) : 0], ['High Float Precision in Vertex Shader', 'HIGH_FLOAT VERTEX_SHADER', [gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).rangeMax, ')'].join('')], ['Medium Float Precision in Vertex Shader', 'MEDIUM_FLOAT VERTEX_SHADER', [gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).rangeMax, ')'].join('')], ['Low Float Precision in Vertex Shader', 'LOW_FLOAT VERTEX_SHADER', [gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT).rangeMax, ')'].join('')], ['High Float Precision in Fragment Shader', 'HIGH_FLOAT FRAGMENT_SHADER', [gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).rangeMax, ')'].join('')], ['Medium Float Precision in Fragment Shader', 'MEDIUM_FLOAT FRAGMENT_SHADER', [gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).rangeMax, ')'].join('')], ['Low Float Precision in Fragment Shader', 'LOW_FLOAT FRAGMENT_SHADER', [gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT).rangeMax, ')'].join('')], ['High Int Precision in Vertex Shader', 'HIGH_INT VERTEX_SHADER', [gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT).rangeMax, ')'].join('')], ['Medium Int Precision in Vertex Shader', 'MEDIUM_INT VERTEX_SHADER', [gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT).rangeMax, ')'].join('')], ['Low Int Precision in Vertex Shader', 'LOW_INT VERTEX_SHADER', [gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT).rangeMax, ')'].join('')], ['High Int Precision in Fragment Shader', 'HIGH_INT FRAGMENT_SHADER', [gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT).rangeMax, ')'].join('')], ['Medium Int Precision in Fragment Shader', 'MEDIUM_INT FRAGMENT_SHADER', [gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT).rangeMax, ')'].join('')], ['Low Int Precision in Fragment Shader', 'LOW_INT FRAGMENT_SHADER', [gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).precision, ' (-2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).rangeMin, ' - 2', gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).rangeMax, ')'].join('')], ['Supported Extensions', 'EXTENSIONS', gl.getSupportedExtensions().join('
\\t\\t\\t\\t\\t ')], ['WebGL Renderer', 'RENDERER', gl.getParameter(gl.RENDERER)], ['WebGL Vendor', 'VENDOR', gl.getParameter(gl.VENDOR)], ['WebGL Version', 'VERSION', gl.getParameter(gl.VERSION)], ['Shading Language Version', 'SHADING_LANGUAGE_VERSION', gl.getParameter(gl.SHADING_LANGUAGE_VERSION)], ['Unmasked Renderer', 'UNMASKED_RENDERER', glDebugRendererInfo && gl.getParameter(glDebugRendererInfo.UNMASKED_RENDERER_WEBGL)], ['Unmasked Vendor', 'UNMASKED_VENDOR', glDebugRendererInfo && gl.getParameter(glDebugRendererInfo.UNMASKED_VENDOR_WEBGL)], ['WebGL Version', 'WEBGL_VERSION', model.webgl2 ? 2 : 1]];\n var result = {};\n\n while (params.length) {\n var _params$pop = params.pop(),\n _params$pop2 = _slicedToArray(_params$pop, 3),\n label = _params$pop2[0],\n key = _params$pop2[1],\n value = _params$pop2[2];\n\n if (key) {\n result[key] = {\n label: label,\n value: value\n };\n }\n }\n\n return result;\n };\n\n publicAPI.traverseAllPasses = function () {\n if (model.renderPasses) {\n for (var index = 0; index < model.renderPasses.length; ++index) {\n model.renderPasses[index].traverse(publicAPI, null);\n }\n }\n\n if (model.notifyStartCaptureImage) {\n getCanvasDataURL();\n }\n };\n\n publicAPI.disableDepthMask = function () {\n if (model.depthMaskEnabled) {\n model.context.depthMask(false);\n model.depthMaskEnabled = false;\n }\n };\n\n publicAPI.enableDepthMask = function () {\n if (!model.depthMaskEnabled) {\n model.context.depthMask(true);\n model.depthMaskEnabled = true;\n }\n };\n\n publicAPI.disableCullFace = function () {\n if (model.cullFaceEnabled) {\n model.context.disable(model.context.CULL_FACE);\n model.cullFaceEnabled = false;\n }\n };\n\n publicAPI.enableCullFace = function () {\n if (!model.cullFaceEnabled) {\n model.context.enable(model.context.CULL_FACE);\n model.cullFaceEnabled = true;\n }\n };\n\n publicAPI.setViewStream = function (stream) {\n if (model.viewStream === stream) {\n return false;\n }\n\n if (model.subscription) {\n model.subscription.unsubscribe();\n model.subscription = null;\n }\n\n model.viewStream = stream;\n\n if (model.viewStream) {\n // Force background to be transparent + render\n var mainRenderer = model.renderable.getRenderers()[0];\n mainRenderer.getBackgroundByReference()[3] = 0; // Enable display of the background image\n\n publicAPI.setUseBackgroundImage(true); // Bind to remote stream\n\n model.subscription = model.viewStream.onImageReady(function (e) {\n return publicAPI.setBackgroundImage(e.image);\n });\n model.viewStream.setSize(model.size[0], model.size[1]);\n model.viewStream.invalidateCache();\n model.viewStream.render();\n publicAPI.modified();\n }\n\n return true;\n };\n\n publicAPI.delete = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.delete, publicAPI.setViewStream, deleteGLContext);\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n cullFaceEnabled: false,\n depthMaskEnabled: true,\n shaderCache: null,\n initialized: false,\n context: null,\n canvas: null,\n cursorVisibility: true,\n cursor: 'pointer',\n textureUnitManager: null,\n textureResourceIds: null,\n containerSize: null,\n renderPasses: [],\n notifyStartCaptureImage: false,\n webgl2: false,\n defaultToWebgl2: true,\n // attempt webgl2 on by default\n vrResolution: [2160, 1200],\n queryVRSize: false,\n hideCanvasInVR: true,\n activeFramebuffer: null,\n vrDisplay: null,\n imageFormat: 'image/png',\n useOffScreen: false,\n useBackgroundImage: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_RenderWindowViewNode__WEBPACK_IMPORTED_MODULE_6__[\"default\"].extend(publicAPI, model, initialValues); // Create internal instances\n\n model.canvas = document.createElement('canvas');\n model.canvas.style.width = '100%';\n createGLContext();\n\n if (!model.selector) {\n model.selector = vtk_js_Sources_Rendering_OpenGL_HardwareSelector__WEBPACK_IMPORTED_MODULE_8__[\"default\"].newInstance();\n model.selector.setOpenGLRenderWindow(publicAPI);\n } // Create internal bgImage\n\n\n model.bgImage = new Image();\n model.bgImage.style.position = 'absolute';\n model.bgImage.style.left = '0';\n model.bgImage.style.top = '0';\n model.bgImage.style.width = '100%';\n model.bgImage.style.height = '100%';\n model.bgImage.style.zIndex = '-1';\n model._textureResourceIds = new Map();\n model.myFactory = vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n /* eslint-disable no-use-before-define */\n\n model.myFactory.registerOverride('vtkRenderWindow', newInstance);\n /* eslint-enable no-use-before-define */\n\n model.shaderCache = vtk_js_Sources_Rendering_OpenGL_ShaderCache__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n model.shaderCache.setOpenGLRenderWindow(publicAPI); // setup default forward pass rendering\n\n model.renderPasses[0] = vtk_js_Sources_Rendering_OpenGL_ForwardPass__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'imageReady');\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'haveVRDisplay'); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['shaderCache', 'textureUnitManager', 'webgl2', 'vrDisplay', 'useBackgroundImage']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['initialized', 'context', 'canvas', 'renderPasses', 'notifyStartCaptureImage', 'defaultToWebgl2', 'cursor', 'queryVRSize', 'hideCanvasInVR', 'useOffScreen', // might want to make this not call modified as\n // we change the active framebuffer a lot. Or maybe\n // only mark modified if the size or depth\n // of the buffer has changed\n 'activeFramebuffer']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['size', 'vrResolution'], 2); // Object methods\n\n vtkOpenGLRenderWindow(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkOpenGLRenderWindow'); // ----------------------------------------------------------------------------\n// Register API specific RenderWindow implementation\n// ----------------------------------------------------------------------------\n\nObject(vtk_js_Sources_Rendering_Core_RenderWindow__WEBPACK_IMPORTED_MODULE_1__[\"registerViewConstructor\"])('WebGL', newInstance); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n pushMonitorGLContextCount: pushMonitorGLContextCount,\n popMonitorGLContextCount: popMonitorGLContextCount\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/RenderWindow/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Renderer/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Renderer/index.js ***! - \************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkDebugMacro\"]; // ----------------------------------------------------------------------------\n// vtkOpenGLRenderer methods\n// ----------------------------------------------------------------------------\n\n/* eslint-disable no-bitwise */\n\nfunction vtkOpenGLRenderer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLRenderer'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n if (!model.renderable) {\n return;\n } // make sure we have a camera\n\n\n if (!model.renderable.isActiveCameraCreated()) {\n model.renderable.resetCamera();\n }\n\n publicAPI.updateLights();\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getActiveCamera());\n publicAPI.addMissingNodes(model.renderable.getViewPropsWithNestedProps());\n publicAPI.removeUnusedNodes();\n }\n };\n\n publicAPI.updateLights = function () {\n var count = 0;\n var lights = model.renderable.getLightsByReference();\n\n for (var index = 0; index < lights.length; ++index) {\n if (lights[index].getSwitch() > 0.0) {\n count++;\n }\n }\n\n if (!count) {\n vtkDebugMacro('No lights are on, creating one.');\n model.renderable.createLight();\n }\n\n return count;\n };\n\n publicAPI.opaqueZBufferPass = function (prepass) {\n if (prepass) {\n var clearMask = 0;\n var gl = model.context;\n\n if (!model.renderable.getTransparent()) {\n model.context.clearColor(1.0, 0.0, 0.0, 1.0);\n clearMask |= gl.COLOR_BUFFER_BIT;\n }\n\n if (!model.renderable.getPreserveDepthBuffer()) {\n gl.clearDepth(1.0);\n clearMask |= gl.DEPTH_BUFFER_BIT;\n gl.depthMask(true);\n }\n\n var ts = publicAPI.getTiledSizeAndOrigin();\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.viewport(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.colorMask(true, true, true, true);\n gl.clear(clearMask);\n gl.enable(gl.DEPTH_TEST);\n }\n }; // Renders myself\n\n\n publicAPI.cameraPass = function (prepass) {\n if (prepass) {\n publicAPI.clear();\n }\n };\n\n publicAPI.getAspectRatio = function () {\n var size = model.parent.getSizeByReference();\n var viewport = model.renderable.getViewportByReference();\n return size[0] * (viewport[2] - viewport[0]) / ((viewport[3] - viewport[1]) * size[1]);\n };\n\n publicAPI.getTiledSizeAndOrigin = function () {\n var vport = model.renderable.getViewportByReference(); // if there is no window assume 0 1\n\n var tileViewPort = [0.0, 0.0, 1.0, 1.0]; // find the lower left corner of the viewport, taking into account the\n // lower left boundary of this tile\n\n var vpu = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[0] - tileViewPort[0], 0.0, 1.0);\n var vpv = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[1] - tileViewPort[1], 0.0, 1.0); // store the result as a pixel value\n\n var ndvp = model.parent.normalizedDisplayToDisplay(vpu, vpv);\n var lowerLeftU = Math.round(ndvp[0]);\n var lowerLeftV = Math.round(ndvp[1]); // find the upper right corner of the viewport, taking into account the\n // lower left boundary of this tile\n\n var vpu2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[2] - tileViewPort[0], 0.0, 1.0);\n var vpv2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[3] - tileViewPort[1], 0.0, 1.0); // also watch for the upper right boundary of the tile\n\n if (vpu2 > tileViewPort[2] - tileViewPort[0]) {\n vpu2 = tileViewPort[2] - tileViewPort[0];\n }\n\n if (vpv2 > tileViewPort[3] - tileViewPort[1]) {\n vpv2 = tileViewPort[3] - tileViewPort[1];\n }\n\n var ndvp2 = model.parent.normalizedDisplayToDisplay(vpu2, vpv2); // now compute the size of the intersection of the viewport with the\n // current tile\n\n var usize = Math.round(ndvp2[0]) - lowerLeftU;\n var vsize = Math.round(ndvp2[1]) - lowerLeftV;\n\n if (usize < 0) {\n usize = 0;\n }\n\n if (vsize < 0) {\n vsize = 0;\n }\n\n return {\n usize: usize,\n vsize: vsize,\n lowerLeftU: lowerLeftU,\n lowerLeftV: lowerLeftV\n };\n };\n\n publicAPI.clear = function () {\n var clearMask = 0;\n var gl = model.context;\n\n if (!model.renderable.getTransparent()) {\n var background = model.renderable.getBackgroundByReference(); // renderable ensures that background has 4 entries.\n\n model.context.clearColor(background[0], background[1], background[2], background[3]);\n clearMask |= gl.COLOR_BUFFER_BIT;\n }\n\n if (!model.renderable.getPreserveDepthBuffer()) {\n gl.clearDepth(1.0);\n clearMask |= gl.DEPTH_BUFFER_BIT;\n gl.depthMask(true);\n }\n\n gl.colorMask(true, true, true, true);\n var ts = publicAPI.getTiledSizeAndOrigin();\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.viewport(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.clear(clearMask);\n gl.enable(gl.DEPTH_TEST);\n /* eslint-enable no-bitwise */\n };\n\n publicAPI.releaseGraphicsResources = function () {\n if (model.selector !== null) {\n model.selector.releaseGraphicsResources();\n }\n };\n\n publicAPI.setOpenGLRenderWindow = function (rw) {\n if (model.openGLRenderWindow === rw) {\n return;\n }\n\n publicAPI.releaseGraphicsResources();\n model.openGLRenderWindow = rw;\n model.context = null;\n\n if (rw) {\n model.context = model.openGLRenderWindow.getContext();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n openGLRenderWindow: null,\n selector: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"get\"](publicAPI, model, ['shaderCache']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['selector']); // Object methods\n\n vtkOpenGLRenderer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkOpenGLRenderer'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkRenderer', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Renderer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper/index.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper/index.js ***! - \***************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n\n\nfunction implementReplaceShaderCoincidentOffset(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n publicAPI.replaceShaderCoincidentOffset = function (shaders, ren, actor) {\n var cp = publicAPI.getCoincidentParameters(ren, actor); // if we need an offset handle it here\n // The value of .000016 is suitable for depth buffers\n // of at least 16 bit depth. We do not query the depth\n // right now because we would need some mechanism to\n // cache the result taking into account FBO changes etc.\n\n if (cp && (cp.factor !== 0.0 || cp.offset !== 0.0)) {\n var FSSource = shaders.Fragment;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::Coincident::Dec', ['uniform float cfactor;', 'uniform float coffset;']).result;\n\n if (model.context.getExtension('EXT_frag_depth')) {\n if (cp.factor !== 0.0) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::UniformFlow::Impl', ['float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));', '//VTK::UniformFlow::Impl'], false).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::Depth::Impl', 'gl_FragDepthEXT = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;').result;\n } else {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::Depth::Impl', 'gl_FragDepthEXT = gl_FragCoord.z + 0.000016*coffset;').result;\n }\n }\n\n if (model.openGLRenderWindow.getWebgl2()) {\n if (cp.factor !== 0.0) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::UniformFlow::Impl', ['float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));', '//VTK::UniformFlow::Impl'], false).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::Depth::Impl', 'gl_FragDepth = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;').result;\n } else {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_0__[\"default\"].substitute(FSSource, '//VTK::Depth::Impl', 'gl_FragDepth = gl_FragCoord.z + 0.000016*coffset;').result;\n }\n }\n\n shaders.Fragment = FSSource;\n }\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n implementReplaceShaderCoincidentOffset: implementReplaceShaderCoincidentOffset\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ReplacementShaderMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Shader/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Shader/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // export const SHADER_TYPES = ['Vertex', 'Fragment', 'Geometry', 'Unknown'];\n// ----------------------------------------------------------------------------\n// vtkShader methods\n// ----------------------------------------------------------------------------\n\nfunction vtkShader(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkShader');\n\n publicAPI.compile = function () {\n var stype = model.context.VERTEX_SHADER;\n\n if (!model.source || !model.source.length || model.shaderType === 'Unknown') {\n return false;\n } // Ensure we delete the previous shader if necessary.\n\n\n if (model.handle !== 0) {\n model.context.deleteShader(model.handle);\n model.handle = 0;\n }\n\n switch (model.shaderType) {\n // case vtkShader::Geometry:\n // type = GL_GEOMETRY_SHADER;\n // break;\n case 'Fragment':\n stype = model.context.FRAGMENT_SHADER;\n break;\n\n case 'Vertex':\n default:\n stype = model.context.VERTEX_SHADER;\n break;\n }\n\n model.handle = model.context.createShader(stype);\n model.context.shaderSource(model.handle, model.source);\n model.context.compileShader(model.handle);\n var isCompiled = model.context.getShaderParameter(model.handle, model.context.COMPILE_STATUS);\n\n if (!isCompiled) {\n var lastError = model.context.getShaderInfoLog(model.handle);\n vtkErrorMacro(\"Error compiling shader '\".concat(model.source, \"': \").concat(lastError));\n model.context.deleteShader(model.handle);\n model.handle = 0;\n return false;\n } // The shader compiled, store its handle and return success.\n\n\n return true;\n };\n\n publicAPI.cleanup = function () {\n if (model.shaderType === 'Unknown' || model.handle === 0) {\n return;\n }\n\n model.context.deleteShader(model.handle);\n model.handle = 0;\n model.dirty = true;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n shaderType: 'Unknown',\n source: '',\n error: '',\n handle: 0,\n dirty: false,\n context: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['shaderType', 'source', 'error', 'handle', 'context']); // Object methods\n\n vtkShader(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkShader'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Shader/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderCache/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderCache/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var blueimp_md5__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! blueimp-md5 */ \"./node_modules/blueimp-md5/js/md5.js\");\n/* harmony import */ var blueimp_md5__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(blueimp_md5__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n\n\n // ----------------------------------------------------------------------------\n\nvar SET_GET_FIELDS = ['lastShaderBound', 'context', 'openGLRenderWindow']; // ----------------------------------------------------------------------------\n// vtkShaderCache methods\n// ----------------------------------------------------------------------------\n\nfunction vtkShaderCache(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkShaderCache');\n\n publicAPI.replaceShaderValues = function (VSSource, FSSource, GSSource) {\n // first handle renaming any Fragment shader inputs\n // if we have a geometry shader. By default fragment shaders\n // assume their inputs come from a Vertex Shader. When we\n // have a Geometry shader we rename the frament shader inputs\n // to come from the geometry shader\n var nFSSource = FSSource;\n\n if (GSSource.length > 0) {\n nFSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(nFSSource, 'VSOut', 'GSOut').result;\n }\n\n var gl2 = model.openGLRenderWindow.getWebgl2();\n var fragDepthString = '\\n';\n var version = '#version 100\\n';\n\n if (gl2) {\n version = '#version 300 es\\n' + '#define attribute in\\n' + '#define textureCube texture\\n' + '#define texture2D texture\\n' + '#define textureCubeLod textureLod\\n' + '#define texture2DLod textureLod\\n';\n } else {\n model.context.getExtension('OES_standard_derivatives');\n\n if (model.context.getExtension('EXT_frag_depth')) {\n fragDepthString = '#extension GL_EXT_frag_depth : enable\\n';\n }\n\n if (model.context.getExtension('EXT_shader_texture_lod')) {\n fragDepthString += '#extension GL_EXT_shader_texture_lod : enable\\n' + '#define textureCubeLod textureCubeLodEXT\\n' + '#define texture2DLod texture2DLodEXT';\n }\n }\n\n nFSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(nFSSource, '//VTK::System::Dec', [\"\".concat(version, \"\\n\"), gl2 ? '' : '#extension GL_OES_standard_derivatives : enable\\n', fragDepthString, '#ifdef GL_FRAGMENT_PRECISION_HIGH', 'precision highp float;', 'precision highp int;', '#else', 'precision mediump float;', 'precision mediump int;', '#endif']).result;\n var nVSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(VSSource, '//VTK::System::Dec', [\"\".concat(version, \"\\n\"), '#ifdef GL_FRAGMENT_PRECISION_HIGH', 'precision highp float;', 'precision highp int;', '#else', 'precision mediump float;', 'precision mediump int;', '#endif']).result;\n\n if (gl2) {\n nVSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(nVSSource, 'varying', 'out').result;\n nFSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(nFSSource, 'varying', 'in').result;\n nFSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(nFSSource, 'gl_FragData\\\\[0\\\\]', 'fragOutput0').result;\n nFSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(nFSSource, '//VTK::Output::Dec', 'layout(location = 0) out vec4 fragOutput0;').result;\n } // nFSSource = ShaderProgram.substitute(nFSSource, 'gl_FragData\\\\[0\\\\]',\n // 'gl_FragColor').result;\n\n\n var nGSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].substitute(GSSource, '//VTK::System::Dec', version).result;\n return {\n VSSource: nVSSource,\n FSSource: nFSSource,\n GSSource: nGSSource\n };\n }; // return NULL if there is an issue\n\n\n publicAPI.readyShaderProgramArray = function (vertexCode, fragmentCode, geometryCode) {\n var data = publicAPI.replaceShaderValues(vertexCode, fragmentCode, geometryCode);\n var shader = publicAPI.getShaderProgram(data.VSSource, data.FSSource, data.GSSource);\n return publicAPI.readyShaderProgram(shader);\n };\n\n publicAPI.readyShaderProgram = function (shader) {\n if (!shader) {\n return null;\n } // compile if needed\n\n\n if (!shader.getCompiled() && !shader.compileShader()) {\n return null;\n } // bind if needed\n\n\n if (!publicAPI.bindShader(shader)) {\n return null;\n }\n\n return shader;\n };\n\n publicAPI.getShaderProgram = function (vertexCode, fragmentCode, geometryCode) {\n // compute the MD5 and the check the map\n var hashInput = \"\".concat(vertexCode).concat(fragmentCode).concat(geometryCode);\n var result = blueimp_md5__WEBPACK_IMPORTED_MODULE_0___default()(hashInput); // does it already exist?\n\n var loc = Object.keys(model.shaderPrograms).indexOf(result);\n\n if (loc === -1) {\n // create one\n var sps = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n sps.setContext(model.context);\n sps.getVertexShader().setSource(vertexCode);\n sps.getFragmentShader().setSource(fragmentCode);\n\n if (geometryCode) {\n sps.getGeometryShader().setSource(geometryCode);\n }\n\n sps.setMd5Hash(result);\n model.shaderPrograms[result] = sps;\n return sps;\n }\n\n return model.shaderPrograms[result];\n };\n\n publicAPI.releaseGraphicsResources = function (win) {\n // NOTE:\n // In the current implementation as of October 26th, if a shader\n // program is created by ShaderCache then it should make sure\n // that it releases the graphics resources used by these programs.\n // It is not wisely for callers to do that since then they would\n // have to loop over all the programs were in use and invoke\n // release graphics resources individually.\n publicAPI.releaseCurrentShader();\n Object.keys(model.shaderPrograms).map(function (key) {\n return model.shaderPrograms[key];\n }).forEach(function (sp) {\n return sp.releaseGraphicsResources(win);\n });\n };\n\n publicAPI.releaseGraphicsResources = function () {\n // release prior shader\n if (model.astShaderBound) {\n model.lastShaderBound.release();\n model.lastShaderBound = null;\n }\n };\n\n publicAPI.bindShader = function (shader) {\n if (model.lastShaderBound === shader) {\n return 1;\n } // release prior shader\n\n\n if (model.lastShaderBound) {\n model.lastShaderBound.release();\n }\n\n shader.bind();\n model.lastShaderBound = shader;\n return 1;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n lastShaderBound: null,\n shaderPrograms: null,\n context: null,\n openGLRenderWindow: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Internal objects\n\n model.shaderPrograms = {}; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, SET_GET_FIELDS); // Object methods\n\n vtkShaderCache(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkShaderCache'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderCache/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js ***! - \*****************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Shader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Shader */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Shader/index.js\");\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // perform in place string substitutions, indicate if a substitution was done\n// this is useful for building up shader strings which typically involve\n// lots of string substitutions. Return true if a substitution was done.\n\nfunction substitute(source, search, replace) {\n var all = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var replaceStr = Array.isArray(replace) ? replace.join('\\n') : replace;\n var replaced = false;\n\n if (source.search(search) !== -1) {\n replaced = true;\n }\n\n var gflag = '';\n\n if (all) {\n gflag = 'g';\n }\n\n var regex = new RegExp(search, gflag);\n var resultstr = source.replace(regex, replaceStr);\n return {\n replace: replaced,\n result: resultstr\n };\n} // ----------------------------------------------------------------------------\n// vtkShaderProgram methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkShaderProgram(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkShaderProgram');\n\n publicAPI.compileShader = function () {\n if (!model.vertexShader.compile()) {\n vtkErrorMacro(model.vertexShader.getSource().split('\\n').map(function (line, index) {\n return \"\".concat(index, \": \").concat(line);\n }).join('\\n'));\n vtkErrorMacro(model.vertexShader.getError());\n return 0;\n }\n\n if (!model.fragmentShader.compile()) {\n vtkErrorMacro(model.fragmentShader.getSource().split('\\n').map(function (line, index) {\n return \"\".concat(index, \": \").concat(line);\n }).join('\\n'));\n vtkErrorMacro(model.fragmentShader.getError());\n return 0;\n } // skip geometry for now\n\n\n if (!publicAPI.attachShader(model.vertexShader)) {\n vtkErrorMacro(model.error);\n return 0;\n }\n\n if (!publicAPI.attachShader(model.fragmentShader)) {\n vtkErrorMacro(model.error);\n return 0;\n }\n\n if (!publicAPI.link()) {\n vtkErrorMacro(\"Links failed: \".concat(model.error));\n return 0;\n }\n\n publicAPI.setCompiled(true);\n return 1;\n };\n\n publicAPI.cleanup = function () {\n if (model.shaderType === 'Unknown' || model.handle === 0) {\n return;\n }\n\n model.context.deleteShader(model.handle);\n model.handle = 0;\n };\n\n publicAPI.bind = function () {\n if (!model.linked && !publicAPI.link()) {\n return false;\n }\n\n model.context.useProgram(model.handle);\n publicAPI.setBound(true);\n return true;\n };\n\n publicAPI.isBound = function () {\n return !!model.bound;\n };\n\n publicAPI.release = function () {\n model.context.useProgram(null);\n publicAPI.setBound(false);\n };\n\n publicAPI.setContext = function (ctx) {\n model.vertexShader.setContext(ctx);\n model.fragmentShader.setContext(ctx);\n model.geometryShader.setContext(ctx);\n };\n\n publicAPI.link = function () {\n if (model.inked) {\n return true;\n }\n\n if (model.handle === 0) {\n model.error = 'Program has not been initialized, and/or does not have shaders.';\n return false;\n } // clear out the list of uniforms used\n\n\n model.uniformLocs = {};\n model.context.linkProgram(model.handle);\n var isCompiled = model.context.getProgramParameter(model.handle, model.context.LINK_STATUS);\n\n if (!isCompiled) {\n var lastError = model.context.getProgramInfoLog(model.handle);\n vtkErrorMacro(\"Error linking shader \".concat(lastError));\n model.handle = 0;\n return false;\n }\n\n publicAPI.setLinked(true);\n model.attributeLocs = {};\n return true;\n };\n\n publicAPI.setUniformMatrix = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n var f32 = new Float32Array(v);\n model.context.uniformMatrix4fv(location, false, f32);\n return true;\n };\n\n publicAPI.setUniformMatrix3x3 = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n var f32 = new Float32Array(v);\n model.context.uniformMatrix3fv(location, false, f32);\n return true;\n };\n\n publicAPI.setUniformf = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform1f(location, v);\n return true;\n };\n\n publicAPI.setUniformfv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform1fv(location, v);\n return true;\n };\n\n publicAPI.setUniformi = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform1i(location, v);\n return true;\n };\n\n publicAPI.setUniformiv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform1iv(location, v);\n return true;\n };\n\n publicAPI.setUniform2f = function (name, v1, v2) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n if (v2 === undefined) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform2f(location, v1, v2);\n return true;\n };\n\n publicAPI.setUniform2fv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform2fv(location, v);\n return true;\n };\n\n publicAPI.setUniform2i = function (name, v1, v2) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n if (v2 === undefined) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform2i(location, v1, v2);\n return true;\n };\n\n publicAPI.setUniform2iv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform2iv(location, v);\n return true;\n };\n\n publicAPI.setUniform3f = function (name, a1, a2, a3) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n if (a3 === undefined) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform3f(location, a1, a2, a3);\n return true;\n };\n\n publicAPI.setUniform3fArray = function (name, a) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n if (!Array.isArray(a) || a.length !== 3) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform3f(location, a[0], a[1], a[2]);\n return true;\n };\n\n publicAPI.setUniform3fv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform3fv(location, v);\n return true;\n };\n\n publicAPI.setUniform3i = function (name) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var array = args; // allow an array passed as a single argument\n\n if (array.length === 1 && Array.isArray(array[0])) {\n array = array[0];\n }\n\n if (array.length !== 3) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform3i(location, array[0], array[1], array[2]);\n return true;\n };\n\n publicAPI.setUniform3iv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform3iv(location, v);\n return true;\n };\n\n publicAPI.setUniform4f = function (name) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n var array = args; // allow an array passed as a single argument\n\n if (array.length === 1 && Array.isArray(array[0])) {\n array = array[0];\n }\n\n if (array.length !== 4) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform4f(location, array[0], array[1], array[2], array[3]);\n return true;\n };\n\n publicAPI.setUniform4fv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform4fv(location, v);\n return true;\n };\n\n publicAPI.setUniform4i = function (name) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n\n var array = args; // allow an array passed as a single argument\n\n if (array.length === 1 && Array.isArray(array[0])) {\n array = array[0];\n }\n\n if (array.length !== 4) {\n throw new RangeError('Invalid number of values for array');\n }\n\n model.context.uniform4i(location, array[0], array[1], array[2], array[3]);\n return true;\n };\n\n publicAPI.setUniform4iv = function (name, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform4iv(location, v);\n return true;\n };\n\n publicAPI.setUniform4fv = function (name, count, v) {\n var location = publicAPI.findUniform(name);\n\n if (location === -1) {\n model.error = \"Could not set uniform \".concat(name, \" . No such uniform.\");\n return false;\n }\n\n model.context.uniform4fv(location, v);\n return true;\n };\n\n publicAPI.findUniform = function (name) {\n if (!name || !model.linked) {\n return -1;\n } // see if we have cached the result\n\n\n var loc = model.uniformLocs[name];\n\n if (loc !== undefined) {\n return loc;\n }\n\n loc = model.context.getUniformLocation(model.handle, name);\n\n if (loc === null) {\n model.error = \"Uniform \".concat(name, \" not found in current shader program.\");\n model.uniformLocs[name] = -1;\n return -1;\n }\n\n model.uniformLocs[name] = loc;\n return loc;\n };\n\n publicAPI.isUniformUsed = function (name) {\n if (!name) {\n return false;\n } // see if we have cached the result\n\n\n var loc = model.uniformLocs[name];\n\n if (loc !== undefined) {\n return loc !== null;\n }\n\n if (!model.linked) {\n vtkErrorMacro('attempt to find uniform when the shader program is not linked');\n return false;\n }\n\n loc = model.context.getUniformLocation(model.handle, name);\n model.uniformLocs[name] = loc;\n\n if (loc === null) {\n return false;\n }\n\n return true;\n };\n\n publicAPI.isAttributeUsed = function (name) {\n if (!name) {\n return false;\n } // see if we have cached the result\n\n\n var loc = Object.keys(model.attributeLocs).indexOf(name);\n\n if (loc !== -1) {\n return true;\n }\n\n if (!model.linked) {\n vtkErrorMacro('attempt to find uniform when the shader program is not linked');\n return false;\n }\n\n loc = model.context.getAttribLocation(model.handle, name);\n\n if (loc === -1) {\n return false;\n }\n\n model.attributeLocs[name] = loc;\n return true;\n };\n\n publicAPI.attachShader = function (shader) {\n if (shader.getHandle() === 0) {\n model.error = 'Shader object was not initialized, cannot attach it.';\n return false;\n }\n\n if (shader.getShaderType() === 'Unknown') {\n model.error = 'Shader object is of type Unknown and cannot be used.';\n return false;\n }\n\n if (model.handle === 0) {\n var thandle = model.context.createProgram();\n\n if (thandle === 0) {\n model.error = 'Could not create shader program.';\n return false;\n }\n\n model.handle = thandle;\n model.linked = false;\n }\n\n if (shader.getShaderType() === 'Vertex') {\n if (model.vertexShaderHandle !== 0) {\n model.comntext.detachShader(model.handle, model.vertexShaderHandle);\n }\n\n model.vertexShaderHandle = shader.getHandle();\n }\n\n if (shader.getShaderType() === 'Fragment') {\n if (model.fragmentShaderHandle !== 0) {\n model.context.detachShader(model.handle, model.fragmentShaderHandle);\n }\n\n model.fragmentShaderHandle = shader.getHandle();\n }\n\n model.context.attachShader(model.handle, shader.getHandle());\n publicAPI.setLinked(false);\n return true;\n };\n\n publicAPI.detachShader = function (shader) {\n if (shader.getHandle() === 0) {\n model.error = 'shader object was not initialized, cannot attach it.';\n return false;\n }\n\n if (shader.getShaderType() === 'Unknown') {\n model.error = 'Shader object is of type Unknown and cannot be used.';\n return false;\n }\n\n if (model.handle === 0) {\n model.error = 'This shader program has not been initialized yet.';\n }\n\n switch (shader.getShaderType()) {\n case 'Vertex':\n if (model.vertexShaderHandle !== shader.getHandle()) {\n model.error = 'The supplied shader was not attached to this program.';\n return false;\n }\n\n model.context.detachShader(model.handle, shader.getHandle());\n model.vertexShaderHandle = 0;\n model.linked = false;\n return true;\n\n case 'Fragment':\n if (model.fragmentShaderHandle !== shader.getHandle()) {\n model.error = 'The supplied shader was not attached to this program.';\n return false;\n }\n\n model.context.detachShader(model.handle, shader.getHandle());\n model.fragmentShaderHandle = 0;\n model.linked = false;\n return true;\n\n default:\n return false;\n }\n };\n\n publicAPI.setContext = function (ctx) {\n model.context = ctx;\n model.vertexShader.setContext(ctx);\n model.fragmentShader.setContext(ctx);\n model.geometryShader.setContext(ctx);\n };\n\n publicAPI.setLastCameraMTime = function (mtime) {\n model.lastCameraMTime = mtime;\n }; // publicAPI.enableAttributeArray = (name) => {\n // const location = publicAPI.findAttributeArray(name);\n // if (location === -1) {\n // model.error = `Could not enable attribute ${name} No such attribute.`;\n // return false;\n // }\n // model.context.enableVertexAttribArray(location);\n // return true;\n // };\n // publicAPI.disableAttributeArray = (name) => {\n // const location = publicAPI.findAttributeArray(name);\n // if (location === -1) {\n // model.error = `Could not enable attribute ${name} No such attribute.`;\n // return false;\n // }\n // model.context.disableVertexAttribArray(location);\n // return true;\n // };\n\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n vertexShaderHandle: 0,\n fragmentShaderHandle: 0,\n geometryShaderHandle: 0,\n vertexShader: null,\n fragmentShader: null,\n geometryShader: null,\n linked: false,\n bound: false,\n compiled: false,\n error: '',\n handle: 0,\n numberOfOutputs: 0,\n attributesLocs: null,\n uniformLocs: null,\n md5Hash: 0,\n context: null,\n lastCameraMTime: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Instantiate internal objects\n\n model.attributesLocs = {};\n model.uniformLocs = {};\n model.vertexShader = vtk_js_Sources_Rendering_OpenGL_Shader__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.vertexShader.setShaderType('Vertex');\n model.fragmentShader = vtk_js_Sources_Rendering_OpenGL_Shader__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.fragmentShader.setShaderType('Fragment');\n model.geometryShader = vtk_js_Sources_Rendering_OpenGL_Shader__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.geometryShader.setShaderType('Geometry'); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['lastCameraMTime']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['error', 'handle', 'compiled', 'bound', 'md5Hash', 'vertexShader', 'fragmentShader', 'geometryShader', 'linked']); // Object methods\n\n vtkShaderProgram(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkShaderProgram'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n substitute: substitute\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Skybox/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Skybox/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Helper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"]; // ----------------------------------------------------------------------------\n// vtkOpenGLSkybox methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLSkybox(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLSkybox'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n model.openGLRenderWindow = model.openGLRenderer.getParent();\n model.context = model.openGLRenderWindow.getContext();\n model.tris.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.openGLTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n var ren = model.openGLRenderer.getRenderable();\n model.openGLCamera = model.openGLRenderer.getViewNodeFor(ren.getActiveCamera());\n }\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n renderPass.incrementOpaqueActorCount();\n }\n };\n\n publicAPI.opaquePass = function (prepass, renderPass) {\n if (prepass && !model.openGLRenderer.getSelector()) {\n publicAPI.updateBufferObjects();\n model.openGLRenderWindow.enableDepthMask();\n model.openGLRenderWindow.getShaderCache().readyShaderProgram(model.tris.getProgram());\n model.openGLTexture.render(model.openGLRenderWindow);\n var texUnit = model.openGLTexture.getTextureUnit();\n model.tris.getProgram().setUniformi('sbtexture', texUnit);\n var ren = model.openGLRenderer.getRenderable();\n var keyMats = model.openGLCamera.getKeyMatrices(ren);\n var imat = new Float64Array(16);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(imat, keyMats.wcpc);\n model.tris.getProgram().setUniformMatrix('IMCPCMatrix', imat);\n\n if (model.lastFormat === 'box') {\n var camPos = ren.getActiveCamera().getPosition();\n model.tris.getProgram().setUniform3f('camPos', camPos[0], camPos[1], camPos[2]);\n }\n\n model.tris.getVAO().bind(); // draw polygons\n\n model.context.drawArrays(model.context.TRIANGLES, 0, model.tris.getCABO().getElementCount());\n model.tris.getVAO().release();\n model.openGLTexture.deactivate();\n }\n };\n\n publicAPI.updateBufferObjects = function () {\n // build the VBO if needed, only happens once\n if (!model.tris.getCABO().getElementCount()) {\n var ptsArray = new Float32Array(12);\n\n for (var i = 0; i < 4; i++) {\n ptsArray[i * 3] = i % 2 * 2 - 1.0;\n ptsArray[i * 3 + 1] = i > 1 ? 1.0 : -1.0;\n ptsArray[i * 3 + 2] = 1.0;\n }\n\n var points = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 3,\n values: ptsArray\n });\n points.setName('points');\n var cellArray = new Uint16Array(8);\n cellArray[0] = 3;\n cellArray[1] = 0;\n cellArray[2] = 1;\n cellArray[3] = 3;\n cellArray[4] = 3;\n cellArray[5] = 0;\n cellArray[6] = 3;\n cellArray[7] = 2;\n var cells = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 1,\n values: cellArray\n });\n model.tris.getCABO().createVBO(cells, 'polys', vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_6__[\"Representation\"].SURFACE, {\n points: points,\n cellOffset: 0\n });\n } // update the program?\n\n\n if (model.renderable.getFormat() !== model.lastFormat) {\n model.lastFormat = model.renderable.getFormat();\n\n if (model.lastFormat === 'box') {\n // we invert Y below because opengl is messed up!\n // Cube Maps have been specified to follow the RenderMan\n // specification (for whatever reason), and RenderMan\n // assumes the images' origin being in the upper left,\n // contrary to the usual OpenGL behaviour of having the\n // image origin in the lower left. That's why things get\n // swapped in the Y direction. It totally breaks with the usual\n // OpenGL semantics and doesn't make sense at all.\n // But now we're stuck with it. From\n // https://stackoverflow.com/questions/11685608/convention-of-faces-in-opengl-cubemapping\n //\n model.tris.setProgram(model.openGLRenderWindow.getShaderCache().readyShaderProgramArray(\"//VTK::System::Dec\\n attribute vec3 vertexMC;\\n uniform mat4 IMCPCMatrix;\\n varying vec3 TexCoords;\\n void main () {\\n gl_Position = vec4(vertexMC.xyz, 1.0);\\n vec4 wpos = IMCPCMatrix * gl_Position;\\n TexCoords = wpos.xyz/wpos.w;\\n }\", \"//VTK::System::Dec\\n //VTK::Output::Dec\\n varying vec3 TexCoords;\\n uniform samplerCube sbtexture;\\n uniform vec3 camPos;\\n void main () {\\n // skybox looks from inside out\\n // which means we have to adjust\\n // our tcoords. Otherwise text would\\n // be flipped\\n vec3 tc = normalize(TexCoords - camPos);\\n if (abs(tc.z) < max(abs(tc.x),abs(tc.y)))\\n {\\n tc = vec3(1.0, 1.0, -1.0) * tc;\\n }\\n else\\n {\\n tc = vec3(-1.0, 1.0, 1.0) * tc;\\n }\\n gl_FragData[0] = textureCube(sbtexture, tc);\\n }\", ''));\n }\n\n if (model.lastFormat === 'background') {\n // maps the texture to the window\n model.tris.setProgram(model.openGLRenderWindow.getShaderCache().readyShaderProgramArray(\"//VTK::System::Dec\\n attribute vec3 vertexMC;\\n uniform mat4 IMCPCMatrix;\\n varying vec2 TexCoords;\\n void main () {\\n gl_Position = vec4(vertexMC.xyz, 1.0);\\n vec4 wpos = IMCPCMatrix * gl_Position;\\n TexCoords = vec2(vertexMC.x, vertexMC.y)*0.5 + 0.5;\\n }\", \"//VTK::System::Dec\\n //VTK::Output::Dec\\n varying vec2 TexCoords;\\n uniform sampler2D sbtexture;\\n void main () {\\n gl_FragData[0] = texture2D(sbtexture, TexCoords);\\n }\", ''));\n }\n\n model.tris.getShaderSourceTime().modified();\n model.tris.getVAO().bind();\n\n if (!model.tris.getVAO().addAttributeArray(model.tris.getProgram(), model.tris.getCABO(), 'vertexMC', model.tris.getCABO().getVertexOffset(), model.tris.getCABO().getStride(), model.context.FLOAT, 3, model.context.FALSE)) {\n vtkErrorMacro('Error setting vertexMC in shader VAO.');\n }\n } // set/update the texture map if needed\n\n\n var tmaps = model.renderable.getTextures();\n\n if (!tmaps.length) {\n vtkErrorMacro('vtkSkybox requires a texture map');\n }\n\n if (model.openGLTexture.getRenderable() !== tmaps[0]) {\n model.openGLTexture.releaseGraphicsResources(model.openGLRenderWindow);\n model.openGLTexture.setRenderable(tmaps[0]);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_4__[\"default\"].extend(publicAPI, model, initialValues);\n model.openGLTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n model.tris = vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.keyMatrixTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.keyMatrixTime, {\n mtime: 0\n });\n model.keyMatrices = {\n normalMatrix: gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(new Float64Array(9)),\n mcwc: gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16))\n }; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['context']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"get\"](publicAPI, model, ['activeTextures']); // Object methods\n\n vtkOpenGLSkybox(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_7__[\"registerOverride\"])('vtkSkybox', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Skybox/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js ***! - \***************************************************************************/ -/*! exports provided: Wrap, Filter, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Wrap\", function() { return Wrap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Filter\", function() { return Filter; });\nvar Wrap = {\n CLAMP_TO_EDGE: 0,\n REPEAT: 1,\n MIRRORED_REPEAT: 2\n};\nvar Filter = {\n NEAREST: 0,\n LINEAR: 1,\n NEAREST_MIPMAP_NEAREST: 2,\n NEAREST_MIPMAP_LINEAR: 3,\n LINEAR_MIPMAP_NEAREST: 4,\n LINEAR_MIPMAP_LINEAR: 5\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n Wrap: Wrap,\n Filter: Filter\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js ***! - \***********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n\nvar Wrap = vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Wrap,\n Filter = vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Filter;\nvar VtkDataTypes = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].VtkDataTypes;\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkDebugMacro\"],\n vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkErrorMacro\"],\n vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkWarningMacro\"]; // ----------------------------------------------------------------------------\n// vtkOpenGLTexture methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLTexture(publicAPI, model) {\n var _this = this;\n\n // Set our className\n model.classHierarchy.push('vtkOpenGLTexture'); // Renders myself\n\n publicAPI.render = function () {\n var renWin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n if (renWin) {\n model.openGLRenderWindow = renWin;\n } else {\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer'); // sync renderable properties\n\n model.openGLRenderWindow = model.openGLRenderer.getParent();\n }\n\n model.context = model.openGLRenderWindow.getContext();\n\n if (model.renderable.getInterpolate()) {\n if (model.generateMipmap) {\n publicAPI.setMinificationFilter(Filter.LINEAR_MIPMAP_LINEAR);\n } else {\n publicAPI.setMinificationFilter(Filter.LINEAR);\n }\n\n publicAPI.setMagnificationFilter(Filter.LINEAR);\n } else {\n publicAPI.setMinificationFilter(Filter.NEAREST);\n publicAPI.setMagnificationFilter(Filter.NEAREST);\n }\n\n if (model.renderable.getRepeat()) {\n publicAPI.setWrapR(Wrap.REPEAT);\n publicAPI.setWrapS(Wrap.REPEAT);\n publicAPI.setWrapT(Wrap.REPEAT);\n } // clear image if input data is set\n\n\n if (model.renderable.getInputData()) {\n model.renderable.setImage(null);\n } // create the texture if it is not done already\n\n\n if (!model.handle || model.renderable.getMTime() > model.textureBuildTime.getMTime()) {\n // if we have an Image\n if (model.renderable.getImage() !== null) {\n if (model.renderable.getInterpolate()) {\n model.generateMipmap = true;\n publicAPI.setMinificationFilter(Filter.LINEAR_MIPMAP_LINEAR);\n } // Have an Image which may not be complete\n\n\n if (model.renderable.getImage() && model.renderable.getImageLoaded()) {\n publicAPI.create2DFromImage(model.renderable.getImage());\n publicAPI.activate();\n publicAPI.sendParameters();\n model.textureBuildTime.modified();\n }\n } // if we have Inputdata\n\n\n var input = model.renderable.getInputData(0);\n\n if (input && input.getPointData().getScalars()) {\n var ext = input.getExtent();\n var inScalars = input.getPointData().getScalars(); // do we have a cube map? Six inputs\n\n var data = [];\n\n for (var i = 0; i < model.renderable.getNumberOfInputPorts(); ++i) {\n var indata = model.renderable.getInputData(i);\n var scalars = indata ? indata.getPointData().getScalars().getData() : null;\n\n if (scalars) {\n data.push(scalars);\n }\n }\n\n if (model.renderable.getInterpolate() && inScalars.getNumberOfComponents() === 4) {\n model.generateMipmap = true;\n publicAPI.setMinificationFilter(Filter.LINEAR_MIPMAP_LINEAR);\n }\n\n if (data.length % 6 === 0) {\n publicAPI.createCubeFromRaw(ext[1] - ext[0] + 1, ext[3] - ext[2] + 1, inScalars.getNumberOfComponents(), inScalars.getDataType(), data);\n } else {\n publicAPI.create2DFromRaw(ext[1] - ext[0] + 1, ext[3] - ext[2] + 1, inScalars.getNumberOfComponents(), inScalars.getDataType(), inScalars.getData());\n }\n\n publicAPI.activate();\n publicAPI.sendParameters();\n model.textureBuildTime.modified();\n }\n }\n\n if (model.handle) {\n publicAPI.activate();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.destroyTexture = function () {\n // deactivate it first\n publicAPI.deactivate();\n\n if (model.context && model.handle) {\n model.context.deleteTexture(model.handle);\n }\n\n model.handle = 0;\n model.numberOfDimensions = 0;\n model.target = 0;\n model.components = 0;\n model.width = 0;\n model.height = 0;\n model.depth = 0;\n publicAPI.resetFormatAndType();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.createTexture = function () {\n // reuse the existing handle if we have one\n if (!model.handle) {\n model.handle = model.context.createTexture();\n\n if (model.target) {\n model.context.bindTexture(model.target, model.handle); // See: http://www.openmodel.context..org/wiki/Common_Mistakes#Creating_a_complete_texture\n // turn off mip map filter or set the base and max level correctly. here\n // both are done.\n\n model.context.texParameteri(model.target, model.context.TEXTURE_MIN_FILTER, publicAPI.getOpenGLFilterMode(model.minificationFilter));\n model.context.texParameteri(model.target, model.context.TEXTURE_MAG_FILTER, publicAPI.getOpenGLFilterMode(model.magnificationFilter));\n model.context.texParameteri(model.target, model.context.TEXTURE_WRAP_S, publicAPI.getOpenGLWrapMode(model.wrapS));\n model.context.texParameteri(model.target, model.context.TEXTURE_WRAP_T, publicAPI.getOpenGLWrapMode(model.wrapT));\n\n if (model.openGLRenderWindow.getWebgl2()) {\n model.context.texParameteri(model.target, model.context.TEXTURE_WRAP_R, publicAPI.getOpenGLWrapMode(model.wrapR));\n }\n\n model.context.bindTexture(model.target, null);\n }\n }\n }; //---------------------------------------------------------------------------\n\n\n publicAPI.getTextureUnit = function () {\n if (model.openGLRenderWindow) {\n return model.openGLRenderWindow.getTextureUnitForTexture(publicAPI);\n }\n\n return -1;\n }; //---------------------------------------------------------------------------\n\n\n publicAPI.activate = function () {\n // activate a free texture unit for this texture\n model.openGLRenderWindow.activateTexture(publicAPI);\n publicAPI.bind();\n }; //---------------------------------------------------------------------------\n\n\n publicAPI.deactivate = function () {\n if (model.openGLRenderWindow) {\n model.openGLRenderWindow.deactivateTexture(publicAPI);\n }\n }; //---------------------------------------------------------------------------\n\n\n publicAPI.releaseGraphicsResources = function (rwin) {\n if (rwin && model.handle) {\n rwin.activateTexture(publicAPI);\n rwin.deactivateTexture(publicAPI);\n model.context.deleteTexture(model.handle);\n model.handle = 0;\n model.numberOfDimensions = 0;\n model.target = 0;\n model.internalFormat = 0;\n model.format = 0;\n model.openGLDataType = 0;\n model.components = 0;\n model.width = 0;\n model.height = 0;\n model.depth = 0;\n }\n\n if (model.shaderProgram) {\n model.shaderProgram.releaseGraphicsResources(rwin);\n model.shaderProgram = null;\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.bind = function () {\n model.context.bindTexture(model.target, model.handle);\n\n if (model.autoParameters && publicAPI.getMTime() > model.sendParametersTime.getMTime()) {\n publicAPI.sendParameters();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.isBound = function () {\n var result = false;\n\n if (model.context && model.handle) {\n var target = 0;\n\n switch (model.target) {\n case model.context.TEXTURE_2D:\n target = model.context.TEXTURE_BINDING_2D;\n break;\n\n default:\n vtkWarningMacro('impossible case');\n break;\n }\n\n var oid = model.context.getIntegerv(target);\n result = oid === model.handle;\n }\n\n return result;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.sendParameters = function () {\n model.context.texParameteri(model.target, model.context.TEXTURE_WRAP_S, publicAPI.getOpenGLWrapMode(model.wrapS));\n model.context.texParameteri(model.target, model.context.TEXTURE_WRAP_T, publicAPI.getOpenGLWrapMode(model.wrapT));\n\n if (model.openGLRenderWindow.getWebgl2()) {\n model.context.texParameteri(model.target, model.context.TEXTURE_WRAP_R, publicAPI.getOpenGLWrapMode(model.wrapR));\n }\n\n model.context.texParameteri(model.target, model.context.TEXTURE_MIN_FILTER, publicAPI.getOpenGLFilterMode(model.minificationFilter));\n model.context.texParameteri(model.target, model.context.TEXTURE_MAG_FILTER, publicAPI.getOpenGLFilterMode(model.magnificationFilter));\n\n if (model.openGLRenderWindow.getWebgl2()) {\n model.context.texParameteri(model.target, model.context.TEXTURE_BASE_LEVEL, model.baseLevel);\n model.context.texParameteri(model.target, model.context.TEXTURE_MAX_LEVEL, model.maxLevel);\n } // model.context.texParameterf(model.target, model.context.TEXTURE_MIN_LOD, model.minLOD);\n // model.context.texParameterf(model.target, model.context.TEXTURE_MAX_LOD, model.maxLOD);\n\n\n model.sendParametersTime.modified();\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getInternalFormat = function (vtktype, numComps) {\n if (!model.internalFormat) {\n model.internalFormat = publicAPI.getDefaultInternalFormat(vtktype, numComps);\n }\n\n if (!model.internalFormat) {\n vtkDebugMacro(\"Unable to find suitable internal format for T=\".concat(vtktype, \" NC= \").concat(numComps));\n }\n\n return model.internalFormat;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getDefaultInternalFormat = function (vtktype, numComps) {\n var result = 0; // try default next\n\n result = model.openGLRenderWindow.getDefaultTextureInternalFormat(vtktype, numComps, false);\n\n if (result) {\n return result;\n } // try floating point\n\n\n result = _this.openGLRenderWindow.getDefaultTextureInternalFormat(vtktype, numComps, true);\n\n if (!result) {\n vtkDebugMacro('Unsupported internal texture type!');\n vtkDebugMacro(\"Unable to find suitable internal format for T=\".concat(vtktype, \" NC= \").concat(numComps));\n }\n\n return result;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.setInternalFormat = function (iFormat) {\n if (iFormat !== model.internalFormat) {\n model.internalFormat = iFormat;\n publicAPI.modified();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getFormat = function (vtktype, numComps) {\n model.format = publicAPI.getDefaultFormat(vtktype, numComps);\n return model.format;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getDefaultFormat = function (vtktype, numComps) {\n if (model.openGLRenderWindow.getWebgl2()) {\n switch (numComps) {\n case 1:\n return model.context.RED;\n\n case 2:\n return model.context.RG;\n\n case 3:\n return model.context.RGB;\n\n case 4:\n return model.context.RGBA;\n\n default:\n return model.context.RGB;\n }\n } else {\n // webgl1\n switch (numComps) {\n case 1:\n return model.context.LUMINANCE;\n\n case 2:\n return model.context.LUMINANCE_ALPHA;\n\n case 3:\n return model.context.RGB;\n\n case 4:\n return model.context.RGBA;\n\n default:\n return model.context.RGB;\n }\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.resetFormatAndType = function () {\n model.format = 0;\n model.internalFormat = 0;\n model.openGLDataType = 0;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getDefaultDataType = function (vtkScalarType) {\n // DON'T DEAL with VTK_CHAR as this is platform dependent.\n if (model.openGLRenderWindow.getWebgl2()) {\n switch (vtkScalarType) {\n // case VtkDataTypes.SIGNED_CHAR:\n // return model.context.BYTE;\n case VtkDataTypes.UNSIGNED_CHAR:\n return model.context.UNSIGNED_BYTE;\n // case VtkDataTypes.SHORT:\n // return model.context.SHORT;\n // case VtkDataTypes.UNSIGNED_SHORT:\n // return model.context.UNSIGNED_SHORT;\n // case VtkDataTypes.INT:\n // return model.context.INT;\n // case VtkDataTypes.UNSIGNED_INT:\n // return model.context.UNSIGNED_INT;\n\n case VtkDataTypes.FLOAT:\n case VtkDataTypes.VOID: // used for depth component textures.\n\n default:\n return model.context.FLOAT;\n }\n }\n\n switch (vtkScalarType) {\n // case VtkDataTypes.SIGNED_CHAR:\n // return model.context.BYTE;\n case VtkDataTypes.UNSIGNED_CHAR:\n return model.context.UNSIGNED_BYTE;\n // case VtkDataTypes.SHORT:\n // return model.context.SHORT;\n // case VtkDataTypes.UNSIGNED_SHORT:\n // return model.context.UNSIGNED_SHORT;\n // case VtkDataTypes.INT:\n // return model.context.INT;\n // case VtkDataTypes.UNSIGNED_INT:\n // return model.context.UNSIGNED_INT;\n\n case VtkDataTypes.FLOAT:\n case VtkDataTypes.VOID: // used for depth component textures.\n\n default:\n if (model.context.getExtension('OES_texture_float') && model.context.getExtension('OES_texture_float_linear')) {\n return model.context.FLOAT;\n }\n\n return model.context.UNSIGNED_BYTE;\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getOpenGLDataType = function (vtkScalarType) {\n model.openGLDataType = publicAPI.getDefaultDataType(vtkScalarType);\n return model.openGLDataType;\n };\n\n publicAPI.getShiftAndScale = function () {\n var shift = 0.0;\n var scale = 1.0; // for all float type internal formats\n\n switch (model.openGLDataType) {\n case model.context.BYTE:\n scale = 127.5;\n shift = scale - 128.0;\n break;\n\n case model.context.UNSIGNED_BYTE:\n scale = 255.0;\n shift = 0.0;\n break;\n\n case model.context.SHORT:\n scale = 32767.5;\n shift = scale - 32768.0;\n break;\n\n case model.context.UNSIGNED_SHORT:\n scale = 65536.0;\n shift = 0.0;\n break;\n\n case model.context.INT:\n scale = 2147483647.5;\n shift = scale - 2147483648.0;\n break;\n\n case model.context.UNSIGNED_INT:\n scale = 4294967295.0;\n shift = 0.0;\n break;\n\n case model.context.FLOAT:\n default:\n break;\n }\n\n return {\n shift: shift,\n scale: scale\n };\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getOpenGLFilterMode = function (emode) {\n switch (emode) {\n case Filter.NEAREST:\n return model.context.NEAREST;\n\n case Filter.LINEAR:\n return model.context.LINEAR;\n\n case Filter.NEAREST_MIPMAP_NEAREST:\n return model.context.NEAREST_MIPMAP_NEAREST;\n\n case Filter.NEAREST_MIPMAP_LINEAR:\n return model.context.NEAREST_MIPMAP_LINEAR;\n\n case Filter.LINEAR_MIPMAP_NEAREST:\n return model.context.LINEAR_MIPMAP_NEAREST;\n\n case Filter.LINEAR_MIPMAP_LINEAR:\n return model.context.LINEAR_MIPMAP_LINEAR;\n\n default:\n return model.context.NEAREST;\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getOpenGLWrapMode = function (vtktype) {\n switch (vtktype) {\n case Wrap.CLAMP_TO_EDGE:\n return model.context.CLAMP_TO_EDGE;\n\n case Wrap.REPEAT:\n return model.context.REPEAT;\n\n case Wrap.MIRRORED_REPEAT:\n return model.context.MIRRORED_REPEAT;\n\n default:\n return model.context.CLAMP_TO_EDGE;\n }\n }; //----------------------------------------------------------------------------\n\n\n function updateArrayDataType(dataType, data) {\n var pixData = []; // if the opengl data type is float\n // then the data array must be float\n\n if (dataType !== VtkDataTypes.FLOAT && model.openGLDataType === model.context.FLOAT) {\n var pixCount = model.width * model.height * model.components;\n\n for (var idx = 0; idx < data.length; idx++) {\n var newArray = new Float32Array(pixCount);\n\n for (var i = 0; i < pixCount; i++) {\n newArray[i] = data[idx][i];\n }\n\n pixData.push(newArray);\n }\n } // if the opengl data type is ubyte\n // then the data array must be u8, we currently simply truncate the data\n\n\n if (dataType !== VtkDataTypes.UNSIGNED_CHAR && model.openGLDataType === model.context.UNSIGNED_BYTE) {\n var _pixCount = model.width * model.height * model.components;\n\n for (var _idx = 0; _idx < data.length; _idx++) {\n var _newArray = new Uint8Array(_pixCount);\n\n for (var _i = 0; _i < _pixCount; _i++) {\n _newArray[_i] = data[_idx][_i];\n }\n\n pixData.push(_newArray);\n }\n } // The output has to be filled\n\n\n if (pixData.length === 0) {\n for (var _i2 = 0; _i2 < data.length; _i2++) {\n pixData.push(data[_i2]);\n }\n }\n\n return pixData;\n } //----------------------------------------------------------------------------\n\n\n function scaleTextureToHighestPowerOfTwo(data) {\n if (model.openGLRenderWindow.getWebgl2()) {\n // No need if webGL2\n return data;\n }\n\n var pixData = [];\n var width = model.width;\n var height = model.height;\n var numComps = model.components;\n\n if (data && (!vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"isPowerOfTwo\"](width) || !vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"isPowerOfTwo\"](height))) {\n // Scale up the texture to the next highest power of two dimensions.\n var newWidth = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"nearestPowerOfTwo\"](width);\n var newHeight = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"nearestPowerOfTwo\"](height);\n var pixCount = newWidth * newHeight * model.components;\n\n for (var idx = 0; idx < data.length; idx++) {\n if (data[idx] !== null) {\n var newArray = null;\n\n switch (model.openGLDataType) {\n case model.context.FLOAT:\n newArray = new Float32Array(pixCount);\n break;\n\n default:\n case model.context.UNSIGNED_BYTE:\n newArray = new Uint8Array(pixCount);\n break;\n }\n\n var jFactor = height / newHeight;\n var iFactor = width / newWidth;\n\n for (var j = 0; j < newHeight; j++) {\n var joff = j * newWidth * numComps;\n var jidx = j * jFactor;\n var jlow = Math.floor(jidx);\n var jhi = Math.ceil(jidx);\n\n if (jhi >= height) {\n jhi = height - 1;\n }\n\n var jmix = jidx - jlow;\n var jmix1 = 1.0 - jmix;\n jlow = jlow * width * numComps;\n jhi = jhi * width * numComps;\n\n for (var i = 0; i < newWidth; i++) {\n var ioff = i * numComps;\n var iidx = i * iFactor;\n var ilow = Math.floor(iidx);\n var ihi = Math.ceil(iidx);\n\n if (ihi >= width) {\n ihi = width - 1;\n }\n\n var imix = iidx - ilow;\n ilow *= numComps;\n ihi *= numComps;\n\n for (var c = 0; c < numComps; c++) {\n newArray[joff + ioff + c] = data[idx][jlow + ilow + c] * jmix1 * (1.0 - imix) + data[idx][jlow + ihi + c] * jmix1 * imix + data[idx][jhi + ilow + c] * jmix * (1.0 - imix) + data[idx][jhi + ihi + c] * jmix * imix;\n }\n }\n }\n\n pixData.push(newArray);\n model.width = newWidth;\n model.height = newHeight;\n } else {\n pixData.push(null);\n }\n }\n } // The output has to be filled\n\n\n if (pixData.length === 0) {\n for (var _i3 = 0; _i3 < data.length; _i3++) {\n pixData.push(data[_i3]);\n }\n }\n\n return pixData;\n } //----------------------------------------------------------------------------\n\n\n publicAPI.create2DFromRaw = function (width, height, numComps, dataType, data) {\n // Now determine the texture parameters using the arguments.\n publicAPI.getOpenGLDataType(dataType);\n publicAPI.getInternalFormat(dataType, numComps);\n publicAPI.getFormat(dataType, numComps);\n\n if (!model.internalFormat || !model.format || !model.openGLDataType) {\n vtkErrorMacro('Failed to determine texture parameters.');\n return false;\n }\n\n model.target = model.context.TEXTURE_2D;\n model.components = numComps;\n model.width = width;\n model.height = height;\n model.depth = 1;\n model.numberOfDimensions = 2;\n model.openGLRenderWindow.activateTexture(publicAPI);\n publicAPI.createTexture();\n publicAPI.bind(); // Create an array of texture with one texture\n\n var dataArray = [data];\n var pixData = updateArrayDataType(dataType, dataArray);\n var scaledData = scaleTextureToHighestPowerOfTwo(pixData); // Source texture data from the PBO.\n // model.context.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n\n model.context.pixelStorei(model.context.UNPACK_ALIGNMENT, 1);\n model.context.texImage2D(model.target, 0, model.internalFormat, model.width, model.height, 0, model.format, model.openGLDataType, scaledData[0]);\n\n if (model.generateMipmap) {\n model.context.generateMipmap(model.target);\n }\n\n publicAPI.deactivate();\n return true;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.createCubeFromRaw = function (width, height, numComps, dataType, data) {\n // Now determine the texture parameters using the arguments.\n publicAPI.getOpenGLDataType(dataType);\n publicAPI.getInternalFormat(dataType, numComps);\n publicAPI.getFormat(dataType, numComps);\n\n if (!model.internalFormat || !model.format || !model.openGLDataType) {\n vtkErrorMacro('Failed to determine texture parameters.');\n return false;\n }\n\n model.target = model.context.TEXTURE_CUBE_MAP;\n model.components = numComps;\n model.width = width;\n model.height = height;\n model.depth = 1;\n model.numberOfDimensions = 2;\n model.openGLRenderWindow.activateTexture(publicAPI);\n model.maxLevel = data.length / 6 - 1;\n publicAPI.createTexture();\n publicAPI.bind();\n var pixData = updateArrayDataType(dataType, data);\n var scaledData = scaleTextureToHighestPowerOfTwo(pixData); // invert the data because opengl is messed up with cube maps\n // and uses the old renderman standard with Y going down\n // even though it is completely at odds with OpenGL standards\n\n var invertedData = [];\n var widthLevel = model.width;\n var heightLevel = model.height;\n\n for (var i = 0; i < scaledData.length; i++) {\n if (i % 6 === 0 && i !== 0) {\n widthLevel /= 2;\n heightLevel /= 2;\n }\n\n invertedData[i] = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newTypedArray\"](dataType, heightLevel * widthLevel * model.components);\n\n for (var y = 0; y < heightLevel; ++y) {\n var row1 = y * widthLevel * model.components;\n var row2 = (heightLevel - y - 1) * widthLevel * model.components;\n invertedData[i].set(scaledData[i].slice(row2, row2 + widthLevel * model.components), row1);\n }\n } // Source texture data from the PBO.\n\n\n model.context.pixelStorei(model.context.UNPACK_ALIGNMENT, 1); // We get the 6 images\n\n for (var _i4 = 0; _i4 < 6; _i4++) {\n // For each mipmap level\n var j = 0;\n var w = model.width;\n var h = model.height;\n\n while (w >= 1 && h >= 1) {\n // In webgl 1, all levels need to be defined. So if the latest level size is\n // 8x8, we have to add 3 more null textures (4x4, 2x2, 1x1)\n // In webgl 2, the attribute maxLevel will be use.\n var tempData = null;\n\n if (j <= model.maxLevel) {\n tempData = invertedData[6 * j + _i4];\n }\n\n model.context.texImage2D(model.context.TEXTURE_CUBE_MAP_POSITIVE_X + _i4, j, model.internalFormat, w, h, 0, model.format, model.openGLDataType, tempData);\n j++;\n w /= 2;\n h /= 2;\n }\n } // generateMipmap must not be called here because we manually upload all levels\n // if it is called, all levels will be overwritten\n\n\n publicAPI.deactivate();\n return true;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.createDepthFromRaw = function (width, height, dataType, data) {\n // Now determine the texture parameters using the arguments.\n publicAPI.getOpenGLDataType(dataType);\n model.format = model.context.DEPTH_COMPONENT;\n\n if (model.openGLRenderWindow.getWebgl2()) {\n if (dataType === VtkDataTypes.FLOAT) {\n model.internalFormat = model.context.DEPTH_COMPONENT32F;\n } else {\n model.internalFormat = model.context.DEPTH_COMPONENT16;\n }\n } else {\n model.internalFormat = model.context.DEPTH_COMPONENT;\n }\n\n if (!model.internalFormat || !model.format || !model.openGLDataType) {\n vtkErrorMacro('Failed to determine texture parameters.');\n return false;\n }\n\n model.target = model.context.TEXTURE_2D;\n model.components = 1;\n model.width = width;\n model.height = height;\n model.depth = 1;\n model.numberOfDimensions = 2;\n model.openGLRenderWindow.activateTexture(publicAPI);\n publicAPI.createTexture();\n publicAPI.bind(); // Source texture data from the PBO.\n // model.context.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n\n model.context.pixelStorei(model.context.UNPACK_ALIGNMENT, 1);\n model.context.texImage2D(model.target, 0, model.internalFormat, model.width, model.height, 0, model.format, model.openGLDataType, data);\n\n if (model.generateMipmap) {\n model.context.generateMipmap(model.target);\n }\n\n publicAPI.deactivate();\n return true;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.create2DFromImage = function (image) {\n // Now determine the texture parameters using the arguments.\n publicAPI.getOpenGLDataType(VtkDataTypes.UNSIGNED_CHAR);\n publicAPI.getInternalFormat(VtkDataTypes.UNSIGNED_CHAR, 4);\n publicAPI.getFormat(VtkDataTypes.UNSIGNED_CHAR, 4);\n\n if (!model.internalFormat || !model.format || !model.openGLDataType) {\n vtkErrorMacro('Failed to determine texture parameters.');\n return false;\n }\n\n model.target = model.context.TEXTURE_2D;\n model.components = 4;\n model.width = image.width;\n model.height = image.height;\n model.depth = 1;\n model.numberOfDimensions = 2;\n model.openGLRenderWindow.activateTexture(publicAPI);\n publicAPI.createTexture();\n publicAPI.bind(); // Source texture data from the PBO.\n // model.context.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n\n model.context.pixelStorei(model.context.UNPACK_ALIGNMENT, 1); // Scale up the texture to the next highest power of two dimensions (if needed) and flip y.\n\n var needNearestPowerOfTwo = !vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"isPowerOfTwo\"](image.width) || !vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"isPowerOfTwo\"](image.height);\n var canvas = document.createElement('canvas');\n canvas.width = needNearestPowerOfTwo ? vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"nearestPowerOfTwo\"](image.width) : image.width;\n canvas.height = needNearestPowerOfTwo ? vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"nearestPowerOfTwo\"](image.height) : image.height;\n var ctx = canvas.getContext('2d');\n ctx.translate(0, canvas.height);\n ctx.scale(1, -1);\n ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height); // In Chrome 69 on Windows and Ubuntu, there is a bug that prevents some\n // canvases from working properly with webGL textures. By getting any\n // image data from the canvas, this works around the bug. See\n // https://bugs.chromium.org/p/chromium/issues/detail?id=896307\n\n if (navigator.userAgent.indexOf('Chrome/69') >= 0) {\n ctx.getImageData(0, 0, 1, 1);\n }\n\n var safeImage = canvas;\n model.context.texImage2D(model.target, 0, model.internalFormat, model.format, model.openGLDataType, safeImage);\n\n if (model.generateMipmap) {\n model.context.generateMipmap(model.target);\n }\n\n publicAPI.deactivate();\n return true;\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.create3DFromRaw = function (width, height, depth, numComps, dataType, data) {\n // Now determine the texture parameters using the arguments.\n publicAPI.getOpenGLDataType(dataType);\n publicAPI.getInternalFormat(dataType, numComps);\n publicAPI.getFormat(dataType, numComps);\n\n if (!model.internalFormat || !model.format || !model.openGLDataType) {\n vtkErrorMacro('Failed to determine texture parameters.');\n return false;\n }\n\n model.target = model.context.TEXTURE_3D;\n model.components = numComps;\n model.width = width;\n model.height = height;\n model.depth = depth;\n model.numberOfDimensions = 3;\n model.openGLRenderWindow.activateTexture(publicAPI);\n publicAPI.createTexture();\n publicAPI.bind(); // Source texture data from the PBO.\n // model.context.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n // model.context.pixelStorei(model.context.UNPACK_ALIGNMENT, 1);\n\n model.context.texImage3D(model.target, 0, model.internalFormat, model.width, model.height, model.depth, 0, model.format, model.openGLDataType, data);\n\n if (model.generateMipmap) {\n model.context.generateMipmap(model.target);\n }\n\n publicAPI.deactivate();\n return true;\n };\n\n function computeScaleOffsets(numComps, numPixelsIn, data) {\n // compute min and max values per component\n var min = [];\n var max = [];\n\n for (var c = 0; c < numComps; ++c) {\n min[c] = data[c];\n max[c] = data[c];\n }\n\n var count = 0;\n\n for (var i = 0; i < numPixelsIn; ++i) {\n for (var _c = 0; _c < numComps; ++_c) {\n if (data[count] < min[_c]) {\n min[_c] = data[count];\n }\n\n if (data[count] > max[_c]) {\n max[_c] = data[count];\n }\n\n count++;\n }\n }\n\n var offset = [];\n var scale = [];\n\n for (var _c2 = 0; _c2 < numComps; ++_c2) {\n if (min[_c2] === max[_c2]) {\n max[_c2] = min[_c2] + 1.0;\n }\n\n offset[_c2] = min[_c2];\n scale[_c2] = max[_c2] - min[_c2];\n }\n\n return {\n scale: scale,\n offset: offset\n };\n } //----------------------------------------------------------------------------\n // This method simulates a 3D texture using 2D\n\n\n publicAPI.create3DFilterableFromRaw = function (width, height, depth, numComps, dataType, data) {\n var numPixelsIn = width * height * depth; // initialize offset/scale\n\n var offset = [];\n var scale = [];\n\n for (var c = 0; c < numComps; ++c) {\n offset[c] = 0.0;\n scale[c] = 1.0;\n } // store the information, we will need it later\n // offset and scale are the offset and scale required to get\n // the texture value back to data values ala\n // data = texture * scale + offset\n // and texture = (data - offset)/scale\n\n\n model.volumeInfo = {\n scale: scale,\n offset: offset,\n width: width,\n height: height,\n depth: depth\n }; // WebGL2 path, we have 3d textures etc\n\n if (model.openGLRenderWindow.getWebgl2()) {\n if (dataType === VtkDataTypes.FLOAT) {\n return publicAPI.create3DFromRaw(width, height, depth, numComps, dataType, data);\n }\n\n if (dataType === VtkDataTypes.UNSIGNED_CHAR) {\n for (var _c3 = 0; _c3 < numComps; ++_c3) {\n model.volumeInfo.scale[_c3] = 255.0;\n }\n\n return publicAPI.create3DFromRaw(width, height, depth, numComps, dataType, data);\n } // otherwise convert to float\n\n\n var _newArray2 = new Float32Array(numPixelsIn * numComps); // compute min and max values\n\n\n var _computeScaleOffsets = computeScaleOffsets(numComps, numPixelsIn, data),\n computedOffset = _computeScaleOffsets.offset,\n computedScale = _computeScaleOffsets.scale;\n\n model.volumeInfo.offset = computedOffset;\n model.volumeInfo.scale = computedScale;\n var count = 0;\n var scaleInverse = computedScale.map(function (s) {\n return 1 / s;\n });\n\n for (var i = 0; i < numPixelsIn; i++) {\n for (var nc = 0; nc < numComps; nc++) {\n _newArray2[count] = (data[count] - computedOffset[nc]) * scaleInverse[nc];\n count++;\n }\n }\n\n return publicAPI.create3DFromRaw(width, height, depth, numComps, VtkDataTypes.FLOAT, _newArray2);\n } // not webgl2, deal with webgl1, no 3d textures\n // and maybe no float textures\n // compute min and max values\n\n\n var res = computeScaleOffsets(numComps, numPixelsIn, data);\n\n var volCopyData = function volCopyData(outArray, outIdx, inValue, smin, smax) {\n outArray[outIdx] = inValue;\n };\n\n var dataTypeToUse = VtkDataTypes.UNSIGNED_CHAR; // unsigned char gets used as is\n\n if (dataType === VtkDataTypes.UNSIGNED_CHAR) {\n for (var _c4 = 0; _c4 < numComps; ++_c4) {\n res.offset[_c4] = 0.0;\n res.scale[_c4] = 255.0;\n }\n } else if (model.context.getExtension('OES_texture_float') && model.context.getExtension('OES_texture_float_linear')) {\n // use float textures scaled to 0.0 to 1.0\n dataTypeToUse = VtkDataTypes.FLOAT;\n\n volCopyData = function volCopyData(outArray, outIdx, inValue, soffset, sscale) {\n outArray[outIdx] = (inValue - soffset) / sscale;\n };\n } else {\n // worst case, scale data to uchar\n dataTypeToUse = VtkDataTypes.UNSIGNED_CHAR;\n\n volCopyData = function volCopyData(outArray, outIdx, inValue, soffset, sscale) {\n outArray[outIdx] = 255.0 * (inValue - soffset) / sscale;\n };\n } // Now determine the texture parameters using the arguments.\n\n\n publicAPI.getOpenGLDataType(dataTypeToUse);\n publicAPI.getInternalFormat(dataTypeToUse, numComps);\n publicAPI.getFormat(dataTypeToUse, numComps);\n\n if (!model.internalFormat || !model.format || !model.openGLDataType) {\n vtkErrorMacro('Failed to determine texture parameters.');\n return false;\n } // have to pack this 3D texture into pot 2D texture\n\n\n model.target = model.context.TEXTURE_2D;\n model.components = numComps;\n model.depth = 1;\n model.numberOfDimensions = 2; // MAX_TEXTURE_SIZE gives the max dimensions that can be supported by the GPU,\n // but it doesn't mean it will fit in memory. If we have to use a float data type\n // or 4 components, there are good chances that the texture size will blow up\n // and could not fit in the GPU memory. Use a smaller texture size in that case,\n // which will force a downsampling of the dataset.\n // That problem does not occur when using webGL2 since we can pack the data in\n // denser textures based on our data type.\n // TODO: try to fit in the biggest supported texture, catch the gl error if it\n // does not fix (OUT_OF_MEMORY), then attempt with smaller texture\n\n var maxTexDim = model.context.getParameter(model.context.MAX_TEXTURE_SIZE);\n\n if (maxTexDim > 4096 && (dataTypeToUse === VtkDataTypes.FLOAT || numComps >= 3)) {\n maxTexDim = 4096;\n } // compute estimate for XY subsample\n\n\n var xstride = 1;\n var ystride = 1;\n\n if (numPixelsIn > maxTexDim * maxTexDim) {\n xstride = Math.ceil(Math.sqrt(numPixelsIn / (maxTexDim * maxTexDim)));\n ystride = xstride;\n }\n\n var targetWidth = Math.sqrt(numPixelsIn) / xstride;\n targetWidth = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"nearestPowerOfTwo\"](targetWidth); // determine X reps\n\n var xreps = Math.floor(targetWidth * xstride / width);\n var yreps = Math.ceil(depth / xreps);\n var targetHeight = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_3__[\"nearestPowerOfTwo\"](height * yreps / ystride);\n model.width = targetWidth;\n model.height = targetHeight;\n model.openGLRenderWindow.activateTexture(publicAPI);\n publicAPI.createTexture();\n publicAPI.bind(); // store the information, we will need it later\n\n model.volumeInfo.xreps = xreps;\n model.volumeInfo.yreps = yreps;\n model.volumeInfo.xstride = xstride;\n model.volumeInfo.ystride = ystride;\n model.volumeInfo.offset = res.offset;\n model.volumeInfo.scale = res.scale; // OK stuff the data into the 2d TEXTURE\n // first allocate the new texture\n\n var newArray;\n var pixCount = targetWidth * targetHeight * numComps;\n\n if (dataTypeToUse === VtkDataTypes.FLOAT) {\n newArray = new Float32Array(pixCount);\n } else {\n newArray = new Uint8Array(pixCount);\n } // then stuff the data into it, nothing fancy right now\n // for stride\n\n\n var outIdx = 0;\n var tileWidth = Math.floor(width / xstride);\n var tileHeight = Math.floor(height / ystride);\n\n for (var yRep = 0; yRep < yreps; yRep++) {\n var xrepsThisRow = Math.min(xreps, depth - yRep * xreps);\n var outXContIncr = numComps * (model.width - xrepsThisRow * Math.floor(width / xstride));\n\n for (var tileY = 0; tileY < tileHeight; tileY++) {\n for (var xRep = 0; xRep < xrepsThisRow; xRep++) {\n var inOffset = numComps * ((yRep * xreps + xRep) * width * height + ystride * tileY * width);\n\n for (var tileX = 0; tileX < tileWidth; tileX++) {\n // copy value\n for (var _nc = 0; _nc < numComps; _nc++) {\n volCopyData(newArray, outIdx, data[inOffset + xstride * tileX * numComps + _nc], res.offset[_nc], res.scale[_nc]);\n outIdx++;\n }\n }\n }\n\n outIdx += outXContIncr;\n }\n } // Source texture data from the PBO.\n // model.context.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n\n\n model.context.pixelStorei(model.context.UNPACK_ALIGNMENT, 1);\n model.context.texImage2D(model.target, 0, model.internalFormat, model.width, model.height, 0, model.format, model.openGLDataType, newArray);\n publicAPI.deactivate();\n return true;\n };\n\n publicAPI.setOpenGLRenderWindow = function (rw) {\n if (model.openGLRenderWindow === rw) {\n return;\n }\n\n publicAPI.releaseGraphicsResources();\n model.openGLRenderWindow = rw;\n model.context = null;\n\n if (rw) {\n model.context = model.openGLRenderWindow.getContext();\n }\n }; //----------------------------------------------------------------------------\n\n\n publicAPI.getMaximumTextureSize = function (ctx) {\n if (ctx && ctx.isCurrent()) {\n return ctx.getIntegerv(ctx.MAX_TEXTURE_SIZE);\n }\n\n return -1;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n openGLRenderWindow: null,\n context: null,\n handle: 0,\n sendParametersTime: null,\n textureBuildTime: null,\n numberOfDimensions: 0,\n target: 0,\n format: 0,\n openGLDataType: 0,\n components: 0,\n width: 0,\n height: 0,\n depth: 0,\n autoParameters: true,\n wrapS: Wrap.CLAMP_TO_EDGE,\n wrapT: Wrap.CLAMP_TO_EDGE,\n wrapR: Wrap.CLAMP_TO_EDGE,\n minificationFilter: Filter.NEAREST,\n magnificationFilter: Filter.NEAREST,\n minLOD: -1000.0,\n maxLOD: 1000.0,\n baseLevel: 0,\n maxLevel: 1000,\n generateMipmap: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_4__[\"default\"].extend(publicAPI, model, initialValues);\n model.sendParametersTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.sendParametersTime, {\n mtime: 0\n });\n model.textureBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.textureBuildTime, {\n mtime: 0\n }); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"set\"](publicAPI, model, ['format', 'openGLDataType']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['keyMatrixTime', 'minificationFilter', 'magnificationFilter', 'wrapS', 'wrapT', 'wrapR', 'generateMipmap']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"get\"](publicAPI, model, ['width', 'height', 'volumeInfo', 'components', 'handle', 'target']); // Object methods\n\n vtkOpenGLTexture(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkOpenGLTexture'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_0__[\"default\"])); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_5__[\"registerOverride\"])('vtkTexture', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/TextureUnitManager/index.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/TextureUnitManager/index.js ***! - \**********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkOpenGLTextureUnitManager methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLTextureUnitManager(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLTextureUnitManager'); // ----------------------------------------------------------------------------\n // Description:\n // Delete the allocation table and check if it is not called before\n // all the texture units have been released.\n\n publicAPI.deleteTable = function () {\n for (var i = 0; i < model.numberOfTextureUnits; ++i) {\n if (model.textureUnits[i] === true) {\n vtkErrorMacro('some texture units were not properly released');\n }\n }\n\n model.textureUnits = [];\n model.numberOfTextureUnits = 0;\n }; // ----------------------------------------------------------------------------\n\n\n publicAPI.setContext = function (ctx) {\n if (model.context !== ctx) {\n if (model.context !== 0) {\n publicAPI.deleteTable();\n }\n\n model.context = ctx;\n\n if (model.context) {\n model.numberOfTextureUnits = ctx.getParameter(ctx.MAX_TEXTURE_IMAGE_UNITS);\n\n for (var i = 0; i < model.numberOfTextureUnits; ++i) {\n model.textureUnits[i] = false;\n }\n }\n\n publicAPI.modified();\n }\n }; // ----------------------------------------------------------------------------\n // Description:\n // Reserve a texture unit. It returns its number.\n // It returns -1 if the allocation failed (because there are no more\n // texture units left).\n // \\post valid_result: result==-1 || result>=0 && resultGetNumberOfTextureUnits())\n // \\post allocated: result==-1 || this->IsAllocated(result)\n\n\n publicAPI.allocate = function () {\n for (var i = 0; i < model.numberOfTextureUnits; i++) {\n if (!publicAPI.isAllocated(i)) {\n model.textureUnits[i] = true;\n return i;\n }\n }\n\n return -1;\n };\n\n publicAPI.allocateUnit = function (unit) {\n if (publicAPI.isAllocated(unit)) {\n return -1;\n }\n\n model.textureUnits[unit] = true;\n return unit;\n }; // ----------------------------------------------------------------------------\n // Description:\n // Tell if texture unit `textureUnitId' is already allocated.\n // \\pre valid_id_range : textureUnitId>=0 && textureUnitIdGetNumberOfTextureUnits()\n\n\n publicAPI.isAllocated = function (textureUnitId) {\n return model.textureUnits[textureUnitId];\n }; // ----------------------------------------------------------------------------\n // Description:\n // Release a texture unit.\n // \\pre valid_id: textureUnitId>=0 && textureUnitIdGetNumberOfTextureUnits()\n // \\pre allocated_id: this->IsAllocated(textureUnitId)\n\n\n publicAPI.free = function (val) {\n model.textureUnits[val] = false;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n numberOfTextureUnits: 0,\n textureUnits: 0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.textureUnits = []; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['numberOfTextureUnits']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['context']); // Object methods\n\n vtkOpenGLTextureUnitManager(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkOpenGLTextureUnitManager'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/TextureUnitManager/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/VertexArrayObject/index.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/VertexArrayObject/index.js ***! - \*********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants.js\");\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLVertexArrayObject methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLVertexArrayObject(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLVertexArrayObject'); // Public API methods\n\n publicAPI.exposedMethod = function () {// This is a publicly exposed method of this object\n };\n\n publicAPI.initialize = function () {\n model.instancingExtension = null;\n\n if (!model.openGLRenderWindow.getWebgl2()) {\n model.instancingExtension = model.context.getExtension('ANGLE_instanced_arrays');\n }\n\n if (!model.forceEmulation && model.openGLRenderWindow && model.openGLRenderWindow.getWebgl2()) {\n model.extension = null;\n model.supported = true;\n model.handleVAO = model.context.createVertexArray();\n } else {\n model.extension = model.context.getExtension('OES_vertex_array_object'); // Start setting up VAO\n\n if (!model.forceEmulation && model.extension) {\n model.supported = true;\n model.handleVAO = model.extension.createVertexArrayOES();\n } else {\n model.supported = false;\n }\n }\n };\n\n publicAPI.isReady = function () {\n return (// We either probed and allocated a VAO, or are falling back as the current\n // hardware does not support VAOs.\n model.handleVAO !== 0 || model.supported === false\n );\n };\n\n publicAPI.bind = function () {\n // Either simply bind the VAO, or emulate behavior by binding all attributes.\n if (!publicAPI.isReady()) {\n publicAPI.initialize();\n }\n\n if (publicAPI.isReady() && model.supported) {\n if (model.extension) {\n model.extension.bindVertexArrayOES(model.handleVAO);\n } else {\n model.context.bindVertexArray(model.handleVAO);\n }\n } else if (publicAPI.isReady()) {\n var gl = model.context;\n\n for (var ibuff = 0; ibuff < model.buffers.length; ++ibuff) {\n var buff = model.buffers[ibuff];\n model.context.bindBuffer(gl.ARRAY_BUFFER, buff.buffer);\n\n for (var iatt = 0; iatt < buff.attributes.length; ++iatt) {\n var attrIt = buff.attributes[iatt];\n var matrixCount = attrIt.isMatrix ? attrIt.size : 1;\n\n for (var i = 0; i < matrixCount; ++i) {\n gl.enableVertexAttribArray(attrIt.index + i);\n gl.vertexAttribPointer(attrIt.index + i, attrIt.size, attrIt.type, attrIt.normalize, attrIt.stride, attrIt.offset + attrIt.stride * i / attrIt.size);\n\n if (attrIt.divisor > 0) {\n if (model.instancingExtension) {\n model.instancingExtension.vertexAttribDivisorANGLE(attrIt.index + i, 1);\n } else {\n gl.vertexAttribDivisor(attrIt.index + i, 1);\n }\n }\n }\n }\n }\n }\n };\n\n publicAPI.release = function () {\n // Either simply release the VAO, or emulate behavior by releasing all attributes.\n if (publicAPI.isReady() && model.supported) {\n if (model.extension) {\n model.extension.bindVertexArrayOES(null);\n } else {\n model.context.bindVertexArray(null);\n }\n } else if (publicAPI.isReady()) {\n var gl = model.context;\n\n for (var ibuff = 0; ibuff < model.buffers.length; ++ibuff) {\n var buff = model.buffers[ibuff];\n model.context.bindBuffer(gl.ARRAY_BUFFER, buff.buffer);\n\n for (var iatt = 0; iatt < buff.attributes.length; ++iatt) {\n var attrIt = buff.attributes[iatt];\n var matrixCount = attrIt.isMatrix ? attrIt.size : 1;\n\n for (var i = 0; i < matrixCount; ++i) {\n gl.enableVertexAttribArray(attrIt.index + i);\n gl.vertexAttribPointer(attrIt.index + i, attrIt.size, attrIt.type, attrIt.normalize, attrIt.stride, attrIt.offset + attrIt.stride * i / attrIt.size);\n\n if (attrIt.divisor > 0) {\n if (model.instancingExtension) {\n model.instancingExtension.vertexAttribDivisorANGLE(attrIt.index + i, 0);\n } else {\n gl.vertexAttribDivisor(attrIt.index + i, 0);\n }\n }\n\n gl.disableVertexAttribArray(attrIt.index + i);\n }\n }\n }\n }\n };\n\n publicAPI.shaderProgramChanged = function () {\n publicAPI.release();\n\n if (model.handleVAO) {\n if (model.extension) {\n model.extension.deleteVertexArrayOES(model.handleVAO);\n } else {\n model.context.deleteVertexArray(model.handleVAO);\n }\n }\n\n model.handleVAO = 0;\n model.handleProgram = 0;\n };\n\n publicAPI.releaseGraphicsResources = function () {\n publicAPI.shaderProgramChanged();\n\n if (model.handleVAO) {\n if (model.extension) {\n model.extension.deleteVertexArrayOES(model.handleVAO);\n } else {\n model.context.deleteVertexArray(model.handleVAO);\n }\n }\n\n model.handleVAO = 0;\n model.supported = true;\n model.handleProgram = 0;\n };\n\n publicAPI.addAttributeArray = function (program, buffer, name, offset, stride, elementType, elementTupleSize, normalize) {\n return publicAPI.addAttributeArrayWithDivisor(program, buffer, name, offset, stride, elementType, elementTupleSize, normalize, 0, false);\n };\n\n publicAPI.addAttributeArrayWithDivisor = function (program, buffer, name, offset, stride, elementType, elementTupleSize, normalize, divisor, isMatrix) {\n if (!program) {\n return false;\n } // Check the program is bound, and the buffer is valid.\n\n\n if (!program.isBound() || buffer.getHandle() === 0 || buffer.getType() !== vtk_js_Sources_Rendering_OpenGL_BufferObject_Constants__WEBPACK_IMPORTED_MODULE_1__[\"ObjectType\"].ARRAY_BUFFER) {\n return false;\n } // Perform initialization if necessary, ensure program matches VAOs.\n\n\n if (model.handleProgram === 0) {\n model.handleProgram = program.getHandle();\n }\n\n if (!publicAPI.isReady()) {\n publicAPI.initialize();\n }\n\n if (!publicAPI.isReady() || model.handleProgram !== program.getHandle()) {\n return false;\n }\n\n var gl = model.context;\n var attribs = {};\n attribs.name = name;\n attribs.index = gl.getAttribLocation(model.handleProgram, name);\n attribs.offset = offset;\n attribs.stride = stride;\n attribs.type = elementType;\n attribs.size = elementTupleSize;\n attribs.normalize = normalize;\n attribs.isMatrix = isMatrix;\n attribs.divisor = divisor;\n\n if (attribs.Index === -1) {\n return false;\n } // Always make the call as even the first use wants the attrib pointer setting\n // up when we are emulating.\n\n\n buffer.bind();\n gl.enableVertexAttribArray(attribs.index);\n gl.vertexAttribPointer(attribs.index, attribs.size, attribs.type, attribs.normalize, attribs.stride, attribs.offset);\n\n if (divisor > 0) {\n if (model.instancingExtension) {\n model.instancingExtension.vertexAttribDivisorANGLE(attribs.index, 1);\n } else {\n gl.vertexAttribDivisor(attribs.index, 1);\n }\n }\n\n attribs.buffer = buffer.getHandle(); // If vertex array objects are not supported then build up our list.\n\n if (!model.supported) {\n // find the buffer\n var buffFound = false;\n\n for (var ibuff = 0; ibuff < model.buffers.length; ++ibuff) {\n var buff = model.buffers[ibuff];\n\n if (buff.buffer === attribs.buffer) {\n buffFound = true;\n var found = false;\n\n for (var iatt = 0; iatt < buff.attributes.length; ++iatt) {\n var attrIt = buff.attributes[iatt];\n\n if (attrIt.name === name) {\n found = true;\n buff.attributes[iatt] = attribs;\n }\n }\n\n if (!found) {\n buff.attributes.push(attribs);\n }\n }\n }\n\n if (!buffFound) {\n model.buffers.push({\n buffer: attribs.buffer,\n attributes: [attribs]\n });\n }\n }\n\n return true;\n };\n\n publicAPI.addAttributeMatrixWithDivisor = function (program, buffer, name, offset, stride, elementType, elementTupleSize, normalize, divisor) {\n // bind the first row of values\n var result = publicAPI.addAttributeArrayWithDivisor(program, buffer, name, offset, stride, elementType, elementTupleSize, normalize, divisor, true);\n\n if (!result) {\n return result;\n }\n\n var gl = model.context;\n var index = gl.getAttribLocation(model.handleProgram, name);\n\n for (var i = 1; i < elementTupleSize; i++) {\n gl.enableVertexAttribArray(index + i);\n gl.vertexAttribPointer(index + i, elementTupleSize, elementType, normalize, stride, offset + stride * i / elementTupleSize);\n\n if (divisor > 0) {\n if (model.instancingExtension) {\n model.instancingExtension.vertexAttribDivisorANGLE(index + i, 1);\n } else {\n gl.vertexAttribDivisor(index + i, 1);\n }\n }\n }\n\n return true;\n };\n\n publicAPI.removeAttributeArray = function (name) {\n if (!publicAPI.isReady() || model.handleProgram === 0) {\n return false;\n } // If we don't have real VAOs find the entry and remove it too.\n\n\n if (!model.supported) {\n for (var ibuff = 0; ibuff < model.buffers.length; ++ibuff) {\n var buff = model.buffers[ibuff];\n\n for (var iatt = 0; iatt < buff.attributes.length; ++iatt) {\n var attrIt = buff.attributes[iatt];\n\n if (attrIt.name === name) {\n buff.attributes.splice(iatt, 1);\n\n if (!buff.attributes.length) {\n model.buffers.splice(ibuff, 1);\n }\n\n return true;\n }\n }\n }\n }\n\n return true;\n };\n\n publicAPI.setOpenGLRenderWindow = function (rw) {\n if (model.openGLRenderWindow === rw) {\n return;\n }\n\n publicAPI.releaseGraphicsResources();\n model.openGLRenderWindow = rw;\n model.context = null;\n\n if (rw) {\n model.context = model.openGLRenderWindow.getContext();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n forceEmulation: false,\n handleVAO: 0,\n handleProgram: 0,\n supported: true,\n buffers: null,\n context: null,\n openGLRenderWindow: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Internal objects initialization\n\n model.buffers = []; // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Create get-only macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['supported']); // Create get-set macros\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['forceEmulation']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkOpenGLVertexArrayObject(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkOpenGLVertexArrayObject'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/VertexArrayObject/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js ***! - \*******************************************************************************/ -/*! exports provided: registerOverride, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerOverride\", function() { return registerOverride; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory/index.js\");\n\n\nvar CLASS_MAPPING = Object.create(null);\nfunction registerOverride(className, fn) {\n CLASS_MAPPING[className] = fn;\n} // ----------------------------------------------------------------------------\n// vtkOpenGLViewNodeFactory methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLViewNodeFactory(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLViewNodeFactory');\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Static class mapping shared across instances\n\n model.overrides = CLASS_MAPPING; // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object methods\n\n vtkOpenGLViewNodeFactory(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkOpenGLViewNodeFactory'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/Volume/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/Volume/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkOpenGLVolume methods\n// ----------------------------------------------------------------------------\n\nfunction vtkOpenGLVolume(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLVolume'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (prepass) {\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getMapper());\n publicAPI.removeUnusedNodes();\n }\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n renderPass.incrementVolumeCount();\n }\n };\n\n publicAPI.traverseVolumePass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || model.openGLRenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.children[0].traverse(renderPass);\n publicAPI.apply(renderPass, false);\n }; // Renders myself\n\n\n publicAPI.volumePass = function (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (prepass) {\n model.context = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow').getContext();\n model.context.depthMask(false);\n } else {\n model.context.depthMask(true);\n }\n };\n\n publicAPI.getKeyMatrices = function () {\n // has the actor changed?\n if (model.renderable.getMTime() > model.keyMatrixTime.getMTime()) {\n model.renderable.computeMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.MCWCMatrix, model.renderable.getMatrix());\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.MCWCMatrix, model.MCWCMatrix);\n\n if (model.renderable.getIsIdentity()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(model.normalMatrix);\n } else {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromMat4(model.normalMatrix, model.MCWCMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].invert(model.normalMatrix, model.normalMatrix);\n }\n\n model.keyMatrixTime.modified();\n }\n\n return {\n mcwc: model.MCWCMatrix,\n normalMatrix: model.normalMatrix\n };\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {// context: null,\n // keyMatrixTime: null,\n // normalMatrix: null,\n // MCWCMatrix: null,\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatrixTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.keyMatrixTime, {\n mtime: 0\n }); // always set by getter\n\n model.normalMatrix = new Float64Array(9);\n model.MCWCMatrix = new Float64Array(16); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['context']); // Object methods\n\n vtkOpenGLVolume(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkOpenGLVolume'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkVolume', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/Volume/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/VolumeMapper/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/VolumeMapper/index.js ***! - \****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray/Constants */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Helper */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Helper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Framebuffer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Framebuffer */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Framebuffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ShaderProgram */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ShaderProgram/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_VertexArrayObject__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/VertexArrayObject */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/VertexArrayObject/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Texture/Constants */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Texture/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/VolumeProperty/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/VolumeProperty/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_VolumeMapper_Constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/VolumeMapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeVS_glsl__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeVS_glsl__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeVS_glsl__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeFS_glsl__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeFS.glsl */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeFS.glsl\");\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeFS_glsl__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeFS_glsl__WEBPACK_IMPORTED_MODULE_16__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n // import vtkBoundingBox from 'vtk.js/Sources/Common/DataModel/BoundingBox';\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkWarningMacro\"],\n vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"]; // TODO: Do we want this in some shared utility? Shouldwe just use lodash.isEqual\n\nfunction arrayEquals(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n} // ----------------------------------------------------------------------------\n// vtkOpenGLVolumeMapper methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkOpenGLVolumeMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLVolumeMapper');\n\n publicAPI.buildPass = function () {\n model.zBufferTexture = null;\n }; // ohh someone is doing a zbuffer pass, use that for\n // intermixed volume rendering\n\n\n publicAPI.opaqueZBufferPass = function (prepass, renderPass) {\n if (prepass) {\n var zbt = renderPass.getZBufferTexture();\n\n if (zbt !== model.zBufferTexture) {\n model.zBufferTexture = zbt;\n }\n }\n }; // Renders myself\n\n\n publicAPI.volumePass = function (prepass, renderPass) {\n if (prepass) {\n model.openGLRenderWindow = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderWindow');\n model.context = model.openGLRenderWindow.getContext();\n model.tris.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.jitterTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.framebuffer.setOpenGLRenderWindow(model.openGLRenderWindow); // Per Component?\n\n model.scalarTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.colorTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.opacityTexture.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.openGLVolume = publicAPI.getFirstAncestorOfType('vtkOpenGLVolume');\n var actor = model.openGLVolume.getRenderable();\n model.openGLRenderer = publicAPI.getFirstAncestorOfType('vtkOpenGLRenderer');\n var ren = model.openGLRenderer.getRenderable();\n model.openGLCamera = model.openGLRenderer.getViewNodeFor(ren.getActiveCamera());\n publicAPI.renderPiece(ren, actor);\n }\n };\n\n publicAPI.buildShaders = function (shaders, ren, actor) {\n publicAPI.getShaderTemplate(shaders, ren, actor);\n publicAPI.replaceShaderValues(shaders, ren, actor);\n };\n\n publicAPI.getShaderTemplate = function (shaders, ren, actor) {\n shaders.Vertex = vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeVS_glsl__WEBPACK_IMPORTED_MODULE_15___default.a;\n shaders.Fragment = vtk_js_Sources_Rendering_OpenGL_glsl_vtkVolumeFS_glsl__WEBPACK_IMPORTED_MODULE_16___default.a;\n shaders.Geometry = '';\n };\n\n publicAPI.replaceShaderValues = function (shaders, ren, actor) {\n var FSSource = shaders.Fragment; // define some values in the shader\n\n var iType = actor.getProperty().getInterpolationType();\n\n if (iType === vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_13__[\"InterpolationType\"].LINEAR) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::TrilinearOn', '#define vtkTrilinearOn').result;\n }\n\n var vtkImageLabelOutline = actor.getProperty().getUseLabelOutline();\n\n if (vtkImageLabelOutline === true) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ImageLabelOutlineOn', '#define vtkImageLabelOutlineOn').result;\n }\n\n var numComp = model.scalarTexture.getComponents();\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::NumComponents', \"#define vtkNumComponents \".concat(numComp)).result;\n var iComps = actor.getProperty().getIndependentComponents();\n\n if (iComps) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::IndependentComponentsOn', '#define vtkIndependentComponentsOn').result; // Define any proportional components\n\n var proportionalComponents = [];\n\n for (var nc = 0; nc < numComp; nc++) {\n if (actor.getProperty().getOpacityMode(nc) === vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_13__[\"OpacityMode\"].PROPORTIONAL) {\n proportionalComponents.push(\"#define vtkComponent\".concat(nc, \"Proportional\"));\n }\n }\n\n if (proportionalComponents.length > 0) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::vtkProportionalComponents', proportionalComponents.join('\\n')).result;\n }\n } // WebGL only supports loops over constants\n // and does not support while loops so we\n // have to hard code how many steps/samples to take\n // We do a break so most systems will gracefully\n // early terminate, but it is always possible\n // a system will execute every step regardless\n\n\n var ext = model.currentInput.getExtent();\n var spc = model.currentInput.getSpacing();\n var vsize = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(vsize, (ext[1] - ext[0]) * spc[0], (ext[3] - ext[2]) * spc[1], (ext[5] - ext[4]) * spc[2]);\n var maxSamples = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].length(vsize) / model.renderable.getSampleDistance();\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::MaximumSamplesValue', \"\".concat(Math.ceil(maxSamples))).result; // set light complexity\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::LightComplexity', \"#define vtkLightComplexity \".concat(model.lastLightComplexity)).result; // if using gradient opacity define that\n\n model.gopacity = actor.getProperty().getUseGradientOpacity(0);\n\n for (var _nc = 1; iComps && !model.gopacity && _nc < numComp; ++_nc) {\n if (actor.getProperty().getUseGradientOpacity(_nc)) {\n model.gopacity = true;\n }\n }\n\n if (model.gopacity) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::GradientOpacityOn', '#define vtkGradientOpacityOn').result;\n } // if we have a ztexture then declare it and use it\n\n\n if (model.zBufferTexture !== null) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ZBuffer::Dec', ['uniform sampler2D zBufferTexture;', 'uniform float vpWidth;', 'uniform float vpHeight;']).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ZBuffer::Impl', ['vec4 depthVec = texture2D(zBufferTexture, vec2(gl_FragCoord.x / vpWidth, gl_FragCoord.y/vpHeight));', 'float zdepth = (depthVec.r*256.0 + depthVec.g)/257.0;', 'zdepth = zdepth * 2.0 - 1.0;', 'zdepth = -2.0 * camFar * camNear / (zdepth*(camFar-camNear)-(camFar+camNear)) - camNear;', 'zdepth = -zdepth/rayDir.z;', 'dists.y = min(zdepth,dists.y);']).result;\n } // Set the BlendMode approach\n\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::BlendMode', \"\".concat(model.renderable.getBlendMode())).result;\n var averageIPScalarRange = model.renderable.getAverageIPScalarRange(); // TODO: Adding the .0 at the end feels hacky\n\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::AverageIPScalarRangeMin', \"\".concat(averageIPScalarRange[0], \".0\")).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::AverageIPScalarRangeMax', \"\".concat(averageIPScalarRange[1], \".0\")).result;\n shaders.Fragment = FSSource;\n publicAPI.replaceShaderLight(shaders, ren, actor);\n publicAPI.replaceShaderClippingPlane(shaders, ren, actor);\n };\n\n publicAPI.replaceShaderLight = function (shaders, ren, actor) {\n var FSSource = shaders.Fragment; // check for shadow maps\n\n var shadowFactor = '';\n\n switch (model.lastLightComplexity) {\n default:\n case 0:\n // no lighting, tcolor is fine as is\n break;\n\n case 1: // headlight\n\n case 2: // light kit\n\n case 3:\n {\n // positional not implemented fallback to directional\n var lightNum = 0;\n ren.getLights().forEach(function (light) {\n var status = light.getSwitch();\n\n if (status > 0) {\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::Light::Dec', [// intensity weighted color\n \"uniform vec3 lightColor\".concat(lightNum, \";\"), \"uniform vec3 lightDirectionVC\".concat(lightNum, \"; // normalized\"), \"uniform vec3 lightHalfAngleVC\".concat(lightNum, \"; // normalized\"), '//VTK::Light::Dec'], false).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::Light::Impl', [// ` float df = max(0.0, dot(normal.rgb, -lightDirectionVC${lightNum}));`,\n \" float df = abs(dot(normal.rgb, -lightDirectionVC\".concat(lightNum, \"));\"), \" diffuse += ((df\".concat(shadowFactor, \") * lightColor\").concat(lightNum, \");\"), // ' if (df > 0.0)',\n // ' {',\n // ` float sf = pow( max(0.0, dot(lightHalfAngleWC${lightNum},normal.rgb)), specularPower);`,\n \" float sf = pow( abs(dot(lightHalfAngleVC\".concat(lightNum, \",normal.rgb)), vSpecularPower);\"), \" specular += ((sf\".concat(shadowFactor, \") * lightColor\").concat(lightNum, \");\"), // ' }',\n ' //VTK::Light::Impl'], false).result;\n lightNum++;\n }\n });\n }\n }\n\n shaders.Fragment = FSSource;\n };\n\n publicAPI.replaceShaderClippingPlane = function (shaders, ren, actor) {\n var FSSource = shaders.Fragment;\n\n if (model.renderable.getClippingPlanes().length > 0) {\n var clipPlaneSize = model.renderable.getClippingPlanes().length;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ClipPlane::Dec', [\"uniform vec3 vClipPlaneNormals[6];\", \"uniform float vClipPlaneDistances[6];\", '//VTK::ClipPlane::Dec'], false).result;\n FSSource = vtk_js_Sources_Rendering_OpenGL_ShaderProgram__WEBPACK_IMPORTED_MODULE_8__[\"default\"].substitute(FSSource, '//VTK::ClipPlane::Impl', [\"for(int i = 0; i < \".concat(clipPlaneSize, \"; i++) {\"), ' float rayDirRatio = dot(rayDir, vClipPlaneNormals[i]);', ' float equationResult = dot(vertexVCVSOutput, vClipPlaneNormals[i]) + vClipPlaneDistances[i];', ' if (rayDirRatio == 0.0)', ' {', ' if (equationResult < 0.0) dists.x = dists.y;', ' continue;', ' }', ' float result = -1.0 * equationResult / rayDirRatio;', ' if (rayDirRatio < 0.0) dists.y = min(dists.y, result);', ' else dists.x = max(dists.x, result);', '}', '//VTK::ClipPlane::Impl'], false).result;\n }\n\n shaders.Fragment = FSSource;\n };\n\n publicAPI.getNeedToRebuildShaders = function (cellBO, ren, actor) {\n // do we need lighting?\n var lightComplexity = 0;\n\n if (actor.getProperty().getShade() && model.renderable.getBlendMode() === vtk_js_Sources_Rendering_Core_VolumeMapper_Constants__WEBPACK_IMPORTED_MODULE_14__[\"BlendMode\"].COMPOSITE_BLEND) {\n // consider the lighting complexity to determine which case applies\n // simple headlight, Light Kit, the whole feature set of VTK\n lightComplexity = 0;\n model.numberOfLights = 0;\n ren.getLights().forEach(function (light) {\n var status = light.getSwitch();\n\n if (status > 0) {\n model.numberOfLights++;\n\n if (lightComplexity === 0) {\n lightComplexity = 1;\n }\n }\n\n if (lightComplexity === 1 && (model.numberOfLights > 1 || light.getIntensity() !== 1.0 || !light.lightTypeIsHeadLight())) {\n lightComplexity = 2;\n }\n\n if (lightComplexity < 3 && light.getPositional()) {\n lightComplexity = 3;\n }\n });\n }\n\n var needRebuild = false;\n\n if (model.lastLightComplexity !== lightComplexity) {\n model.lastLightComplexity = lightComplexity;\n needRebuild = true;\n }\n\n var numComp = model.scalarTexture.getComponents();\n var iComps = actor.getProperty().getIndependentComponents();\n var usesProportionalComponents = false;\n var proportionalComponents = [];\n\n if (iComps) {\n // Define any proportional components\n for (var nc = 0; nc < numComp; nc++) {\n proportionalComponents.push(actor.getProperty().getOpacityMode(nc));\n }\n\n if (proportionalComponents.length > 0) {\n usesProportionalComponents = true;\n }\n }\n\n var ext = model.currentInput.getExtent();\n var spc = model.currentInput.getSpacing();\n var vsize = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(vsize, (ext[1] - ext[0]) * spc[0], (ext[3] - ext[2]) * spc[1], (ext[5] - ext[4]) * spc[2]);\n var maxSamples = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].length(vsize) / model.renderable.getSampleDistance();\n var state = {\n interpolationType: actor.getProperty().getInterpolationType(),\n useLabelOutline: actor.getProperty().getUseLabelOutline(),\n numComp: numComp,\n usesProportionalComponents: usesProportionalComponents,\n iComps: iComps,\n maxSamples: maxSamples,\n useGradientOpacity: actor.getProperty().getUseGradientOpacity(0),\n blendMode: model.renderable.getBlendMode(),\n averageIPScalarMode: model.renderable.getAverageIPScalarRange(),\n proportionalComponents: proportionalComponents\n }; // We only need to rebuild the shader if one of these variables has changed,\n // since they are used in the shader template replacement step.\n\n if (!model.previousState || model.previousState.interpolationType !== state.interpolationType || model.previousState.useLabelOutline !== state.useLabelOutline || model.previousState.numComp !== state.numComp || model.previousState.usesProportionalComponents !== state.usesProportionalComponents || model.previousState.iComps !== state.iComps || model.previousState.maxSamples !== state.maxSamples || model.previousState.useGradientOpacity !== state.useGradientOpacity || model.previousState.blendMode !== state.blendMode || !arrayEquals(model.previousState.averageIPScalarMode, state.averageIPScalarMode) || !arrayEquals(model.previousState.proportionalComponents, state.proportionalComponents)) {\n model.previousState = _objectSpread({}, state);\n return true;\n } // has something changed that would require us to recreate the shader?\n\n\n if (cellBO.getProgram() === 0 || needRebuild || model.lastHaveSeenDepthRequest !== model.haveSeenDepthRequest || !!model.lastZBufferTexture !== !!model.zBufferTexture || cellBO.getShaderSourceTime().getMTime() < publicAPI.getMTime() || cellBO.getShaderSourceTime().getMTime() < model.renderable.getMTime()) {\n model.lastZBufferTexture = model.zBufferTexture;\n return true;\n }\n\n return false;\n };\n\n publicAPI.updateShaders = function (cellBO, ren, actor) {\n model.lastBoundBO = cellBO; // has something changed that would require us to recreate the shader?\n\n if (publicAPI.getNeedToRebuildShaders(cellBO, ren, actor)) {\n var shaders = {\n Vertex: null,\n Fragment: null,\n Geometry: null\n };\n publicAPI.buildShaders(shaders, ren, actor); // compile and bind the program if needed\n\n var newShader = model.openGLRenderWindow.getShaderCache().readyShaderProgramArray(shaders.Vertex, shaders.Fragment, shaders.Geometry); // if the shader changed reinitialize the VAO\n\n if (newShader !== cellBO.getProgram()) {\n cellBO.setProgram(newShader); // reset the VAO as the shader has changed\n\n cellBO.getVAO().releaseGraphicsResources();\n }\n\n cellBO.getShaderSourceTime().modified();\n } else {\n model.openGLRenderWindow.getShaderCache().readyShaderProgram(cellBO.getProgram());\n }\n\n cellBO.getVAO().bind();\n publicAPI.setMapperShaderParameters(cellBO, ren, actor);\n publicAPI.setCameraShaderParameters(cellBO, ren, actor);\n publicAPI.setPropertyShaderParameters(cellBO, ren, actor);\n publicAPI.getClippingPlaneShaderParameters(cellBO, ren, actor);\n };\n\n publicAPI.setMapperShaderParameters = function (cellBO, ren, actor) {\n // Now to update the VAO too, if necessary.\n var program = cellBO.getProgram();\n\n if (cellBO.getCABO().getElementCount() && (model.VBOBuildTime.getMTime() > cellBO.getAttributeUpdateTime().getMTime() || cellBO.getShaderSourceTime().getMTime() > cellBO.getAttributeUpdateTime().getMTime())) {\n if (program.isAttributeUsed('vertexDC')) {\n if (!cellBO.getVAO().addAttributeArray(program, cellBO.getCABO(), 'vertexDC', cellBO.getCABO().getVertexOffset(), cellBO.getCABO().getStride(), model.context.FLOAT, 3, model.context.FALSE)) {\n vtkErrorMacro('Error setting vertexDC in shader VAO.');\n }\n }\n\n cellBO.getAttributeUpdateTime().modified();\n }\n\n program.setUniformi('texture1', model.scalarTexture.getTextureUnit());\n program.setUniformf('sampleDistance', model.renderable.getSampleDistance()); // if we have a zbuffer texture then set it\n\n if (model.zBufferTexture !== null) {\n program.setUniformi('zBufferTexture', model.zBufferTexture.getTextureUnit());\n var size = publicAPI.getRenderTargetSize();\n program.setUniformf('vpWidth', size[0]);\n program.setUniformf('vpHeight', size[1]);\n }\n };\n\n publicAPI.setCameraShaderParameters = function (cellBO, ren, actor) {\n // // [WMVP]C == {world, model, view, projection} coordinates\n // // E.g., WCPC == world to projection coordinate transformation\n var keyMats = model.openGLCamera.getKeyMatrices(ren);\n var actMats = model.openGLVolume.getKeyMatrices();\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].multiply(model.modelToView, keyMats.wcvc, actMats.mcwc);\n var program = cellBO.getProgram();\n var cam = model.openGLCamera.getRenderable();\n var crange = cam.getClippingRange();\n program.setUniformf('camThick', crange[1] - crange[0]);\n program.setUniformf('camNear', crange[0]);\n program.setUniformf('camFar', crange[1]);\n var bounds = model.currentInput.getBounds();\n var dims = model.currentInput.getDimensions(); // compute the viewport bounds of the volume\n // we will only render those fragments.\n\n var pos = new Float64Array(3);\n var dir = new Float64Array(3);\n var dcxmin = 1.0;\n var dcxmax = -1.0;\n var dcymin = 1.0;\n var dcymax = -1.0;\n\n for (var i = 0; i < 8; ++i) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos, bounds[i % 2], bounds[2 + Math.floor(i / 2) % 2], bounds[4 + Math.floor(i / 4)]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat4(pos, pos, model.modelToView);\n\n if (!cam.getParallelProjection()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].normalize(dir, pos); // now find the projection of this point onto a\n // nearZ distance plane. Since the camera is at 0,0,0\n // in VC the ray is just t*pos and\n // t is -nearZ/dir.z\n // intersection becomes pos.x/pos.z\n\n var t = -crange[0] / pos[2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].scale(pos, dir, t);\n } // now convert to DC\n\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat4(pos, pos, keyMats.vcpc);\n dcxmin = Math.min(pos[0], dcxmin);\n dcxmax = Math.max(pos[0], dcxmax);\n dcymin = Math.min(pos[1], dcymin);\n dcymax = Math.max(pos[1], dcymax);\n }\n\n program.setUniformf('dcxmin', dcxmin);\n program.setUniformf('dcxmax', dcxmax);\n program.setUniformf('dcymin', dcymin);\n program.setUniformf('dcymax', dcymax);\n\n if (program.isUniformUsed('cameraParallel')) {\n program.setUniformi('cameraParallel', cam.getParallelProjection());\n }\n\n var ext = model.currentInput.getExtent();\n var spc = model.currentInput.getSpacing();\n var vsize = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(vsize, (ext[1] - ext[0] + 1) * spc[0], (ext[3] - ext[2] + 1) * spc[1], (ext[5] - ext[4] + 1) * spc[2]);\n program.setUniform3f('vSpacing', spc[0], spc[1], spc[2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos, ext[0], ext[2], ext[4]);\n model.currentInput.indexToWorldVec3(pos, pos);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat4(pos, pos, model.modelToView);\n program.setUniform3f('vOriginVC', pos[0], pos[1], pos[2]); // apply the image directions\n\n var i2wmat4 = model.currentInput.getIndexToWorld();\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].multiply(model.idxToView, model.modelToView, i2wmat4);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat3\"].multiply(model.idxNormalMatrix, keyMats.normalMatrix, actMats.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat3\"].multiply(model.idxNormalMatrix, model.idxNormalMatrix, model.currentInput.getDirection());\n var maxSamples = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].length(vsize) / model.renderable.getSampleDistance();\n\n if (maxSamples > model.renderable.getMaximumSamplesPerRay()) {\n vtkWarningMacro(\"The number of steps required \".concat(Math.ceil(maxSamples), \" is larger than the\\n specified maximum number of steps \").concat(model.renderable.getMaximumSamplesPerRay(), \".\\n Please either change the\\n volumeMapper sampleDistance or its maximum number of samples.\"));\n }\n\n var vctoijk = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(vctoijk, 1.0, 1.0, 1.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].divide(vctoijk, vctoijk, vsize);\n program.setUniform3f('vVCToIJK', vctoijk[0], vctoijk[1], vctoijk[2]);\n program.setUniform3i('volumeDimensions', dims[0], dims[1], dims[2]);\n\n if (!model.openGLRenderWindow.getWebgl2()) {\n var volInfo = model.scalarTexture.getVolumeInfo();\n program.setUniformf('texWidth', model.scalarTexture.getWidth());\n program.setUniformf('texHeight', model.scalarTexture.getHeight());\n program.setUniformi('xreps', volInfo.xreps);\n program.setUniformi('xstride', volInfo.xstride);\n program.setUniformi('ystride', volInfo.ystride);\n } // map normals through normal matrix\n // then use a point on the plane to compute the distance\n\n\n var normal = new Float64Array(3);\n var pos2 = new Float64Array(3);\n\n for (var _i = 0; _i < 6; ++_i) {\n switch (_i) {\n default:\n case 0:\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, 1.0, 0.0, 0.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos2, ext[1], ext[3], ext[5]);\n break;\n\n case 1:\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, -1.0, 0.0, 0.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos2, ext[0], ext[2], ext[4]);\n break;\n\n case 2:\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, 0.0, 1.0, 0.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos2, ext[1], ext[3], ext[5]);\n break;\n\n case 3:\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, 0.0, -1.0, 0.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos2, ext[0], ext[2], ext[4]);\n break;\n\n case 4:\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, 0.0, 0.0, 1.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos2, ext[1], ext[3], ext[5]);\n break;\n\n case 5:\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, 0.0, 0.0, -1.0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(pos2, ext[0], ext[2], ext[4]);\n break;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat3(normal, normal, model.idxNormalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat4(pos2, pos2, model.idxToView);\n var dist = -1.0 * gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].dot(pos2, normal); // we have the plane in view coordinates\n // specify the planes in view coordinates\n\n program.setUniform3f(\"vPlaneNormal\".concat(_i), normal[0], normal[1], normal[2]);\n program.setUniformf(\"vPlaneDistance\".concat(_i), dist);\n\n if (actor.getProperty().getUseLabelOutline()) {\n var image = model.currentInput;\n var worldToIndex = image.getWorldToIndex();\n program.setUniformMatrix('vWCtoIDX', worldToIndex); // Get the projection coordinate to world coordinate transformation matrix.\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].invert(model.projectionToWorld, keyMats.wcpc);\n program.setUniformMatrix('PCWCMatrix', model.projectionToWorld);\n var size = publicAPI.getRenderTargetSize();\n program.setUniformf('vpWidth', size[0]);\n program.setUniformf('vpHeight', size[1]);\n }\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].invert(model.projectionToView, keyMats.vcpc);\n program.setUniformMatrix('PCVCMatrix', model.projectionToView); // handle lighting values\n\n switch (model.lastLightComplexity) {\n default:\n case 0:\n // no lighting, tcolor is fine as is\n break;\n\n case 1: // headlight\n\n case 2: // light kit\n\n case 3:\n {\n // positional not implemented fallback to directional\n // mat3.transpose(keyMats.normalMatrix, keyMats.normalMatrix);\n var lightNum = 0;\n var lightColor = [];\n ren.getLights().forEach(function (light) {\n var status = light.getSwitch();\n\n if (status > 0) {\n var dColor = light.getColor();\n var intensity = light.getIntensity();\n lightColor[0] = dColor[0] * intensity;\n lightColor[1] = dColor[1] * intensity;\n lightColor[2] = dColor[2] * intensity;\n program.setUniform3fArray(\"lightColor\".concat(lightNum), lightColor);\n var ldir = light.getDirection();\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].set(normal, ldir[0], ldir[1], ldir[2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat3(normal, normal, keyMats.normalMatrix);\n program.setUniform3f(\"lightDirectionVC\".concat(lightNum), normal[0], normal[1], normal[2]); // camera DOP is 0,0,-1.0 in VC\n\n var halfAngle = [-0.5 * normal[0], -0.5 * normal[1], -0.5 * (normal[2] - 1.0)];\n program.setUniform3fArray(\"lightHalfAngleVC\".concat(lightNum), halfAngle);\n lightNum++;\n }\n }); // mat3.transpose(keyMats.normalMatrix, keyMats.normalMatrix);\n }\n }\n };\n\n publicAPI.setPropertyShaderParameters = function (cellBO, ren, actor) {\n var program = cellBO.getProgram();\n program.setUniformi('ctexture', model.colorTexture.getTextureUnit());\n program.setUniformi('otexture', model.opacityTexture.getTextureUnit());\n program.setUniformi('jtexture', model.jitterTexture.getTextureUnit());\n var volInfo = model.scalarTexture.getVolumeInfo();\n var vprop = actor.getProperty(); // set the component mix when independent\n\n var numComp = model.scalarTexture.getComponents();\n var iComps = actor.getProperty().getIndependentComponents();\n\n if (iComps && numComp >= 2) {\n for (var i = 0; i < numComp; i++) {\n program.setUniformf(\"mix\".concat(i), actor.getProperty().getComponentWeight(i));\n }\n } // three levels of shift scale combined into one\n // for performance in the fragment shader\n\n\n for (var _i2 = 0; _i2 < numComp; _i2++) {\n var target = iComps ? _i2 : 0;\n var sscale = volInfo.scale[_i2];\n var ofun = vprop.getScalarOpacity(target);\n var oRange = ofun.getRange();\n var oscale = sscale / (oRange[1] - oRange[0]);\n var oshift = (volInfo.offset[_i2] - oRange[0]) / (oRange[1] - oRange[0]);\n program.setUniformf(\"oshift\".concat(_i2), oshift);\n program.setUniformf(\"oscale\".concat(_i2), oscale);\n var cfun = vprop.getRGBTransferFunction(target);\n var cRange = cfun.getRange();\n program.setUniformf(\"cshift\".concat(_i2), (volInfo.offset[_i2] - cRange[0]) / (cRange[1] - cRange[0]));\n program.setUniformf(\"cscale\".concat(_i2), sscale / (cRange[1] - cRange[0]));\n }\n\n if (model.gopacity) {\n if (iComps) {\n for (var nc = 0; nc < numComp; ++nc) {\n var _sscale = volInfo.scale[nc];\n var useGO = vprop.getUseGradientOpacity(nc);\n\n if (useGO) {\n var gomin = vprop.getGradientOpacityMinimumOpacity(nc);\n var gomax = vprop.getGradientOpacityMaximumOpacity(nc);\n program.setUniformf(\"gomin\".concat(nc), gomin);\n program.setUniformf(\"gomax\".concat(nc), gomax);\n var goRange = [vprop.getGradientOpacityMinimumValue(nc), vprop.getGradientOpacityMaximumValue(nc)];\n program.setUniformf(\"goscale\".concat(nc), _sscale * (gomax - gomin) / (goRange[1] - goRange[0]));\n program.setUniformf(\"goshift\".concat(nc), -goRange[0] * (gomax - gomin) / (goRange[1] - goRange[0]) + gomin);\n } else {\n program.setUniformf(\"gomin\".concat(nc), 1.0);\n program.setUniformf(\"gomax\".concat(nc), 1.0);\n program.setUniformf(\"goscale\".concat(nc), 0.0);\n program.setUniformf(\"goshift\".concat(nc), 1.0);\n }\n }\n } else {\n var _sscale2 = volInfo.scale[numComp - 1];\n\n var _gomin = vprop.getGradientOpacityMinimumOpacity(0);\n\n var _gomax = vprop.getGradientOpacityMaximumOpacity(0);\n\n program.setUniformf('gomin0', _gomin);\n program.setUniformf('gomax0', _gomax);\n var _goRange = [vprop.getGradientOpacityMinimumValue(0), vprop.getGradientOpacityMaximumValue(0)];\n program.setUniformf('goscale0', _sscale2 * (_gomax - _gomin) / (_goRange[1] - _goRange[0]));\n program.setUniformf('goshift0', -_goRange[0] * (_gomax - _gomin) / (_goRange[1] - _goRange[0]) + _gomin);\n }\n }\n\n var vtkImageLabelOutline = actor.getProperty().getUseLabelOutline();\n\n if (vtkImageLabelOutline === true) {\n var labelOutlineThickness = actor.getProperty().getLabelOutlineThickness();\n program.setUniformi('outlineThickness', labelOutlineThickness);\n }\n\n if (model.lastLightComplexity > 0) {\n program.setUniformf('vAmbient', vprop.getAmbient());\n program.setUniformf('vDiffuse', vprop.getDiffuse());\n program.setUniformf('vSpecular', vprop.getSpecular());\n program.setUniformf('vSpecularPower', vprop.getSpecularPower());\n }\n };\n\n publicAPI.getClippingPlaneShaderParameters = function (cellBO, ren, actor) {\n if (model.renderable.getClippingPlanes().length > 0) {\n var keyMats = model.openGLCamera.getKeyMatrices(ren);\n var clipPlaneNormals = [];\n var clipPlaneDistances = [];\n var clipPlanes = model.renderable.getClippingPlanes();\n var clipPlaneSize = clipPlanes.length;\n\n for (var i = 0; i < clipPlaneSize; ++i) {\n var clipPlaneNormal = clipPlanes[i].getNormal();\n var clipPlanePos = clipPlanes[i].getOrigin();\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat3(clipPlaneNormal, clipPlaneNormal, keyMats.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].transformMat4(clipPlanePos, clipPlanePos, keyMats.wcvc);\n var clipPlaneDist = -1.0 * gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].dot(clipPlanePos, clipPlaneNormal);\n clipPlaneNormals.push(clipPlaneNormal[0]);\n clipPlaneNormals.push(clipPlaneNormal[1]);\n clipPlaneNormals.push(clipPlaneNormal[2]);\n clipPlaneDistances.push(clipPlaneDist);\n }\n\n var program = cellBO.getProgram();\n program.setUniform3fv(\"vClipPlaneNormals\", clipPlaneNormals);\n program.setUniformfv(\"vClipPlaneDistances\", clipPlaneDistances);\n }\n };\n\n publicAPI.getRenderTargetSize = function () {\n if (model.lastXYF > 1.43) {\n var sz = model.framebuffer.getSize();\n return [model.fvp[0] * sz[0], model.fvp[1] * sz[1]];\n }\n\n return model.openGLRenderWindow.getFramebufferSize();\n };\n\n publicAPI.renderPieceStart = function (ren, actor) {\n if (model.renderable.getAutoAdjustSampleDistances()) {\n var rwi = ren.getVTKWindow().getInteractor();\n var rft = rwi.getLastFrameTime(); // console.log(`last frame time ${Math.floor(1.0 / rft)}`);\n // frame time is typically for a couple frames prior\n // which makes it messy, so keep long running averages\n // of frame times and pixels rendered\n\n model.avgFrameTime = 0.97 * model.avgFrameTime + 0.03 * rft;\n model.avgWindowArea = 0.97 * model.avgWindowArea + 0.03 / (model.lastXYF * model.lastXYF);\n\n if (ren.getVTKWindow().getInteractor().isAnimating()) {\n // compute target xy factor\n var txyf = Math.sqrt(model.avgFrameTime * rwi.getDesiredUpdateRate() / model.avgWindowArea); // limit subsampling to a factor of 10\n\n if (txyf > 10.0) {\n txyf = 10.0;\n }\n\n model.targetXYF = txyf;\n } else {\n model.targetXYF = Math.sqrt(model.avgFrameTime * rwi.getStillUpdateRate() / model.avgWindowArea);\n } // have some inertia to change states around 1.43\n\n\n if (model.targetXYF < 1.53 && model.targetXYF > 1.33) {\n model.targetXYF = model.lastXYF;\n } // and add some inertia to change at all\n\n\n if (Math.abs(1.0 - model.targetXYF / model.lastXYF) < 0.1) {\n model.targetXYF = model.lastXYF;\n }\n\n model.lastXYF = model.targetXYF;\n } else {\n model.lastXYF = model.renderable.getImageSampleDistance();\n } // only use FBO beyond this value\n\n\n if (model.lastXYF <= 1.43) {\n model.lastXYF = 1.0;\n } // console.log(`last target ${model.lastXYF} ${model.targetXYF}`);\n // console.log(`awin aft ${model.avgWindowArea} ${model.avgFrameTime}`);\n\n\n var xyf = model.lastXYF;\n var size = model.openGLRenderWindow.getFramebufferSize(); // const newSize = [\n // Math.floor((size[0] / xyf) + 0.5),\n // Math.floor((size[1] / xyf) + 0.5)];\n // const diag = vtkBoundingBox.getDiagonalLength(model.currentInput.getBounds());\n // // so what is the resulting sample size roughly\n // console.log(`sam size ${diag / newSize[0]} ${diag / newSize[1]} ${model.renderable.getImageSampleDistance()}`);\n // // if the sample distance is getting far from the image sample dist\n // if (2.0 * diag / (newSize[0] + newSize[1]) > 4 * model.renderable.getSampleDistance()) {\n // model.renderable.setSampleDistance(4.0 * model.renderable.getSampleDistance());\n // }\n // if (2.0 * diag / (newSize[0] + newSize[1]) < 0.25 * model.renderable.getSampleDistance()) {\n // model.renderable.setSampleDistance(0.25 * model.renderable.getSampleDistance());\n // }\n // create/resize framebuffer if needed\n\n if (xyf > 1.43) {\n model.framebuffer.saveCurrentBindingsAndBuffers();\n\n if (model.framebuffer.getGLFramebuffer() === null) {\n model.framebuffer.create(Math.floor(size[0] * 0.7), Math.floor(size[1] * 0.7));\n model.framebuffer.populateFramebuffer();\n } else {\n var fbSize = model.framebuffer.getSize();\n\n if (fbSize[0] !== Math.floor(size[0] * 0.7) || fbSize[1] !== Math.floor(size[1] * 0.7)) {\n model.framebuffer.create(Math.floor(size[0] * 0.7), Math.floor(size[1] * 0.7));\n model.framebuffer.populateFramebuffer();\n }\n }\n\n model.framebuffer.bind();\n var gl = model.context;\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\n gl.colorMask(true, true, true, true);\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.viewport(0, 0, size[0] / xyf, size[1] / xyf);\n model.fvp = [Math.floor(size[0] / xyf) / Math.floor(size[0] * 0.7), Math.floor(size[1] / xyf) / Math.floor(size[1] * 0.7)];\n }\n\n model.context.disable(model.context.DEPTH_TEST); // make sure the BOs are up to date\n\n publicAPI.updateBufferObjects(ren, actor); // set interpolation on the texture based on property setting\n\n var iType = actor.getProperty().getInterpolationType();\n\n if (iType === vtk_js_Sources_Rendering_Core_VolumeProperty_Constants__WEBPACK_IMPORTED_MODULE_13__[\"InterpolationType\"].NEAREST) {\n model.scalarTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].NEAREST);\n model.scalarTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].NEAREST);\n } else {\n model.scalarTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n model.scalarTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n } // Bind the OpenGL, this is shared between the different primitive/cell types.\n\n\n model.lastBoundBO = null; // if we have a zbuffer texture then activate it\n\n if (model.zBufferTexture !== null) {\n model.zBufferTexture.activate();\n }\n };\n\n publicAPI.renderPieceDraw = function (ren, actor) {\n var gl = model.context; // render the texture\n\n model.scalarTexture.activate();\n model.opacityTexture.activate();\n model.colorTexture.activate();\n model.jitterTexture.activate();\n publicAPI.updateShaders(model.tris, ren, actor); // First we do the triangles, update the shader, set uniforms, etc.\n // for (let i = 0; i < 11; ++i) {\n // gl.drawArrays(gl.TRIANGLES, 66 * i, 66);\n // }\n\n gl.drawArrays(gl.TRIANGLES, 0, model.tris.getCABO().getElementCount());\n model.tris.getVAO().release();\n model.scalarTexture.deactivate();\n model.colorTexture.deactivate();\n model.opacityTexture.deactivate();\n model.jitterTexture.deactivate();\n };\n\n publicAPI.renderPieceFinish = function (ren, actor) {\n // if we have a zbuffer texture then deactivate it\n if (model.zBufferTexture !== null) {\n model.zBufferTexture.deactivate();\n }\n\n if (model.lastXYF > 1.43) {\n // now copy the framebuffer with the volume into the\n // regular buffer\n model.framebuffer.restorePreviousBindingsAndBuffers();\n\n if (model.copyShader === null) {\n model.copyShader = model.openGLRenderWindow.getShaderCache().readyShaderProgramArray(['//VTK::System::Dec', 'attribute vec4 vertexDC;', 'uniform vec2 tfactor;', 'varying vec2 tcoord;', 'void main() { tcoord = vec2(vertexDC.x*0.5 + 0.5, vertexDC.y*0.5 + 0.5) * tfactor; gl_Position = vertexDC; }'].join('\\n'), ['//VTK::System::Dec', '//VTK::Output::Dec', 'uniform sampler2D texture1;', 'varying vec2 tcoord;', 'void main() { gl_FragData[0] = texture2D(texture1,tcoord); }'].join('\\n'), '');\n var program = model.copyShader;\n model.copyVAO = vtk_js_Sources_Rendering_OpenGL_VertexArrayObject__WEBPACK_IMPORTED_MODULE_9__[\"default\"].newInstance();\n model.copyVAO.setOpenGLRenderWindow(model.openGLRenderWindow);\n model.tris.getCABO().bind();\n\n if (!model.copyVAO.addAttributeArray(program, model.tris.getCABO(), 'vertexDC', model.tris.getCABO().getVertexOffset(), model.tris.getCABO().getStride(), model.context.FLOAT, 3, model.context.FALSE)) {\n vtkErrorMacro('Error setting vertexDC in copy shader VAO.');\n }\n } else {\n model.openGLRenderWindow.getShaderCache().readyShaderProgram(model.copyShader);\n }\n\n var size = model.openGLRenderWindow.getFramebufferSize();\n model.context.viewport(0, 0, size[0], size[1]); // activate texture\n\n var tex = model.framebuffer.getColorTexture();\n tex.activate();\n model.copyShader.setUniformi('texture', tex.getTextureUnit());\n model.copyShader.setUniform2f('tfactor', model.fvp[0], model.fvp[1]);\n var gl = model.context;\n gl.blendFuncSeparate(gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); // render quad\n\n model.context.drawArrays(model.context.TRIANGLES, 0, model.tris.getCABO().getElementCount());\n tex.deactivate();\n gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n }\n };\n\n publicAPI.renderPiece = function (ren, actor) {\n publicAPI.invokeEvent({\n type: 'StartEvent'\n });\n model.renderable.update();\n model.currentInput = model.renderable.getInputData();\n publicAPI.invokeEvent({\n type: 'EndEvent'\n });\n\n if (!model.currentInput) {\n vtkErrorMacro('No input!');\n return;\n }\n\n publicAPI.renderPieceStart(ren, actor);\n publicAPI.renderPieceDraw(ren, actor);\n publicAPI.renderPieceFinish(ren, actor);\n };\n\n publicAPI.computeBounds = function (ren, actor) {\n if (!publicAPI.getInput()) {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_5__[\"uninitializeBounds\"](model.Bounds);\n return;\n }\n\n model.bounds = publicAPI.getInput().getBounds();\n };\n\n publicAPI.updateBufferObjects = function (ren, actor) {\n // Rebuild buffers if needed\n if (publicAPI.getNeedToRebuildBufferObjects(ren, actor)) {\n publicAPI.buildBufferObjects(ren, actor);\n }\n };\n\n publicAPI.getNeedToRebuildBufferObjects = function (ren, actor) {\n // first do a coarse check\n if (model.VBOBuildTime.getMTime() < publicAPI.getMTime() || model.VBOBuildTime.getMTime() < actor.getMTime() || model.VBOBuildTime.getMTime() < model.renderable.getMTime() || model.VBOBuildTime.getMTime() < actor.getProperty().getMTime() || model.VBOBuildTime.getMTime() < model.currentInput.getMTime()) {\n return true;\n }\n\n return false;\n };\n\n publicAPI.buildBufferObjects = function (ren, actor) {\n var image = model.currentInput;\n\n if (!image) {\n return;\n }\n\n var scalars = image.getPointData() && image.getPointData().getScalars();\n\n if (!scalars) {\n return;\n }\n\n var vprop = actor.getProperty();\n\n if (!model.jitterTexture.getHandle()) {\n var oTable = new Uint8Array(32 * 32);\n\n for (var i = 0; i < 32 * 32; ++i) {\n oTable[i] = 255.0 * Math.random();\n }\n\n model.jitterTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n model.jitterTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n model.jitterTexture.create2DFromRaw(32, 32, 1, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_3__[\"VtkDataTypes\"].UNSIGNED_CHAR, oTable);\n }\n\n var numComp = scalars.getNumberOfComponents();\n var iComps = vprop.getIndependentComponents();\n var numIComps = iComps ? numComp : 1; // rebuild opacity tfun?\n\n var toString = \"\".concat(vprop.getMTime());\n\n if (model.opacityTextureString !== toString) {\n var oWidth = 1024;\n var oSize = oWidth * 2 * numIComps;\n var ofTable = new Float32Array(oSize);\n var tmpTable = new Float32Array(oWidth);\n\n for (var c = 0; c < numIComps; ++c) {\n var ofun = vprop.getScalarOpacity(c);\n var opacityFactor = model.renderable.getSampleDistance() / vprop.getScalarOpacityUnitDistance(c);\n var oRange = ofun.getRange();\n ofun.getTable(oRange[0], oRange[1], oWidth, tmpTable, 1); // adjust for sample distance etc\n\n for (var _i3 = 0; _i3 < oWidth; ++_i3) {\n ofTable[c * oWidth * 2 + _i3] = 1.0 - Math.pow(1.0 - tmpTable[_i3], opacityFactor);\n ofTable[c * oWidth * 2 + _i3 + oWidth] = ofTable[c * oWidth * 2 + _i3];\n }\n }\n\n model.opacityTexture.releaseGraphicsResources(model.openGLRenderWindow);\n model.opacityTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n model.opacityTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR); // use float texture where possible because we really need the resolution\n // for this table. Errors in low values of opacity accumulate to\n // visible artifacts. High values of opacity quickly terminate without\n // artifacts.\n\n if (model.openGLRenderWindow.getWebgl2() || model.context.getExtension('OES_texture_float') && model.context.getExtension('OES_texture_float_linear')) {\n model.opacityTexture.create2DFromRaw(oWidth, 2 * numIComps, 1, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_3__[\"VtkDataTypes\"].FLOAT, ofTable);\n } else {\n var _oTable = new Uint8Array(oSize);\n\n for (var _i4 = 0; _i4 < oSize; ++_i4) {\n _oTable[_i4] = 255.0 * ofTable[_i4];\n }\n\n model.opacityTexture.create2DFromRaw(oWidth, 2 * numIComps, 1, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_3__[\"VtkDataTypes\"].UNSIGNED_CHAR, _oTable);\n }\n\n model.opacityTextureString = toString;\n } // rebuild color tfun?\n\n\n toString = \"\".concat(vprop.getMTime());\n\n if (model.colorTextureString !== toString) {\n var cWidth = 1024;\n var cSize = cWidth * 2 * numIComps * 3;\n var cTable = new Uint8Array(cSize);\n\n var _tmpTable = new Float32Array(cWidth * 3);\n\n for (var _c = 0; _c < numIComps; ++_c) {\n var cfun = vprop.getRGBTransferFunction(_c);\n var cRange = cfun.getRange();\n cfun.getTable(cRange[0], cRange[1], cWidth, _tmpTable, 1);\n\n for (var _i5 = 0; _i5 < cWidth * 3; ++_i5) {\n cTable[_c * cWidth * 6 + _i5] = 255.0 * _tmpTable[_i5];\n cTable[_c * cWidth * 6 + _i5 + cWidth * 3] = 255.0 * _tmpTable[_i5];\n }\n }\n\n model.colorTexture.releaseGraphicsResources(model.openGLRenderWindow);\n model.colorTexture.setMinificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n model.colorTexture.setMagnificationFilter(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Filter\"].LINEAR);\n model.colorTexture.create2DFromRaw(cWidth, 2 * numIComps, 3, vtk_js_Sources_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_3__[\"VtkDataTypes\"].UNSIGNED_CHAR, cTable);\n model.colorTextureString = toString;\n } // rebuild the scalarTexture if the data has changed\n\n\n toString = \"\".concat(image.getMTime());\n\n if (model.scalarTextureString !== toString) {\n // Build the textures\n var dims = image.getDimensions();\n model.scalarTexture.releaseGraphicsResources(model.openGLRenderWindow);\n model.scalarTexture.resetFormatAndType();\n model.scalarTexture.create3DFilterableFromRaw(dims[0], dims[1], dims[2], numComp, scalars.getDataType(), scalars.getData()); // console.log(model.scalarTexture.get());\n\n model.scalarTextureString = toString;\n }\n\n if (!model.tris.getCABO().getElementCount()) {\n // build the CABO\n var ptsArray = new Float32Array(12);\n\n for (var _i6 = 0; _i6 < 4; _i6++) {\n ptsArray[_i6 * 3] = _i6 % 2 * 2 - 1.0;\n ptsArray[_i6 * 3 + 1] = _i6 > 1 ? 1.0 : -1.0;\n ptsArray[_i6 * 3 + 2] = -1.0;\n }\n\n var cellArray = new Uint16Array(8);\n cellArray[0] = 3;\n cellArray[1] = 0;\n cellArray[2] = 1;\n cellArray[3] = 3;\n cellArray[4] = 3;\n cellArray[5] = 0;\n cellArray[6] = 3;\n cellArray[7] = 2; // const dim = 12.0;\n // const ptsArray = new Float32Array(3 * dim * dim);\n // for (let i = 0; i < dim; i++) {\n // for (let j = 0; j < dim; j++) {\n // const offset = ((i * dim) + j) * 3;\n // ptsArray[offset] = (2.0 * (i / (dim - 1.0))) - 1.0;\n // ptsArray[offset + 1] = (2.0 * (j / (dim - 1.0))) - 1.0;\n // ptsArray[offset + 2] = -1.0;\n // }\n // }\n // const cellArray = new Uint16Array(8 * (dim - 1) * (dim - 1));\n // for (let i = 0; i < dim - 1; i++) {\n // for (let j = 0; j < dim - 1; j++) {\n // const offset = 8 * ((i * (dim - 1)) + j);\n // cellArray[offset] = 3;\n // cellArray[offset + 1] = (i * dim) + j;\n // cellArray[offset + 2] = (i * dim) + 1 + j;\n // cellArray[offset + 3] = ((i + 1) * dim) + 1 + j;\n // cellArray[offset + 4] = 3;\n // cellArray[offset + 5] = (i * dim) + j;\n // cellArray[offset + 6] = ((i + 1) * dim) + 1 + j;\n // cellArray[offset + 7] = ((i + 1) * dim) + j;\n // }\n // }\n\n var points = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 3,\n values: ptsArray\n });\n points.setName('points');\n var cells = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n numberOfComponents: 1,\n values: cellArray\n });\n model.tris.getCABO().createVBO(cells, 'polys', vtk_js_Sources_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_11__[\"Representation\"].SURFACE, {\n points: points,\n cellOffset: 0\n });\n }\n\n model.VBOBuildTime.modified();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n context: null,\n VBOBuildTime: null,\n scalarTexture: null,\n scalarTextureString: null,\n opacityTexture: null,\n opacityTextureString: null,\n colorTexture: null,\n colorTextureString: null,\n jitterTexture: null,\n tris: null,\n framebuffer: null,\n copyShader: null,\n copyVAO: null,\n lastXYF: 1.0,\n targetXYF: 1.0,\n zBufferTexture: null,\n lastZBufferTexture: null,\n lastLightComplexity: 0,\n fullViewportTime: 1.0,\n idxToView: null,\n idxNormalMatrix: null,\n modelToView: null,\n projectionToView: null,\n avgWindowArea: 0.0,\n avgFrameTime: 0.0\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_10__[\"default\"].extend(publicAPI, model, initialValues);\n model.VBOBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"obj\"](model.VBOBuildTime, {\n mtime: 0\n });\n model.tris = vtk_js_Sources_Rendering_OpenGL_Helper__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n model.scalarTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.opacityTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.colorTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.jitterTexture = vtk_js_Sources_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.jitterTexture.setWrapS(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Wrap\"].REPEAT);\n model.jitterTexture.setWrapT(vtk_js_Sources_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_12__[\"Wrap\"].REPEAT);\n model.framebuffer = vtk_js_Sources_Rendering_OpenGL_Framebuffer__WEBPACK_IMPORTED_MODULE_6__[\"default\"].newInstance();\n model.idxToView = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].identity(new Float64Array(16));\n model.idxNormalMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat3\"].identity(new Float64Array(9));\n model.modelToView = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].identity(new Float64Array(16));\n model.projectionToView = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].identity(new Float64Array(16));\n model.projectionToWorld = gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"mat4\"].identity(new Float64Array(16)); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['context']); // Object methods\n\n vtkOpenGLVolumeMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkOpenGLVolumeMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to OpenGL backend if imported\n\nObject(vtk_js_Sources_Rendering_OpenGL_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_17__[\"registerOverride\"])('vtkVolumeMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/VolumeMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl ***! - \******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = \"//VTK::System::Dec\\n\\n/*=========================================================================\\n\\n Program: Visualization Toolkit\\n Module: vtkPolyDataFS.glsl\\n\\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\\n All rights reserved.\\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\\n\\n This software is distributed WITHOUT ANY WARRANTY; without even\\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\\n PURPOSE. See the above copyright notice for more information.\\n\\n=========================================================================*/\\n// Template for the polydata mappers fragment shader\\n\\nuniform int PrimitiveIDOffset;\\n\\n// VC position of this fragment\\n//VTK::PositionVC::Dec\\n\\n// optional color passed in from the vertex shader, vertexColor\\n//VTK::Color::Dec\\n\\n// optional surface normal declaration\\n//VTK::Normal::Dec\\n\\n// extra lighting parameters\\n//VTK::Light::Dec\\n\\n// Texture coordinates\\n//VTK::TCoord::Dec\\n\\n// picking support\\n//VTK::Picking::Dec\\n\\n// Depth Peeling Support\\n//VTK::DepthPeeling::Dec\\n\\n// clipping plane vars\\n//VTK::Clip::Dec\\n\\n// the output of this shader\\n//VTK::Output::Dec\\n\\n// Apple Bug\\n//VTK::PrimID::Dec\\n\\n// handle coincident offsets\\n//VTK::Coincident::Dec\\n\\n//VTK::ZBuffer::Dec\\n\\nvoid main()\\n{\\n // VC position of this fragment. This should not branch/return/discard.\\n //VTK::PositionVC::Impl\\n\\n // Place any calls that require uniform flow (e.g. dFdx) here.\\n //VTK::UniformFlow::Impl\\n\\n // Set gl_FragDepth here (gl_FragCoord.z by default)\\n //VTK::Depth::Impl\\n\\n // Early depth peeling abort:\\n //VTK::DepthPeeling::PreColor\\n\\n // Apple Bug\\n //VTK::PrimID::Impl\\n\\n //VTK::Clip::Impl\\n\\n //VTK::Color::Impl\\n\\n // Generate the normal if we are not passed in one\\n //VTK::Normal::Impl\\n\\n //VTK::Light::Impl\\n\\n //VTK::TCoord::Impl\\n\\n if (gl_FragData[0].a <= 0.0)\\n {\\n discard;\\n }\\n\\n //VTK::DepthPeeling::Impl\\n\\n //VTK::Picking::Impl\\n\\n // handle coincident offsets\\n //VTK::Coincident::Impl\\n\\n //VTK::ZBuffer::Impl\\n}\\n\"\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl ***! - \******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = \"//VTK::System::Dec\\n\\n/*=========================================================================\\n\\n Program: Visualization Toolkit\\n Module: vtkPolyDataVS.glsl\\n\\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\\n All rights reserved.\\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\\n\\n This software is distributed WITHOUT ANY WARRANTY; without even\\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\\n PURPOSE. See the above copyright notice for more information.\\n\\n=========================================================================*/\\n\\nattribute vec4 vertexMC;\\n\\n// frag position in VC\\n//VTK::PositionVC::Dec\\n\\n// optional normal declaration\\n//VTK::Normal::Dec\\n\\n// extra lighting parameters\\n//VTK::Light::Dec\\n\\n// Texture coordinates\\n//VTK::TCoord::Dec\\n\\n// material property values\\n//VTK::Color::Dec\\n\\n// clipping plane vars\\n//VTK::Clip::Dec\\n\\n// camera and actor matrix values\\n//VTK::Camera::Dec\\n\\n// Apple Bug\\n//VTK::PrimID::Dec\\n\\n// picking support\\n//VTK::Picking::Dec\\n\\nvoid main()\\n{\\n //VTK::Color::Impl\\n\\n //VTK::Normal::Impl\\n\\n //VTK::TCoord::Impl\\n\\n //VTK::Clip::Impl\\n\\n //VTK::PrimID::Impl\\n\\n //VTK::PositionVC::Impl\\n\\n //VTK::Light::Impl\\n\\n //VTK::Picking::Impl\\n}\\n\"\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyDataVS.glsl?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeFS.glsl": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeFS.glsl ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = \"//VTK::System::Dec\\n\\n/*=========================================================================\\n\\n Program: Visualization Toolkit\\n Module: vtkVolumeFS.glsl\\n\\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\\n All rights reserved.\\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\\n\\n This software is distributed WITHOUT ANY WARRANTY; without even\\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\\n PURPOSE. See the above copyright notice for more information.\\n\\n=========================================================================*/\\n// Template for the volume mappers fragment shader\\n\\n// the output of this shader\\n//VTK::Output::Dec\\n\\nvarying vec3 vertexVCVSOutput;\\n\\n// first declare the settings from the mapper\\n// that impact the code paths in here\\n\\n// always set vtkNumComponents 1,2,3,4\\n//VTK::NumComponents\\n\\n// possibly define vtkUseTriliear\\n//VTK::TrilinearOn\\n\\n// possibly define vtkIndependentComponents\\n//VTK::IndependentComponentsOn\\n\\n// possibly define any \\\"proportional\\\" components\\n//VTK::vtkProportionalComponents\\n\\n// Define the blend mode to use\\n#define vtkBlendMode //VTK::BlendMode\\n\\n// Possibly define vtkImageLabelOutlineOn\\n//VTK::ImageLabelOutlineOn\\n\\n#ifdef vtkImageLabelOutlineOn\\nuniform int outlineThickness;\\nuniform float vpWidth;\\nuniform float vpHeight;\\nuniform mat4 PCWCMatrix;\\nuniform mat4 vWCtoIDX;\\n#endif\\n\\n// define vtkLightComplexity\\n//VTK::LightComplexity\\n#if vtkLightComplexity > 0\\nuniform float vSpecularPower;\\nuniform float vAmbient;\\nuniform float vDiffuse;\\nuniform float vSpecular;\\n//VTK::Light::Dec\\n#endif\\n\\n// possibly define vtkGradientOpacityOn\\n//VTK::GradientOpacityOn\\n#ifdef vtkGradientOpacityOn\\nuniform float goscale0;\\nuniform float goshift0;\\nuniform float gomin0;\\nuniform float gomax0;\\n#if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\\nuniform float goscale1;\\nuniform float goshift1;\\nuniform float gomin1;\\nuniform float gomax1;\\n#if vtkNumComponents >= 3\\nuniform float goscale2;\\nuniform float goshift2;\\nuniform float gomin2;\\nuniform float gomax2;\\n#endif\\n#if vtkNumComponents >= 4\\nuniform float goscale3;\\nuniform float goshift3;\\nuniform float gomin3;\\nuniform float gomax3;\\n#endif\\n#endif\\n#endif\\n\\n// if you want to see the raw tiled\\n// data in webgl1 uncomment the following line\\n// #define debugtile\\n\\n// camera values\\nuniform float camThick;\\nuniform float camNear;\\nuniform float camFar;\\nuniform int cameraParallel;\\n\\n// values describing the volume geometry\\nuniform vec3 vOriginVC;\\nuniform vec3 vSpacing;\\nuniform ivec3 volumeDimensions; // 3d texture dimensions\\nuniform vec3 vPlaneNormal0;\\nuniform float vPlaneDistance0;\\nuniform vec3 vPlaneNormal1;\\nuniform float vPlaneDistance1;\\nuniform vec3 vPlaneNormal2;\\nuniform float vPlaneDistance2;\\nuniform vec3 vPlaneNormal3;\\nuniform float vPlaneDistance3;\\nuniform vec3 vPlaneNormal4;\\nuniform float vPlaneDistance4;\\nuniform vec3 vPlaneNormal5;\\nuniform float vPlaneDistance5;\\n\\n//VTK::ClipPlane::Dec\\n\\n// opacity and color textures\\nuniform sampler2D otexture;\\nuniform float oshift0;\\nuniform float oscale0;\\nuniform sampler2D ctexture;\\nuniform float cshift0;\\nuniform float cscale0;\\n\\n// jitter texture\\nuniform sampler2D jtexture;\\n\\n// some 3D texture values\\nuniform float sampleDistance;\\nuniform vec3 vVCToIJK;\\n\\n// the heights defined below are the locations\\n// for the up to four components of the tfuns\\n// the tfuns have a height of 2XnumComps pixels so the\\n// values are computed to hit the middle of the two rows\\n// for that component\\n#ifdef vtkIndependentComponentsOn\\n#if vtkNumComponents == 2\\nuniform float mix0;\\nuniform float mix1;\\n#define height0 0.25\\n#define height1 0.75\\n#endif\\n#if vtkNumComponents == 3\\nuniform float mix0;\\nuniform float mix1;\\nuniform float mix2;\\n#define height0 0.17\\n#define height1 0.5\\n#define height2 0.83\\n#endif\\n#if vtkNumComponents == 4\\nuniform float mix0;\\nuniform float mix1;\\nuniform float mix2;\\nuniform float mix3;\\n#define height0 0.125\\n#define height1 0.375\\n#define height2 0.625\\n#define height3 0.875\\n#endif\\n#endif\\n\\n#if vtkNumComponents >= 2\\nuniform float oshift1;\\nuniform float oscale1;\\nuniform float cshift1;\\nuniform float cscale1;\\n#endif\\n#if vtkNumComponents >= 3\\nuniform float oshift2;\\nuniform float oscale2;\\nuniform float cshift2;\\nuniform float cscale2;\\n#endif\\n#if vtkNumComponents >= 4\\nuniform float oshift3;\\nuniform float oscale3;\\nuniform float cshift3;\\nuniform float cscale3;\\n#endif\\n\\n// declaration for intermixed geometry\\n//VTK::ZBuffer::Dec\\n\\n// Lighting values\\n//VTK::Light::Dec\\n\\n//=======================================================================\\n// Webgl2 specific version of functions\\n#if __VERSION__ == 300\\n\\nuniform highp sampler3D texture1;\\n\\nvec4 getTextureValue(vec3 pos)\\n{\\n vec4 tmp = texture(texture1, pos);\\n#if vtkNumComponents == 1\\n tmp.a = tmp.r;\\n#endif\\n#if vtkNumComponents == 2\\n tmp.a = tmp.g;\\n#endif\\n#if vtkNumComponents == 3\\n tmp.a = length(tmp.rgb);\\n#endif\\n return tmp;\\n}\\n\\n//=======================================================================\\n// WebGL1 specific version of functions\\n#else\\n\\nuniform sampler2D texture1;\\n\\nuniform float texWidth;\\nuniform float texHeight;\\nuniform int xreps;\\nuniform int xstride;\\nuniform int ystride;\\n\\n// if computing triliear values from multiple z slices\\n#ifdef vtkTriliearOn\\nvec4 getTextureValue(vec3 ijk)\\n{\\n float zoff = 1.0/float(volumeDimensions.z);\\n vec4 val1 = getOneTextureValue(ijk);\\n vec4 val2 = getOneTextureValue(vec3(ijk.xy, ijk.z + zoff));\\n\\n float indexZ = float(volumeDimensions)*ijk.z;\\n float zmix = indexZ - floor(indexZ);\\n\\n return mix(val1, val2, zmix);\\n}\\n\\nvec4 getOneTextureValue(vec3 ijk)\\n#else // nearest or fast linear\\nvec4 getTextureValue(vec3 ijk)\\n#endif\\n{\\n vec3 tdims = vec3(volumeDimensions);\\n\\n#ifdef debugtile\\n vec2 tpos = vec2(ijk.x, ijk.y);\\n vec4 tmp = texture2D(texture1, tpos);\\n tmp.a = 1.0;\\n\\n#else\\n int z = int(ijk.z * tdims.z);\\n int yz = z / xreps;\\n int xz = z - yz*xreps;\\n\\n int tileWidth = volumeDimensions.x/xstride;\\n int tileHeight = volumeDimensions.y/ystride;\\n\\n xz *= tileWidth;\\n yz *= tileHeight;\\n\\n float ni = float(xz) + (ijk.x*float(tileWidth));\\n float nj = float(yz) + (ijk.y*float(tileHeight));\\n\\n vec2 tpos = vec2(ni/texWidth, nj/texHeight);\\n\\n vec4 tmp = texture2D(texture1, tpos);\\n\\n#if vtkNumComponents == 1\\n tmp.a = tmp.r;\\n#endif\\n#if vtkNumComponents == 2\\n tmp.g = tmp.a;\\n#endif\\n#if vtkNumComponents == 3\\n tmp.a = length(tmp.rgb);\\n#endif\\n#endif\\n\\n return tmp;\\n}\\n\\n// End of Webgl1 specific code\\n//=======================================================================\\n#endif\\n\\n//=======================================================================\\n// compute the normal and gradient magnitude for a position\\nvec4 computeNormal(vec3 pos, float scalar, vec3 tstep)\\n{\\n vec4 result;\\n\\n result.x = getTextureValue(pos + vec3(tstep.x, 0.0, 0.0)).a - scalar;\\n result.y = getTextureValue(pos + vec3(0.0, tstep.y, 0.0)).a - scalar;\\n result.z = getTextureValue(pos + vec3(0.0, 0.0, tstep.z)).a - scalar;\\n\\n // divide by spacing\\n result.xyz /= vSpacing;\\n\\n result.w = length(result.xyz);\\n\\n // rotate to View Coords\\n result.xyz =\\n result.x * vPlaneNormal0 +\\n result.y * vPlaneNormal2 +\\n result.z * vPlaneNormal4;\\n\\n if (result.w > 0.0)\\n {\\n result.xyz /= result.w;\\n }\\n return result;\\n}\\n\\n#ifdef vtkImageLabelOutlineOn\\nvec3 fragCoordToIndexSpace(vec4 fragCoord) {\\n vec4 pcPos = vec4(\\n (fragCoord.x / vpWidth - 0.5) * 2.0,\\n (fragCoord.y / vpHeight - 0.5) * 2.0,\\n (fragCoord.z - 0.5) * 2.0,\\n 1.0);\\n\\n vec4 worldCoord = PCWCMatrix * pcPos;\\n vec4 vertex = (worldCoord/worldCoord.w);\\n\\n return (vWCtoIDX * vertex).xyz / vec3(volumeDimensions);\\n}\\n#endif\\n\\n//=======================================================================\\n// compute the normals and gradient magnitudes for a position\\n// for independent components\\nmat4 computeMat4Normal(vec3 pos, vec4 tValue, vec3 tstep)\\n{\\n mat4 result;\\n vec4 distX = getTextureValue(pos + vec3(tstep.x, 0.0, 0.0)) - tValue;\\n vec4 distY = getTextureValue(pos + vec3(0.0, tstep.y, 0.0)) - tValue;\\n vec4 distZ = getTextureValue(pos + vec3(0.0, 0.0, tstep.z)) - tValue;\\n\\n // divide by spacing\\n distX /= vSpacing.x;\\n distY /= vSpacing.y;\\n distZ /= vSpacing.z;\\n\\n mat3 rot;\\n rot[0] = vPlaneNormal0;\\n rot[1] = vPlaneNormal2;\\n rot[2] = vPlaneNormal4;\\n\\n#if !defined(vtkComponent0Proportional)\\n result[0].xyz = vec3(distX.r, distY.r, distZ.r);\\n result[0].a = length(result[0].xyz);\\n result[0].xyz *= rot;\\n if (result[0].w > 0.0)\\n {\\n result[0].xyz /= result[0].w;\\n }\\n#endif\\n\\n// optionally compute the 2nd component\\n#if vtkNumComponents >= 2 && !defined(vtkComponent1Proportional)\\n result[1].xyz = vec3(distX.g, distY.g, distZ.g);\\n result[1].a = length(result[1].xyz);\\n result[1].xyz *= rot;\\n if (result[1].w > 0.0)\\n {\\n result[1].xyz /= result[1].w;\\n }\\n#endif\\n\\n// optionally compute the 3rd component\\n#if vtkNumComponents >= 3 && !defined(vtkComponent2Proportional)\\n result[2].xyz = vec3(distX.b, distY.b, distZ.b);\\n result[2].a = length(result[2].xyz);\\n result[2].xyz *= rot;\\n if (result[2].w > 0.0)\\n {\\n result[2].xyz /= result[2].w;\\n }\\n#endif\\n\\n// optionally compute the 4th component\\n#if vtkNumComponents >= 4 && !defined(vtkComponent3Proportional)\\n result[3].xyz = vec3(distX.a, distY.a, distZ.a);\\n result[3].a = length(result[3].xyz);\\n result[3].xyz *= rot;\\n if (result[3].w > 0.0)\\n {\\n result[3].xyz /= result[3].w;\\n }\\n#endif\\n\\n return result;\\n}\\n\\n//=======================================================================\\n// Given a normal compute the gradient opacity factors\\n//\\nfloat computeGradientOpacityFactor(\\n vec4 normal, float goscale, float goshift, float gomin, float gomax)\\n{\\n#if defined(vtkGradientOpacityOn)\\n return clamp(normal.a*goscale + goshift, gomin, gomax);\\n#else\\n return 1.0;\\n#endif\\n}\\n\\n#if vtkLightComplexity > 0\\nvoid applyLighting(inout vec3 tColor, vec4 normal)\\n{\\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\\n vec3 specular = vec3(0.0, 0.0, 0.0);\\n //VTK::Light::Impl\\n tColor.rgb = tColor.rgb*(diffuse*vDiffuse + vAmbient) + specular*vSpecular;\\n}\\n#endif\\n\\n//=======================================================================\\n// Given a texture value compute the color and opacity\\n//\\nvec4 getColorForValue(vec4 tValue, vec3 posIS, vec3 tstep)\\n{\\n#ifdef vtkImageLabelOutlineOn\\n vec3 centerPosIS = fragCoordToIndexSpace(gl_FragCoord); // pos in texture space\\n vec4 centerValue = getTextureValue(centerPosIS);\\n bool pixelOnBorder = false;\\n vec4 tColor = texture2D(ctexture, vec2(centerValue.r * cscale0 + cshift0, 0.5));\\n\\n // Get alpha of segment from opacity function.\\n tColor.a = texture2D(otexture, vec2(centerValue.r * oscale0 + oshift0, 0.5)).r;\\n\\n // Only perform outline check on fragments rendering voxels that aren't invisible.\\n // Saves a bunch of needless checks on the background.\\n // TODO define epsilon when building shader?\\n if (float(tColor.a) > 0.01) {\\n for (int i = -outlineThickness; i <= outlineThickness; i++) {\\n for (int j = -outlineThickness; j <= outlineThickness; j++) {\\n if (i == 0 || j == 0) {\\n continue;\\n }\\n\\n vec4 neighborPixelCoord = vec4(gl_FragCoord.x + float(i),\\n gl_FragCoord.y + float(j),\\n gl_FragCoord.z, gl_FragCoord.w);\\n\\n vec3 neighborPosIS = fragCoordToIndexSpace(neighborPixelCoord);\\n vec4 value = getTextureValue(neighborPosIS);\\n\\n // If any of my neighbours are not the same value as I\\n // am, this means I am on the border of the segment.\\n // We can break the loops\\n if (any(notEqual(value, centerValue))) {\\n pixelOnBorder = true;\\n break;\\n }\\n }\\n\\n if (pixelOnBorder == true) {\\n break;\\n }\\n }\\n\\n // If I am on the border, I am displayed at full opacity\\n if (pixelOnBorder == true) {\\n tColor.a = 1.0;\\n }\\n }\\n\\n#else\\n // compute the normal and gradient magnitude if needed\\n // We compute it as a vec4 if possible otherwise a mat4\\n //\\n vec4 goFactor = vec4(1.0,1.0,1.0,1.0);\\n\\n // compute the normal vectors as needed\\n #if (vtkLightComplexity > 0) || defined(vtkGradientOpacityOn)\\n #if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\\n mat4 normalMat = computeMat4Normal(posIS, tValue, tstep);\\n #if !defined(vtkComponent0Proportional)\\n vec4 normal0 = normalMat[0];\\n #endif\\n #if !defined(vtkComponent1Proportional)\\n vec4 normal1 = normalMat[1];\\n #endif\\n #if vtkNumComponents > 2\\n #if !defined(vtkComponent2Proportional)\\n vec4 normal2 = normalMat[2];\\n #endif\\n #if vtkNumComponents > 3\\n #if !defined(vtkComponent3Proportional)\\n vec4 normal3 = normalMat[3];\\n #endif\\n #endif\\n #endif\\n #else\\n vec4 normal0 = computeNormal(posIS, tValue.a, tstep);\\n #endif\\n #endif\\n\\n // compute gradient opacity factors as needed\\n #if defined(vtkGradientOpacityOn)\\n #if !defined(vtkComponent0Proportional)\\n goFactor.x =\\n computeGradientOpacityFactor(normal0, goscale0, goshift0, gomin0, gomax0);\\n #endif\\n #if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\\n #if !defined(vtkComponent1Proportional)\\n goFactor.y =\\n computeGradientOpacityFactor(normal1, goscale1, goshift1, gomin1, gomax1);\\n #endif\\n #if vtkNumComponents > 2\\n #if !defined(vtkComponent2Proportional)\\n goFactor.z =\\n computeGradientOpacityFactor(normal2, goscale2, goshift2, gomin2, gomax2);\\n #endif\\n #if vtkNumComponents > 3\\n #if !defined(vtkComponent3Proportional)\\n goFactor.w =\\n computeGradientOpacityFactor(normal3, goscale3, goshift3, gomin3, gomax3);\\n #endif\\n #endif\\n #endif\\n #endif\\n #endif\\n\\n // single component is always independent\\n #if vtkNumComponents == 1\\n vec4 tColor = texture2D(ctexture, vec2(tValue.r * cscale0 + cshift0, 0.5));\\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, 0.5)).r;\\n #endif\\n\\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\\n vec4 tColor = mix0*texture2D(ctexture, vec2(tValue.r * cscale0 + cshift0, height0));\\n #if !defined(vtkComponent0Proportional)\\n tColor.a = goFactor.x*mix0*texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, height0)).r;\\n #else\\n float pwfValue = texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, height0)).r;\\n tColor *= pwfValue;\\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix0));\\n #endif\\n\\n vec3 tColor1 = mix1*texture2D(ctexture, vec2(tValue.g * cscale1 + cshift1, height1)).rgb;\\n #if !defined(vtkComponent1Proportional)\\n tColor.a += goFactor.y*mix1*texture2D(otexture, vec2(tValue.g * oscale1 + oshift1, height1)).r;\\n #else\\n float pwfValue = texture2D(otexture, vec2(tValue.g * oscale1 + oshift1, height1)).r;\\n tColor1 *= pwfValue;\\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix1));\\n #endif\\n\\n #if vtkNumComponents >= 3\\n vec3 tColor2 = mix2*texture2D(ctexture, vec2(tValue.b * cscale2 + cshift2, height2)).rgb;\\n #if !defined(vtkComponent2Proportional)\\n tColor.a += goFactor.z*mix2*texture2D(otexture, vec2(tValue.b * oscale2 + oshift2, height2)).r;\\n #else\\n float pwfValue = texture2D(otexture, vec2(tValue.b * oscale2 + oshift2, height2)).r;\\n tColor2 *= pwfValue;\\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix2));\\n #endif\\n\\n #if vtkNumComponents >= 4\\n vec3 tColor3 = mix3*texture2D(ctexture, vec2(tValue.a * cscale3 + cshift3, height3)).rgb;\\n #if !defined(vtkComponent3Proportional)\\n tColor.a += goFactor.w*mix3*texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, height3)).r;\\n #else\\n float pwfValue = texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, height3)).r;\\n tColor3 *= pwfValue;\\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix3));\\n #endif\\n #endif\\n #endif\\n #else // then not independent\\n\\n #if vtkNumComponents == 2\\n float lum = tValue.r * cscale0 + cshift0;\\n float alpha = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale1 + oshift1, 0.5)).r;\\n vec4 tColor = vec4(lum, lum, lum, alpha);\\n #endif\\n #if vtkNumComponents == 3\\n vec4 tColor;\\n tColor.r = tValue.r * cscale0 + cshift0;\\n tColor.g = tValue.g * cscale1 + cshift1;\\n tColor.b = tValue.b * cscale2 + cshift2;\\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale0 + oshift0, 0.5)).r;\\n #endif\\n #if vtkNumComponents == 4\\n vec4 tColor;\\n tColor.r = tValue.r * cscale0 + cshift0;\\n tColor.g = tValue.g * cscale1 + cshift1;\\n tColor.b = tValue.b * cscale2 + cshift2;\\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, 0.5)).r;\\n #endif\\n #endif // dependent\\n\\n // apply lighting if requested as appropriate\\n #if vtkLightComplexity > 0\\n #if !defined(vtkComponent0Proportional)\\n applyLighting(tColor.rgb, normal0);\\n #endif\\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\\n #if !defined(vtkComponent1Proportional)\\n applyLighting(tColor1, normal1);\\n #endif\\n #if vtkNumComponents >= 3\\n #if !defined(vtkComponent2Proportional)\\n applyLighting(tColor2, normal2);\\n #endif\\n #if vtkNumComponents >= 4\\n #if !defined(vtkComponent3Proportional)\\n applyLighting(tColor3, normal3);\\n #endif\\n #endif\\n #endif\\n #endif\\n#endif\\n\\n// perform final independent blend as needed\\n#if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\\n tColor.rgb += tColor1;\\n#if vtkNumComponents >= 3\\n tColor.rgb += tColor2;\\n#if vtkNumComponents >= 4\\n tColor.rgb += tColor3;\\n#endif\\n#endif\\n#endif\\n\\n#endif\\n\\n\\n\\n\\n\\n\\n\\nreturn tColor;\\n}\\n\\n\\n\\n//=======================================================================\\n// Apply the specified blend mode operation along the ray's path.\\n//\\nvoid applyBlend(vec3 posIS, vec3 endIS, float sampleDistanceIS, vec3 tdims)\\n{\\n vec3 tstep = 1.0/tdims;\\n\\n // start slightly inside and apply some jitter\\n vec3 delta = endIS - posIS;\\n vec3 stepIS = normalize(delta)*sampleDistanceIS;\\n float raySteps = length(delta)/sampleDistanceIS;\\n\\n // avoid 0.0 jitter\\n float jitter = 0.01 + 0.99*texture2D(jtexture, gl_FragCoord.xy/32.0).r;\\n float stepsTraveled = jitter;\\n\\n // local vars for the loop\\n vec4 color = vec4(0.0, 0.0, 0.0, 0.0);\\n vec4 tValue;\\n vec4 tColor;\\n\\n // if we have less than one step then pick the middle point\\n // as our value\\n // if (raySteps <= 1.0)\\n // {\\n // posIS = (posIS + endIS)*0.5;\\n // }\\n\\n // Perform initial step at the volume boundary\\n // compute the scalar\\n tValue = getTextureValue(posIS);\\n\\n #if vtkBlendMode == 0 // COMPOSITE_BLEND\\n // now map through opacity and color\\n tColor = getColorForValue(tValue, posIS, tstep);\\n\\n // handle very thin volumes\\n if (raySteps <= 1.0)\\n {\\n tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps);\\n gl_FragData[0] = tColor;\\n return;\\n }\\n\\n tColor.a = 1.0 - pow(1.0 - tColor.a, jitter);\\n color = vec4(tColor.rgb*tColor.a, tColor.a);\\n posIS += (jitter*stepIS);\\n\\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\\n {\\n if (stepsTraveled + 1.0 >= raySteps) { break; }\\n\\n // compute the scalar\\n tValue = getTextureValue(posIS);\\n\\n // now map through opacity and color\\n tColor = getColorForValue(tValue, posIS, tstep);\\n\\n float mix = (1.0 - color.a);\\n\\n // this line should not be needed but nvidia seems to not handle\\n // the break correctly on windows/chrome 58 angle\\n //mix = mix * sign(max(raySteps - stepsTraveled - 1.0, 0.0));\\n\\n color = color + vec4(tColor.rgb*tColor.a, tColor.a)*mix;\\n stepsTraveled++;\\n posIS += stepIS;\\n if (color.a > 0.99) { color.a = 1.0; break; }\\n }\\n\\n if (color.a < 0.99 && (raySteps - stepsTraveled) > 0.0)\\n {\\n posIS = endIS;\\n\\n // compute the scalar\\n tValue = getTextureValue(posIS);\\n\\n // now map through opacity and color\\n tColor = getColorForValue(tValue, posIS, tstep);\\n tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps - stepsTraveled);\\n\\n float mix = (1.0 - color.a);\\n color = color + vec4(tColor.rgb*tColor.a, tColor.a)*mix;\\n }\\n\\n gl_FragData[0] = vec4(color.rgb/color.a, color.a);\\n #endif\\n #if vtkBlendMode == 1 || vtkBlendMode == 2\\n // MAXIMUM_INTENSITY_BLEND || MINIMUM_INTENSITY_BLEND\\n // Find maximum/minimum intensity along the ray.\\n\\n // Define the operation we will use (min or max)\\n #if vtkBlendMode == 1\\n #define OP max\\n #else\\n #define OP min\\n #endif\\n\\n // If the clipping range is shorter than the sample distance\\n // we can skip the sampling loop along the ray.\\n if (raySteps <= 1.0)\\n {\\n gl_FragData[0] = getColorForValue(tValue, posIS, tstep);\\n return;\\n }\\n\\n vec4 value = tValue;\\n posIS += (jitter*stepIS);\\n\\n // Sample along the ray until MaximumSamplesValue,\\n // ending slightly inside the total distance\\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\\n {\\n // If we have reached the last step, break\\n if (stepsTraveled + 1.0 >= raySteps) { break; }\\n\\n // compute the scalar\\n tValue = getTextureValue(posIS);\\n\\n // Update the maximum value if necessary\\n value = OP(tValue, value);\\n\\n // Otherwise, continue along the ray\\n stepsTraveled++;\\n posIS += stepIS;\\n }\\n\\n // Perform the last step along the ray using the\\n // residual distance\\n posIS = endIS;\\n tValue = getTextureValue(posIS);\\n value = OP(tValue, value);\\n\\n // Now map through opacity and color\\n gl_FragData[0] = getColorForValue(value, posIS, tstep);\\n #endif\\n #if vtkBlendMode == 3 //AVERAGE_INTENSITY_BLEND\\n vec4 averageIPScalarRangeMin = vec4 (\\n //VTK::AverageIPScalarRangeMin,\\n //VTK::AverageIPScalarRangeMin,\\n //VTK::AverageIPScalarRangeMin,\\n 1.0);\\n vec4 averageIPScalarRangeMax = vec4(\\n //VTK::AverageIPScalarRangeMax,\\n //VTK::AverageIPScalarRangeMax,\\n //VTK::AverageIPScalarRangeMax,\\n 1.0);\\n\\n vec4 sum = vec4(0.);\\n\\n averageIPScalarRangeMin.a = tValue.a;\\n averageIPScalarRangeMax.a = tValue.a;\\n\\n if (all(greaterThanEqual(tValue, averageIPScalarRangeMin)) &&\\n all(lessThanEqual(tValue, averageIPScalarRangeMax))) {\\n sum += tValue;\\n }\\n\\n if (raySteps <= 1.0) {\\n gl_FragData[0] = getColorForValue(sum, posIS, tstep);\\n return;\\n }\\n\\n posIS += (jitter*stepIS);\\n\\n // Sample along the ray until MaximumSamplesValue,\\n // ending slightly inside the total distance\\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\\n {\\n // If we have reached the last step, break\\n if (stepsTraveled + 1.0 >= raySteps) { break; }\\n\\n // compute the scalar\\n tValue = getTextureValue(posIS);\\n\\n // One can control the scalar range by setting the AverageIPScalarRange to disregard scalar values, not in the range of interest, from the average computation.\\n // Notes:\\n // - We are comparing all values in the texture to see if any of them\\n // are outside of the scalar range. In the future we might want to allow\\n // scalar ranges for each component.\\n // - We are setting the alpha channel for averageIPScalarRangeMin and\\n // averageIPScalarRangeMax so that we do not trigger this 'continue'\\n // based on the alpha channel comparison.\\n // - There might be a better way to do this. I'm not sure if there is an\\n // equivalent of 'any' which only operates on RGB, though I suppose\\n // we could write an 'anyRGB' function and see if that is faster.\\n averageIPScalarRangeMin.a = tValue.a;\\n averageIPScalarRangeMax.a = tValue.a;\\n if (any(lessThan(tValue, averageIPScalarRangeMin)) ||\\n any(greaterThan(tValue, averageIPScalarRangeMax))) {\\n continue;\\n }\\n\\n // Sum the values across each step in the path\\n sum += tValue;\\n\\n // Otherwise, continue along the ray\\n stepsTraveled++;\\n posIS += stepIS;\\n }\\n\\n // Perform the last step along the ray using the\\n // residual distance\\n posIS = endIS;\\n\\n // compute the scalar\\n tValue = getTextureValue(posIS);\\n\\n // One can control the scalar range by setting the AverageIPScalarRange to disregard scalar values, not in the range of interest, from the average computation\\n if (all(greaterThanEqual(tValue, averageIPScalarRangeMin)) &&\\n all(lessThanEqual(tValue, averageIPScalarRangeMax))) {\\n sum += tValue;\\n\\n stepsTraveled++;\\n }\\n\\n sum /= vec4(stepsTraveled, stepsTraveled, stepsTraveled, 1.0);\\n\\n gl_FragData[0] = getColorForValue(sum, posIS, tstep);\\n #endif\\n}\\n\\n//=======================================================================\\n// Compute a new start and end point for a given ray based\\n// on the provided bounded clipping plane (aka a rectangle)\\nvoid getRayPointIntersectionBounds(\\n vec3 rayPos, vec3 rayDir,\\n vec3 planeDir, float planeDist,\\n inout vec2 tbounds, vec3 vPlaneX, vec3 vPlaneY,\\n float vSize1, float vSize2)\\n{\\n float result = dot(rayDir, planeDir);\\n if (result == 0.0)\\n {\\n return;\\n }\\n result = -1.0 * (dot(rayPos, planeDir) + planeDist) / result;\\n vec3 xposVC = rayPos + rayDir*result;\\n vec3 vxpos = xposVC - vOriginVC;\\n vec2 vpos = vec2(\\n dot(vxpos, vPlaneX),\\n dot(vxpos, vPlaneY));\\n\\n // on some apple nvidia systems this does not work\\n // if (vpos.x < 0.0 || vpos.x > vSize1 ||\\n // vpos.y < 0.0 || vpos.y > vSize2)\\n // even just\\n // if (vpos.x < 0.0 || vpos.y < 0.0)\\n // fails\\n // so instead we compute a value that represents in and out\\n //and then compute the return using this value\\n float xcheck = max(0.0, vpos.x * (vpos.x - vSize1)); // 0 means in bounds\\n float check = sign(max(xcheck, vpos.y * (vpos.y - vSize2))); // 0 means in bounds, 1 = out\\n\\n tbounds = mix(\\n vec2(min(tbounds.x, result), max(tbounds.y, result)), // in value\\n tbounds, // out value\\n check); // 0 in 1 out\\n}\\n\\n//=======================================================================\\n// given a\\n// - ray direction (rayDir)\\n// - starting point (vertexVCVSOutput)\\n// - bounding planes of the volume\\n// - optionally depth buffer values\\n// - far clipping plane\\n// compute the start/end distances of the ray we need to cast\\nvec2 computeRayDistances(vec3 rayDir, vec3 tdims)\\n{\\n vec2 dists = vec2(100.0*camFar, -1.0);\\n\\n vec3 vSize = vSpacing*(tdims - 1.0);\\n\\n // all this is in View Coordinates\\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\\n vPlaneNormal0, vPlaneDistance0, dists, vPlaneNormal2, vPlaneNormal4,\\n vSize.y, vSize.z);\\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\\n vPlaneNormal1, vPlaneDistance1, dists, vPlaneNormal2, vPlaneNormal4,\\n vSize.y, vSize.z);\\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\\n vPlaneNormal2, vPlaneDistance2, dists, vPlaneNormal0, vPlaneNormal4,\\n vSize.x, vSize.z);\\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\\n vPlaneNormal3, vPlaneDistance3, dists, vPlaneNormal0, vPlaneNormal4,\\n vSize.x, vSize.z);\\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\\n vPlaneNormal4, vPlaneDistance4, dists, vPlaneNormal0, vPlaneNormal2,\\n vSize.x, vSize.y);\\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\\n vPlaneNormal5, vPlaneDistance5, dists, vPlaneNormal0, vPlaneNormal2,\\n vSize.x, vSize.y);\\n\\n //VTK::ClipPlane::Impl\\n\\n // do not go behind front clipping plane\\n dists.x = max(0.0,dists.x);\\n\\n // do not go PAST far clipping plane\\n float farDist = -camThick/rayDir.z;\\n dists.y = min(farDist,dists.y);\\n\\n // Do not go past the zbuffer value if set\\n // This is used for intermixing opaque geometry\\n //VTK::ZBuffer::Impl\\n\\n return dists;\\n}\\n\\n//=======================================================================\\n// Compute the index space starting position (pos) and end\\n// position\\n//\\nvoid computeIndexSpaceValues(out vec3 pos, out vec3 endPos, out float sampleDistanceIS, vec3 rayDir, vec2 dists)\\n{\\n // compute starting and ending values in volume space\\n pos = vertexVCVSOutput + dists.x*rayDir;\\n pos = pos - vOriginVC;\\n // convert to volume basis and origin\\n pos = vec3(\\n dot(pos, vPlaneNormal0),\\n dot(pos, vPlaneNormal2),\\n dot(pos, vPlaneNormal4));\\n\\n endPos = vertexVCVSOutput + dists.y*rayDir;\\n endPos = endPos - vOriginVC;\\n endPos = vec3(\\n dot(endPos, vPlaneNormal0),\\n dot(endPos, vPlaneNormal2),\\n dot(endPos, vPlaneNormal4));\\n\\n float delta = length(endPos - pos);\\n\\n pos *= vVCToIJK;\\n endPos *= vVCToIJK;\\n\\n float delta2 = length(endPos - pos);\\n sampleDistanceIS = sampleDistance*delta2/delta;\\n}\\n\\nvoid main()\\n{\\n\\n vec3 rayDirVC;\\n\\n if (cameraParallel == 1)\\n {\\n // Camera is parallel, so the rayDir is just the direction of the camera.\\n rayDirVC = vec3(0.0, 0.0, -1.0);\\n } else {\\n // camera is at 0,0,0 so rayDir for perspective is just the vc coord\\n rayDirVC = normalize(vertexVCVSOutput);\\n }\\n\\n vec3 tdims = vec3(volumeDimensions);\\n\\n // compute the start and end points for the ray\\n vec2 rayStartEndDistancesVC = computeRayDistances(rayDirVC, tdims);\\n\\n // do we need to composite? aka does the ray have any length\\n // If not, bail out early\\n if (rayStartEndDistancesVC.y <= rayStartEndDistancesVC.x)\\n {\\n discard;\\n }\\n\\n // IS = Index Space\\n vec3 posIS;\\n vec3 endIS;\\n float sampleDistanceIS;\\n computeIndexSpaceValues(posIS, endIS, sampleDistanceIS, rayDirVC, rayStartEndDistancesVC);\\n\\n // Perform the blending operation along the ray\\n applyBlend(posIS, endIS, sampleDistanceIS, tdims);\\n}\\n\"\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeFS.glsl?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = \"//VTK::System::Dec\\n\\n/*=========================================================================\\n\\n Program: Visualization Toolkit\\n Module: vtkPolyDataVS.glsl\\n\\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\\n All rights reserved.\\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\\n\\n This software is distributed WITHOUT ANY WARRANTY; without even\\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\\n PURPOSE. See the above copyright notice for more information.\\n\\n=========================================================================*/\\n\\nattribute vec4 vertexDC;\\n\\nvarying vec3 vertexVCVSOutput;\\nuniform mat4 PCVCMatrix;\\n\\nuniform float dcxmin;\\nuniform float dcxmax;\\nuniform float dcymin;\\nuniform float dcymax;\\n\\nvoid main()\\n{\\n // dcsmall is the device coords reduced to the\\n // x y area covered by the volume\\n vec4 dcsmall = vec4(\\n dcxmin + 0.5 * (vertexDC.x + 1.0) * (dcxmax - dcxmin),\\n dcymin + 0.5 * (vertexDC.y + 1.0) * (dcymax - dcymin),\\n vertexDC.z,\\n vertexDC.w);\\n vec4 vcpos = PCVCMatrix * dcsmall;\\n vertexVCVSOutput = vcpos.xyz/vcpos.w;\\n gl_Position = dcsmall;\\n}\\n\"\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/OpenGL/glsl/vtkVolumeVS.glsl?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Profiles/Geometry.js": -/*!********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Profiles/Geometry.js ***! - \********************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Profiles_Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Profiles/Geometry */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Geometry.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Profiles_Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Profiles/Geometry */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Geometry.js\");\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Profiles/Geometry.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Profiles/Glyph.js": -/*!*****************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Profiles/Glyph.js ***! - \*****************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Profiles_Glyph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Profiles/Glyph */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Glyph.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Profiles_Glyph__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Profiles/Glyph */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Glyph.js\");\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Profiles/Glyph.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/Profiles/Volume.js": -/*!******************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/Profiles/Volume.js ***! - \******************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_OpenGL_Profiles_Volume__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/OpenGL/Profiles/Volume */ \"./node_modules/vtk.js/Sources/Rendering/OpenGL/Profiles/Volume.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Profiles_Volume__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Profiles/Volume */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Volume.js\");\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/Profiles/Volume.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderPass/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderPass/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n\nfunction vtkRenderPass(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkRenderPass');\n\n publicAPI.getOperation = function () {\n return model.currentOperation;\n };\n\n publicAPI.setCurrentOperation = function (val) {\n model.currentOperation = val;\n model.currentTraverseOperation = \"traverse\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(model.currentOperation));\n };\n\n publicAPI.getTraverseOperation = function () {\n return model.currentTraverseOperation;\n }; // by default this class will traverse all of its\n // preDelegateOperations, then call its delegate render passes\n // the traverse all of its postDelegateOperations\n // any of those three arrays can be empty\n\n\n publicAPI.traverse = function (viewNode) {\n var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (model.deleted) {\n return;\n } // we just render our delegates in order\n\n\n model.currentParent = parent;\n model.preDelegateOperations.forEach(function (val) {\n publicAPI.setCurrentOperation(val);\n viewNode.traverse(publicAPI);\n });\n model.delegates.forEach(function (val) {\n val.traverse(viewNode, publicAPI);\n });\n model.postDelegateOperations.forEach(function (val) {\n publicAPI.setCurrentOperation(val);\n viewNode.traverse(publicAPI);\n });\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n delegates: [],\n currentOperation: null,\n preDelegateOperations: [],\n postDelegateOperations: [],\n currentParent: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['currentOperation']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['delegates', 'currentParent', 'preDelegateOperations', 'postDelegateOperations']); // Object methods\n\n vtkRenderPass(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkRenderPass'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderPass/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderWindowViewNode/index.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderWindowViewNode/index.js ***! - \****************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n\n // ----------------------------------------------------------------------------\n// vtkRenderWindowViewNode is intended to be a superclass for all api specific\n// RenderWindows. It is intended to define a common API that can be invoked\n// upon an api specific render window and provide some common method\n// implementations. If your application requires communicating with an api specific\n// view try to limit such interactions to methods defined in this class.\n// ----------------------------------------------------------------------------\n// ----------------------------------------------------------------------------\n// vtkRenderWindowViewNode methods\n// ----------------------------------------------------------------------------\n\nfunction vtkRenderWindowViewNode(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkRenderWindowViewNode');\n\n publicAPI.getViewNodeFactory = function () {\n return null;\n };\n\n publicAPI.getAspectRatio = function () {\n return model.size[0] / model.size[1];\n };\n\n publicAPI.getAspectRatioForRenderer = function (renderer) {\n var viewport = renderer.getViewportByReference();\n return model.size[0] * (viewport[2] - viewport[0]) / ((viewport[3] - viewport[1]) * model.size[1]);\n };\n\n publicAPI.isInViewport = function (x, y, viewport) {\n var vCoords = viewport.getViewportByReference();\n var size = publicAPI.getFramebufferSize();\n\n if (vCoords[0] * size[0] <= x && vCoords[2] * size[0] >= x && vCoords[1] * size[1] <= y && vCoords[3] * size[1] >= y) {\n return true;\n }\n\n return false;\n };\n\n publicAPI.getViewportSize = function (viewport) {\n var vCoords = viewport.getViewportByReference();\n var size = publicAPI.getFramebufferSize();\n return [(vCoords[2] - vCoords[0]) * size[0], (vCoords[3] - vCoords[1]) * size[1]];\n };\n\n publicAPI.getViewportCenter = function (viewport) {\n var size = publicAPI.getViewportSize(viewport);\n return [size[0] * 0.5, size[1] * 0.5];\n };\n\n publicAPI.displayToNormalizedDisplay = function (x, y, z) {\n var size = publicAPI.getFramebufferSize();\n return [x / size[0], y / size[1], z];\n };\n\n publicAPI.normalizedDisplayToDisplay = function (x, y, z) {\n var size = publicAPI.getFramebufferSize();\n return [x * size[0], y * size[1], z];\n };\n\n publicAPI.worldToView = function (x, y, z, renderer) {\n return renderer.worldToView(x, y, z);\n };\n\n publicAPI.viewToWorld = function (x, y, z, renderer) {\n return renderer.viewToWorld(x, y, z);\n };\n\n publicAPI.worldToDisplay = function (x, y, z, renderer) {\n var val = renderer.worldToView(x, y, z);\n var dims = publicAPI.getViewportSize(renderer);\n var val2 = renderer.viewToProjection(val[0], val[1], val[2], dims[0] / dims[1]);\n var val3 = renderer.projectionToNormalizedDisplay(val2[0], val2[1], val2[2]);\n return publicAPI.normalizedDisplayToDisplay(val3[0], val3[1], val3[2]);\n };\n\n publicAPI.displayToWorld = function (x, y, z, renderer) {\n var val = publicAPI.displayToNormalizedDisplay(x, y, z);\n var val2 = renderer.normalizedDisplayToProjection(val[0], val[1], val[2]);\n var dims = publicAPI.getViewportSize(renderer);\n var val3 = renderer.projectionToView(val2[0], val2[1], val2[2], dims[0] / dims[1]);\n return renderer.viewToWorld(val3[0], val3[1], val3[2]);\n };\n\n publicAPI.normalizedDisplayToViewport = function (x, y, z, renderer) {\n var vCoords = renderer.getViewportByReference();\n vCoords = publicAPI.normalizedDisplayToDisplay(vCoords[0], vCoords[1], 0.0);\n var coords = publicAPI.normalizedDisplayToDisplay(x, y, z);\n return [coords[0] - vCoords[0] - 0.5, coords[1] - vCoords[1] - 0.5, z];\n };\n\n publicAPI.viewportToNormalizedViewport = function (x, y, z, renderer) {\n var size = publicAPI.getViewportSize(renderer);\n\n if (size && size[0] !== 0 && size[1] !== 0) {\n return [x / (size[0] - 1.0), y / (size[1] - 1.0), z];\n }\n\n return [x, y, z];\n };\n\n publicAPI.normalizedViewportToViewport = function (x, y, z) {\n var size = publicAPI.getFramebufferSize();\n return [x * (size[0] - 1.0), y * (size[1] - 1.0), z];\n };\n\n publicAPI.displayToLocalDisplay = function (x, y, z) {\n var size = publicAPI.getFramebufferSize();\n return [x, size[1] - y - 1, z];\n };\n\n publicAPI.viewportToNormalizedDisplay = function (x, y, z, renderer) {\n var vCoords = renderer.getViewportByReference();\n vCoords = publicAPI.normalizedDisplayToDisplay(vCoords[0], vCoords[1], 0.0);\n var x2 = x + vCoords[0] + 0.5;\n var y2 = y + vCoords[1] + 0.5;\n return publicAPI.displayToNormalizedDisplay(x2, y2, z);\n };\n\n publicAPI.getPixelData = function (x1, y1, x2, y2) {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro('not implemented');\n return undefined;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n size: undefined,\n selector: undefined\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n\n if (!model.size) {\n model.size = [300, 300];\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['size'], 2);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['selector']); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object methods\n\n vtkRenderWindowViewNode(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkRenderWindowViewNode'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/SceneGraph/RenderWindowViewNode/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js ***! - \****************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro;\nvar PASS_TYPES = ['Build', 'Render']; // ----------------------------------------------------------------------------\n// vtkViewNode methods\n// ----------------------------------------------------------------------------\n\nfunction vtkViewNode(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkViewNode'); // Builds myself.\n\n publicAPI.build = function (prepass) {}; // Renders myself\n\n\n publicAPI.render = function (prepass) {};\n\n publicAPI.traverse = function (renderPass) {\n // we can choose to do special\n // traversal here based on pass\n var passTraversal = renderPass.getTraverseOperation();\n var fn = publicAPI[passTraversal];\n\n if (fn) {\n fn(renderPass);\n return;\n } // default traversal\n\n\n publicAPI.apply(renderPass, true);\n\n for (var index = 0; index < model.children.length; index++) {\n model.children[index].traverse(renderPass);\n }\n\n publicAPI.apply(renderPass, false);\n };\n\n publicAPI.apply = function (renderPass, prepass) {\n var customRenderPass = publicAPI[renderPass.getOperation()];\n\n if (customRenderPass) {\n customRenderPass(prepass, renderPass);\n }\n };\n\n publicAPI.getViewNodeFor = function (dataObject) {\n if (model.renderable === dataObject) {\n return publicAPI;\n }\n\n for (var index = 0; index < model.children.length; ++index) {\n var child = model.children[index];\n var vn = child.getViewNodeFor(dataObject);\n\n if (vn) {\n return vn;\n }\n }\n\n return undefined;\n };\n\n publicAPI.getFirstAncestorOfType = function (type) {\n if (!model.parent) {\n return null;\n }\n\n if (model.parent.isA(type)) {\n return model.parent;\n }\n\n return model.parent.getFirstAncestorOfType(type);\n };\n\n publicAPI.addMissingNode = function (dobj) {\n if (!dobj) {\n return;\n }\n\n var result = model._renderableChildMap.get(dobj); // if found just mark as visited\n\n\n if (result !== undefined) {\n result.setVisited(true);\n } else {\n // otherwise create a node\n var newNode = publicAPI.createViewNode(dobj);\n\n if (newNode) {\n newNode.setParent(publicAPI);\n newNode.setVisited(true);\n\n model._renderableChildMap.set(dobj, newNode);\n\n model.children.push(newNode);\n }\n }\n };\n\n publicAPI.addMissingNodes = function (dataObjs) {\n if (!dataObjs || !dataObjs.length) {\n return;\n }\n\n for (var index = 0; index < dataObjs.length; ++index) {\n var dobj = dataObjs[index];\n\n var result = model._renderableChildMap.get(dobj); // if found just mark as visited\n\n\n if (result !== undefined) {\n result.setVisited(true);\n } else {\n // otherwise create a node\n var newNode = publicAPI.createViewNode(dobj);\n\n if (newNode) {\n newNode.setParent(publicAPI);\n newNode.setVisited(true);\n\n model._renderableChildMap.set(dobj, newNode);\n\n model.children.push(newNode);\n }\n }\n }\n };\n\n publicAPI.prepareNodes = function () {\n for (var index = 0; index < model.children.length; ++index) {\n model.children[index].setVisited(false);\n }\n };\n\n publicAPI.setVisited = function (val) {\n model.visited = val;\n };\n\n publicAPI.removeUnusedNodes = function () {\n var deleted = null;\n\n for (var index = 0; index < model.children.length; ++index) {\n var child = model.children[index];\n var visited = child.getVisited();\n\n if (!visited) {\n var renderable = child.getRenderable();\n\n if (renderable) {\n model._renderableChildMap.delete(renderable);\n }\n\n if (!deleted) {\n deleted = [];\n }\n\n deleted.push(child);\n } else {\n child.setVisited(false);\n }\n }\n\n if (deleted) {\n // slow does alloc but not as common\n model.children = model.children.filter(function (el) {\n return !deleted.includes(el);\n });\n }\n };\n\n publicAPI.createViewNode = function (dataObj) {\n if (!model.myFactory) {\n vtkErrorMacro('Cannot create view nodes without my own factory');\n return null;\n }\n\n var ret = model.myFactory.createNode(dataObj);\n\n if (ret) {\n ret.setRenderable(dataObj);\n }\n\n return ret;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n parent: null,\n renderable: null,\n myFactory: null,\n children: [],\n visited: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'event');\n model._renderableChildMap = new Map();\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['visited']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['parent', 'renderable', 'myFactory']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['children']); // Object methods\n\n vtkViewNode(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkViewNode'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n PASS_TYPES: PASS_TYPES\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory/index.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory/index.js ***! - \***********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkViewNodeFactory methods\n// ----------------------------------------------------------------------------\n\nfunction vtkViewNodeFactory(publicAPI, model) {\n // Make sure our overrides is just for our instance not shared with everyone...\n if (!model.overrides) {\n model.overrides = {};\n } // Set our className\n\n\n model.classHierarchy.push('vtkViewNodeFactory');\n\n publicAPI.createNode = function (dataObject) {\n if (dataObject.isDeleted()) {\n return null;\n }\n\n var cpt = 0;\n var className = dataObject.getClassName(cpt++);\n var isObject = false;\n var keys = Object.keys(model.overrides);\n\n while (className && !isObject) {\n if (keys.indexOf(className) !== -1) {\n isObject = true;\n } else {\n className = dataObject.getClassName(cpt++);\n }\n }\n\n if (!isObject) {\n return null;\n }\n\n var vn = model.overrides[className]();\n vn.setMyFactory(publicAPI);\n return vn;\n };\n\n publicAPI.registerOverride = function (className, func) {\n model.overrides[className] = func;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {// overrides: {},\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Object methods\n\n vtkViewNodeFactory(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkViewNodeFactory'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Actor/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Actor/index.js ***! - \*********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUActor methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUActor(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUActor'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.WebGPURenderer = publicAPI.getFirstAncestorOfType('vtkWebGPURenderer');\n model.WebGPURenderWindow = model.WebGPURenderer.getFirstAncestorOfType('vtkWebGPURenderWindow');\n\n if (model.propID === undefined) {\n model.propID = model.WebGPURenderWindow.getUniquePropID();\n }\n\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getMapper());\n publicAPI.removeUnusedNodes();\n }\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseOpaquePass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || !model.renderable.getIsOpaque() || model.WebGPURenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n\n if (model.children[0]) {\n model.children[0].traverse(renderPass);\n }\n\n publicAPI.apply(renderPass, false);\n }; // we draw textures, then mapper, then post pass textures\n\n\n publicAPI.traverseTranslucentPass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || model.renderable.getIsOpaque() || model.WebGPURenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n\n if (model.children[0]) {\n model.children[0].traverse(renderPass);\n }\n\n publicAPI.apply(renderPass, false);\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (model.renderable.getIsOpaque()) {\n renderPass.incrementOpaqueActorCount();\n } else {\n renderPass.incrementTranslucentActorCount();\n }\n }\n };\n\n publicAPI.getBufferShift = function (wgpuRen) {\n publicAPI.getKeyMatrices(wgpuRen);\n return model.bufferShift;\n };\n\n publicAPI.getKeyMatrices = function (wgpuRen) {\n // has the actor or stabilization center changed?\n if (Math.max(model.renderable.getMTime(), wgpuRen.getStabilizedTime().getMTime()) > model.keyMatricesTime.getMTime()) {\n model.renderable.computeMatrix();\n var mcwc = model.renderable.getMatrix(); // compute the net shift\n\n var center = wgpuRen.getStabilizedCenterByReference();\n model.bufferShift[0] = mcwc[3] - center[0];\n model.bufferShift[1] = mcwc[7] - center[1];\n model.bufferShift[2] = mcwc[11] - center[2];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.bcwc, mcwc);\n\n if (model.renderable.getIsIdentity()) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(model.keyMatrices.normalMatrix);\n } else {\n // we use bcwc BEFORE the translate below (just to get transposed mcvc)\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.keyMatrices.normalMatrix, model.keyMatrices.bcwc); // zero out translation\n\n model.keyMatrices.normalMatrix[3] = 0.0;\n model.keyMatrices.normalMatrix[7] = 0.0;\n model.keyMatrices.normalMatrix[11] = 0.0;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(model.keyMatrices.normalMatrix, model.keyMatrices.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.normalMatrix, model.keyMatrices.normalMatrix);\n } // only meed the buffer shift to get to world\n\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.keyMatrices.bcwc, model.keyMatrices.bcwc, [-model.bufferShift[0], -model.bufferShift[1], -model.bufferShift[2]]); // to get to stabilized we also need the center\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.keyMatrices.bcsc, model.keyMatrices.bcwc, [-center[0], -center[1], -center[2]]);\n model.keyMatricesTime.modified();\n }\n\n return model.keyMatrices;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n keyMatricesTime: null,\n keyMatrices: null,\n propID: undefined,\n bufferShift: undefined\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatricesTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(model.keyMatricesTime, {\n mtime: 0\n });\n model.keyMatrices = {\n normalMatrix: new Float64Array(16),\n bcwc: new Float64Array(16),\n bcsc: new Float64Array(16)\n };\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get(publicAPI, model, ['propID', 'keyMatricesTime']);\n model.bufferShift = [0, 0, 0, 0]; // Object methods\n\n vtkWebGPUActor(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkActor', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Actor/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/BindGroup/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/BindGroup/index.js ***! - \*************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkWebGPUBindGroup methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUBindGroup(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUBindGroup');\n\n publicAPI.addBindable = function (bindable) {\n // only add new bindables\n for (var i = 0; i < model.bindables.length; i++) {\n if (model.bindables[i] === bindable) {\n return;\n }\n }\n\n model.bindables.push(bindable);\n publicAPI.modified();\n };\n\n publicAPI.getBindGroupLayout = function (device) {\n var entries = [];\n\n for (var i = 0; i < model.bindables.length; i++) {\n var entry = model.bindables[i].getBindGroupLayoutEntry();\n entry.binding = i;\n entries.push(entry);\n }\n\n return device.getBindGroupLayout({\n entries: entries\n });\n };\n\n publicAPI.getBindGroup = function (device) {\n // check mtime\n var mtime = publicAPI.getMTime();\n\n for (var i = 0; i < model.bindables.length; i++) {\n var tm = model.bindables[i].getBindGroupTime();\n mtime = tm > mtime ? tm : mtime;\n }\n\n if (mtime < model.bindGroupTime.getMTime()) {\n return model.bindGroup;\n }\n\n var entries = [];\n\n for (var _i = 0; _i < model.bindables.length; _i++) {\n var entry = model.bindables[_i].getBindGroupEntry();\n\n entry.binding = _i;\n entries.push(entry);\n }\n\n model.bindGroup = device.getHandle().createBindGroup({\n layout: publicAPI.getBindGroupLayout(device),\n entries: entries\n });\n model.bindGroupTime.modified();\n return model.bindGroup;\n };\n\n publicAPI.getShaderCode = function (pipeline) {\n var lines = [];\n var bgroup = pipeline.getBindGroupLayoutCount(model.name);\n\n for (var i = 0; i < model.bindables.length; i++) {\n lines.push(model.bindables[i].getShaderCode(i, bgroup));\n }\n\n return lines.join('\\n');\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n device: null,\n handle: null,\n name: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.bindables = [];\n model.bindGroupTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.bindGroupTime, {\n mtime: 0\n });\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['bindGroupTime', 'handle', 'sizeInBytes', 'usage']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['name', 'device', 'arrayInformation', 'sourceTime']);\n vtkWebGPUBindGroup(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/BindGroup/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Buffer/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Buffer/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BufferManager_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BufferManager/Constants */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n // methods we forward to the handle\n\nvar forwarded = ['getMappedRange', 'mapAsync', 'unmap'];\n\nfunction bufferSubData(device, destBuffer, destOffset, srcArrayBuffer) {\n var byteCount = srcArrayBuffer.byteLength;\n var srcBuffer = device.createBuffer({\n size: byteCount,\n\n /* eslint-disable no-undef */\n usage: GPUBufferUsage.COPY_SRC,\n\n /* eslint-enable no-undef */\n mappedAtCreation: true\n });\n var arrayBuffer = srcBuffer.getMappedRange(0, byteCount);\n new Uint8Array(arrayBuffer).set(new Uint8Array(srcArrayBuffer)); // memcpy\n\n srcBuffer.unmap();\n var encoder = device.createCommandEncoder();\n encoder.copyBufferToBuffer(srcBuffer, 0, destBuffer, destOffset, byteCount);\n var commandBuffer = encoder.finish();\n var queue = device.queue;\n queue.submit([commandBuffer]);\n srcBuffer.destroy();\n} // ----------------------------------------------------------------------------\n// vtkWebGPUBufferManager methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkWebGPUBuffer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUBuffer');\n\n publicAPI.create = function (sizeInBytes, usage) {\n model.handle = model.device.getHandle().createBuffer({\n size: sizeInBytes,\n usage: usage\n });\n model.sizeInBytes = sizeInBytes;\n model.usage = usage;\n };\n\n publicAPI.write = function (data) {\n bufferSubData(model.device.getHandle(), model.handle, 0, data.buffer);\n };\n\n publicAPI.createAndWrite = function (data, usage) {\n model.handle = model.device.getHandle().createBuffer({\n size: data.byteLength,\n usage: usage,\n mappedAtCreation: true\n });\n model.sizeInBytes = data.byteLength;\n model.usage = usage;\n new Uint8Array(model.handle.getMappedRange()).set(new Uint8Array(data.buffer)); // memcpy\n\n model.handle.unmap();\n }; // simple forwarders\n\n\n var _loop = function _loop(i) {\n publicAPI[forwarded[i]] = function () {\n var _model$handle;\n\n return (_model$handle = model.handle)[forwarded[i]].apply(_model$handle, arguments);\n };\n };\n\n for (var i = 0; i < forwarded.length; i++) {\n _loop(i);\n }\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n device: null,\n handle: null,\n sizeInBytes: 0,\n strideInBytes: 0,\n arrayInformation: null,\n usage: null,\n sourceTime: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['handle', 'sizeInBytes', 'usage']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['strideInBytes', 'device', 'arrayInformation', 'sourceTime']);\n vtkWebGPUBuffer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, vtk_js_Sources_Rendering_WebGPU_BufferManager_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Buffer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/Constants.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/Constants.js ***! - \*********************************************************************************/ -/*! exports provided: BufferUsage, PrimitiveTypes, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BufferUsage\", function() { return BufferUsage; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PrimitiveTypes\", function() { return PrimitiveTypes; });\nvar BufferUsage = {\n Verts: 0,\n Lines: 1,\n Triangles: 2,\n Strips: 3,\n LinesFromStrips: 4,\n LinesFromTriangles: 5,\n Points: 6,\n UniformArray: 7,\n PointArray: 8,\n NormalsFromPoints: 9,\n Texture: 10,\n RawVertex: 11,\n Storage: 12\n};\nvar PrimitiveTypes = {\n Start: 0,\n Points: 0,\n Lines: 1,\n Triangles: 2,\n TriangleStrips: 3,\n TriangleEdges: 4,\n TriangleStripEdges: 5,\n End: 6\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n BufferUsage: BufferUsage,\n PrimitiveTypes: PrimitiveTypes\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js ***! - \*****************************************************************************/ -/*! exports provided: STATIC, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STATIC\", function() { return STATIC; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Buffer */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Buffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Types */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js\");\n/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Constants */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n\nvar BufferUsage = _Constants__WEBPACK_IMPORTED_MODULE_5__[\"default\"].BufferUsage,\n PrimitiveTypes = _Constants__WEBPACK_IMPORTED_MODULE_5__[\"default\"].PrimitiveTypes;\nvar Representation = vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Representation;\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkDebugMacro\"]; // the webgpu constants all show up as undefined\n\n/* eslint-disable no-undef */\n// ----------------------------------------------------------------------------\n// Static API\n// ----------------------------------------------------------------------------\n\nvar STATIC = {};\n\nfunction requestMatches(req1, req2) {\n if (req1.time !== req2.time) return false;\n if (req1.format !== req2.format) return false;\n if (req1.usage !== req2.usage) return false;\n if (req1.hash !== req2.hash) return false;\n return true;\n}\n\nvar cellCounters = {\n // easy, every input point becomes an output point\n anythingToPoints: function anythingToPoints(numPoints, cellPts) {\n return numPoints;\n },\n linesToWireframe: function linesToWireframe(numPoints, cellPts) {\n if (numPoints > 1) {\n return (numPoints - 1) * 2;\n }\n\n return 0;\n },\n polysToWireframe: function polysToWireframe(numPoints, cellPts) {\n if (numPoints > 2) {\n return numPoints * 2;\n }\n\n return 0;\n },\n stripsToWireframe: function stripsToWireframe(numPoints, cellPts) {\n if (numPoints > 2) {\n return numPoints * 4 - 6;\n }\n\n return 0;\n },\n polysToSurface: function polysToSurface(npts, cellPts) {\n if (npts > 2) {\n return (npts - 2) * 3;\n }\n\n return 0;\n },\n stripsToSurface: function stripsToSurface(npts, cellPts, offset) {\n if (numPoints > 2) {\n return (npts - 2) * 3;\n }\n\n return 0;\n }\n};\n\nfunction getPrimitiveName(primType) {\n switch (primType) {\n case PrimitiveTypes.Points:\n return 'points';\n\n case PrimitiveTypes.Lines:\n return 'lines';\n\n case PrimitiveTypes.Triangles:\n return 'polys';\n\n case PrimitiveTypes.TriangleStrips:\n return 'strips';\n\n default:\n return '';\n }\n}\n\nfunction getOutputSize(cellArray, representation, inRepName) {\n var countFunc = null;\n\n if (representation === Representation.POINTS || inRepName === 'points') {\n countFunc = cellCounters.anythingToPoints;\n } else if (representation === Representation.WIREFRAME || inRepName === 'lines') {\n countFunc = cellCounters[\"\".concat(inRepName, \"ToWireframe\")];\n } else {\n countFunc = cellCounters[\"\".concat(inRepName, \"ToSurface\")];\n }\n\n var array = cellArray.getData();\n var size = array.length;\n var caboCount = 0;\n\n for (var index = 0; index < size;) {\n caboCount += countFunc(array[index], array);\n index += array[index] + 1;\n }\n\n return caboCount;\n}\n\nfunction packArray(cellArray, primType, representation, inArray, outputType, options) {\n var result = {\n elementCount: 0,\n blockSize: 0,\n stride: 0\n };\n\n if (!cellArray.getData() || !cellArray.getData().length) {\n return result;\n } // setup shift and scale\n\n\n var shift = [0.0, 0.0, 0.0, 0.0];\n\n if (options.shift) {\n if (options.shift.length) {\n shift = options.shift;\n } else {\n shift.fill(options.shift);\n }\n }\n\n var scale = [1.0, 1.0, 1.0, 1.0];\n\n if (options.scale) {\n if (options.scale.length) {\n scale = options.scale;\n } else {\n scale.fill(options.scale);\n }\n }\n\n var packExtra = Object.prototype.hasOwnProperty.call(options, 'packExtra') ? options.packExtra : false;\n var pointData = inArray.getData();\n var addAPoint;\n var cellBuilders = {\n // easy, every input point becomes an output point\n anythingToPoints: function anythingToPoints(numPoints, cellPts, offset, cellId) {\n for (var i = 0; i < numPoints; ++i) {\n addAPoint(cellPts[offset + i], cellId);\n }\n },\n linesToWireframe: function linesToWireframe(numPoints, cellPts, offset, cellId) {\n // for lines we add a bunch of segments\n for (var i = 0; i < numPoints - 1; ++i) {\n addAPoint(cellPts[offset + i], cellId);\n addAPoint(cellPts[offset + i + 1], cellId);\n }\n },\n polysToWireframe: function polysToWireframe(numPoints, cellPts, offset, cellId) {\n // for polys we add a bunch of segments and close it\n if (numPoints > 2) {\n for (var i = 0; i < numPoints; ++i) {\n addAPoint(cellPts[offset + i], cellId);\n addAPoint(cellPts[offset + (i + 1) % numPoints], cellId);\n }\n }\n },\n stripsToWireframe: function stripsToWireframe(numPoints, cellPts, offset, cellId) {\n if (numPoints > 2) {\n // for strips we add a bunch of segments and close it\n for (var i = 0; i < numPoints - 1; ++i) {\n addAPoint(cellPts[offset + i], cellId);\n addAPoint(cellPts[offset + i + 1], cellId);\n }\n\n for (var _i = 0; _i < numPoints - 2; _i++) {\n addAPoint(cellPts[offset + _i], cellId);\n addAPoint(cellPts[offset + _i + 2], cellId);\n }\n }\n },\n polysToSurface: function polysToSurface(npts, cellPts, offset, cellId) {\n for (var i = 0; i < npts - 2; i++) {\n addAPoint(cellPts[offset + 0], cellId);\n addAPoint(cellPts[offset + i + 1], cellId);\n addAPoint(cellPts[offset + i + 2], cellId);\n }\n },\n stripsToSurface: function stripsToSurface(npts, cellPts, offset, cellId) {\n for (var i = 0; i < npts - 2; i++) {\n addAPoint(cellPts[offset + i], cellId);\n addAPoint(cellPts[offset + i + 1 + i % 2], cellId);\n addAPoint(cellPts[offset + i + 1 + (i + 1) % 2], cellId);\n }\n }\n };\n var inRepName = getPrimitiveName(primType);\n var func = null;\n\n if (representation === Representation.POINTS || primType === PrimitiveTypes.Points) {\n func = cellBuilders.anythingToPoints;\n } else if (representation === Representation.WIREFRAME || primType === PrimitiveTypes.Lines) {\n func = cellBuilders[\"\".concat(inRepName, \"ToWireframe\")];\n } else {\n func = cellBuilders[\"\".concat(inRepName, \"ToSurface\")];\n }\n\n var array = cellArray.getData();\n var size = array.length;\n var caboCount = getOutputSize(cellArray, representation, inRepName);\n var vboidx = 0;\n var numComp = inArray.getNumberOfComponents();\n var packedVBO = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newTypedArray\"](outputType, caboCount * (numComp + (packExtra ? 1 : 0))); // pick the right function based on point versus cell data\n\n var getData = function getData(ptId, cellId) {\n return pointData[ptId];\n };\n\n if (options.cellData) {\n getData = function getData(ptId, cellId) {\n return pointData[cellId];\n };\n } // add data based on number of components\n\n\n if (numComp === 1) {\n addAPoint = function addAPointFunc(i, cellid) {\n packedVBO[vboidx++] = scale[0] * getData(i, cellid) + shift[0];\n };\n } else if (numComp === 2) {\n addAPoint = function addAPointFunc(i, cellid) {\n packedVBO[vboidx++] = scale[0] * getData(i * 2, cellid * 2) + shift[0];\n packedVBO[vboidx++] = scale[1] * getData(i * 2 + 1, cellid * 2 + 1) + shift[1];\n };\n } else if (numComp === 3 && !packExtra) {\n addAPoint = function addAPointFunc(i, cellid) {\n packedVBO[vboidx++] = scale[0] * getData(i * 3, cellid * 3) + shift[0];\n packedVBO[vboidx++] = scale[1] * getData(i * 3 + 1, cellid * 3 + 1) + shift[1];\n packedVBO[vboidx++] = scale[2] * getData(i * 3 + 2, cellid * 3 + 2) + shift[2];\n };\n } else if (numComp === 3 && packExtra) {\n addAPoint = function addAPointFunc(i, cellid) {\n packedVBO[vboidx++] = scale[0] * getData(i * 3, cellid * 3) + shift[0];\n packedVBO[vboidx++] = scale[1] * getData(i * 3 + 1, cellid * 3 + 1) + shift[1];\n packedVBO[vboidx++] = scale[2] * getData(i * 3 + 2, cellid * 3 + 2) + shift[2];\n packedVBO[vboidx++] = scale[3] * 1.0 + shift[3];\n };\n } else if (numComp === 4) {\n addAPoint = function addAPointFunc(i, cellid) {\n packedVBO[vboidx++] = scale[0] * getData(i * 4, cellid * 4) + shift[0];\n packedVBO[vboidx++] = scale[1] * getData(i * 4 + 1, cellid * 4 + 1) + shift[1];\n packedVBO[vboidx++] = scale[2] * getData(i * 4 + 2, cellid * 4 + 2) + shift[2];\n packedVBO[vboidx++] = scale[3] * getData(i * 4 + 3, cellid * 4 + 3) + shift[3];\n };\n }\n\n var cellId = options.cellOffset;\n\n for (var index = 0; index < size;) {\n func(array[index], array, index + 1, cellId);\n index += array[index] + 1;\n cellId++;\n }\n\n result.nativeArray = packedVBO;\n result.elementCount = caboCount;\n return result;\n}\n\nfunction getNormal(pointData, i0, i1, i2) {\n var v1 = [pointData[i2 * 3] - pointData[i1 * 3], pointData[i2 * 3 + 1] - pointData[i1 * 3 + 1], pointData[i2 * 3 + 2] - pointData[i1 * 3 + 2]];\n var v2 = [pointData[i0 * 3] - pointData[i1 * 3], pointData[i0 * 3 + 1] - pointData[i1 * 3 + 1], pointData[i0 * 3 + 2] - pointData[i1 * 3 + 2]];\n var result = [];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"cross\"](v1, v2, result);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"normalize\"](result);\n return result;\n}\n\nfunction generateNormals(cellArray, primType, representation, inArray) {\n if (!cellArray.getData() || !cellArray.getData().length) {\n return null;\n }\n\n var pointData = inArray.getData();\n var addAPoint;\n var cellBuilders = {\n polysToPoints: function polysToPoints(numPoints, cellPts, offset) {\n var normal = getNormal(pointData, cellPts[offset], cellPts[offset + 1], cellPts[offset + 2]);\n\n for (var i = 0; i < numPoints; ++i) {\n addAPoint(normal);\n }\n },\n polysToWireframe: function polysToWireframe(numPoints, cellPts, offset) {\n // for polys we add a bunch of segments and close it\n // compute the normal\n var normal = getNormal(pointData, cellPts[offset], cellPts[offset + 1], cellPts[offset + 2]);\n\n for (var i = 0; i < numPoints; ++i) {\n addAPoint(normal);\n addAPoint(normal);\n }\n },\n polysToSurface: function polysToSurface(npts, cellPts, offset) {\n if (npts < 3) {\n // ignore degenerate triangles\n vtkDebugMacro('skipping degenerate triangle');\n } else {\n // compute the normal\n var normal = getNormal(pointData, cellPts[offset], cellPts[offset + 1], cellPts[offset + 2]);\n\n for (var i = 0; i < npts - 2; i++) {\n addAPoint(normal);\n addAPoint(normal);\n addAPoint(normal);\n }\n }\n }\n };\n var primName = getPrimitiveName(primType);\n var func = null;\n\n if (representation === Representation.POINTS) {\n func = cellBuilders[\"\".concat(primName, \"ToPoints\")];\n } else if (representation === Representation.WIREFRAME) {\n func = cellBuilders[\"\".concat(primName, \"ToWireframe\")];\n } else {\n func = cellBuilders[\"\".concat(primName, \"ToSurface\")];\n }\n\n var caboCount = getOutputSize(cellArray, representation, primName);\n var vboidx = 0;\n var packedVBO = new Int8Array(caboCount * 4);\n\n addAPoint = function addAPointFunc(normal) {\n packedVBO[vboidx++] = 127 * normal[0];\n packedVBO[vboidx++] = 127 * normal[1];\n packedVBO[vboidx++] = 127 * normal[2];\n packedVBO[vboidx++] = 127;\n };\n\n var array = cellArray.getData();\n var size = array.length;\n\n for (var index = 0; index < size;) {\n func(array[index], array, index + 1);\n index += array[index] + 1;\n }\n\n return packedVBO;\n} // ----------------------------------------------------------------------------\n// vtkWebGPUBufferManager methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkWebGPUBufferManager(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUBufferManager'); // is the buffer already present?\n\n publicAPI.hasBuffer = function (req) {\n if (req.source) {\n // if a matching buffer already exists then return true\n if (model.buffers.has(req.source)) {\n var dabuffers = model.buffers.get(req.source);\n\n for (var i = 0; i < dabuffers.length; i++) {\n if (requestMatches(dabuffers[i].request, req)) {\n return true;\n }\n }\n }\n }\n\n return false;\n }; // we cache based on the passed in source, when the source is\n // garbage collected then the cache entry is removed. If a source\n // is not provided then the buffer is NOT cached and you are on your own\n // if you want to share it etc\n\n\n publicAPI.getBuffer = function (req) {\n if (req.source) {\n // if a matching buffer already exists then return it\n if (model.buffers.has(req.source)) {\n var dabuffers = model.buffers.get(req.source);\n\n for (var i = 0; i < dabuffers.length; i++) {\n if (requestMatches(dabuffers[i].request, req)) {\n return dabuffers[i].buffer;\n }\n }\n }\n } // if a dataArray is provided set the nativeArray\n\n\n if (req.dataArray && !req.nativeArray) {\n req.nativeArray = req.dataArray.getData();\n } // create one\n\n\n var buffer = vtk_js_Sources_Rendering_WebGPU_Buffer__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n buffer.setDevice(model.device);\n var stride = vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getByteStrideFromBufferFormat(req.format);\n var arrayType = vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getNativeTypeFromBufferFormat(req.format);\n var gpuUsage = null; // handle uniform buffers\n\n if (req.usage === BufferUsage.UniformArray) {\n /* eslint-disable no-bitwise */\n gpuUsage = GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST;\n /* eslint-enable no-bitwise */\n\n buffer.createAndWrite(req.nativeArray, gpuUsage);\n } // handle storage buffers\n\n\n if (req.usage === BufferUsage.Storage) {\n /* eslint-disable no-bitwise */\n gpuUsage = GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST;\n /* eslint-enable no-bitwise */\n\n buffer.createAndWrite(req.nativeArray, gpuUsage);\n } // handle textures\n\n\n if (req.usage === BufferUsage.Texture) {\n /* eslint-disable no-bitwise */\n gpuUsage = GPUBufferUsage.COPY_SRC;\n /* eslint-enable no-bitwise */\n\n buffer.createAndWrite(req.nativeArray, gpuUsage);\n buffer.setArrayInformation([{\n offset: 0,\n format: req.format\n }]);\n } // handle point data\n\n\n if (req.usage === BufferUsage.PointArray) {\n gpuUsage = GPUBufferUsage.VERTEX;\n var result = packArray(req.cells, req.primitiveType, req.representation, req.dataArray, arrayType, {\n packExtra: req.packExtra,\n shift: req.shift,\n scale: req.scale,\n cellData: req.cellData,\n cellOffset: req.cellOffset\n }); // console.log(result);\n\n buffer.createAndWrite(result.nativeArray, gpuUsage);\n buffer.setStrideInBytes(stride);\n buffer.setArrayInformation([{\n offset: 0,\n format: req.format\n }]);\n } // handle normals from points, snorm8x4\n\n\n if (req.usage === BufferUsage.NormalsFromPoints) {\n gpuUsage = GPUBufferUsage.VERTEX;\n var normals = generateNormals(req.cells, req.primitiveType, req.representation, req.dataArray);\n buffer.createAndWrite(normals, gpuUsage);\n buffer.setStrideInBytes(stride);\n buffer.setArrayInformation([{\n offset: 0,\n format: req.format\n }]);\n }\n\n if (req.usage === BufferUsage.RawVertex) {\n gpuUsage = GPUBufferUsage.VERTEX;\n buffer.createAndWrite(req.nativeArray, gpuUsage);\n buffer.setStrideInBytes(stride);\n buffer.setArrayInformation([{\n offset: 0,\n format: req.format\n }]);\n }\n\n buffer.setSourceTime(req.time); // cache the buffer if we have a dataArray.\n // We create a new req that only has the 4 fields required for\n // a comparison to avoid GC cycles\n\n if (req.source) {\n if (!model.buffers.has(req.source)) {\n model.buffers.set(req.source, []);\n }\n\n var _dabuffers = model.buffers.get(req.source);\n\n _dabuffers.push({\n request: {\n time: req.time,\n format: req.format,\n usage: req.usage,\n hash: req.hash\n },\n buffer: buffer\n });\n }\n\n return buffer;\n };\n\n publicAPI.getFullScreenQuadBuffer = function () {\n if (model.fullScreenQuadBuffer) {\n return model.fullScreenQuadBuffer;\n }\n\n model.fullScreenQuadBuffer = vtk_js_Sources_Rendering_WebGPU_Buffer__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.fullScreenQuadBuffer.setDevice(model.device); // prettier-ignore\n\n var array = new Float32Array([-1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0]);\n model.fullScreenQuadBuffer.createAndWrite(array, GPUBufferUsage.VERTEX);\n model.fullScreenQuadBuffer.setStrideInBytes(12);\n model.fullScreenQuadBuffer.setArrayInformation([{\n offset: 0,\n format: 'float32x3'\n }]);\n return model.fullScreenQuadBuffer;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n device: null,\n fullScreenQuadBuffer: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"obj\"](publicAPI, model); // this is a cache, and a cache with GC pretty much means WeakMap\n\n model.buffers = new WeakMap();\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['device']);\n vtkWebGPUBufferManager(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_objectSpread(_objectSpread({\n newInstance: newInstance,\n extend: extend\n}, STATIC), _Constants__WEBPACK_IMPORTED_MODULE_5__[\"default\"]));\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Camera/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Camera/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUCamera methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUCamera(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUCamera');\n\n publicAPI.getKeyMatrices = function (webGPURenderer) {\n // has the camera changed?\n var ren = webGPURenderer.getRenderable();\n var webGPURenderWindow = webGPURenderer.getParent();\n\n if (Math.max(webGPURenderWindow.getMTime(), publicAPI.getMTime(), ren.getMTime(), model.renderable.getMTime(), webGPURenderer.getStabilizedTime().getMTime()) > model.keyMatrixTime.getMTime()) {\n var wcvc = model.renderable.getViewMatrix();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].copy(model.keyMatrices.normalMatrix, wcvc); // zero out translation\n\n model.keyMatrices.normalMatrix[3] = 0.0;\n model.keyMatrices.normalMatrix[7] = 0.0;\n model.keyMatrices.normalMatrix[11] = 0.0;\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(model.keyMatrices.normalMatrix, model.keyMatrices.normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.wcvc, wcvc);\n var center = webGPURenderer.getStabilizedCenterByReference();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.keyMatrices.scvc, model.keyMatrices.wcvc, center);\n var aspectRatio = webGPURenderer.getAspectRatio();\n var vcpc = model.renderable.getProjectionMatrix(aspectRatio, -1, 1);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.vcpc, vcpc); // adjust due to WebGPU using a different coordinate system in Z\n\n model.keyMatrices.vcpc[2] = 0.5 * vcpc[8] + 0.5 * vcpc[12];\n model.keyMatrices.vcpc[6] = 0.5 * vcpc[9] + 0.5 * vcpc[13];\n model.keyMatrices.vcpc[10] = 0.5 * vcpc[10] + 0.5 * vcpc[14];\n model.keyMatrices.vcpc[14] = 0.5 * vcpc[11] + 0.5 * vcpc[15];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].multiply(model.keyMatrices.scpc, model.keyMatrices.vcpc, model.keyMatrices.scvc);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].invert(model.keyMatrices.pcsc, model.keyMatrices.scpc);\n model.keyMatrixTime.modified();\n }\n\n return model.keyMatrices;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n keyMatrixTime: null,\n keyMatrices: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatrixTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(model.keyMatrixTime); // values always get set by the get method\n\n model.keyMatrices = {\n normalMatrix: new Float64Array(16),\n vcpc: new Float64Array(16),\n pcsc: new Float64Array(16),\n wcvc: new Float64Array(16),\n scpc: new Float64Array(16),\n scvc: new Float64Array(16)\n }; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setGet(publicAPI, model, ['keyMatrixTime']); // Object methods\n\n vtkWebGPUCamera(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkCamera', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Camera/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/FullScreenQuad/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/FullScreenQuad/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderCache */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_MapperHelper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/MapperHelper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/MapperHelper/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUFullScreenQuad methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUFullScreenQuad(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUFullScreenQuad');\n\n publicAPI.replaceShaderPosition = function (hash, pipeline, vertexInput) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addBuiltinOutput('vec4', '[[builtin(position)]] Position');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_1__[\"default\"].substitute(code, '//VTK::Position::Impl', ['output.tcoordVS = vec2(vertexBC.x * 0.5 + 0.5, 1.0 - vertexBC.y * 0.5 - 0.5);', 'output.Position = vec4(vertexBC, 1.0);']).result;\n vDesc.setCode(code);\n };\n\n model.shaderReplacements.set('replaceShaderPosition', publicAPI.replaceShaderPosition);\n var superclassBuild = publicAPI.build;\n\n publicAPI.build = function (renderEncoder, device) {\n var buff = device.getBufferManager().getFullScreenQuadBuffer();\n model.vertexInput.addBuffer(buff, ['vertexBC']);\n model.numberOfVertices = 6;\n superclassBuild(renderEncoder, device);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_WebGPU_MapperHelper__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues); // Object methods\n\n vtkWebGPUFullScreenQuad(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUFullScreenQuad'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/FullScreenQuad/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Glyph3DMapper/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Glyph3DMapper/index.js ***! - \*****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_PolyDataMapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/PolyDataMapper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/PolyDataMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_StorageBuffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/StorageBuffer */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/StorageBuffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderCache */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BufferManager */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\n\n\nvar PrimitiveTypes = vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_4__[\"default\"].PrimitiveTypes; // ----------------------------------------------------------------------------\n// vtkWebGPUSphereMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUGlyph3DMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUGlyph3DMapper'); // Capture 'parentClass' api for internal use\n\n var superClass = _objectSpread({}, publicAPI);\n\n publicAPI.replaceShaderPosition = function (hash, pipeline, vertexInput) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addBuiltinInput('u32', '[[builtin(instance_index)]] instanceIndex');\n vDesc.addBuiltinOutput('vec4', '[[builtin(position)]] Position');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Position::Impl', [' output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix', ' *glyphSSBO.values[input.instanceIndex].matrix', ' *vertexBC;']).result;\n vDesc.setCode(code);\n };\n\n publicAPI.replaceShaderNormal = function (hash, pipeline, vertexInput) {\n if (vertexInput.hasAttribute('normalMC')) {\n var vDesc = pipeline.getShaderDescription('vertex');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Normal::Impl', [' output.normalVC = normalize((rendererUBO.WCVCNormals', ' * mapperUBO.MCWCNormals', ' * glyphSSBO.values[input.instanceIndex].normal*normalMC).xyz);']).result;\n vDesc.setCode(code);\n }\n\n superClass.replaceShaderNormal(hash, pipeline, vertexInput);\n };\n\n publicAPI.replaceShaderColor = function (hash, pipeline, vertexInput) {\n if (!model.carray) {\n superClass.replaceShaderColor(hash, pipeline, vertexInput);\n return;\n }\n\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addOutput('vec4', 'color');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Color::Impl', [' output.color = glyphSSBO.values[input.instanceIndex].color;']).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n code = fDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Color::Impl', ['ambientColor = input.color;', 'diffuseColor = input.color;', 'opacity = mapperUBO.Opacity * input.color.a;']).result;\n fDesc.setCode(code);\n };\n\n publicAPI.replaceShaderSelect = function (hash, pipeline, vertexInput) {\n if (hash.includes('sel')) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addOutput('u32', 'compositeID');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Select::Impl', [' output.compositeID = input.instanceIndex;']).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n code = fDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Select::Impl', ['var compositeID: u32 = input.compositeID;']).result;\n fDesc.setCode(code);\n }\n };\n\n publicAPI.buildPrimitives = function () {\n model.currentInput = model.renderable.getInputData(1);\n model.renderable.buildArrays(); // update the buffer objects if needed\n\n var garray = model.renderable.getMatrixArray();\n var narray = model.renderable.getNormalArray();\n model.carray = model.renderable.getColorArray();\n var numInstances = garray.length / 16;\n\n if (model.renderable.getBuildTime().getMTime() > model.glyphBOBuildTime.getMTime()) {\n // In Core class all arrays are rebuilt when this happens\n // but these arrays can be shared between all primType\n var device = model.WebGPURenderWindow.getDevice();\n model.SSBO.clearData();\n model.SSBO.setNumberOfInstances(numInstances);\n model.SSBO.addEntry('matrix', 'mat4x4');\n model.SSBO.addEntry('normal', 'mat4x4');\n\n if (model.carray) {\n model.SSBO.addEntry('color', 'vec4');\n }\n\n model.SSBO.setAllInstancesFromArray('matrix', garray);\n model.SSBO.setAllInstancesFromArray3x3To4x4('normal', narray);\n\n if (model.carray) {\n model.SSBO.setAllInstancesFromArrayColorToFloat('color', model.carray.getData());\n }\n\n model.SSBO.send(device);\n model.glyphBOBuildTime.modified();\n }\n\n superClass.buildPrimitives();\n\n for (var i = 0; i < model.primitives.length; i++) {\n var primHelper = model.primitives[i];\n primHelper.setNumberOfInstances(numInstances);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_WebGPU_PolyDataMapper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n model.glyphBOBuildTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"obj\"](model.glyphBOBuildTime, {\n mtime: 0\n });\n model.SSBO = vtk_js_Sources_Rendering_WebGPU_StorageBuffer__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.SSBO.setName('glyphSSBO'); // Object methods\n\n vtkWebGPUGlyph3DMapper(publicAPI, model);\n\n for (var i = PrimitiveTypes.Start; i < PrimitiveTypes.End; i++) {\n model.primitives[i].setSSBO(model.SSBO);\n var sr = model.primitives[i].getShaderReplacements();\n sr.set('replaceShaderPosition', publicAPI.replaceShaderPosition);\n sr.set('replaceShaderNormal', publicAPI.replaceShaderNormal);\n sr.set('replaceShaderSelect', publicAPI.replaceShaderSelect);\n sr.set('replaceShaderColor', publicAPI.replaceShaderColor);\n }\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkWebGPUGlyph3DMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_5__[\"registerOverride\"])('vtkGlyph3DMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Glyph3DMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/MapperHelper/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/MapperHelper/index.js ***! - \****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BindGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BindGroup */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BindGroup/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Pipeline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Pipeline */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Pipeline/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderCache */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderDescription__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderDescription */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderDescription/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_VertexInput__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/VertexInput */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/VertexInput/index.js\");\n\n\n\n\n\n\nvar vtkWebGPUMapperHelperVS = \"\\n//VTK::Renderer::Dec\\n\\n//VTK::Color::Dec\\n\\n//VTK::Normal::Dec\\n\\n//VTK::TCoord::Dec\\n\\n//VTK::Select::Dec\\n\\n//VTK::Mapper::Dec\\n\\n//VTK::IOStructs::Dec\\n\\n[[stage(vertex)]]\\nfn main(\\n//VTK::IOStructs::Input\\n)\\n//VTK::IOStructs::Output\\n{\\n var output : vertexOutput;\\n\\n // var vertex: vec4 = vertexBC;\\n\\n //VTK::Color::Impl\\n\\n //VTK::Normal::Impl\\n\\n //VTK::TCoord::Impl\\n\\n //VTK::Select::Impl\\n\\n //VTK::Position::Impl\\n\\n return output;\\n}\\n\";\nvar vtkWebGPUMapperHelperFS = \"\\n//VTK::Renderer::Dec\\n\\n//VTK::Color::Dec\\n\\n//VTK::Normal::Dec\\n\\n//VTK::TCoord::Dec\\n\\n//VTK::Select::Dec\\n\\n//VTK::RenderEncoder::Dec\\n\\n//VTK::Mapper::Dec\\n\\n//VTK::IOStructs::Dec\\n\\n[[stage(fragment)]]\\nfn main(\\n//VTK::IOStructs::Input\\n)\\n//VTK::IOStructs::Output\\n{\\n var output : fragmentOutput;\\n\\n //VTK::Color::Impl\\n\\n //VTK::Normal::Impl\\n\\n //VTK::Light::Impl\\n\\n //VTK::TCoord::Impl\\n\\n //VTK::Select::Impl\\n\\n // var computedColor:vec4 = vec4(1.0,0.5,0.5,1.0);\\n\\n //VTK::RenderEncoder::Impl\\n return output;\\n}\\n\"; // ----------------------------------------------------------------------------\n// vtkWebGPUMapperHelper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUMapperHelper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUMapperHelper');\n\n publicAPI.generateShaderDescriptions = function (hash, pipeline, vertexInput) {\n // create the shader descriptions\n var vDesc = vtk_js_Sources_Rendering_WebGPU_ShaderDescription__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance({\n type: 'vertex',\n hash: hash,\n code: model.vertexShaderTemplate\n });\n var fDesc = vtk_js_Sources_Rendering_WebGPU_ShaderDescription__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance({\n type: 'fragment',\n hash: hash,\n code: model.fragmentShaderTemplate\n }); // add them to the pipeline\n\n var sdrs = pipeline.getShaderDescriptions();\n sdrs.push(vDesc);\n sdrs.push(fDesc); // look for replacements to invoke\n\n var scode = model.vertexShaderTemplate + model.fragmentShaderTemplate;\n var re = new RegExp('//VTK::[^:]*::', 'g');\n var unique = scode.match(re).filter(function (v, i, a) {\n return a.indexOf(v) === i;\n });\n var fnames = unique.map(function (v) {\n return \"replaceShader\".concat(v.substring(7, v.length - 2));\n }); // now invoke shader replacement functions\n\n for (var i = 0; i < fnames.length; i++) {\n var fname = fnames[i];\n\n if (fname !== 'replaceShaderIOStructs' && model.shaderReplacements.has(fname)) {\n model.shaderReplacements.get(fname)(hash, pipeline, vertexInput);\n }\n } // always replace the IOStructs last as other replacement funcs may\n // add inputs or outputs\n\n\n publicAPI.replaceShaderIOStructs(hash, pipeline, vertexInput); // console.log(vDesc.getCode());\n // console.log(fDesc.getCode());\n };\n\n publicAPI.replaceShaderIOStructs = function (hash, pipeline, vertexInput) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.replaceShaderCode(null, vertexInput);\n var fDesc = pipeline.getShaderDescription('fragment');\n fDesc.replaceShaderCode(vDesc);\n };\n\n publicAPI.replaceShaderRenderEncoder = function (hash, pipeline, vertexInput) {\n model.renderEncoder.replaceShaderCode(pipeline);\n };\n\n model.shaderReplacements.set('replaceShaderRenderEncoder', publicAPI.replaceShaderRenderEncoder);\n\n publicAPI.replaceShaderRenderer = function (hash, pipeline, vertexInput) {\n if (!model.WebGPURenderer) {\n return;\n }\n\n var ubocode = model.WebGPURenderer.getBindGroup().getShaderCode(pipeline);\n var vDesc = pipeline.getShaderDescription('vertex');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Renderer::Dec', [ubocode]).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n code = fDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Renderer::Dec', [ubocode]).result;\n fDesc.setCode(code);\n };\n\n model.shaderReplacements.set('replaceShaderRenderer', publicAPI.replaceShaderRenderer);\n\n publicAPI.replaceShaderMapper = function (hash, pipeline, vertexInput) {\n var ubocode = model.bindGroup.getShaderCode(pipeline);\n var vDesc = pipeline.getShaderDescription('vertex');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Mapper::Dec', [ubocode]).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n fDesc.addBuiltinInput('bool', '[[builtin(front_facing)]] frontFacing');\n code = fDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Mapper::Dec', [ubocode]).result;\n fDesc.setCode(code);\n };\n\n model.shaderReplacements.set('replaceShaderMapper', publicAPI.replaceShaderMapper);\n\n publicAPI.replaceShaderPosition = function (hash, pipeline, vertexInput) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addBuiltinOutput('vec4', '[[builtin(position)]] Position');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_3__[\"default\"].substitute(code, '//VTK::Position::Impl', [' output.Position = rendererUBO.SCPCMatrix*vertexBC;']).result;\n vDesc.setCode(code);\n };\n\n model.shaderReplacements.set('replaceShaderPosition', publicAPI.replaceShaderPosition);\n\n publicAPI.replaceShaderTCoord = function (hash, pipeline, vertexInput) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addOutput('vec2', 'tcoordVS');\n };\n\n model.shaderReplacements.set('replaceShaderTCoord', publicAPI.replaceShaderTCoord);\n\n publicAPI.addTextureView = function (view) {\n // is it already there?\n if (model.textureViews.includes(view)) {\n return;\n }\n\n model.textureViews.push(view);\n };\n\n publicAPI.renderForPipeline = function (renderEncoder) {\n var pipeline = renderEncoder.getBoundPipeline(); // bind the mapper bind group\n\n renderEncoder.activateBindGroup(model.bindGroup); // bind the vertex input\n\n pipeline.bindVertexInput(renderEncoder, model.vertexInput);\n renderEncoder.draw(model.numberOfVertices, model.numberOfInstances, 0, 0);\n };\n\n publicAPI.registerToDraw = function () {\n if (model.pipeline) {\n model.WebGPURenderer.registerPipelineCallback(model.pipeline, publicAPI.renderForPipeline);\n }\n };\n\n publicAPI.render = function (renderEncoder, device) {\n publicAPI.build(renderEncoder, device);\n renderEncoder.setPipeline(model.pipeline);\n\n if (model.WebGPURenderer) {\n model.WebGPURenderer.bindUBO(renderEncoder);\n }\n\n publicAPI.renderForPipeline(renderEncoder);\n };\n\n publicAPI.build = function (renderEncoder, device) {\n // handle per primitive type\n model.renderEncoder = renderEncoder;\n model.pipeline = device.getPipeline(model.pipelineHash); // todo handle removing a bindable\n\n if (model.UBO) {\n model.bindGroup.addBindable(model.UBO);\n }\n\n if (model.SSBO) {\n model.bindGroup.addBindable(model.SSBO);\n } // add texture BindGroupLayouts\n\n\n for (var t = 0; t < model.textureViews.length; t++) {\n model.bindGroup.addBindable(model.textureViews[t]);\n var samp = model.textureViews[t].getSampler();\n\n if (samp) {\n model.bindGroup.addBindable(samp);\n }\n } // build VBO for this primitive\n // build the pipeline if needed\n\n\n if (!model.pipeline) {\n model.pipeline = vtk_js_Sources_Rendering_WebGPU_Pipeline__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n model.pipeline.setDevice(device);\n\n if (model.WebGPURenderer) {\n model.pipeline.addBindGroupLayout(model.WebGPURenderer.getBindGroup());\n }\n\n model.pipeline.addBindGroupLayout(model.bindGroup);\n publicAPI.generateShaderDescriptions(model.pipelineHash, model.pipeline, model.vertexInput);\n model.pipeline.setTopology(model.topology);\n model.pipeline.setRenderEncoder(renderEncoder);\n model.pipeline.setVertexState(model.vertexInput.getVertexInputInformation());\n device.createPipeline(model.pipelineHash, model.pipeline);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bindGroup: null,\n device: null,\n fragmentShaderTemplate: null,\n numberOfInstances: 1,\n numberOfVertices: 0,\n pipelineHash: null,\n shaderReplacements: null,\n SSBO: null,\n textureViews: null,\n topology: 'triangle-list',\n UBO: null,\n vertexShaderTemplate: null,\n WebGPURenderer: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.textureViews = [];\n model.vertexInput = vtk_js_Sources_Rendering_WebGPU_VertexInput__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n model.bindGroup = vtk_js_Sources_Rendering_WebGPU_BindGroup__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.bindGroup.setName('mapperBG');\n model.fragmentShaderTemplate = model.fragmentShaderTemplate || vtkWebGPUMapperHelperFS;\n model.vertexShaderTemplate = model.vertexShaderTemplate || vtkWebGPUMapperHelperVS;\n model.shaderReplacements = new Map(); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['vertexInput']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['device', 'fragmentShaderTemplate', 'interpolate', 'numberOfInstances', 'numberOfVertices', 'pipelineHash', 'shaderReplacements', 'SSBO', 'textureViews', 'topology', 'UBO', 'vertexShaderTemplate', 'WebGPURenderer']); // Object methods\n\n vtkWebGPUMapperHelper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUMapperHelper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/MapperHelper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Pipeline/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Pipeline/index.js ***! - \************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkWebGPUPipeline methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUPipeline(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUPipeline');\n\n publicAPI.getShaderDescriptions = function () {\n return model.shaderDescriptions;\n };\n\n publicAPI.initialize = function (device) {\n // start with the renderencoder settings\n var pipelineDesc = model.renderEncoder.getPipelineSettings();\n pipelineDesc.primitive.topology = model.topology;\n pipelineDesc.vertex = model.vertexState; // add in bind group layouts\n\n var bindGroupLayouts = [];\n\n for (var i = 0; i < model.layouts.length; i++) {\n bindGroupLayouts.push(model.layouts[i].layout);\n }\n\n model.pipelineLayout = device.getHandle().createPipelineLayout({\n bindGroupLayouts: bindGroupLayouts\n });\n pipelineDesc.layout = model.pipelineLayout;\n\n for (var _i = 0; _i < model.shaderDescriptions.length; _i++) {\n var sd = model.shaderDescriptions[_i];\n var sm = device.getShaderModule(sd);\n\n if (sd.getType() === 'vertex') {\n pipelineDesc.vertex.module = sm.getHandle();\n pipelineDesc.vertex.entryPoint = 'main';\n }\n\n if (sd.getType() === 'fragment') {\n pipelineDesc.fragment.module = sm.getHandle();\n pipelineDesc.fragment.entryPoint = 'main';\n }\n }\n\n model.handle = device.getHandle().createRenderPipeline(pipelineDesc);\n };\n\n publicAPI.getShaderDescription = function (stype) {\n for (var i = 0; i < model.shaderDescriptions.length; i++) {\n if (model.shaderDescriptions[i].getType() === stype) return model.shaderDescriptions[i];\n }\n\n return null;\n };\n\n publicAPI.addBindGroupLayout = function (bindGroup) {\n if (!bindGroup) {\n return;\n }\n\n model.layouts.push({\n layout: bindGroup.getBindGroupLayout(model.device),\n name: bindGroup.getName()\n });\n };\n\n publicAPI.getBindGroupLayoutCount = function (lname) {\n for (var i = 0; i < model.layouts.length; i++) {\n if (model.layouts[i].name === lname) {\n return i;\n }\n }\n\n return 0;\n };\n\n publicAPI.bindVertexInput = function (renderEncoder, vInput) {\n vInput.bindBuffers(renderEncoder);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n handle: null,\n layouts: null,\n renderEncoder: null,\n shaderDescriptions: null,\n vertexState: null,\n topology: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"obj\"](publicAPI, model);\n model.layouts = [];\n model.shaderDescriptions = [];\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"get\"](publicAPI, model, ['handle']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['device', 'renderEncoder', 'topology', 'vertexState']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkWebGPUPipeline(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkWebGPUPipeline'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Pipeline/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper/index.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper/index.js ***! - \****************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\n\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUPixelSpaceCallbackMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUPixelSpaceCallbackMapper(publicAPI, model) {\n model.classHierarchy.push('vtkWebGPUPixelSpaceCallbackMapper');\n\n publicAPI.opaquePass = function (prepass, renderPass) {\n model.WebGPURenderer = publicAPI.getFirstAncestorOfType('vtkWebGPURenderer');\n model.WebGPURenderWindow = model.WebGPURenderer.getParent();\n var aspectRatio = model.WebGPURenderer.getAspectRatio();\n var camera = model.WebGPURenderer ? model.WebGPURenderer.getRenderable().getActiveCamera() : null;\n var tsize = model.WebGPURenderer.getTiledSizeAndOrigin();\n var texels = null;\n\n if (model.renderable.getUseZValues()) {// Todo\n }\n\n model.renderable.invokeCallback(model.renderable.getInputData(), camera, aspectRatio, tsize, texels);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object methods\n\n vtkWebGPUPixelSpaceCallbackMapper(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUPixelSpaceCallbackMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__[\"registerOverride\"])('vtkPixelSpaceCallbackMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/PolyDataMapper/index.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/PolyDataMapper/index.js ***! - \******************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Property */ \"./node_modules/vtk.js/Sources/Rendering/Core/Property/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Texture__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Texture */ \"./node_modules/vtk.js/Sources/Rendering/Core/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BufferManager */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderCache */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_UniformBuffer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/UniformBuffer */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/UniformBuffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_MapperHelper__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/MapperHelper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/MapperHelper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\n\n\n\n\n\n\n\n\n\n\n\nvar BufferUsage = vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].BufferUsage,\n PrimitiveTypes = vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].PrimitiveTypes;\nvar Representation = vtk_js_Sources_Rendering_Core_Property__WEBPACK_IMPORTED_MODULE_3__[\"default\"].Representation;\nvar ScalarMode = vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ScalarMode;\nvar StartEvent = {\n type: 'StartEvent'\n};\nvar EndEvent = {\n type: 'EndEvent'\n};\nvar vtkWebGPUPolyDataVS = \"\\n//VTK::Renderer::Dec\\n\\n//VTK::Color::Dec\\n\\n//VTK::Normal::Dec\\n\\n//VTK::TCoord::Dec\\n\\n//VTK::Select::Dec\\n\\n//VTK::Mapper::Dec\\n\\n//VTK::IOStructs::Dec\\n\\n[[stage(vertex)]]\\nfn main(\\n//VTK::IOStructs::Input\\n)\\n//VTK::IOStructs::Output\\n{\\n var output : vertexOutput;\\n\\n var vertex: vec4 = vertexBC;\\n\\n //VTK::Color::Impl\\n\\n //VTK::Normal::Impl\\n\\n //VTK::TCoord::Impl\\n\\n //VTK::Select::Impl\\n\\n //VTK::Position::Impl\\n\\n return output;\\n}\\n\";\nvar vtkWebGPUPolyDataFS = \"\\n//VTK::Renderer::Dec\\n\\n//VTK::Color::Dec\\n\\n// optional surface normal declaration\\n//VTK::Normal::Dec\\n\\n//VTK::TCoord::Dec\\n\\n//VTK::Select::Dec\\n\\n//VTK::RenderEncoder::Dec\\n\\n//VTK::Mapper::Dec\\n\\n//VTK::IOStructs::Dec\\n\\n[[stage(fragment)]]\\nfn main(\\n//VTK::IOStructs::Input\\n)\\n//VTK::IOStructs::Output\\n{\\n var output : fragmentOutput;\\n\\n var ambientColor: vec4 = mapperUBO.AmbientColor;\\n var diffuseColor: vec4 = mapperUBO.DiffuseColor;\\n var opacity: f32 = mapperUBO.Opacity;\\n\\n //VTK::Color::Impl\\n\\n //VTK::Normal::Impl\\n\\n //VTK::Light::Impl\\n\\n var computedColor: vec4 = vec4(ambientColor.rgb * mapperUBO.AmbientIntensity\\n + diffuse * mapperUBO.DiffuseIntensity\\n + specular * mapperUBO.SpecularIntensity,\\n opacity);\\n\\n //VTK::TCoord::Impl\\n\\n //VTK::Select::Impl\\n\\n if (computedColor.a == 0.0) { discard; };\\n\\n //VTK::RenderEncoder::Impl\\n return output;\\n}\\n\"; // ----------------------------------------------------------------------------\n// vtkWebGPUPolyDataMapper methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUPolyDataMapper(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUPolyDataMapper');\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n model.WebGPUActor = publicAPI.getFirstAncestorOfType('vtkWebGPUActor');\n model.WebGPURenderer = model.WebGPUActor.getFirstAncestorOfType('vtkWebGPURenderer');\n model.WebGPURenderWindow = model.WebGPURenderer.getParent();\n model.device = model.WebGPURenderWindow.getDevice();\n }\n }; // Renders myself\n\n\n publicAPI.translucentPass = function (prepass) {\n if (prepass) {\n publicAPI.render();\n }\n };\n\n publicAPI.opaquePass = function (prepass) {\n if (prepass) {\n publicAPI.render();\n }\n };\n\n publicAPI.updateUBO = function () {\n // make sure the data is up to date\n var actor = model.WebGPUActor.getRenderable();\n var ppty = actor.getProperty();\n var utime = model.UBO.getSendTime();\n\n if (publicAPI.getMTime() > utime || ppty.getMTime() > utime || model.renderable.getMTime() > utime) {\n var keyMats = model.WebGPUActor.getKeyMatrices(model.WebGPURenderer);\n model.UBO.setArray('BCWCMatrix', keyMats.bcwc);\n model.UBO.setArray('BCSCMatrix', keyMats.bcsc);\n model.UBO.setArray('MCWCNormals', keyMats.normalMatrix);\n var aColor = ppty.getAmbientColorByReference();\n model.UBO.setValue('AmbientIntensity', ppty.getAmbient());\n model.UBO.setArray('AmbientColor', [aColor[0], aColor[1], aColor[2], 1.0]);\n model.UBO.setValue('DiffuseIntensity', ppty.getDiffuse());\n aColor = ppty.getDiffuseColorByReference();\n model.UBO.setArray('DiffuseColor', [aColor[0], aColor[1], aColor[2], 1.0]);\n model.UBO.setValue('SpecularIntensity', ppty.getSpecular());\n model.UBO.setValue('SpecularPower', ppty.getSpecularPower());\n aColor = ppty.getSpecularColorByReference();\n model.UBO.setArray('SpecularColor', [aColor[0], aColor[1], aColor[2], 1.0]);\n model.UBO.setValue('Opacity', ppty.getOpacity());\n model.UBO.setValue('PropID', model.WebGPUActor.getPropID());\n var device = model.WebGPURenderWindow.getDevice();\n model.UBO.sendIfNeeded(device);\n }\n };\n\n publicAPI.render = function () {\n publicAPI.invokeEvent(StartEvent);\n\n if (!model.renderable.getStatic()) {\n model.renderable.update();\n }\n\n model.currentInput = model.renderable.getInputData();\n publicAPI.invokeEvent(EndEvent);\n model.renderEncoder = model.WebGPURenderer.getRenderEncoder();\n publicAPI.buildPrimitives(); // update descriptor sets\n\n publicAPI.updateUBO();\n };\n\n publicAPI.replaceShaderPosition = function (hash, pipeline, vertexInput) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addBuiltinOutput('vec4', '[[builtin(position)]] Position');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Position::Impl', [' output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix*vertexBC;']).result;\n vDesc.setCode(code);\n };\n\n publicAPI.replaceShaderNormal = function (hash, pipeline, vertexInput) {\n if (vertexInput.hasAttribute('normalMC')) {\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addOutput('vec3', 'normalVC');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Normal::Impl', [' output.normalVC = normalize((rendererUBO.WCVCNormals * mapperUBO.MCWCNormals * normalMC).xyz);']).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n code = fDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Normal::Impl', [' var normal: vec3 = input.normalVC;', ' if (!input.frontFacing) { normal = -normal; }']).result;\n fDesc.setCode(code);\n }\n }; // we only apply lighting when there is a \"var normal\" declaration in the\n // fragment shader code. That is the lighting trigger.\n\n\n publicAPI.replaceShaderLight = function (hash, pipeline, vertexInput) {\n var fDesc = pipeline.getShaderDescription('fragment');\n var code = fDesc.getCode();\n\n if (code.includes('var normal')) {\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Light::Impl', [' var df: f32 = max(0.0, normal.z);', ' var sf: f32 = pow(df, mapperUBO.SpecularPower);', ' var diffuse: vec3 = df * diffuseColor.rgb;', ' var specular: vec3 = sf * mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;']).result;\n fDesc.setCode(code);\n } else {\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Light::Impl', [' var diffuse: vec3 = diffuseColor.rgb;', ' var specular: vec3 = mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;']).result;\n fDesc.setCode(code);\n }\n };\n\n publicAPI.replaceShaderColor = function (hash, pipeline, vertexInput) {\n if (!vertexInput.hasAttribute('colorVI')) return;\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addOutput('vec4', 'color');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Color::Impl', [' output.color = colorVI;']).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n code = fDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Color::Impl', ['ambientColor = input.color;', 'diffuseColor = input.color;', 'opacity = mapperUBO.Opacity * input.color.a;']).result;\n fDesc.setCode(code);\n };\n\n publicAPI.replaceShaderTCoord = function (hash, pipeline, vertexInput) {\n if (!vertexInput.hasAttribute('tcoord')) return;\n var vDesc = pipeline.getShaderDescription('vertex');\n vDesc.addOutput('vec2', 'tcoordVS');\n var code = vDesc.getCode();\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::TCoord::Impl', [' output.tcoordVS = tcoord;']).result;\n vDesc.setCode(code);\n var fDesc = pipeline.getShaderDescription('fragment');\n code = fDesc.getCode(); // todo handle multiple textures? Blend multiply ?\n\n if (model.textures.length) {\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::TCoord::Impl', ['var tcolor: vec4 = textureSample(Texture0, Texture0Sampler, input.tcoordVS);', 'computedColor = computedColor*tcolor;']).result;\n }\n\n fDesc.setCode(code);\n };\n\n publicAPI.replaceShaderSelect = function (hash, pipeline, vertexInput) {\n if (hash.includes('sel')) {\n var fDesc = pipeline.getShaderDescription('fragment');\n var code = fDesc.getCode(); // by default there are no composites, so just 0\n\n code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_6__[\"default\"].substitute(code, '//VTK::Select::Impl', [' var compositeID: u32 = 0u;']).result;\n fDesc.setCode(code);\n }\n };\n\n publicAPI.getUsage = function (rep, i) {\n if (rep === Representation.POINTS || i === 0) {\n return BufferUsage.Verts;\n }\n\n if (i === 1) {\n return BufferUsage.Lines;\n }\n\n if (rep === Representation.WIREFRAME) {\n if (i === 2) {\n return BufferUsage.LinesFromTriangles;\n }\n\n return BufferUsage.LinesFromStrips;\n }\n\n if (i === 2) {\n return BufferUsage.Triangles;\n }\n\n return BufferUsage.Strips;\n };\n\n publicAPI.getHashFromUsage = function (usage) {\n return \"pt\".concat(usage);\n };\n\n publicAPI.getTopologyFromUsage = function (usage) {\n switch (usage) {\n case BufferUsage.Triangles:\n return 'triangle-list';\n\n case BufferUsage.Verts:\n return 'point-list';\n\n default:\n case BufferUsage.Lines:\n return 'line-list';\n }\n };\n\n publicAPI.buildVertexInput = function (pd, cells, primType) {\n var actor = model.WebGPUActor.getRenderable();\n var representation = actor.getProperty().getRepresentation();\n var device = model.WebGPURenderWindow.getDevice();\n var vertexInput = model.primitives[primType].getVertexInput(); // hash = all things that can change the values on the buffer\n // since mtimes are unique we can use\n // - cells mtime - because cells drive how we pack\n // - rep (point/wireframe/surface) - again because of packing\n // - relevant dataArray mtime - the source data\n // - shift - not currently captured\n // - scale - not currently captured\n // - format\n // - usage\n // - packExtra - covered by format\n // - prim type (vert/lines/polys/strips) - covered by cells mtime\n\n var hash = cells.getMTime() + representation; // points\n\n var points = pd.getPoints();\n\n if (points) {\n var shift = model.WebGPUActor.getBufferShift(model.WebGPURenderer);\n var buffRequest = {\n hash: hash + points.getMTime(),\n dataArray: points,\n source: points,\n cells: cells,\n primitiveType: primType,\n representation: representation,\n time: Math.max(points.getMTime(), cells.getMTime(), model.WebGPUActor.getKeyMatricesTime().getMTime()),\n shift: shift,\n usage: BufferUsage.PointArray,\n format: 'float32x4',\n packExtra: true\n };\n var buff = device.getBufferManager().getBuffer(buffRequest);\n vertexInput.addBuffer(buff, ['vertexBC']);\n } else {\n vertexInput.removeBufferIfPresent('vertexBC');\n } // normals, only used for surface rendering\n\n\n var usage = publicAPI.getUsage(representation, primType);\n\n if (usage === BufferUsage.Triangles || usage === BufferUsage.Strips) {\n var normals = pd.getPointData().getNormals();\n var _buffRequest = {\n cells: cells,\n representation: representation,\n primitiveType: primType,\n format: 'snorm8x4',\n packExtra: true,\n shift: 0,\n scale: 127\n };\n\n if (normals) {\n _buffRequest.hash = hash + normals.getMTime();\n _buffRequest.dataArray = normals;\n _buffRequest.source = normals;\n _buffRequest.time = Math.max(normals.getMTime(), cells.getMTime());\n _buffRequest.usage = BufferUsage.PointArray;\n\n var _buff = device.getBufferManager().getBuffer(_buffRequest);\n\n vertexInput.addBuffer(_buff, ['normalMC']);\n } else if (primType === PrimitiveTypes.Triangles) {\n _buffRequest.hash = hash + points.getMTime();\n _buffRequest.dataArray = points;\n _buffRequest.source = points;\n _buffRequest.time = Math.max(points.getMTime(), cells.getMTime());\n _buffRequest.usage = BufferUsage.NormalsFromPoints;\n\n var _buff2 = device.getBufferManager().getBuffer(_buffRequest);\n\n vertexInput.addBuffer(_buff2, ['normalMC']);\n } else {\n vertexInput.removeBufferIfPresent('normalMC');\n }\n } else {\n vertexInput.removeBufferIfPresent('normalMC');\n } // deal with colors but only if modified\n\n\n var haveColors = false;\n\n if (model.renderable.getScalarVisibility()) {\n var c = model.renderable.getColorMapColors();\n\n if (c) {\n var scalarMode = model.renderable.getScalarMode();\n var haveCellScalars = false; // We must figure out how the scalars should be mapped to the polydata.\n\n if ((scalarMode === ScalarMode.USE_CELL_DATA || scalarMode === ScalarMode.USE_CELL_FIELD_DATA || scalarMode === ScalarMode.USE_FIELD_DATA || !pd.getPointData().getScalars()) && scalarMode !== ScalarMode.USE_POINT_FIELD_DATA && c) {\n haveCellScalars = true;\n }\n\n var _buffRequest2 = {\n hash: hash + points.getMTime(),\n dataArray: c,\n source: c,\n cells: cells,\n primitiveType: primType,\n representation: representation,\n time: Math.max(c.getMTime(), cells.getMTime()),\n usage: BufferUsage.PointArray,\n format: 'unorm8x4',\n cellData: haveCellScalars,\n cellOffset: 0\n };\n\n var _buff3 = device.getBufferManager().getBuffer(_buffRequest2);\n\n vertexInput.addBuffer(_buff3, ['colorVI']);\n haveColors = true;\n }\n }\n\n if (!haveColors) {\n vertexInput.removeBufferIfPresent('colorVI');\n }\n\n var tcoords = null;\n\n if (model.renderable.getInterpolateScalarsBeforeMapping() && model.renderable.getColorCoordinates()) {\n tcoords = model.renderable.getColorCoordinates();\n } else {\n tcoords = pd.getPointData().getTCoords();\n }\n\n if (tcoords) {\n var _buffRequest3 = {\n hash: hash + tcoords.getMTime(),\n dataArray: tcoords,\n source: tcoords,\n cells: cells,\n primitiveType: primType,\n representation: representation,\n time: Math.max(tcoords.getMTime(), cells.getMTime()),\n usage: BufferUsage.PointArray,\n format: 'float32x2'\n };\n\n var _buff4 = device.getBufferManager().getBuffer(_buffRequest3);\n\n vertexInput.addBuffer(_buff4, ['tcoord']);\n } else {\n vertexInput.removeBufferIfPresent('tcoord');\n }\n };\n\n publicAPI.updateTextures = function () {\n // we keep track of new and used textures so\n // that we can clean up any unused textures so we don't hold onto them\n var usedTextures = [];\n var newTextures = []; // do we have a scalar color texture\n\n var idata = model.renderable.getColorTextureMap(); // returns an imagedata\n\n if (idata) {\n if (!model.colorTexture) {\n model.colorTexture = vtk_js_Sources_Rendering_Core_Texture__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n }\n\n model.colorTexture.setInputData(idata);\n newTextures.push(model.colorTexture);\n } // actor textures?\n\n\n var actor = model.WebGPUActor.getRenderable();\n var textures = actor.getTextures();\n\n for (var i = 0; i < textures.length; i++) {\n if (textures[i].getInputData()) {\n newTextures.push(textures[i]);\n }\n\n if (textures[i].getImage() && textures[i].getImageLoaded()) {\n newTextures.push(textures[i]);\n }\n }\n\n var usedCount = 0;\n\n for (var _i = 0; _i < newTextures.length; _i++) {\n var srcTexture = newTextures[_i];\n var treq = {};\n\n if (srcTexture.getInputData()) {\n treq.imageData = srcTexture.getInputData();\n treq.source = treq.imageData;\n } else if (srcTexture.getImage()) {\n treq.image = srcTexture.getImage();\n treq.source = treq.image;\n }\n\n var newTex = model.device.getTextureManager().getTexture(treq);\n\n if (newTex.getReady()) {\n // is this a new texture\n var found = false;\n\n for (var t = 0; t < model.textures.length; t++) {\n if (model.textures[t] === newTex) {\n usedCount++;\n found = true;\n usedTextures[t] = true;\n }\n }\n\n if (!found) {\n usedTextures[model.textures.length] = true;\n var tview = newTex.createView();\n tview.setName(\"Texture\".concat(usedCount++));\n model.textures.push(newTex);\n model.textureViews.push(tview);\n var interpolate = srcTexture.getInterpolate() ? 'linear' : 'nearest';\n tview.addSampler(model.device, {\n minFilter: interpolate,\n maxFilter: interpolate\n });\n }\n }\n } // remove unused textures\n\n\n for (var _i2 = model.textures.length - 1; _i2 >= 0; _i2--) {\n if (!usedTextures[_i2]) {\n model.textures.splice(_i2, 1);\n model.textureViews.splice(_i2, 1);\n }\n }\n }; // compute a unique hash for a pipeline, this needs to be unique enough to\n // capture any pipeline code changes (which includes shader changes)\n // or vertex input changes/ bind groups/ etc\n\n\n publicAPI.computePipelineHash = function (vertexInput, usage) {\n var pipelineHash = 'pd';\n\n if (vertexInput.hasAttribute(\"normalMC\")) {\n pipelineHash += \"n\";\n }\n\n if (vertexInput.hasAttribute(\"colorVI\")) {\n pipelineHash += \"c\";\n }\n\n if (vertexInput.hasAttribute(\"tcoord\")) {\n pipelineHash += \"t\";\n }\n\n if (model.textures.length) {\n pipelineHash += \"tx\".concat(model.textures.length);\n }\n\n if (model.SSBO) {\n pipelineHash += \"ssbo\";\n }\n\n var uhash = publicAPI.getHashFromUsage(usage);\n pipelineHash += uhash;\n pipelineHash += model.renderEncoder.getPipelineHash();\n return pipelineHash;\n }; // was originally buildIBOs() but not using IBOs right now\n\n\n publicAPI.buildPrimitives = function () {\n var poly = model.currentInput;\n var prims = [poly.getVerts(), poly.getLines(), poly.getPolys(), poly.getStrips()];\n var device = model.WebGPURenderWindow.getDevice();\n model.renderable.mapScalars(poly, 1.0); // handle textures\n\n publicAPI.updateTextures(); // handle per primitive type\n\n for (var i = PrimitiveTypes.Points; i <= PrimitiveTypes.Triangles; i++) {\n if (prims[i].getNumberOfValues() > 0) {\n var actor = model.WebGPUActor.getRenderable();\n var rep = actor.getProperty().getRepresentation();\n var usage = publicAPI.getUsage(rep, i);\n var primHelper = model.primitives[i];\n publicAPI.buildVertexInput(model.currentInput, prims[i], i);\n primHelper.setPipelineHash(publicAPI.computePipelineHash(primHelper.getVertexInput(), usage));\n primHelper.setTextureViews(model.textureViews);\n primHelper.setWebGPURenderer(model.WebGPURenderer);\n primHelper.setNumberOfInstances(1);\n var vbo = primHelper.getVertexInput().getBuffer('vertexBC');\n primHelper.setNumberOfVertices(vbo.getSizeInBytes() / vbo.getStrideInBytes());\n primHelper.setTopology(publicAPI.getTopologyFromUsage(usage));\n primHelper.build(model.renderEncoder, device);\n primHelper.registerToDraw();\n }\n }\n };\n\n publicAPI.setShaderReplacement = function (name, func) {\n for (var i = PrimitiveTypes.Start; i < PrimitiveTypes.End; i++) {\n var sr = model.primitives[i].getShaderReplacements();\n sr.set(name, func);\n }\n };\n\n publicAPI.setFragmentShaderTemplate = function (val) {\n model.fragmentShaderTemplate = val;\n\n for (var i = PrimitiveTypes.Start; i < PrimitiveTypes.End; i++) {\n model.primitives[i].setFragmentShaderTemplate(val);\n }\n };\n\n publicAPI.setVertexShaderTemplate = function (val) {\n model.fragmentShaderTemplate = val;\n\n for (var i = PrimitiveTypes.Start; i < PrimitiveTypes.End; i++) {\n model.primitives[i].setVertexShaderTemplate(val);\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n colorTexture: null,\n renderEncoder: null,\n textures: null,\n textureViews: null,\n primitives: null,\n tmpMat4: null,\n fragmentShaderTemplate: null,\n vertexShaderTemplate: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_9__[\"default\"].extend(publicAPI, model, initialValues);\n model.tmpMat3 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].identity(new Float64Array(9));\n model.tmpMat4 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.fragmentShaderTemplate = model.fragmentShaderTemplate || vtkWebGPUPolyDataFS;\n model.vertexShaderTemplate = model.vertexShaderTemplate || vtkWebGPUPolyDataVS;\n model.UBO = vtk_js_Sources_Rendering_WebGPU_UniformBuffer__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n model.UBO.setName('mapperUBO');\n model.UBO.addEntry('BCWCMatrix', 'mat4x4');\n model.UBO.addEntry('BCSCMatrix', 'mat4x4');\n model.UBO.addEntry('MCWCNormals', 'mat4x4');\n model.UBO.addEntry('AmbientColor', 'vec4');\n model.UBO.addEntry('DiffuseColor', 'vec4');\n model.UBO.addEntry('AmbientIntensity', 'f32');\n model.UBO.addEntry('DiffuseIntensity', 'f32');\n model.UBO.addEntry('SpecularColor', 'vec4');\n model.UBO.addEntry('SpecularIntensity', 'f32');\n model.UBO.addEntry('Opacity', 'f32');\n model.UBO.addEntry('SpecularPower', 'f32');\n model.UBO.addEntry('PropID', 'u32'); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"get\"](publicAPI, model, ['fragmentShaderTemplate', 'vertexShaderTemplate', 'UBO']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['renderEncoder']);\n model.textures = [];\n model.textureViews = [];\n model.primitives = []; // Object methods\n\n vtkWebGPUPolyDataMapper(publicAPI, model);\n\n for (var i = PrimitiveTypes.Start; i < PrimitiveTypes.End; i++) {\n model.primitives[i] = vtk_js_Sources_Rendering_WebGPU_MapperHelper__WEBPACK_IMPORTED_MODULE_8__[\"default\"].newInstance();\n model.primitives[i].setUBO(model.UBO);\n model.primitives[i].setVertexShaderTemplate(publicAPI.getVertexShaderTemplate());\n model.primitives[i].setFragmentShaderTemplate(publicAPI.getFragmentShaderTemplate());\n }\n\n publicAPI.setShaderReplacement('replaceShaderPosition', publicAPI.replaceShaderPosition);\n publicAPI.setShaderReplacement('replaceShaderLight', publicAPI.replaceShaderLight);\n publicAPI.setShaderReplacement('replaceShaderTCoord', publicAPI.replaceShaderTCoord);\n publicAPI.setShaderReplacement('replaceShaderNormal', publicAPI.replaceShaderNormal);\n publicAPI.setShaderReplacement('replaceShaderSelect', publicAPI.replaceShaderSelect);\n publicAPI.setShaderReplacement('replaceShaderColor', publicAPI.replaceShaderColor);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkWebGPUPolyDataMapper'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_10__[\"registerOverride\"])('vtkMapper', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/PolyDataMapper/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Geometry.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Geometry.js ***! - \***************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Camera__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Camera */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Camera/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Renderer */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Renderer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Actor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Actor */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_PolyDataMapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/PolyDataMapper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/PolyDataMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Texture__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Texture */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Texture/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper/index.js\");\n// Common\n\n // Geometry\n\n // import 'vtk.js/Sources/Rendering/WebGPU/Actor2D';\n\n // import 'vtk.js/Sources/Rendering/WebGPU/Skybox';\n\n // Pixel mapping\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Geometry.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Glyph.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Glyph.js ***! - \************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Glyph3DMapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Glyph3DMapper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Glyph3DMapper/index.js\");\n// Geometry advanced\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Glyph.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Volume.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Volume.js ***! - \*************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Camera__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Camera */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Camera/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Renderer */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Renderer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Volume__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Volume */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Volume/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/PixelSpaceCallbackMapper/index.js\");\n// Common\n\n // Volume\n// import 'vtk.js/Sources/Rendering/WebGPU/ImageMapper';\n// import 'vtk.js/Sources/Rendering/WebGPU/ImageSlice';\n\n // Pixel mapping\n\n\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Profiles/Volume.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Renderer/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Renderer/index.js ***! - \************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BindGroup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BindGroup */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BindGroup/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_FullScreenQuad__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/FullScreenQuad */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/FullScreenQuad/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_UniformBuffer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/UniformBuffer */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/UniformBuffer/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\n\n\n\n\n\n\n\n\nvar vtkDebugMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"vtkDebugMacro\"];\nvar clearFragTemplate = \"\\n//VTK::Renderer::Dec\\n\\n//VTK::Mapper::Dec\\n\\n//VTK::TCoord::Dec\\n\\n//VTK::RenderEncoder::Dec\\n\\n//VTK::IOStructs::Dec\\n\\n[[stage(fragment)]]\\nfn main(\\n//VTK::IOStructs::Input\\n)\\n//VTK::IOStructs::Output\\n{\\n var output: fragmentOutput;\\n\\n var computedColor: vec4 = mapperUBO.BackgroundColor;\\n\\n //VTK::RenderEncoder::Impl\\n return output;\\n}\\n\"; // ----------------------------------------------------------------------------\n// vtkWebGPURenderer methods\n// ----------------------------------------------------------------------------\n\n/* eslint-disable no-bitwise */\n\nfunction vtkWebGPURenderer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPURenderer'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n if (!model.renderable) {\n return;\n } // make sure we have a camera\n\n\n if (!model.renderable.isActiveCameraCreated()) {\n model.renderable.resetCamera();\n }\n\n publicAPI.updateLights();\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getActiveCamera());\n publicAPI.addMissingNodes(model.renderable.getViewPropsWithNestedProps());\n publicAPI.removeUnusedNodes();\n publicAPI.updateStabilizedMatrix();\n }\n };\n\n publicAPI.updateStabilizedMatrix = function () {\n // This method is designed to help with floating point\n // issues when rendering datasets that push the limits of\n // resolutions on float.\n //\n // One of the most common cases is when the dataset is located far\n // away from the origin relative to the clipping range we are looking\n // at. For that case we want to perform the floating point sensitive\n // multiplications on the CPU in double. To this end we want the\n // vertex rendering ops to look something like\n //\n // Compute shifted points and load those into the VBO\n // pointCoordsSC = WorldToStabilizedMatrix * pointCoords;\n //\n // In the vertex shader do the following\n // positionVC = StabilizedToDeviceMatrix * ModelToStabilizedMatrix*vertexIn;\n //\n // We use two matrices because it is expensive to change the\n // WorldToStabilized matrix as we have to reupload all pointCoords\n // So that matrix (MCSCMatrix) is fairly static, the Stabilized to\n // Device matrix is the one that gets updated every time the camera\n // changes.\n //\n // The basic idea is that we should translate the data so that\n // when the center of the view frustum moves a lot\n // we recenter it. The center of the view frustum is roughly\n // camPos + dirOfProj*(far + near)*0.5\n var cam = model.renderable.getActiveCamera();\n var clipRange = cam.getClippingRange();\n var pos = cam.getPositionByReference();\n var dop = cam.getDirectionOfProjectionByReference();\n var center = [];\n var offset = [];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].scale(offset, dop, 0.5 * (clipRange[0] + clipRange[1]));\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].add(center, pos, offset);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].sub(offset, center, model.stabilizedCenter);\n var length = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].len(offset);\n\n if (length / (clipRange[1] - clipRange[0]) > model.recenterThreshold) {\n model.stabilizedCenter = center;\n model.stabilizedTime.modified();\n }\n };\n\n publicAPI.updateLights = function () {\n var count = 0;\n var lights = model.renderable.getLightsByReference();\n\n for (var index = 0; index < lights.length; ++index) {\n if (lights[index].getSwitch() > 0.0) {\n count++;\n }\n }\n\n if (!count) {\n vtkDebugMacro('No lights are on, creating one.');\n model.renderable.createLight();\n }\n\n return count;\n }; // register pipeline callbacks from a mapper\n\n\n publicAPI.registerPipelineCallback = function (pipeline, cb) {\n // if there is a matching pipeline just add the cb\n for (var i = 0; i < model.pipelineCallbacks.length; i++) {\n if (model.pipelineCallbacks[i].pipeline === pipeline) {\n model.pipelineCallbacks[i].callbacks.push(cb);\n return;\n }\n }\n\n model.pipelineCallbacks.push({\n pipeline: pipeline,\n callbacks: [cb]\n });\n };\n\n publicAPI.updateUBO = function () {\n // make sure the data is up to date\n // has the camera changed?\n var cam = model.renderable.getActiveCamera();\n var webgpuCamera = publicAPI.getViewNodeFor(cam);\n var utime = model.UBO.getSendTime();\n\n if (model.parent.getMTime() > utime || publicAPI.getMTime() > utime || cam.getMTime() > utime || model.renderable.getMTime() > utime) {\n var keyMats = webgpuCamera.getKeyMatrices(publicAPI);\n model.UBO.setArray('WCVCMatrix', keyMats.wcvc);\n model.UBO.setArray('SCPCMatrix', keyMats.scpc);\n model.UBO.setArray('PCSCMatrix', keyMats.pcsc);\n model.UBO.setArray('SCVCMatrix', keyMats.scvc);\n model.UBO.setArray('VCPCMatrix', keyMats.vcpc);\n model.UBO.setArray('WCVCNormals', keyMats.normalMatrix);\n model.UBO.setValue('cameraParallel', cam.getParallelProjection());\n var device = model.parent.getDevice();\n model.UBO.sendIfNeeded(device);\n }\n };\n\n publicAPI.scissorAndViewport = function (encoder) {\n var tsize = publicAPI.getYInvertedTiledSizeAndOrigin();\n encoder.getHandle().setViewport(tsize.lowerLeftU, tsize.lowerLeftV, tsize.usize, tsize.vsize, 0.0, 1.0); // set scissor\n\n encoder.getHandle().setScissorRect(tsize.lowerLeftU, tsize.lowerLeftV, tsize.usize, tsize.vsize);\n };\n\n publicAPI.bindUBO = function (renderEncoder) {\n renderEncoder.activateBindGroup(model.bindGroup);\n }; // Renders myself\n\n\n publicAPI.opaquePass = function (prepass) {\n if (prepass) {\n // clear last pipelines\n model.pipelineCallbacks = [];\n model.renderEncoder.begin(model.parent.getCommandEncoder());\n publicAPI.updateUBO();\n } else {\n publicAPI.scissorAndViewport(model.renderEncoder);\n publicAPI.clear(); // loop over registered pipelines\n\n for (var i = 0; i < model.pipelineCallbacks.length; i++) {\n var pStruct = model.pipelineCallbacks[i];\n var pl = pStruct.pipeline;\n model.renderEncoder.setPipeline(pl);\n publicAPI.bindUBO(model.renderEncoder);\n\n for (var cb = 0; cb < pStruct.callbacks.length; cb++) {\n pStruct.callbacks[cb](model.renderEncoder);\n }\n }\n\n model.renderEncoder.end();\n }\n };\n\n publicAPI.clear = function () {\n if (model.renderable.getTransparent() || model.suppressClear) {\n return;\n }\n\n var device = model.parent.getDevice();\n\n if (!model.clearFSQ) {\n model.clearFSQ = vtk_js_Sources_Rendering_WebGPU_FullScreenQuad__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n model.clearFSQ.setDevice(device);\n model.clearFSQ.setPipelineHash('clearfsq');\n model.clearFSQ.setFragmentShaderTemplate(clearFragTemplate);\n var ubo = vtk_js_Sources_Rendering_WebGPU_UniformBuffer__WEBPACK_IMPORTED_MODULE_6__[\"default\"].newInstance();\n ubo.setName('mapperUBO');\n ubo.addEntry('BackgroundColor', 'vec4');\n model.clearFSQ.setUBO(ubo);\n }\n\n var background = model.renderable.getBackgroundByReference();\n model.clearFSQ.getUBO().setArray('BackgroundColor', background);\n model.clearFSQ.getUBO().sendIfNeeded(device);\n model.clearFSQ.render(model.renderEncoder, device);\n };\n\n publicAPI.translucentPass = function (prepass) {\n if (prepass) {\n // clear last pipelines\n model.pipelineCallbacks = [];\n model.renderEncoder.begin(model.parent.getCommandEncoder());\n } else {\n publicAPI.scissorAndViewport(model.renderEncoder); // loop over registered pipelines\n\n for (var i = 0; i < model.pipelineCallbacks.length; i++) {\n var pStruct = model.pipelineCallbacks[i];\n var pl = pStruct.pipeline;\n model.renderEncoder.setPipeline(pl);\n publicAPI.bindUBO(model.renderEncoder);\n\n for (var cb = 0; cb < pStruct.callbacks.length; cb++) {\n pStruct.callbacks[cb](model.renderEncoder);\n }\n }\n\n model.renderEncoder.end();\n }\n };\n\n publicAPI.volumeDepthRangePass = function (prepass) {\n if (prepass) {\n // clear last pipelines\n model.pipelineCallbacks = [];\n model.renderEncoder.begin(model.parent.getCommandEncoder());\n } else {\n publicAPI.scissorAndViewport(model.renderEncoder); // loop over registered pipelines\n\n for (var i = 0; i < model.pipelineCallbacks.length; i++) {\n var pStruct = model.pipelineCallbacks[i];\n var pl = pStruct.pipeline;\n model.renderEncoder.setPipeline(pl);\n publicAPI.bindUBO(model.renderEncoder);\n\n for (var cb = 0; cb < pStruct.callbacks.length; cb++) {\n pStruct.callbacks[cb](model.renderEncoder);\n }\n }\n\n model.renderEncoder.end();\n }\n };\n\n publicAPI.getAspectRatio = function () {\n var size = model.parent.getSizeByReference();\n var viewport = model.renderable.getViewportByReference();\n return size[0] * (viewport[2] - viewport[0]) / ((viewport[3] - viewport[1]) * size[1]);\n };\n\n publicAPI.getYInvertedTiledSizeAndOrigin = function () {\n var res = publicAPI.getTiledSizeAndOrigin();\n var size = model.parent.getSizeByReference();\n res.lowerLeftV = size[1] - res.vsize - res.lowerLeftV;\n return res;\n };\n\n publicAPI.getTiledSizeAndOrigin = function () {\n var vport = model.renderable.getViewportByReference(); // if there is no window assume 0 1\n\n var tileViewPort = [0.0, 0.0, 1.0, 1.0]; // find the lower left corner of the viewport, taking into account the\n // lower left boundary of this tile\n\n var vpu = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[0] - tileViewPort[0], 0.0, 1.0);\n var vpv = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[1] - tileViewPort[1], 0.0, 1.0); // store the result as a pixel value\n\n var ndvp = model.parent.normalizedDisplayToDisplay(vpu, vpv);\n var lowerLeftU = Math.round(ndvp[0]);\n var lowerLeftV = Math.round(ndvp[1]); // find the upper right corner of the viewport, taking into account the\n // lower left boundary of this tile\n\n var vpu2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[2] - tileViewPort[0], 0.0, 1.0);\n var vpv2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[3] - tileViewPort[1], 0.0, 1.0); // also watch for the upper right boundary of the tile\n\n if (vpu2 > tileViewPort[2] - tileViewPort[0]) {\n vpu2 = tileViewPort[2] - tileViewPort[0];\n }\n\n if (vpv2 > tileViewPort[3] - tileViewPort[1]) {\n vpv2 = tileViewPort[3] - tileViewPort[1];\n }\n\n var ndvp2 = model.parent.normalizedDisplayToDisplay(vpu2, vpv2); // now compute the size of the intersection of the viewport with the\n // current tile\n\n var usize = Math.round(ndvp2[0]) - lowerLeftU;\n var vsize = Math.round(ndvp2[1]) - lowerLeftV;\n\n if (usize < 0) {\n usize = 0;\n }\n\n if (vsize < 0) {\n vsize = 0;\n }\n\n return {\n usize: usize,\n vsize: vsize,\n lowerLeftU: lowerLeftU,\n lowerLeftV: lowerLeftV\n };\n };\n\n publicAPI.getPropFromID = function (id) {\n for (var i = 0; i < model.children.length; i++) {\n var res = model.children[i].getPropID ? model.children[i].getPropID() : -1;\n\n if (res === id) {\n return model.children[i];\n }\n }\n\n return null;\n };\n\n publicAPI.releaseGraphicsResources = function () {\n if (model.selector !== null) {\n model.selector.releaseGraphicsResources();\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bindGroup: null,\n selector: null,\n renderEncoder: null,\n recenterThreshold: 20.0,\n suppressClear: false,\n stabilizedCenter: [0.0, 0.0, 0.0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues);\n model.UBO = vtk_js_Sources_Rendering_WebGPU_UniformBuffer__WEBPACK_IMPORTED_MODULE_6__[\"default\"].newInstance();\n model.UBO.setName('rendererUBO');\n model.UBO.addEntry('WCVCMatrix', 'mat4x4');\n model.UBO.addEntry('SCPCMatrix', 'mat4x4');\n model.UBO.addEntry('PCSCMatrix', 'mat4x4');\n model.UBO.addEntry('SCVCMatrix', 'mat4x4');\n model.UBO.addEntry('VCPCMatrix', 'mat4x4');\n model.UBO.addEntry('WCVCNormals', 'mat4x4');\n model.UBO.addEntry('cameraParallel', 'u32');\n model.bindGroup = vtk_js_Sources_Rendering_WebGPU_BindGroup__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n model.bindGroup.setName('rendererBG');\n model.bindGroup.addBindable(model.UBO);\n model.tmpMat4 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].identity(new Float64Array(16));\n model.stabilizedTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"obj\"](model.stabilizedTime, {\n mtime: 0\n }); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"get\"](publicAPI, model, ['bindGroup', 'stabilizedTime']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"getArray\"](publicAPI, model, ['stabilizedCenter']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"setGet\"](publicAPI, model, ['renderEncoder', 'selector', 'suppressClear', 'UBO']); // Object methods\n\n vtkWebGPURenderer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"newInstance\"](extend, 'vtkWebGPURenderer'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_7__[\"registerOverride\"])('vtkRenderer', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Renderer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Sampler/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Sampler/index.js ***! - \***********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\n/* eslint-disable no-bitwise */\n// ----------------------------------------------------------------------------\n// vtkWebGPUSampler methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUSampler(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUSampler');\n\n publicAPI.create = function (device) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n model.device = device;\n model.handle = model.device.getHandle().createSampler({\n magFilter: options.magFilter ? options.magFilter : 'nearest',\n minFilter: options.minFilter ? options.minFilter : 'nearest'\n });\n model.bindGroupTime.modified();\n };\n\n publicAPI.getShaderCode = function (binding, group) {\n var result = \"[[binding(\".concat(binding, \"), group(\").concat(group, \")]] var \").concat(model.name, \": sampler;\");\n return result;\n };\n\n publicAPI.getBindGroupEntry = function () {\n var foo = {\n resource: model.handle\n };\n return foo;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n device: null,\n handle: null,\n name: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.bindGroupLayoutEntry = {\n /* eslint-disable no-undef */\n visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT,\n\n /* eslint-enable no-undef */\n sampler: {// type: 'filtering',\n }\n };\n model.bindGroupTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.bindGroupTime, {\n mtime: 0\n });\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['bindGroupTime', 'handle']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['bindGroupLayoutEntry', 'device', 'name']);\n vtkWebGPUSampler(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Sampler/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderModule__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderModule */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderModule/index.js\");\n\n // perform in place string substitutions, indicate if a substitution was done\n// this is useful for building up shader strings which typically involve\n// lots of string substitutions. Return true if a substitution was done.\n\nfunction substitute(source, search, replace) {\n var all = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var replaceStr = Array.isArray(replace) ? replace.join('\\n') : replace;\n var replaced = false;\n\n if (source.search(search) !== -1) {\n replaced = true;\n }\n\n var gflag = '';\n\n if (all) {\n gflag = 'g';\n }\n\n var regex = new RegExp(search, gflag);\n var resultstr = source.replace(regex, replaceStr);\n return {\n replace: replaced,\n result: resultstr\n };\n} // ----------------------------------------------------------------------------\n// vtkWebGPUShaderCache methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkWebGPUShaderCache(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUShaderCache');\n\n publicAPI.getShaderModule = function (shaderDesc) {\n // has it already been created?\n var sType = shaderDesc.getType();\n var sHash = shaderDesc.getHash();\n\n var keys = model._shaderModules.keys();\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key.getHash() === sHash && key.getType() === sType) {\n return model._shaderModules.get(key);\n }\n } // console.log(JSON.stringify(shaderDesc));\n\n\n var sm = vtk_js_Sources_Rendering_WebGPU_ShaderModule__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n sm.initialize(model.device, shaderDesc);\n\n model._shaderModules.set(shaderDesc, sm);\n\n return sm;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n shaderModules: null,\n device: null,\n window: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Internal objects\n\n model._shaderModules = new Map(); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['device', 'window']); // Object methods\n\n vtkWebGPUShaderCache(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUShaderCache'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n substitute: substitute\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderDescription/index.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderDescription/index.js ***! - \*********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ShaderCache */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderCache/index.js\");\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUShaderDescription methods\n// ----------------------------------------------------------------------------\n// shader description\n\nfunction vtkWebGPUShaderDescription(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUShaderDescription');\n\n publicAPI.hasOutput = function (name) {\n return model.outputNames.includes(name);\n };\n\n publicAPI.addOutput = function (type, name) {\n model.outputTypes.push(type);\n model.outputNames.push(name);\n };\n\n publicAPI.addBuiltinOutput = function (type, name) {\n model.builtinOutputTypes.push(type);\n model.builtinOutputNames.push(name);\n };\n\n publicAPI.addBuiltinInput = function (type, name) {\n model.builtinInputTypes.push(type);\n model.builtinInputNames.push(name);\n }; // perform shader replacements for the input and outputs\n // of this shader. That includes vertex inputs if specified\n\n\n publicAPI.replaceShaderCode = function (priorStage, vertexInput) {\n var inputImpl = [];\n var iodec = [];\n\n if (vertexInput) {\n inputImpl.push(vertexInput.getShaderCode());\n }\n\n if (priorStage || model.builtinInputNames.length) {\n var inputStruct = [];\n inputStruct.push(\"struct \".concat(model.type, \"Input\\n{\"));\n\n if (priorStage) {\n var inputNames = priorStage.getOutputNamesByReference();\n var inputTypes = priorStage.getOutputTypesByReference();\n\n for (var i = 0; i < inputNames.length; i++) {\n inputStruct.push(\" [[location(\".concat(i, \")]] \").concat(inputNames[i], \" : \").concat(inputTypes[i], \";\"));\n }\n }\n\n for (var _i = 0; _i < model.builtinInputNames.length; _i++) {\n inputStruct.push(\" \".concat(model.builtinInputNames[_i], \" : \").concat(model.builtinInputTypes[_i], \";\"));\n }\n\n if (inputStruct.length > 1) {\n inputStruct.push('};');\n iodec = inputStruct;\n inputImpl[inputImpl.length - 1] += ',';\n inputImpl.push(\"input: \".concat(model.type, \"Input\"));\n }\n }\n\n if (inputImpl.length) {\n model.code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_1__[\"default\"].substitute(model.code, '//VTK::IOStructs::Input', inputImpl).result;\n }\n\n if (model.outputNames.length + model.builtinOutputNames.length) {\n var outputStruct = [\"struct \".concat(model.type, \"Output\\n{\")];\n\n for (var _i2 = 0; _i2 < model.outputNames.length; _i2++) {\n outputStruct.push(\" [[location(\".concat(_i2, \")]] \").concat(model.outputNames[_i2], \" : \").concat(model.outputTypes[_i2], \";\"));\n }\n\n for (var _i3 = 0; _i3 < model.builtinOutputNames.length; _i3++) {\n outputStruct.push(\" \".concat(model.builtinOutputNames[_i3], \" : \").concat(model.builtinOutputTypes[_i3], \";\"));\n }\n\n outputStruct.push('};');\n iodec = iodec.concat(outputStruct);\n model.code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_1__[\"default\"].substitute(model.code, '//VTK::IOStructs::Output', [\"-> \".concat(model.type, \"Output\")]).result;\n }\n\n model.code = vtk_js_Sources_Rendering_WebGPU_ShaderCache__WEBPACK_IMPORTED_MODULE_1__[\"default\"].substitute(model.code, '//VTK::IOStructs::Dec', iodec).result;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n type: null,\n // 'vertex' or 'fragment'\n hash: null,\n code: null,\n outputNames: null,\n outputTypes: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n model.outputNames = [];\n model.outputTypes = [];\n model.builtinOutputNames = [];\n model.builtinOutputTypes = [];\n model.builtinInputNames = [];\n model.builtinInputTypes = []; // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['type', 'hash', 'code']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getArray(publicAPI, model, ['outputTypes', 'outputNames']); // Object methods\n\n vtkWebGPUShaderDescription(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUShaderDescription'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderDescription/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderModule/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderModule/index.js ***! - \****************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkWebGPUShaderModule methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUShaderModule(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUShaderModule');\n\n publicAPI.initialize = function (device, shaderDesc) {\n model.device = device; // console.log(shaderDesc.getCode());\n\n model.handle = model.device.getHandle().createShaderModule({\n code: shaderDesc.getCode()\n });\n }; // publicAPI.setLastCameraMTime = (mtime) => {\n // model.lastCameraMTime = mtime;\n // };\n\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n device: null,\n handle: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['lastCameraMTime']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['device', 'handle']); // Object methods\n\n vtkWebGPUShaderModule(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUShaderModule'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/ShaderModule/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/StorageBuffer/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/StorageBuffer/index.js ***! - \*****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BufferManager */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Types */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js\");\n\n\n\nvar BufferUsage = vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].BufferUsage;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkWebGPUStorageBuffer - similar to the UniformBuffer class\n// but YOU are responsible for layout issues and alignment.\n// The order you add entries is the order they will be layed out\n// in memory. But you must follow layout rules.\n// ----------------------------------------------------------------------------\n// ----------------------------------------------------------------------------\n// vtkWebGPUStorageBuffer methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUStorageBuffer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUStorageBuffer');\n\n publicAPI.addEntry = function (name, type) {\n if (model._bufferEntryNames.has(name)) {\n vtkErrorMacro(\"entry named \".concat(name, \" already exists\"));\n return;\n }\n\n model._bufferEntryNames.set(name, model.bufferEntries.length);\n\n var sizeInBytes = vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getByteStrideFromShaderFormat(type);\n model.bufferEntries.push({\n name: name,\n type: type,\n sizeInBytes: sizeInBytes,\n offset: model.sizeInBytes,\n nativeType: vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getNativeTypeFromShaderFormat(type)\n });\n model.sizeInBytes += sizeInBytes;\n };\n\n publicAPI.send = function (device) {\n if (!model._buffer) {\n var req = {\n nativeArray: model.Float32Array,\n time: 0,\n usage: BufferUsage.Storage\n };\n model._buffer = device.getBufferManager().getBuffer(req);\n model.bindGroupTime.modified();\n\n model._sendTime.modified();\n\n return;\n }\n\n device.getHandle().queue.writeBuffer(model._buffer.getHandle(), 0, model.arrayBuffer, 0, model.sizeInBytes * model.numberOfInstances);\n\n model._sendTime.modified();\n };\n\n publicAPI.createView = function (type) {\n if (type in model === false) {\n if (!model.arrayBuffer) {\n model.arrayBuffer = new ArrayBuffer(model.sizeInBytes * model.numberOfInstances);\n }\n\n model[type] = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newTypedArray(type, model.arrayBuffer);\n }\n };\n\n publicAPI.setValue = function (name, instance, val) {\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n view[(entry.offset + instance * model.sizeInBytes) / view.BYTES_PER_ELEMENT] = val;\n };\n\n publicAPI.setArray = function (name, instance, arr) {\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n var ioffset = (entry.offset + instance * model.sizeInBytes) / view.BYTES_PER_ELEMENT;\n\n for (var i = 0; i < arr.length; i++) {\n view[ioffset + i] = arr[i];\n }\n };\n\n publicAPI.setAllInstancesFromArray = function (name, arr) {\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n var numComponents = arr.length / model.numberOfInstances;\n\n for (var inst = 0; inst < model.numberOfInstances; inst++) {\n var ioffset = (entry.offset + inst * model.sizeInBytes) / view.BYTES_PER_ELEMENT;\n\n for (var i = 0; i < numComponents; i++) {\n view[ioffset + i] = arr[inst * numComponents + i];\n }\n }\n };\n\n publicAPI.setAllInstancesFromArrayColorToFloat = function (name, arr) {\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n var numComponents = arr.length / model.numberOfInstances;\n\n for (var inst = 0; inst < model.numberOfInstances; inst++) {\n var ioffset = (entry.offset + inst * model.sizeInBytes) / view.BYTES_PER_ELEMENT;\n\n for (var i = 0; i < numComponents; i++) {\n view[ioffset + i] = arr[inst * numComponents + i] / 255.0;\n }\n }\n };\n\n publicAPI.setAllInstancesFromArray3x3To4x4 = function (name, arr) {\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n var numComponents = 9;\n\n for (var inst = 0; inst < model.numberOfInstances; inst++) {\n var ioffset = (entry.offset + inst * model.sizeInBytes) / view.BYTES_PER_ELEMENT;\n\n for (var j = 0; j < 3; j++) {\n for (var i = 0; i < 3; i++) {\n view[ioffset + j * 4 + i] = arr[inst * numComponents + j * 3 + i];\n }\n }\n }\n };\n\n publicAPI.getSendTime = function () {\n return model.sendTime.getMTime();\n };\n\n publicAPI.getShaderCode = function (binding, group) {\n var lines = [\"struct \".concat(model.name, \"StructEntry\\n{\")];\n\n for (var i = 0; i < model.bufferEntries.length; i++) {\n var entry = model.bufferEntries[i];\n lines.push(\" \".concat(entry.name, \": \").concat(entry.type, \";\"));\n }\n\n lines.push(\"\\n};\\n[[block]] struct \".concat(model.name, \"Struct\\n{\\n values: array<\").concat(model.name, \"StructEntry>;\\n};\\n[[binding(\").concat(binding, \"), group(\").concat(group, \")]] var \").concat(model.name, \": [[access(read)]] \").concat(model.name, \"Struct;\\n\"));\n return lines.join('\\n');\n };\n\n publicAPI.getBindGroupEntry = function () {\n var foo = {\n resource: {\n buffer: model._buffer.getHandle()\n }\n };\n return foo;\n };\n\n publicAPI.clearData = function () {\n model.numberOfInstances = 0;\n model.sizeInBytes = 0;\n model.bufferEntries = [];\n model._bufferEntryNames = new Map();\n model._buffer = null;\n delete model.arrayBuffer;\n delete model.Float32Array;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bufferEntries: null,\n bufferEntryNames: null,\n sizeInBytes: 0,\n name: null,\n numberOfInstances: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Internal objects\n\n model._bufferEntryNames = new Map();\n model.bufferEntries = [];\n model._sendTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model._sendTime, {\n mtime: 0\n });\n model.bindGroupTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.bindGroupTime, {\n mtime: 0\n }); // default SSBO desc\n\n model.bindGroupLayoutEntry = model.bindGroupLayoutEntry || {\n buffer: {\n type: 'read-only-storage'\n }\n };\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['bindGroupTime']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['device', 'bindGroupLayoutEntry', 'name', 'numberOfInstances', 'sizeInBytes']); // Object methods\n\n vtkWebGPUStorageBuffer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUStorageBuffer'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/StorageBuffer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Texture/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Texture/index.js ***! - \***********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BufferManager */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_TextureView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/TextureView */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/TextureView/index.js\");\n\n\n\nvar BufferUsage = vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].BufferUsage; // ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n// ----------------------------------------------------------------------------\n// vtkWebGPUTexture methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUTexture(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUTexture');\n\n publicAPI.create = function (device, options) {\n model.device = device;\n model.width = options.width;\n model.height = options.height;\n model.depth = options.depth ? options.depth : 1;\n var dimension = model.depth === 1 ? '2d' : '3d';\n model.format = options.format ? options.format : 'rgbaunorm';\n /* eslint-disable no-undef */\n\n /* eslint-disable no-bitwise */\n\n model.usage = options.usage ? options.usage : GPUTextureUsage.SAMPLED | GPUTextureUsage.COPY_DST;\n /* eslint-enable no-undef */\n\n /* eslint-enable no-bitwise */\n\n model.handle = model.device.getHandle().createTexture({\n size: [model.width, model.height, model.depth],\n format: model.format,\n // 'rgba8unorm',\n usage: model.usage,\n dimension: dimension\n });\n };\n\n publicAPI.assignFromHandle = function (device, handle, options) {\n model.device = device;\n model.handle = handle;\n model.width = options.width;\n model.height = options.height;\n model.depth = options.depth ? options.depth : 1;\n model.format = options.format ? options.format : 'rgbaunorm';\n /* eslint-disable no-undef */\n\n /* eslint-disable no-bitwise */\n\n model.usage = options.usage ? options.usage : GPUTextureUsage.SAMPLED | GPUTextureUsage.COPY_DST;\n /* eslint-enable no-undef */\n\n /* eslint-enable no-bitwise */\n }; // set the data\n\n\n publicAPI.writeImageData = function (req) {\n var bufferBytesPerRow = model.width * 4;\n\n if (req.dataArray) {\n // create and write the buffer\n var buffRequest = {\n dataArray: req.dataArray,\n time: req.dataArray.getMTime(),\n\n /* eslint-disable no-undef */\n usage: BufferUsage.Texture,\n\n /* eslint-enable no-undef */\n format: 'unorm8x4'\n }; // bytesPerRow must be a multiple of 256 so we might need to rebuild\n // the data here before passing to the buffer. If it is unorm8x4 then\n // we need to have width be a multiple of 64\n\n if (model.width % 64) {\n var oArray = req.dataArray.getData();\n var bufferWidth = 64 * Math.floor((model.width + 63) / 64);\n var nArray = new Uint8Array(bufferWidth * model.height * 4);\n\n for (var v = 0; v < model.height; v++) {\n nArray.set(oArray.subarray(v * 4 * model.width, (v + 1) * 4 * model.width), v * 4 * bufferWidth);\n }\n\n buffRequest.nativeArray = nArray;\n bufferBytesPerRow = bufferWidth * 4;\n }\n\n var buff = model.device.getBufferManager().getBuffer(buffRequest);\n model.buffer = buff;\n }\n\n if (req.image) {\n var canvas = document.createElement('canvas');\n canvas.width = req.image.width;\n canvas.height = req.image.height;\n var ctx = canvas.getContext('2d');\n ctx.translate(0, canvas.height);\n ctx.scale(1, -1);\n ctx.drawImage(req.image, 0, 0, req.image.width, req.image.height, 0, 0, canvas.width, canvas.height);\n var imageData = ctx.getImageData(0, 0, req.image.width, req.image.height); // create and write the buffer\n\n var _buffRequest = {\n nativeArray: imageData.data,\n time: 0,\n\n /* eslint-disable no-undef */\n usage: BufferUsage.Texture,\n\n /* eslint-enable no-undef */\n format: 'unorm8x4'\n };\n\n var _buff = model.device.getBufferManager().getBuffer(_buffRequest);\n\n model.buffer = _buff;\n } // get a buffer for the image\n\n\n var cmdEnc = model.device.createCommandEncoder();\n cmdEnc.copyBufferToTexture({\n buffer: model.buffer.getHandle(),\n offset: 0,\n bytesPerRow: bufferBytesPerRow,\n rowsPerImage: model.height\n }, {\n texture: model.handle\n }, [model.width, model.height, model.depth]);\n model.device.submitCommandEncoder(cmdEnc);\n model.ready = true;\n };\n\n publicAPI.resizeToMatch = function (tex) {\n if (tex.getWidth() !== model.width || tex.getHeight() !== model.height || tex.getDepth() !== model.depth) {\n model.width = tex.getWidth();\n model.height = tex.getHeight();\n model.depth = tex.getDepth();\n model.handle = model.device.getHandle().createTexture({\n size: [model.width, model.height, model.depth],\n format: model.format,\n usage: model.usage\n });\n }\n };\n\n publicAPI.resize = function (width, height) {\n var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n if (width !== model.width || height !== model.height || depth !== model.depth) {\n model.width = width;\n model.height = height;\n model.depth = depth;\n model.handle = model.device.getHandle().createTexture({\n size: [model.width, model.height, model.depth],\n format: model.format,\n usage: model.usage\n });\n }\n };\n\n publicAPI.createView = function (options) {\n var view = vtk_js_Sources_Rendering_WebGPU_TextureView__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n view.create(publicAPI, options);\n return view;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n device: null,\n handle: null,\n buffer: null,\n ready: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['handle', 'ready', 'width', 'height', 'depth', 'format', 'usage']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['device']);\n vtkWebGPUTexture(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Texture/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/TextureView/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/TextureView/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Sampler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Sampler */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Sampler/index.js\");\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUTextureView methods\n// ----------------------------------------------------------------------------\n\n/* eslint-disable no-bitwise */\n\nfunction vtkWebGPUTextureView(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUTextureView');\n\n publicAPI.create = function (texture, options) {\n model.texture = texture;\n model.options = options;\n model.textureHandle = texture.getHandle();\n model.handle = model.textureHandle.createView(model.options);\n };\n\n publicAPI.getBindGroupEntry = function () {\n var foo = {\n resource: publicAPI.getHandle()\n };\n return foo;\n };\n\n publicAPI.getShaderCode = function (binding, group) {\n var result = \"[[binding(\".concat(binding, \"), group(\").concat(group, \")]] var \").concat(model.name, \": texture_2d;\");\n return result;\n };\n\n publicAPI.addSampler = function (device, options) {\n var newSamp = vtk_js_Sources_Rendering_WebGPU_Sampler__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n newSamp.create(device, options);\n publicAPI.setSampler(newSamp);\n model.sampler.setName(\"\".concat(model.name, \"Sampler\"));\n };\n\n publicAPI.setName = function (val) {\n if (model.sampler) {\n model.sampler.setName(\"\".concat(val, \"Sampler\"));\n }\n\n if (model.name === val) {\n return;\n }\n\n model.name = val;\n publicAPI.modified();\n }; // if the texture has changed then get a new view\n\n\n publicAPI.getHandle = function () {\n if (model.texture.getHandle() !== model.textureHandle) {\n model.textureHandle = model.texture.getHandle();\n model.handle = model.textureHandle.createView(model.options);\n model.bindGroupTime.modified();\n }\n\n return model.handle;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n texture: null,\n handle: null,\n name: null,\n sampler: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n model.bindGroupLayoutEntry = {\n /* eslint-disable no-undef */\n visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT,\n\n /* eslint-enable no-undef */\n texture: {// sampleType: 'float',\n // viewDimension: '2d',\n // multisampled: false,\n }\n };\n model.bindGroupTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.bindGroupTime, {\n mtime: 0\n });\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['bindGroupTime', 'name', 'texture']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['bindGroupLayoutEntry', 'sampler']);\n vtkWebGPUTextureView(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/TextureView/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js ***! - \*********************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n// vtkWebGPUDevice static functions\n//\n// WebGPU uses types in a many places and calls, and often those types\n// need to be associated with byte sizes, alignments, native arrays etc.\n// The folowing methods are designed to help vtk.js introspect those types.\n// WebGPU currently tends to use multiple type formats:\n// - buffer types such as float32x4\n// - shader types suchs as vec4\n// - texture types such as rgba32float\n// ----------------------------------------------------------------------------\n// see https://gpuweb.github.io/gpuweb/#enumdef-gpuvertexformat\n// for possible formats\n\nfunction getByteStrideFromBufferFormat(format) {\n if (!format || format.length < 5) return 0; // options are x2, x3, x4 or nothing\n\n var numComp = 1;\n\n if (format[format.length - 2] === 'x') {\n numComp = format[format.length - 1];\n }\n\n var sizeStart = numComp === 1 ? format.length - 1 : format.length - 3; // options are 8, 16, 32 resulting in 8, 6, 2 as the last char\n // plugged into the formula below gives 1, 2, 4 respectively\n\n var num = Number(format[sizeStart]);\n\n if (Number.isNaN(num)) {\n Object(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"])(\"unknown format \".concat(format));\n return 0;\n }\n\n var typeSize = 5 - num / 2;\n return numComp * typeSize;\n} // see https://gpuweb.github.io/gpuweb/#enumdef-gpuvertexformat\n// for possible formats\n\n\nfunction getNativeTypeFromBufferFormat(format) {\n if (!format || format.length < 5) return 0; // raw types are Uint Int or Float as follows\n\n var result;\n\n if (format[0] === 'f') {\n result = 'Float';\n } else if (format[0] === 's') {\n result = 'Int';\n } else if (format[0] === 'u') {\n result = 'Uint';\n } else {\n Object(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"])(\"unknown format \".concat(format));\n return undefined;\n } // options are 8, 16, 32 resulting in 8, 6, 2 as the last char\n // plugged into the formula below gives 1, 2, 4 respectively\n\n\n var base = format.split('x')[0];\n var num = Number(base[base.length - 1]);\n\n if (Number.isNaN(num)) {\n Object(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"])(\"unknown format \".concat(format));\n return undefined;\n }\n\n result += 8 * (5 - num / 2);\n result += 'Array';\n return result;\n}\n\nfunction getShaderTypeFromBufferFormat(format) {\n var dataType;\n\n if (format[0] === 'f' || format[1] === 'n') {\n dataType = 'f32';\n } else if (format[0] === 's' && format[1] === 'i') {\n dataType = 'i32';\n } else if (format[0] === 'u' && format[1] === 'i') {\n dataType = 'u32';\n } else {\n Object(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"])(\"unknown format \".concat(format));\n return undefined;\n } // options are x2, x3, x4 or nothing\n\n\n var numComp = 1;\n\n if (format[format.length - 2] === 'x') {\n numComp = Number(format[format.length - 1]);\n }\n\n if (numComp === 4) return \"vec4<\".concat(dataType, \">\");\n if (numComp === 3) return \"vec3<\".concat(dataType, \">\");\n if (numComp === 2) return \"vec2<\".concat(dataType, \">\");\n return dataType;\n}\n\nfunction getByteStrideFromShaderFormat(format) {\n if (!format) return 0;\n var numComp = 1;\n\n if (format.substring(0, 3) === 'vec') {\n numComp = format[3];\n } else if (format.substring(0, 3) === 'mat') {\n numComp = format[3] * format[5];\n }\n\n var typeSize = 4;\n return numComp * typeSize;\n}\n\nfunction getNativeTypeFromShaderFormat(format) {\n if (!format) return undefined;\n if (format.includes('f32')) return 'Float32Array';\n if (format.includes('i32')) return 'Int32Array';\n if (format.includes('u32')) return 'Uint32Array';\n Object(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"vtkErrorMacro\"])(\"unknown format \".concat(format));\n return undefined;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getByteStrideFromBufferFormat: getByteStrideFromBufferFormat,\n getNativeTypeFromBufferFormat: getNativeTypeFromBufferFormat,\n getShaderTypeFromBufferFormat: getShaderTypeFromBufferFormat,\n getByteStrideFromShaderFormat: getByteStrideFromShaderFormat,\n getNativeTypeFromShaderFormat: getNativeTypeFromShaderFormat\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/UniformBuffer/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/UniformBuffer/index.js ***! - \*****************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/BufferManager */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/BufferManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Types */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\nvar BufferUsage = vtk_js_Sources_Rendering_WebGPU_BufferManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].BufferUsage;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// vtkWebGPUUniformBuffer methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUUniformBuffer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUUniformBuffer');\n\n publicAPI.addEntry = function (name, type) {\n if (model._bufferEntryNames.has(name)) {\n vtkErrorMacro(\"entry named \".concat(name, \" already exists\"));\n return;\n }\n\n model.sortDirty = true;\n\n model._bufferEntryNames.set(name, model.bufferEntries.length);\n\n model.bufferEntries.push({\n name: name,\n type: type,\n sizeInBytes: vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getByteStrideFromShaderFormat(type),\n offset: -1,\n nativeType: vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getNativeTypeFromShaderFormat(type),\n packed: false\n });\n }; // UBOs have layout rules in terms of how memory is aligned so we\n // have to be careful how we order the entries. For example a vec4\n // must be aligned on a 16 byte offset, etc. See\n // https://gpuweb.github.io/gpuweb/wgsl/#memory-layouts\n // for more details. Right now you can create a situation that would fail\n // in the future we could add dummy spacer entries where needed to\n // handle alignment issues\n\n\n publicAPI.sortBufferEntries = function () {\n if (!model.sortDirty) {\n return;\n }\n\n var currOffset = 0;\n var newEntries = []; // pack anything whose size is a multiple of 16 bytes first\n // this includes a couple types that don't require 16 byte alignment\n // such as mat2x2 but that is OK\n\n for (var i = 0; i < model.bufferEntries.length; i++) {\n var entry = model.bufferEntries[i];\n\n if (entry.packed === false && entry.sizeInBytes % 16 === 0) {\n entry.packed = true;\n entry.offset = currOffset;\n newEntries.push(entry);\n currOffset += entry.sizeInBytes;\n }\n } // now it gets tough, we have the following common types (f32, i32, u32)\n // - vec2 8 byte size, 8 byte alignment\n // - vec3 12 byte size, 16 byte alignment\n // - f32 4 byte size, 4 byte alignment\n // try adding 12 byte, 4 byte pairs\n\n\n for (var _i = 0; _i < model.bufferEntries.length; _i++) {\n var _entry = model.bufferEntries[_i];\n\n if (_entry.packed === false && _entry.sizeInBytes === 12) {\n for (var i2 = 0; i2 < model.bufferEntries.length; i2++) {\n var entry2 = model.bufferEntries[i2];\n\n if (entry2.packed === false && entry2.sizeInBytes === 4) {\n _entry.packed = true;\n _entry.offset = currOffset;\n newEntries.push(_entry);\n currOffset += _entry.sizeInBytes;\n entry2.packed = true;\n entry2.offset = currOffset;\n newEntries.push(entry2);\n currOffset += entry2.sizeInBytes;\n break;\n }\n }\n }\n } // try adding 8 byte, 8 byte pairs\n\n\n for (var _i2 = 0; _i2 < model.bufferEntries.length; _i2++) {\n var _entry2 = model.bufferEntries[_i2];\n\n if (!_entry2.packed && _entry2.sizeInBytes % 8 === 0) {\n for (var _i3 = _i2 + 1; _i3 < model.bufferEntries.length; _i3++) {\n var _entry3 = model.bufferEntries[_i3];\n\n if (!_entry3.packed && _entry3.sizeInBytes % 8 === 0) {\n _entry2.packed = true;\n _entry2.offset = currOffset;\n newEntries.push(_entry2);\n currOffset += _entry2.sizeInBytes;\n _entry3.packed = true;\n _entry3.offset = currOffset;\n newEntries.push(_entry3);\n currOffset += _entry3.sizeInBytes;\n break;\n }\n }\n }\n } // try adding 8 byte, 4 byte 4 byte triplets\n\n\n for (var _i4 = 0; _i4 < model.bufferEntries.length; _i4++) {\n var _entry4 = model.bufferEntries[_i4];\n\n if (!_entry4.packed && _entry4.sizeInBytes % 8 === 0) {\n var found = false;\n\n for (var _i5 = 0; !found && _i5 < model.bufferEntries.length; _i5++) {\n var _entry5 = model.bufferEntries[_i5];\n\n if (!_entry5.packed && _entry5.sizeInBytes === 4) {\n for (var i3 = _i5 + 1; i3 < model.bufferEntries.length; i3++) {\n var entry3 = model.bufferEntries[i3];\n\n if (!entry3.packed && entry3.sizeInBytes === 4) {\n _entry4.packed = true;\n _entry4.offset = currOffset;\n newEntries.push(_entry4);\n currOffset += _entry4.sizeInBytes;\n _entry5.packed = true;\n _entry5.offset = currOffset;\n newEntries.push(_entry5);\n currOffset += _entry5.sizeInBytes;\n entry3.packed = true;\n entry3.offset = currOffset;\n newEntries.push(entry3);\n currOffset += entry3.sizeInBytes;\n found = true;\n break;\n }\n }\n }\n }\n }\n } // Add anything remaining that is larger than 4 bytes and hope we get lucky.\n // Likely if there is more than one item added here it will result\n // in a failed UBO\n\n\n for (var _i6 = 0; _i6 < model.bufferEntries.length; _i6++) {\n var _entry6 = model.bufferEntries[_i6];\n\n if (!_entry6.packed && _entry6.sizeInBytes > 4) {\n _entry6.packed = true;\n _entry6.offset = currOffset;\n newEntries.push(_entry6);\n currOffset += _entry6.sizeInBytes;\n }\n } // finally add remaining 4 byte items\n\n\n for (var _i7 = 0; _i7 < model.bufferEntries.length; _i7++) {\n var _entry7 = model.bufferEntries[_i7];\n\n if (!_entry7.packed) {\n _entry7.packed = true;\n _entry7.offset = currOffset;\n newEntries.push(_entry7);\n currOffset += _entry7.sizeInBytes;\n }\n } // update entries and entryNames\n\n\n model.bufferEntries = newEntries;\n\n model._bufferEntryNames.clear();\n\n for (var _i8 = 0; _i8 < model.bufferEntries.length; _i8++) {\n model._bufferEntryNames.set(model.bufferEntries[_i8].name, _i8);\n }\n\n model.sizeInBytes = currOffset;\n model.sortDirty = false;\n };\n\n publicAPI.sendIfNeeded = function (device) {\n if (!model.UBO) {\n var req = {\n nativeArray: model.Float32Array,\n time: 0,\n usage: BufferUsage.UniformArray\n };\n model.UBO = device.getBufferManager().getBuffer(req);\n model.bindGroupTime.modified();\n model.sendDirty = false;\n } // send data down if needed\n\n\n if (model.sendDirty) {\n device.getHandle().queue.writeBuffer(model.UBO.getHandle(), 0, model.arrayBuffer, 0, model.sizeInBytes);\n model.sendDirty = false;\n } // always updated as mappers depend on this time\n // it is more of a sentIfNeededTime\n\n\n model.sendTime.modified();\n };\n\n publicAPI.createView = function (type) {\n if (type in model === false) {\n if (!model.arrayBuffer) {\n model.arrayBuffer = new ArrayBuffer(model.sizeInBytes);\n }\n\n model[type] = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newTypedArray(type, model.arrayBuffer);\n }\n };\n\n publicAPI.setValue = function (name, val) {\n publicAPI.sortBufferEntries();\n\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n\n if (entry.lastValue !== val) {\n view[entry.offset / view.BYTES_PER_ELEMENT] = val;\n model.sendDirty = true;\n }\n\n entry.lastValue = val;\n };\n\n publicAPI.setArray = function (name, arr) {\n publicAPI.sortBufferEntries();\n\n var idx = model._bufferEntryNames.get(name);\n\n if (idx === undefined) {\n vtkErrorMacro(\"entry named \".concat(name, \" not found in UBO\"));\n return;\n }\n\n var entry = model.bufferEntries[idx];\n publicAPI.createView(entry.nativeType);\n var view = model[entry.nativeType];\n var changed = false;\n\n for (var i = 0; i < arr.length; i++) {\n if (!entry.lastValue || entry.lastValue[i] !== arr[i]) {\n view[entry.offset / view.BYTES_PER_ELEMENT + i] = arr[i];\n changed = true;\n }\n }\n\n if (changed) {\n model.sendDirty = true;\n entry.lastValue = _toConsumableArray(arr);\n }\n };\n\n publicAPI.getBindGroupEntry = function () {\n var foo = {\n resource: {\n buffer: model.UBO.getHandle()\n }\n };\n return foo;\n };\n\n publicAPI.getSendTime = function () {\n return model.sendTime.getMTime();\n };\n\n publicAPI.getShaderCode = function (binding, group) {\n // sort the entries\n publicAPI.sortBufferEntries();\n var lines = [\"[[block]] struct \".concat(model.name, \"Struct\\n{\")];\n\n for (var i = 0; i < model.bufferEntries.length; i++) {\n var entry = model.bufferEntries[i];\n lines.push(\" \".concat(entry.name, \": \").concat(entry.type, \";\"));\n }\n\n lines.push(\"};\\n[[binding(\".concat(binding, \"), group(\").concat(group, \")]] var \").concat(model.name, \": \").concat(model.name, \"Struct;\"));\n return lines.join('\\n');\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bufferEntries: null,\n bufferEntryNames: null,\n sizeInBytes: 0,\n name: null,\n bindGroupLayoutEntry: null,\n bindGroupEntry: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model); // Internal objects\n\n model._bufferEntryNames = new Map();\n model.bufferEntries = []; // default UBO desc\n\n model.bindGroupLayoutEntry = model.bindGroupLayoutEntry || {\n buffer: {\n type: 'uniform'\n }\n };\n model.sendTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.sendTime, {\n mtime: 0\n });\n model.bindGroupTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(model.bindGroupTime, {\n mtime: 0\n });\n model.sendDirty = true;\n model.sortDirty = true;\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['binding', 'bindGroupTime']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['bindGroupLayoutEntry', 'device', 'name', 'sizeInBytes']); // Object methods\n\n vtkWebGPUUniformBuffer(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUUniformBuffer'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/UniformBuffer/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/VertexInput/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/VertexInput/index.js ***! - \***************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/Types */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/Types/index.js\");\n\n\n\nfunction arraysEqual(a, b) {\n if (a === b) return true;\n if (a == null || b == null) return false;\n if (a.length !== b.length) return false;\n\n for (var i = 0; i < a.length; ++i) {\n if (!b.includes(a[i])) return false;\n }\n\n return true;\n} // ----------------------------------------------------------------------------\n// vtkWebGPUVertexInput methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkWebGPUVertexInput(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUVertexInput');\n\n publicAPI.addBuffer = function (buffer, inames) {\n var stepMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'vertex';\n var names = inames;\n\n if (!Array.isArray(names)) {\n names = [names];\n } // only add if it is a new setting\n\n\n for (var i = 0; i < model.inputs.length; i++) {\n if (arraysEqual(model.inputs[i].names, names)) {\n if (model.inputs[i].buffer === buffer) {\n return;\n }\n\n model.inputs[i].buffer = buffer;\n return;\n }\n } // when adding a new entry, make sure we sort the array\n // as the order is important to the shader and must always\n // be the same, so alphabetical is an easy option\n\n\n model.inputs.push({\n buffer: buffer,\n stepMode: stepMode,\n names: names\n });\n model.inputs = model.inputs.sort(function (v1, v2) {\n if (v1.names[0] < v2.names[0]) {\n return -1;\n }\n\n if (v1.names[0] > v2.names[0]) {\n return 1;\n }\n\n return 0;\n });\n };\n\n publicAPI.removeBufferIfPresent = function (name) {\n for (var i = 0; i < model.inputs.length; i++) {\n if (model.inputs[i].names.includes(name)) {\n model.inputs.splice(i, 1);\n }\n }\n };\n\n publicAPI.getBuffer = function (name) {\n for (var i = 0; i < model.inputs.length; i++) {\n if (model.inputs[i].names.includes(name)) {\n return model.inputs[i].buffer;\n }\n }\n\n return null;\n };\n\n publicAPI.hasAttribute = function (name) {\n for (var i = 0; i < model.inputs.length; i++) {\n if (model.inputs[i].names.includes(name)) {\n return true;\n }\n }\n\n return false;\n };\n\n publicAPI.getAttributeTime = function (name) {\n for (var i = 0; i < model.inputs.length; i++) {\n if (model.inputs[i].names.includes(name)) {\n return model.inputs[i].buffer.getSourceTime();\n }\n }\n\n return 0;\n };\n\n publicAPI.getShaderCode = function () {\n var result = '';\n var nameCount = 0;\n\n for (var i = 0; i < model.inputs.length; i++) {\n for (var nm = 0; nm < model.inputs[i].names.length; nm++) {\n var arrayInfo = model.inputs[i].buffer.getArrayInformation()[nm];\n var type = vtk_js_Sources_Rendering_WebGPU_Types__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getShaderTypeFromBufferFormat(arrayInfo.format);\n\n if (nameCount > 0) {\n result += ',\\n';\n }\n\n result = \"\".concat(result, \" [[location(\").concat(nameCount, \")]] \").concat(model.inputs[i].names[nm], \" : \").concat(type);\n nameCount++;\n }\n }\n\n return result;\n };\n\n publicAPI.getVertexInputInformation = function () {\n var info = {};\n\n if (model.inputs.length) {\n var vertexBuffers = [];\n var nameCount = 0;\n\n for (var i = 0; i < model.inputs.length; i++) {\n var buf = model.inputs[i].buffer;\n var buffer = {\n arrayStride: buf.getStrideInBytes(),\n stepMode: model.inputs[i].stepMode,\n attributes: []\n };\n var arrayInfo = buf.getArrayInformation();\n\n for (var nm = 0; nm < model.inputs[i].names.length; nm++) {\n buffer.attributes.push({\n shaderLocation: nameCount,\n offset: arrayInfo[nm].offset,\n format: arrayInfo[nm].format\n });\n nameCount++;\n }\n\n vertexBuffers.push(buffer);\n }\n\n info.buffers = vertexBuffers;\n }\n\n return info;\n };\n\n publicAPI.bindBuffers = function (renderEncoder) {\n for (var i = 0; i < model.inputs.length; i++) {\n renderEncoder.setVertexBuffer(i, model.inputs[i].buffer.getHandle());\n }\n };\n\n publicAPI.getReady = function () {};\n\n publicAPI.releaseGraphicsResources = function () {\n if (model.created) {\n model.inputs = [];\n model.bindingDescriptions = [];\n model.attributeDescriptions = [];\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n inputs: null,\n bindingDescriptions: false,\n attributeDescriptions: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"obj\"](publicAPI, model);\n model.bindingDescriptions = [];\n model.attributeDescriptions = [];\n model.inputs = [];\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"setGet\"](publicAPI, model, ['created', 'device', 'handle']); // For more macro methods, see \"Sources/macro.js\"\n // Object specific methods\n\n vtkWebGPUVertexInput(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"newInstance\"](extend, 'vtkWebGPUVertexInput'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/VertexInput/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js ***! - \*******************************************************************************/ -/*! exports provided: registerOverride, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerOverride\", function() { return registerOverride; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory/index.js\");\n\n\nvar CLASS_MAPPING = Object.create(null);\nfunction registerOverride(className, fn) {\n CLASS_MAPPING[className] = fn;\n} // ----------------------------------------------------------------------------\n// vtkWebGPUViewNodeFactory methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUViewNodeFactory(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUViewNodeFactory');\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Static class mapping shared across instances\n\n model.overrides = CLASS_MAPPING; // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues); // Object methods\n\n vtkWebGPUViewNodeFactory(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkWebGPUViewNodeFactory'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Rendering/WebGPU/Volume/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Rendering/WebGPU/Volume/index.js ***! - \**********************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/SceneGraph/ViewNode */ \"./node_modules/vtk.js/Sources/Rendering/SceneGraph/ViewNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory */ \"./node_modules/vtk.js/Sources/Rendering/WebGPU/ViewNodeFactory/index.js\");\n\n\n\n // ----------------------------------------------------------------------------\n// vtkWebGPUVolume methods\n// ----------------------------------------------------------------------------\n\nfunction vtkWebGPUVolume(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWebGPUVolume'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n }\n\n if (prepass) {\n model.WebGPURenderer = publicAPI.getFirstAncestorOfType('vtkWebGPURenderer');\n model.WebGPURenderWindow = model.WebGPURenderer.getFirstAncestorOfType('vtkWebGPURenderWindow'); // for the future if we support hardware selection of volumes\n\n if (model.propID === undefined) {\n model.propID = model.WebGPURenderWindow.getUniquePropID();\n }\n\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getMapper());\n publicAPI.removeUnusedNodes();\n }\n };\n\n publicAPI.queryPass = function (prepass, renderPass) {\n if (prepass) {\n if (!model.renderable || !model.renderable.getVisibility()) {\n return;\n } // Check for the special case when the mapper's bounds are unknown\n\n\n var bds = model.renderable.getMapper().getBounds();\n\n if (!bds || bds.length !== 6 || bds[0] > bds[1]) {\n return;\n }\n\n renderPass.addVolume(publicAPI);\n }\n };\n\n publicAPI.getBoundingCubePoints = function (result, offset) {\n var bounds = model.renderable.getMapper().getBounds();\n var m = model.renderable.getMatrix();\n var count = 0;\n\n for (var iz = 4; iz < 6; iz++) {\n var z = bounds[iz];\n\n for (var iy = 2; iy < 4; iy++) {\n var y = bounds[iy];\n\n for (var ix = 0; ix < 2; ix++) {\n var x = bounds[ix];\n var poffset = offset + count * 3;\n result[poffset++] = m[0] * x + m[1] * y + m[2] * z + m[3];\n result[poffset++] = m[4] * x + m[5] * y + m[6] * z + m[7];\n result[poffset++] = m[8] * x + m[9] * y + m[10] * z + m[11];\n count++;\n }\n }\n }\n };\n\n publicAPI.traverseVolumePass = function (renderPass) {\n if (!model.renderable || !model.renderable.getVisibility() || model.WebGPURenderer.getSelector() && !model.renderable.getPickable()) {\n return;\n }\n\n publicAPI.apply(renderPass, true);\n model.children[0].traverse(renderPass);\n publicAPI.apply(renderPass, false);\n };\n\n publicAPI.getKeyMatrices = function (wgpuRen) {\n // has the actor or stabilization center changed?\n if (Math.max(model.renderable.getMTime(), wgpuRen.getStabilizedTime().getMTime()) > model.keyMatricesTime.getMTime()) {\n model.renderable.computeMatrix();\n var mcwc = model.renderable.getMatrix(); // compute the net shift\n\n var center = wgpuRen.getStabilizedCenterByReference();\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].transpose(model.keyMatrices.bcwc, mcwc); // to get to stabilized we also need the center\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat4\"].translate(model.keyMatrices.bcsc, model.keyMatrices.bcwc, [-center[0], -center[1], -center[2]]);\n model.keyMatricesTime.modified();\n }\n\n return model.keyMatrices;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n propID: undefined,\n keyMatricesTime: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance\n\n vtk_js_Sources_Rendering_SceneGraph_ViewNode__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n model.keyMatricesTime = {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].obj(model.keyMatricesTime, {\n mtime: 0\n });\n model.keyMatrices = {\n bcwc: new Float64Array(16),\n bcsc: new Float64Array(16)\n };\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get(publicAPI, model, ['propID', 'keyMatricesTime']); // Object methods\n\n vtkWebGPUVolume(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(extend, 'vtkWebGPUVolume'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n}); // Register ourself to WebGPU backend if imported\n\nObject(vtk_js_Sources_Rendering_WebGPU_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_3__[\"registerOverride\"])('vtkVolume', newInstance);\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Rendering/WebGPU/Volume/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/Constants.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/Constants.js ***! - \******************************************************************************/ -/*! exports provided: WIDGET_PRIORITY, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WIDGET_PRIORITY\", function() { return WIDGET_PRIORITY; });\nvar WIDGET_PRIORITY = 0.5;\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n WIDGET_PRIORITY: WIDGET_PRIORITY\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/index.js ***! - \**************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorObserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorObserver */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorObserver/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Prop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Prop */ \"./node_modules/vtk.js/Sources/Rendering/Core/Prop/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_AbstractWidget_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/AbstractWidget/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/Constants.js\");\n\n\n\n\n // ----------------------------------------------------------------------------\n\nfunction vtkAbstractWidget(publicAPI, model) {\n model.classHierarchy.push('vtkAbstractWidget');\n model.actorToRepresentationMap = new WeakMap(); // --------------------------------------------------------------------------\n\n publicAPI.getBounds = model.widgetState.getBounds;\n\n publicAPI.getNestedProps = function () {\n return model.representations;\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.activateHandle = function (_ref) {\n var selectedState = _ref.selectedState,\n representation = _ref.representation;\n model.widgetState.activateOnly(selectedState);\n model.activeState = selectedState;\n\n if (selectedState && selectedState.updateManipulator) {\n selectedState.updateManipulator();\n }\n\n publicAPI.invokeActivateHandle({\n selectedState: selectedState,\n representation: representation\n });\n\n if (publicAPI.updateCursor) {\n publicAPI.updateCursor();\n }\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.deactivateAllHandles = function () {\n model.widgetState.deactivate();\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.hasActor = function (actor) {\n return model.actorToRepresentationMap.has(actor);\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.grabFocus = function () {\n model.hasFocus = true;\n };\n\n publicAPI.loseFocus = function () {\n model.hasFocus = false;\n };\n\n publicAPI.hasFocus = function () {\n return model.hasFocus;\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.placeWidget = function (bounds) {\n return model.widgetState.placeWidget(bounds);\n };\n\n publicAPI.getPlaceFactor = function () {\n return model.widgetState.getPlaceFactor();\n };\n\n publicAPI.setPlaceFactor = function (factor) {\n return model.widgetState.setPlaceFactor(factor);\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.getRepresentationFromActor = function (actor) {\n return model.actorToRepresentationMap.get(actor);\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.updateRepresentationForRender = function () {\n var renderingType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_3__[\"RenderingTypes\"].FRONT_BUFFER;\n\n for (var i = 0; i < model.representations.length; i++) {\n var representation = model.representations[i];\n representation.updateActorVisibility(renderingType, model.visibility, model.contextVisibility, model.handleVisibility);\n }\n };\n\n publicAPI.getViewWidgets = function () {\n return model.factory.getViewIds().map(function (viewId) {\n return model.factory.getWidgetForView({\n viewId: viewId\n });\n });\n }; // --------------------------------------------------------------------------\n // Initialization calls\n // --------------------------------------------------------------------------\n\n\n publicAPI.setPriority(vtk_js_Sources_Widgets_Core_AbstractWidget_Constants__WEBPACK_IMPORTED_MODULE_4__[\"WIDGET_PRIORITY\"]);\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n contextVisibility: true,\n handleVisibility: true,\n hasFocus: false\n};\n/**\n * @param {*} publicAPI public methods to populate\n * @param {*} model internal values to populate\n * @param {object} initialValues Contains at least\n * {viewType, renderer, camera, openGLRenderWindow, factory}\n */\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Rendering_Core_Prop__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_Rendering_Core_InteractorObserver__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['contextVisibility', 'handleVisibility', 'widgetManager']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['representations', 'widgetState']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'ActivateHandle');\n vtkAbstractWidget(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkAbstractWidget'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidgetFactory/index.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidgetFactory/index.js ***! - \*********************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_AbstractWidget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/AbstractWidget */ \"./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidget/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\n\nfunction NoOp() {} // ----------------------------------------------------------------------------\n\n\nfunction vtkAbstractWidgetFactory(publicAPI, model) {\n model.classHierarchy.push('vtkAbstractWidgetFactory'); // DO NOT share on the model ------------------------------------------------\n\n var viewToWidget = {}; // DO NOT share on the model ------------------------------------------------\n // Can be called with just ViewId after the widget has been registered\n\n publicAPI.getWidgetForView = function (_ref) {\n var viewId = _ref.viewId,\n renderer = _ref.renderer,\n viewType = _ref.viewType,\n initialValues = _ref.initialValues;\n\n if (!viewToWidget[viewId]) {\n if (!renderer) {\n return null;\n }\n\n var _extractRenderingComp = Object(vtk_js_Sources_Widgets_Core_WidgetManager__WEBPACK_IMPORTED_MODULE_2__[\"extractRenderingComponents\"])(renderer),\n interactor = _extractRenderingComp.interactor,\n apiSpecificRenderWindow = _extractRenderingComp.apiSpecificRenderWindow,\n camera = _extractRenderingComp.camera;\n\n var widgetModel = {};\n var widgetPublicAPI = {\n onWidgetChange: publicAPI.onWidgetChange\n };\n Object.assign(widgetModel, model, {\n viewType: viewType,\n renderer: renderer,\n camera: camera,\n apiSpecificRenderWindow: apiSpecificRenderWindow,\n factory: publicAPI\n });\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].safeArrays(widgetModel);\n vtk_js_Sources_Widgets_Core_AbstractWidget__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(widgetPublicAPI, widgetModel, initialValues); // Create representations for that view\n\n /* eslint-disable no-shadow */\n\n var widgetInitialValues = initialValues; // Avoid shadowing\n\n widgetModel.representations = publicAPI.getRepresentationsForViewType(viewType).map(function (_ref2) {\n var builder = _ref2.builder,\n labels = _ref2.labels,\n initialValues = _ref2.initialValues;\n return builder.newInstance(_objectSpread(_objectSpread({\n labels: labels\n }, initialValues), widgetInitialValues));\n });\n /* eslint-enable no-shadow */\n\n widgetModel.representations.forEach(function (r) {\n r.setInputData(widgetModel.widgetState);\n r.getActors().forEach(function (actor) {\n widgetModel.actorToRepresentationMap.set(actor, r);\n });\n });\n model.behavior(widgetPublicAPI, widgetModel); // Forward representation methods\n\n ['coincidentTopologyParameters'].concat(_toConsumableArray(model.methodsToLink || [])).forEach(function (methodName) {\n var _methods;\n\n var set = \"set\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(methodName));\n var get = \"get\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(methodName));\n var methods = (_methods = {}, _defineProperty(_methods, methodName, []), _defineProperty(_methods, set, []), _defineProperty(_methods, get, []), _methods);\n widgetModel.representations.forEach(function (representation) {\n if (representation[methodName]) {\n methods[methodName].push(representation[methodName]);\n }\n\n if (representation[set]) {\n methods[set].push(representation[set]);\n }\n\n if (representation[get]) {\n methods[get].push(representation[get]);\n }\n });\n Object.keys(methods).forEach(function (name) {\n var calls = methods[name];\n\n if (calls.length === 1) {\n widgetPublicAPI[name] = calls[0];\n } else if (calls.length > 1) {\n widgetPublicAPI[name] = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain.apply(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"], _toConsumableArray(calls));\n }\n });\n }); // Custom delete to detach from parent\n\n widgetPublicAPI.delete = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(function () {\n delete viewToWidget[viewId];\n }, widgetPublicAPI.delete);\n widgetPublicAPI.setInteractor(interactor);\n var viewWidget = Object.freeze(widgetPublicAPI);\n viewToWidget[viewId] = viewWidget;\n return viewWidget;\n }\n\n return viewToWidget[viewId];\n }; // List of all the views the widget has been registered to.\n\n\n publicAPI.getViewIds = function () {\n return Object.keys(viewToWidget);\n }; // --------------------------------------------------------------------------\n // Widget visibility / enable\n // --------------------------------------------------------------------------\n // Call methods on all its view widgets\n\n\n publicAPI.setVisibility = function (value) {\n var viewIds = Object.keys(viewToWidget);\n\n for (var i = 0; i < viewIds.length; i++) {\n viewToWidget[viewIds[i]].setVisibility(value);\n }\n };\n\n publicAPI.setPickable = function (value) {\n var viewIds = Object.keys(viewToWidget);\n\n for (var i = 0; i < viewIds.length; i++) {\n viewToWidget[viewIds[i]].setPickable(value);\n }\n };\n\n publicAPI.setDragable = function (value) {\n var viewIds = Object.keys(viewToWidget);\n\n for (var i = 0; i < viewIds.length; i++) {\n viewToWidget[viewIds[i]].setDragable(value);\n }\n };\n\n publicAPI.setContextVisibility = function (value) {\n var viewIds = Object.keys(viewToWidget);\n\n for (var i = 0; i < viewIds.length; i++) {\n viewToWidget[viewIds[i]].setContextVisibility(value);\n }\n };\n\n publicAPI.setHandleVisibility = function (value) {\n var viewIds = Object.keys(viewToWidget);\n\n for (var i = 0; i < viewIds.length; i++) {\n viewToWidget[viewIds[i]].setHandleVisibility(value);\n }\n }; // --------------------------------------------------------------------------\n // Place Widget API\n // --------------------------------------------------------------------------\n\n\n publicAPI.placeWidget = function (bounds) {\n return model.widgetState.placeWidget(bounds);\n };\n\n publicAPI.getPlaceFactor = function () {\n return model.widgetState.getPlaceFactor();\n };\n\n publicAPI.setPlaceFactor = function (factor) {\n return model.widgetState.setPlaceFactor(factor);\n }; // --------------------------------------------------------------------------\n // Event Widget API\n // --------------------------------------------------------------------------\n\n\n var unsubscribe = NoOp;\n publicAPI.delete = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.delete, function () {\n return unsubscribe();\n }); // Defer after object instantiation so model.widgetState actually exist\n\n setTimeout(function () {\n unsubscribe = model.widgetState.onModified(function () {\n return publicAPI.invokeWidgetChange(model.widgetState);\n }).unsubscribe;\n }, 0);\n} // ----------------------------------------------------------------------------\n\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['widgetState']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'WidgetChange');\n vtkAbstractWidgetFactory(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkAbstractWidget'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidgetFactory/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/boundsMixin.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/boundsMixin.js ***! - \******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/BoundingBox */ \"./node_modules/vtk.js/Sources/Common/DataModel/BoundingBox/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\nfunction vtkBoundsMixin(publicAPI, model) {\n var sourceBounds = [];\n\n var bbox = _toConsumableArray(vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"].INIT_BOUNDS);\n\n publicAPI.containsPoint = function (x, y, z) {\n if (Array.isArray(x)) {\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"].containsPoint(bbox, x[0], x[1], x[2]);\n }\n\n return vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"].containsPoint(bbox, x, y, z);\n };\n\n publicAPI.placeWidget = function (bounds) {\n model.bounds = [];\n var center = [(bounds[0] + bounds[1]) / 2.0, (bounds[2] + bounds[3]) / 2.0, (bounds[4] + bounds[5]) / 2.0];\n\n for (var i = 0; i < 6; i++) {\n var axisCenter = center[Math.floor(i / 2)];\n sourceBounds[i] = bounds[i];\n model.bounds[i] = (bounds[i] - axisCenter) * model.placeFactor + axisCenter;\n }\n\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setBounds(bbox, model.bounds);\n publicAPI.invokeBoundsChange(model.bounds);\n publicAPI.modified();\n };\n\n publicAPI.setPlaceFactor = function (factor) {\n if (model.placeFactor !== factor) {\n model.placeFactor = factor;\n model.bounds = [];\n var center = [(sourceBounds[0] + sourceBounds[1]) / 2.0, (sourceBounds[2] + sourceBounds[3]) / 2.0, (sourceBounds[4] + sourceBounds[5]) / 2.0];\n\n for (var i = 0; i < 6; i++) {\n var axisCenter = center[Math.floor(i / 2)];\n model.bounds[i] = (sourceBounds[i] - axisCenter) * model.placeFactor + axisCenter;\n }\n\n vtk_js_Sources_Common_DataModel_BoundingBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setBounds(bbox, model.bounds);\n publicAPI.invokeBoundsChange(model.bounds);\n publicAPI.modified();\n }\n };\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n bounds: [-1, 1, -1, 1, -1, 1],\n placeFactor: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['bounds'], 6);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['placeFactor']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].event(publicAPI, model, 'BoundsChange');\n model.bounds = model.bounds.slice();\n vtkBoundsMixin(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/boundsMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/colorMixin.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/colorMixin.js ***! - \*****************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VALUES = {\n color: 0.5\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['color']);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/colorMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/cornerMixin.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/cornerMixin.js ***! - \******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n // ----------------------------------------------------------------------------\n\nfunction vtkCornerMixin(publicAPI, model) {\n publicAPI.translate = function (dx, dy, dz) {\n var _publicAPI$getCornerB = publicAPI.getCornerByReference(),\n _publicAPI$getCornerB2 = _slicedToArray(_publicAPI$getCornerB, 3),\n x = _publicAPI$getCornerB2[0],\n y = _publicAPI$getCornerB2[1],\n z = _publicAPI$getCornerB2[2];\n\n publicAPI.setCorner(x + dx, y + dy, z + dz);\n };\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n corner: [0, 0, 0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['corner'], 3);\n vtkCornerMixin(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/cornerMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/directionMixin.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/directionMixin.js ***! - \*********************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/MatrixBuilder */ \"./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js\");\n\n // ----------------------------------------------------------------------------\n\nfunction vtkDirectionMixin(publicAPI, model) {\n var transform = model.angleUnit === 'degree' ? vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_1__[\"default\"].buildFromDegree() : vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_1__[\"default\"].buildFromRadian();\n\n publicAPI.rotateFromDirections = function (originDirection, targetDirection) {\n transform.identity().rotateFromDirections(originDirection, targetDirection).apply(model.direction);\n publicAPI.modified();\n };\n\n publicAPI.rotate = function (angle, axis) {\n transform.identity().rotate(angle, axis).apply(model.direction);\n };\n\n publicAPI.rotateX = function (angle) {\n transform.identity().rotateX(angle).apply(model.direction);\n };\n\n publicAPI.rotateY = function (angle) {\n transform.identity().rotateY(angle).apply(model.direction);\n };\n\n publicAPI.rotateZ = function (angle) {\n transform.identity().rotateZ(angle).apply(model.direction);\n };\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n direction: [1, 0, 0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['direction'], 3);\n vtkDirectionMixin(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/directionMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/index.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/index.js ***! - \************************************************************************/ -/*! exports provided: createBuilder, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createBuilder\", function() { return createBuilder; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetState */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetState/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_boundsMixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/boundsMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/boundsMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_colorMixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/colorMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/colorMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_cornerMixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/cornerMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/cornerMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_directionMixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/directionMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/directionMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_manipulatorMixin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/manipulatorMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/manipulatorMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_nameMixin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/nameMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/nameMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_orientationMixin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/orientationMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/orientationMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_originMixin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/originMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/originMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_scale1Mixin__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/scale1Mixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale1Mixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_scale3Mixin__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/scale3Mixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale3Mixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_textMixin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/textMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/textMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_visibleMixin__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/visibleMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/visibleMixin.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder_shapeMixin__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder/shapeMixin */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/shapeMixin.js\");\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // ----------------------------------------------------------------------------\n// Global type lookup map\n// ----------------------------------------------------------------------------\n\nvar MIXINS = {\n bounds: vtk_js_Sources_Widgets_Core_StateBuilder_boundsMixin__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n color: vtk_js_Sources_Widgets_Core_StateBuilder_colorMixin__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n corner: vtk_js_Sources_Widgets_Core_StateBuilder_cornerMixin__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n direction: vtk_js_Sources_Widgets_Core_StateBuilder_directionMixin__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n manipulator: vtk_js_Sources_Widgets_Core_StateBuilder_manipulatorMixin__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n name: vtk_js_Sources_Widgets_Core_StateBuilder_nameMixin__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n orientation: vtk_js_Sources_Widgets_Core_StateBuilder_orientationMixin__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n origin: vtk_js_Sources_Widgets_Core_StateBuilder_originMixin__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n scale1: vtk_js_Sources_Widgets_Core_StateBuilder_scale1Mixin__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n scale3: vtk_js_Sources_Widgets_Core_StateBuilder_scale3Mixin__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n text: vtk_js_Sources_Widgets_Core_StateBuilder_textMixin__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n visible: vtk_js_Sources_Widgets_Core_StateBuilder_visibleMixin__WEBPACK_IMPORTED_MODULE_13__[\"default\"],\n shape: vtk_js_Sources_Widgets_Core_StateBuilder_shapeMixin__WEBPACK_IMPORTED_MODULE_14__[\"default\"]\n}; // ----------------------------------------------------------------------------\n\nfunction newInstance(mixins, initialValues) {\n var publicAPI = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var skipWidgetState = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n if (!skipWidgetState) {\n vtk_js_Sources_Widgets_Core_WidgetState__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n }\n\n for (var i = 0; i < mixins.length; i++) {\n var mixin = MIXINS[mixins[i]];\n\n if (mixin) {\n mixin.extend(publicAPI, model, initialValues);\n } else {\n vtkErrorMacro('Invalid mixin name:', mixins[i]);\n }\n }\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].safeArrays(model);\n return Object.freeze(publicAPI);\n} // ----------------------------------------------------------------------------\n\n\nvar Builder = /*#__PURE__*/function () {\n function Builder() {\n _classCallCheck(this, Builder);\n\n this.publicAPI = {};\n this.model = {};\n vtk_js_Sources_Widgets_Core_WidgetState__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(this.publicAPI, this.model); // The root state should always have the bounds/placeWidget/widgetFactor\n\n vtk_js_Sources_Widgets_Core_StateBuilder_boundsMixin__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(this.publicAPI, this.model);\n }\n /* eslint-disable no-shadow */\n\n\n _createClass(Builder, [{\n key: \"addDynamicMixinState\",\n value: function addDynamicMixinState(_ref) {\n var _this = this;\n\n var labels = _ref.labels,\n mixins = _ref.mixins,\n name = _ref.name,\n initialValues = _ref.initialValues;\n var listName = \"\".concat(name, \"List\");\n this.model[listName] = []; // Create new Instance method\n\n this.publicAPI[\"add\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(name))] = function () {\n var instance = newInstance(mixins, initialValues);\n\n _this.publicAPI.bindState(instance, labels);\n\n _this.model[listName].push(instance);\n\n _this.publicAPI.modified();\n\n return instance;\n };\n\n this.publicAPI[\"remove\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(name))] = function (instanceOrIndex) {\n var removeIndex = _this.model[listName].indexOf(instanceOrIndex);\n\n if (removeIndex === -1 && instanceOrIndex < _this.model[listName].length) {\n removeIndex = instanceOrIndex;\n }\n\n var instance = _this.model[listName][removeIndex];\n\n if (instance) {\n _this.publicAPI.unbindState(instance);\n }\n\n _this.model[listName].splice(removeIndex, 1);\n\n _this.publicAPI.modified();\n };\n\n this.publicAPI[\"get\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(name), \"List\")] = function () {\n return _this.model[listName].slice();\n };\n\n this.publicAPI[\"clear\".concat(vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].capitalize(name), \"List\")] = function () {\n while (_this.model[listName].length) {\n var instance = _this.model[listName].pop();\n\n if (instance) {\n _this.publicAPI.unbindState(instance);\n }\n }\n\n _this.publicAPI.modified();\n };\n\n return this;\n }\n }, {\n key: \"addStateFromMixin\",\n value: function addStateFromMixin(_ref2) {\n var labels = _ref2.labels,\n mixins = _ref2.mixins,\n name = _ref2.name,\n initialValues = _ref2.initialValues;\n var instance = newInstance(mixins, initialValues);\n this.model[name] = instance;\n this.publicAPI.bindState(instance, labels);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(this.publicAPI, this.model, [name]);\n return this;\n }\n }, {\n key: \"addStateFromInstance\",\n value: function addStateFromInstance(_ref3) {\n var labels = _ref3.labels,\n name = _ref3.name,\n instance = _ref3.instance;\n this.model[name] = instance;\n this.publicAPI.bindState(instance, labels);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(this.publicAPI, this.model, [name]);\n return this;\n }\n }, {\n key: \"addField\",\n value: function addField(_ref4) {\n var name = _ref4.name,\n initialValue = _ref4.initialValue;\n\n if (Array.isArray(initialValue)) {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(this.publicAPI, this.model, [name], initialValue.length);\n } else {\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(this.publicAPI, this.model, [name]);\n }\n\n this.model[name] = initialValue;\n return this;\n }\n }, {\n key: \"build\",\n value: function build() {\n for (var _len = arguments.length, mixins = new Array(_len), _key = 0; _key < _len; _key++) {\n mixins[_key] = arguments[_key];\n }\n\n return newInstance(mixins, {}, this.publicAPI, this.model, true);\n }\n }]);\n\n return Builder;\n}(); // ----------------------------------------------------------------------------\n// Public API\n// ----------------------------------------------------------------------------\n\n\nfunction createBuilder() {\n return new Builder();\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n createBuilder: createBuilder\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/manipulatorMixin.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/manipulatorMixin.js ***! - \***********************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n\nfunction vtkManipulatorMixin(publicAPI, model) {\n publicAPI.updateManipulator = function () {\n if (model.manipulator) {\n var origin = model.origin,\n normal = model.normal,\n direction = model.direction;\n var _model$manipulator = model.manipulator,\n setOrigin = _model$manipulator.setOrigin,\n setCenter = _model$manipulator.setCenter,\n setNormal = _model$manipulator.setNormal,\n setDirection = _model$manipulator.setDirection;\n\n if (origin && setOrigin) {\n setOrigin(origin);\n } else if (origin && setCenter) {\n setCenter(origin);\n }\n\n if (direction && setDirection) {\n setDirection(direction);\n } else if (direction && !normal && setNormal) {\n setNormal(direction);\n } else if (normal && setDirection) {\n setDirection(normal);\n }\n }\n };\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n manipulator: null\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['manipulator']);\n vtkManipulatorMixin(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/manipulatorMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/nameMixin.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/nameMixin.js ***! - \****************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VALUES = {\n name: ''\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['name']);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/nameMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/orientationMixin.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/orientationMixin.js ***! - \***********************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n\n\nfunction eq(v1, v2) {\n return v1.length === 3 && v2.length === 3 && v1[0] === v2[0] && v1[1] === v2[1] && v1[2] === v2[2];\n}\n\nfunction isSame(o, p1, p2, before) {\n return eq(o, before.o) && eq(p1, before.p1) && eq(p2, before.p2);\n} // function axis(o, p1, p2) {\n// if (o[0] === p1[0] && p1[0] === p2[0]) {\n// return 'X';\n// }\n// if (o[1] === p1[1] && p1[1] === p2[1]) {\n// return 'Y';\n// }\n// if (o[2] === p1[2] && p1[2] === p2[2]) {\n// return 'Z';\n// }\n// return '?';\n// }\n// ----------------------------------------------------------------------------\n\n\nfunction vtkOrientationMixin(publicAPI, model) {\n var previousPoints = {\n o: [],\n p1: [],\n p2: []\n };\n\n publicAPI.normalize = function () {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"normalize\"](model.up);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"normalize\"](model.right);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"normalize\"](model.direction);\n publicAPI.modified();\n };\n\n publicAPI.updateFromOriginRightUp = function (o, p1, p2) {\n if (isSame(o, p1, p2, previousPoints)) {\n return;\n }\n\n previousPoints.o = o.slice();\n previousPoints.p1 = p1.slice();\n previousPoints.p2 = p2.slice();\n model.up = [p2[0] - o[0], p2[1] - o[1], p2[2] - o[2]];\n model.right = [p1[0] - o[0], p1[1] - o[1], p1[2] - o[2]];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"cross\"](model.up, model.right, model.direction);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"cross\"](model.direction, model.up, model.right);\n publicAPI.normalize();\n publicAPI.modified();\n };\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n up: [0, 1, 0],\n right: [1, 0, 0],\n direction: [0, 0, 1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['up', 'right', 'direction'], 3);\n vtkOrientationMixin(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/orientationMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/originMixin.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/originMixin.js ***! - \******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n // ----------------------------------------------------------------------------\n\nfunction vtkOriginMixin(publicAPI, model) {\n publicAPI.translate = function (dx, dy, dz) {\n var _publicAPI$getOriginB = publicAPI.getOriginByReference(),\n _publicAPI$getOriginB2 = _slicedToArray(_publicAPI$getOriginB, 3),\n x = _publicAPI$getOriginB2[0],\n y = _publicAPI$getOriginB2[1],\n z = _publicAPI$getOriginB2[2];\n\n publicAPI.setOrigin(x + dx, y + dy, z + dz);\n };\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n origin: [0, 0, 0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['origin'], 3);\n vtkOriginMixin(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/originMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale1Mixin.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale1Mixin.js ***! - \******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VALUES = {\n scale1: 0.5\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['scale1']);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale1Mixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale3Mixin.js": -/*!******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale3Mixin.js ***! - \******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VALUES = {\n scale3: [1, 1, 1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['scale3'], 3);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/scale3Mixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/shapeMixin.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/shapeMixin.js ***! - \*****************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n // ----------------------------------------------------------------------------\n\nvar DEFAULT_VALUES = {\n shape: ''\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['shape']);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/shapeMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/textMixin.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/textMixin.js ***! - \****************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VALUES = {\n text: 'DefaultText'\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['text']);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/textMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/visibleMixin.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/visibleMixin.js ***! - \*******************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_VALUES = {\n visible: true\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['visible']);\n publicAPI.isVisible = publicAPI.getVisible;\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/visibleMixin.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js ***! - \*****************************************************************************/ -/*! exports provided: ViewTypes, RenderingTypes, CaptureOn, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ViewTypes\", function() { return ViewTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RenderingTypes\", function() { return RenderingTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CaptureOn\", function() { return CaptureOn; });\nvar ViewTypes = {\n DEFAULT: 0,\n GEOMETRY: 1,\n SLICE: 2,\n VOLUME: 3,\n YZ_PLANE: 4,\n // Sagittal\n XZ_PLANE: 5,\n // Coronal\n XY_PLANE: 6 // Axial\n\n};\nvar RenderingTypes = {\n PICKING_BUFFER: 0,\n FRONT_BUFFER: 1\n};\nvar CaptureOn = {\n MOUSE_MOVE: 0,\n MOUSE_RELEASE: 1\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ViewTypes: ViewTypes,\n RenderingTypes: RenderingTypes,\n CaptureOn: CaptureOn\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/index.js ***! - \*************************************************************************/ -/*! exports provided: extractRenderingComponents, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extractRenderingComponents\", function() { return extractRenderingComponents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_DataSet_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/DataSet/Constants */ \"./node_modules/vtk.js/Sources/Common/DataModel/DataSet/Constants.js\");\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_SelectionNode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/SelectionNode */ \"./node_modules/vtk.js/Sources/Common/DataModel/SelectionNode/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_SVG_SVGRepresentation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Widgets/SVG/SVGRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/SVG/SVGRepresentation/index.js\");\n/* harmony import */ var _vdom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./vdom */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/vdom.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n\n\n\n\n\nvar ViewTypes = vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ViewTypes,\n RenderingTypes = vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"default\"].RenderingTypes,\n CaptureOn = vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CaptureOn;\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].vtkErrorMacro;\nvar createSvgElement = vtk_js_Sources_Widgets_SVG_SVGRepresentation__WEBPACK_IMPORTED_MODULE_5__[\"default\"].createSvgElement,\n createSvgDomElement = vtk_js_Sources_Widgets_SVG_SVGRepresentation__WEBPACK_IMPORTED_MODULE_5__[\"default\"].createSvgDomElement;\nvar viewIdCount = 1; // ----------------------------------------------------------------------------\n// Helper\n// ----------------------------------------------------------------------------\n\nfunction extractRenderingComponents(renderer) {\n var camera = renderer.getActiveCamera();\n var renderWindow = renderer.getRenderWindow();\n var interactor = renderWindow.getInteractor();\n var apiSpecificRenderWindow = interactor.getView();\n return {\n renderer: renderer,\n renderWindow: renderWindow,\n interactor: interactor,\n apiSpecificRenderWindow: apiSpecificRenderWindow,\n camera: camera\n };\n} // ----------------------------------------------------------------------------\n\nfunction createSvgRoot(id) {\n var svgRoot = createSvgDomElement('svg');\n svgRoot.setAttribute('style', 'position: absolute; top: 0; left: 0; width: 100%; height: 100%;');\n svgRoot.setAttribute('version', '1.1');\n svgRoot.setAttribute('baseProfile', 'full');\n return svgRoot;\n} // ----------------------------------------------------------------------------\n// vtkWidgetManager methods\n// ----------------------------------------------------------------------------\n\n\nfunction vtkWidgetManager(publicAPI, model) {\n if (!model.viewId) {\n model.viewId = \"view-\".concat(viewIdCount++);\n }\n\n model.classHierarchy.push('vtkWidgetManager');\n var propsWeakMap = new WeakMap();\n var widgetToSvgMap = new WeakMap();\n var svgVTrees = new WeakMap();\n var subscriptions = []; // --------------------------------------------------------------------------\n // Internal variable\n // --------------------------------------------------------------------------\n\n model.svgRoot = createSvgRoot(model.viewId); // --------------------------------------------------------------------------\n // API internal\n // --------------------------------------------------------------------------\n\n function updateWidgetWeakMap(widget) {\n var representations = widget.getRepresentations();\n\n for (var i = 0; i < representations.length; i++) {\n var representation = representations[i];\n var origin = {\n widget: widget,\n representation: representation\n };\n var actors = representation.getActors();\n\n for (var j = 0; j < actors.length; j++) {\n var actor = actors[j];\n propsWeakMap.set(actor, origin);\n }\n }\n }\n\n function getViewWidget(widget) {\n return widget && (widget.isA('vtkAbstractWidget') ? widget : widget.getWidgetForView({\n viewId: model.viewId\n }));\n } // --------------------------------------------------------------------------\n // internal SVG API\n // --------------------------------------------------------------------------\n\n\n var pendingSvgRenders = new WeakMap();\n\n function enableSvgLayer() {\n var container = model.apiSpecificRenderWindow.getReferenceByName('el');\n var canvas = model.apiSpecificRenderWindow.getCanvas();\n container.insertBefore(model.svgRoot, canvas.nextSibling);\n var containerStyles = window.getComputedStyle(container);\n\n if (containerStyles.position === 'static') {\n container.style.position = 'relative';\n }\n }\n\n function disableSvgLayer() {\n var container = model.apiSpecificRenderWindow.getReferenceByName('el');\n container.removeChild(model.svgRoot);\n }\n\n function removeFromSvgLayer(viewWidget) {\n var group = widgetToSvgMap.get(viewWidget);\n\n if (group) {\n widgetToSvgMap.delete(viewWidget);\n svgVTrees.delete(viewWidget);\n model.svgRoot.removeChild(group);\n }\n }\n\n function setSvgSize() {\n var _model$apiSpecificRen = model.apiSpecificRenderWindow.getSize(),\n _model$apiSpecificRen2 = _slicedToArray(_model$apiSpecificRen, 2),\n cwidth = _model$apiSpecificRen2[0],\n cheight = _model$apiSpecificRen2[1];\n\n var ratio = window.devicePixelRatio || 1;\n var bwidth = String(cwidth / ratio);\n var bheight = String(cheight / ratio);\n var viewBox = \"0 0 \".concat(cwidth, \" \").concat(cheight);\n var origWidth = model.svgRoot.getAttribute('width');\n var origHeight = model.svgRoot.getAttribute('height');\n var origViewBox = model.svgRoot.getAttribute('viewBox');\n\n if (origWidth !== bwidth) {\n model.svgRoot.setAttribute('width', bwidth);\n }\n\n if (origHeight !== bheight) {\n model.svgRoot.setAttribute('height', bheight);\n }\n\n if (origViewBox !== viewBox) {\n model.svgRoot.setAttribute('viewBox', viewBox);\n }\n }\n\n function updateSvg() {\n if (model.useSvgLayer) {\n var _loop = function _loop(i) {\n var widget = model.widgets[i];\n var svgReps = widget.getRepresentations().filter(function (r) {\n return r.isA('vtkSVGRepresentation');\n });\n var pendingContent = [];\n\n if (widget.getVisibility()) {\n pendingContent = svgReps.filter(function (r) {\n return r.getVisibility();\n }).map(function (r) {\n return r.render();\n });\n }\n\n var promise = Promise.all(pendingContent);\n var renders = pendingSvgRenders.get(widget) || [];\n renders.push(promise);\n pendingSvgRenders.set(widget, renders);\n promise.then(function (vnodes) {\n var pendingRenders = pendingSvgRenders.get(widget) || [];\n var idx = pendingRenders.indexOf(promise);\n\n if (model.deleted || widget.isDeleted() || idx === -1) {\n return;\n } // throw away previous renders\n\n\n pendingRenders = pendingRenders.slice(idx + 1);\n pendingSvgRenders.set(widget, pendingRenders);\n var oldVTree = svgVTrees.get(widget);\n var newVTree = createSvgElement('g');\n\n for (var ni = 0; ni < vnodes.length; ni++) {\n newVTree.appendChild(vnodes[ni]);\n }\n\n var widgetGroup = widgetToSvgMap.get(widget);\n var node = widgetGroup;\n var patchFns = Object(_vdom__WEBPACK_IMPORTED_MODULE_6__[\"diff\"])(oldVTree, newVTree);\n\n for (var j = 0; j < patchFns.length; j++) {\n node = patchFns[j](node);\n }\n\n if (!widgetGroup && node) {\n // add\n model.svgRoot.appendChild(node);\n widgetToSvgMap.set(widget, node);\n } else if (widgetGroup && !node) {\n // delete\n widgetGroup.remove();\n widgetToSvgMap.delete(widget);\n }\n\n svgVTrees.set(widget, newVTree);\n });\n };\n\n for (var i = 0; i < model.widgets.length; i++) {\n _loop(i);\n }\n }\n } // --------------------------------------------------------------------------\n // Widget scaling\n // --------------------------------------------------------------------------\n\n\n function updateDisplayScaleParams() {\n var apiSpecificRenderWindow = model.apiSpecificRenderWindow,\n camera = model.camera,\n renderer = model.renderer;\n\n if (renderer && apiSpecificRenderWindow && camera) {\n var _apiSpecificRenderWin = apiSpecificRenderWindow.getSize(),\n _apiSpecificRenderWin2 = _slicedToArray(_apiSpecificRenderWin, 2),\n rwW = _apiSpecificRenderWin2[0],\n rwH = _apiSpecificRenderWin2[1];\n\n var _renderer$getViewport = renderer.getViewport(),\n _renderer$getViewport2 = _slicedToArray(_renderer$getViewport, 4),\n vxmin = _renderer$getViewport2[0],\n vymin = _renderer$getViewport2[1],\n vxmax = _renderer$getViewport2[2],\n vymax = _renderer$getViewport2[3];\n\n var rendererPixelDims = [rwW * (vxmax - vxmin), rwH * (vymax - vymin)];\n var cameraPosition = camera.getPosition();\n var cameraDir = camera.getDirectionOfProjection();\n var isParallel = camera.getParallelProjection();\n var dispHeightFactor = isParallel ? camera.getParallelScale() : 2 * Math.tan(Object(vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"radiansFromDegrees\"])(camera.getViewAngle()) / 2);\n model.widgets.forEach(function (w) {\n w.getNestedProps().forEach(function (r) {\n if (r.getScaleInPixels()) {\n r.setDisplayScaleParams({\n dispHeightFactor: dispHeightFactor,\n cameraPosition: cameraPosition,\n cameraDir: cameraDir,\n isParallel: isParallel,\n rendererPixelDims: rendererPixelDims\n });\n }\n });\n });\n }\n } // --------------------------------------------------------------------------\n // API public\n // --------------------------------------------------------------------------\n\n\n function updateWidgetForRender(w) {\n w.updateRepresentationForRender(model.renderingType);\n }\n\n function renderPickingBuffer() {\n model.renderingType = RenderingTypes.PICKING_BUFFER;\n model.widgets.forEach(updateWidgetForRender);\n }\n\n function renderFrontBuffer() {\n model.renderingType = RenderingTypes.FRONT_BUFFER;\n model.widgets.forEach(updateWidgetForRender);\n }\n\n function captureBuffers(x1, y1, x2, y2) {\n renderPickingBuffer();\n model.selector.setArea(x1, y1, x2, y2);\n model.selector.releasePixBuffers();\n model.previousSelectedData = null;\n return model.selector.captureBuffers();\n }\n\n publicAPI.enablePicking = function () {\n model.pickingEnabled = true;\n model.pickingAvailable = true;\n publicAPI.renderWidgets();\n };\n\n publicAPI.renderWidgets = function () {\n if (model.pickingEnabled && model.captureOn === CaptureOn.MOUSE_RELEASE) {\n var _model$apiSpecificRen3 = model.apiSpecificRenderWindow.getSize(),\n _model$apiSpecificRen4 = _slicedToArray(_model$apiSpecificRen3, 2),\n w = _model$apiSpecificRen4[0],\n h = _model$apiSpecificRen4[1];\n\n model.pickingAvailable = captureBuffers(0, 0, w, h);\n }\n\n renderFrontBuffer();\n publicAPI.modified();\n };\n\n publicAPI.disablePicking = function () {\n model.pickingEnabled = false;\n model.pickingAvailable = false;\n };\n\n publicAPI.setRenderer = function (renderer) {\n Object.assign(model, extractRenderingComponents(renderer));\n\n while (subscriptions.length) {\n subscriptions.pop().unsubscribe();\n }\n\n model.selector = model.apiSpecificRenderWindow.getSelector();\n model.selector.setFieldAssociation(vtk_js_Sources_Common_DataModel_DataSet_Constants__WEBPACK_IMPORTED_MODULE_1__[\"FieldAssociations\"].FIELD_ASSOCIATION_POINTS);\n model.selector.attach(model.apiSpecificRenderWindow, model.renderer);\n subscriptions.push(model.interactor.onRenderEvent(updateSvg));\n subscriptions.push(model.apiSpecificRenderWindow.onModified(setSvgSize));\n setSvgSize();\n subscriptions.push(model.apiSpecificRenderWindow.onModified(updateDisplayScaleParams));\n subscriptions.push(model.camera.onModified(updateDisplayScaleParams));\n updateDisplayScaleParams();\n subscriptions.push(model.interactor.onStartAnimation(function () {\n model.isAnimating = true;\n }));\n subscriptions.push(model.interactor.onEndAnimation(function () {\n model.isAnimating = false;\n publicAPI.renderWidgets();\n }));\n subscriptions.push(model.interactor.onMouseMove(function (_ref) {\n var position = _ref.position;\n\n if (model.isAnimating || !model.pickingAvailable) {\n return;\n }\n\n publicAPI.updateSelectionFromXY(position.x, position.y);\n\n var _publicAPI$getSelecte = publicAPI.getSelectedData(),\n requestCount = _publicAPI$getSelecte.requestCount,\n selectedState = _publicAPI$getSelecte.selectedState,\n representation = _publicAPI$getSelecte.representation,\n widget = _publicAPI$getSelecte.widget;\n\n if (requestCount) {\n // Call activate only once\n return;\n } // Default cursor behavior\n\n\n model.apiSpecificRenderWindow.setCursor(widget ? 'pointer' : 'default');\n\n if (model.widgetInFocus === widget && widget.hasFocus()) {\n widget.activateHandle({\n selectedState: selectedState,\n representation: representation\n }); // Ken FIXME\n\n model.interactor.render();\n model.interactor.render();\n } else {\n for (var i = 0; i < model.widgets.length; i++) {\n var w = model.widgets[i];\n\n if (w === widget && w.getPickable()) {\n w.activateHandle({\n selectedState: selectedState,\n representation: representation\n });\n model.activeWidget = w;\n } else {\n w.deactivateAllHandles();\n }\n } // Ken FIXME\n\n\n model.interactor.render();\n model.interactor.render();\n }\n }));\n publicAPI.modified();\n\n if (model.pickingEnabled) {\n // also sets pickingAvailable\n publicAPI.enablePicking();\n }\n\n if (model.useSvgLayer) {\n enableSvgLayer();\n }\n };\n\n function addWidgetInternal(viewWidget) {\n viewWidget.setWidgetManager(publicAPI);\n updateWidgetWeakMap(viewWidget);\n updateDisplayScaleParams(); // Register to renderer\n\n model.renderer.addActor(viewWidget);\n }\n\n publicAPI.addWidget = function (widget, viewType, initialValues) {\n if (!model.renderer) {\n vtkErrorMacro('Widget manager MUST BE link to a view before registering widgets');\n return null;\n }\n\n var viewId = model.viewId,\n renderer = model.renderer;\n var w = widget.getWidgetForView({\n viewId: viewId,\n renderer: renderer,\n viewType: viewType || ViewTypes.DEFAULT,\n initialValues: initialValues\n });\n\n if (model.widgets.indexOf(w) === -1) {\n model.widgets.push(w);\n addWidgetInternal(w);\n publicAPI.modified();\n }\n\n return w;\n };\n\n function removeWidgetInternal(viewWidget) {\n model.renderer.removeActor(viewWidget);\n removeFromSvgLayer(viewWidget);\n viewWidget.delete();\n }\n\n function onWidgetRemoved() {\n model.renderer.getRenderWindow().getInteractor().render();\n publicAPI.renderWidgets();\n }\n\n publicAPI.removeWidgets = function () {\n model.widgets.forEach(removeWidgetInternal);\n model.widgets = [];\n model.widgetInFocus = null;\n onWidgetRemoved();\n };\n\n publicAPI.removeWidget = function (widget) {\n var viewWidget = getViewWidget(widget);\n var index = model.widgets.indexOf(viewWidget);\n\n if (index !== -1) {\n model.widgets.splice(index, 1);\n var isWidgetInFocus = model.widgetInFocus === viewWidget;\n\n if (isWidgetInFocus) {\n publicAPI.releaseFocus();\n }\n\n removeWidgetInternal(viewWidget);\n onWidgetRemoved();\n }\n };\n\n publicAPI.updateSelectionFromXY = function (x, y) {\n if (model.pickingEnabled) {\n // First pick SVG representation\n for (var i = 0; i < model.widgets.length; ++i) {\n var widget = model.widgets[i];\n var hoveredSVGReps = widget.getRepresentations().filter(function (r) {\n return r.isA('vtkSVGRepresentation') && r.getHover() != null;\n });\n\n if (hoveredSVGReps.length) {\n var selection = vtk_js_Sources_Common_DataModel_SelectionNode__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n selection.getProperties().compositeID = hoveredSVGReps[0].getHover();\n selection.getProperties().widget = widget;\n selection.getProperties().representation = hoveredSVGReps[0];\n model.selections = [selection];\n return;\n }\n } // Then pick regular representations.\n\n\n var pickingAvailable = model.pickingAvailable;\n\n if (model.captureOn === CaptureOn.MOUSE_MOVE) {\n pickingAvailable = captureBuffers(x, y, x, y);\n renderFrontBuffer();\n }\n\n if (pickingAvailable) {\n model.selections = model.selector.generateSelection(x, y, x, y);\n }\n }\n };\n\n publicAPI.updateSelectionFromMouseEvent = function (event) {\n var pageX = event.pageX,\n pageY = event.pageY;\n\n var _model$apiSpecificRen5 = model.apiSpecificRenderWindow.getCanvas().getBoundingClientRect(),\n top = _model$apiSpecificRen5.top,\n left = _model$apiSpecificRen5.left,\n height = _model$apiSpecificRen5.height;\n\n var x = pageX - left;\n var y = height - (pageY - top);\n publicAPI.updateSelectionFromXY(x, y);\n };\n\n publicAPI.getSelectedData = function () {\n if (!model.selections || !model.selections.length) {\n model.previousSelectedData = null;\n return {};\n }\n\n var _model$selections$0$g = model.selections[0].getProperties(),\n propID = _model$selections$0$g.propID,\n compositeID = _model$selections$0$g.compositeID,\n prop = _model$selections$0$g.prop;\n\n var _model$selections$0$g2 = model.selections[0].getProperties(),\n widget = _model$selections$0$g2.widget,\n representation = _model$selections$0$g2.representation; // prop is undefined for SVG representation, widget is undefined for handle\n // representation.\n\n\n if (model.previousSelectedData && model.previousSelectedData.prop === prop && model.previousSelectedData.widget === widget && model.previousSelectedData.compositeID === compositeID) {\n model.previousSelectedData.requestCount++;\n return model.previousSelectedData;\n }\n\n if (propsWeakMap.has(prop)) {\n var props = propsWeakMap.get(prop);\n widget = props.widget;\n representation = props.representation;\n }\n\n if (widget && representation) {\n var selectedState = representation.getSelectedState(prop, compositeID);\n model.previousSelectedData = {\n requestCount: 0,\n propID: propID,\n compositeID: compositeID,\n prop: prop,\n widget: widget,\n representation: representation,\n selectedState: selectedState\n };\n return model.previousSelectedData;\n }\n\n model.previousSelectedData = null;\n return {};\n };\n\n publicAPI.grabFocus = function (widget) {\n var viewWidget = getViewWidget(widget);\n\n if (model.widgetInFocus && model.widgetInFocus !== viewWidget) {\n model.widgetInFocus.loseFocus();\n }\n\n model.widgetInFocus = viewWidget;\n\n if (model.widgetInFocus) {\n model.widgetInFocus.grabFocus();\n }\n };\n\n publicAPI.releaseFocus = function () {\n return publicAPI.grabFocus(null);\n };\n\n publicAPI.setUseSvgLayer = function (useSvgLayer) {\n if (useSvgLayer !== model.useSvgLayer) {\n model.useSvgLayer = useSvgLayer;\n\n if (model.renderer) {\n if (useSvgLayer) {\n enableSvgLayer(); // force a render so svg widgets can be drawn\n\n updateSvg();\n } else {\n disableSvgLayer();\n }\n }\n\n return true;\n }\n\n return false;\n };\n\n var superDelete = publicAPI.delete;\n\n publicAPI.delete = function () {\n while (subscriptions.length) {\n subscriptions.pop().unsubscribe();\n }\n\n superDelete();\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n viewId: null,\n widgets: [],\n renderer: null,\n viewType: ViewTypes.DEFAULT,\n pickingAvailable: false,\n isAnimating: false,\n pickingEnabled: true,\n selections: null,\n previousSelectedData: null,\n widgetInFocus: null,\n useSvgLayer: true,\n captureOn: CaptureOn.MOUSE_MOVE\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].setGet(publicAPI, model, ['captureOn', {\n type: 'enum',\n name: 'viewType',\n enum: ViewTypes\n }]);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].get(publicAPI, model, ['selections', 'widgets', 'viewId', 'pickingEnabled', 'useSvgLayer']); // Object specific methods\n\n vtkWidgetManager(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance(extend, 'vtkWidgetManager'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend,\n Constants: vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/vdom.js": -/*!************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/vdom.js ***! - \************************************************************************/ -/*! exports provided: render, diff */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"diff\", function() { return diff; });\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar SVG_XMLNS = 'http://www.w3.org/2000/svg';\n\nfunction attrDelta(oldObj, newObj) {\n var set = [];\n var remove = [];\n var oldKeysArray = Object.keys(oldObj);\n var newKeysArray = Object.keys(newObj);\n var oldKeys = new Set(oldKeysArray);\n var newKeys = new Set(newKeysArray);\n\n for (var i = 0; i < oldKeysArray.length; i++) {\n var key = oldKeysArray[i];\n\n if (newKeys.has(key)) {\n if (oldObj[key] !== newObj[key]) {\n set.push([key, newObj[key]]);\n }\n } else {\n remove.push(key);\n }\n }\n\n for (var _i = 0; _i < newKeysArray.length; _i++) {\n var _key = newKeysArray[_i];\n\n if (!oldKeys.has(_key)) {\n set.push([_key, newObj[_key]]);\n }\n }\n\n return [set, remove];\n}\n\nfunction render(vnode) {\n var node = document.createElementNS(SVG_XMLNS, vnode.name);\n var keys = Object.keys(vnode.attrs);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n node.setAttribute(key, vnode.attrs[key]);\n } // TODO: support removing event listener (e.g. use snabbdom)\n\n\n Object.keys(vnode.eventListeners).forEach(function (key) {\n node.addEventListener(key, vnode.eventListeners[key]);\n });\n\n if (vnode.textContent) {\n node.textContent = vnode.textContent;\n } else {\n for (var _i2 = 0; _i2 < vnode.children.length; _i2++) {\n node.appendChild(render(vnode.children[_i2]));\n }\n }\n\n return node;\n}\n/**\n * Returns a set of patch functions to be applied to a document node.\n *\n * Patch functions must return the effective result node.\n */\n\nfunction diff(oldVTree, newVTree) {\n if (newVTree.textContent !== null && newVTree.children.length) {\n throw new Error('Tree cannot have both children and textContent!');\n }\n\n if (!oldVTree) {\n return [function () {\n return render(newVTree);\n }];\n }\n\n if (!newVTree) {\n return [function (node) {\n return node.remove();\n }];\n }\n\n if (oldVTree.name !== newVTree.name) {\n return [function (node) {\n var newNode = render(newVTree);\n node.replaceWith(newNode);\n return newNode;\n }];\n }\n\n var patchFns = [];\n\n var _attrDelta = attrDelta(oldVTree.attrs, newVTree.attrs),\n _attrDelta2 = _slicedToArray(_attrDelta, 2),\n attrsSet = _attrDelta2[0],\n attrsRemove = _attrDelta2[1];\n\n if (attrsSet.length || attrsRemove.length) {\n patchFns.push(function (node) {\n for (var i = 0; i < attrsSet.length; i++) {\n var _attrsSet$i = _slicedToArray(attrsSet[i], 2),\n name = _attrsSet$i[0],\n value = _attrsSet$i[1];\n\n node.setAttribute(name, value);\n }\n\n for (var _i3 = 0; _i3 < attrsRemove.length; _i3++) {\n var _name = attrsRemove[_i3];\n node.removeAttribute(_name);\n }\n\n return node;\n });\n }\n\n if (oldVTree.textContent !== newVTree.textContent && newVTree.textContent !== null) {\n patchFns.push(function (node) {\n node.textContent = newVTree.textContent;\n return node;\n });\n }\n\n if (newVTree.textContent === null) {\n var min = Math.min(oldVTree.children.length, newVTree.children.length);\n\n var _loop = function _loop(i) {\n var childPatches = diff(oldVTree.children[i], newVTree.children[i]);\n patchFns.push(function (node) {\n for (var p = 0; p < childPatches.length; p++) {\n childPatches[p](node.children[i]);\n }\n\n return node;\n });\n };\n\n for (var i = 0; i < min; i++) {\n _loop(i);\n }\n\n if (oldVTree.children.length < newVTree.children.length) {\n var _loop2 = function _loop2(_i4) {\n patchFns.push(function (node) {\n node.appendChild(render(newVTree.children[_i4]));\n return node;\n });\n };\n\n for (var _i4 = min; _i4 < newVTree.children.length; _i4++) {\n _loop2(_i4);\n }\n } else {\n var _loop3 = function _loop3(_i5) {\n patchFns.push(function (node) {\n node.children[_i5].remove();\n\n return node;\n });\n };\n\n // always delete nodes in reverse\n for (var _i5 = oldVTree.children.length - 1; _i5 >= min; _i5--) {\n _loop3(_i5);\n }\n }\n }\n\n return patchFns;\n}\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/vdom.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Core/WidgetState/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Core/WidgetState/index.js ***! - \***********************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n\nvar DEFAULT_LABEL = 'default';\n\nfunction removeObjectInArray(array, obj) {\n var idx = array.indexOf(obj);\n\n if (idx !== -1) {\n array.splice(idx, 1);\n }\n} // ----------------------------------------------------------------------------\n\n\nfunction vtkWidgetState(publicAPI, model) {\n model.classHierarchy.push('vtkWidgetState');\n var subscriptions = [];\n model.labels = {};\n model.nestedStates = []; // --------------------------------------------------------------------------\n // labels can be a string or an array of strings.\n // If nothing (or empty array) provided the default label will be used.\n // --------------------------------------------------------------------------\n\n publicAPI.bindState = function (nested) {\n var labels = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [DEFAULT_LABEL];\n model.nestedStates.push(nested);\n subscriptions.push(nested.onModified(publicAPI.modified));\n\n if (Array.isArray(labels) && labels.length) {\n for (var i = 0; i < labels.length; i++) {\n var label = labels[i];\n\n if (!model.labels[label]) {\n model.labels[label] = [];\n }\n\n model.labels[label].push(nested);\n }\n } else {\n // Need to bind to a label\n var labelToUse = Array.isArray(labels) ? DEFAULT_LABEL : labels || DEFAULT_LABEL;\n\n if (!model.labels[labelToUse]) {\n model.labels[labelToUse] = [];\n }\n\n model.labels[labelToUse].push(nested);\n }\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.unbindState = function (nested) {\n while (subscriptions.length) {\n subscriptions.pop().unsubscribe();\n }\n\n removeObjectInArray(model.nestedStates, nested);\n\n for (var i = 0; i < model.nestedStates.length; i++) {\n subscriptions.push(model.nestedStates[i].onModified(publicAPI.modified));\n }\n\n Object.keys(model.labels).forEach(function (label) {\n var list = model.labels[label];\n removeObjectInArray(list, nested);\n });\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.unbindAll = function () {\n while (subscriptions.length) {\n subscriptions.pop().unsubscribe();\n }\n\n model.nestedStates = [];\n }; // --------------------------------------------------------------------------\n // Active flag API\n // --------------------------------------------------------------------------\n\n\n publicAPI.activate = function () {\n return publicAPI.setActive(true);\n };\n\n publicAPI.deactivate = function (excludingState) {\n if (excludingState !== publicAPI) {\n publicAPI.setActive(false);\n }\n\n for (var i = 0; i < model.nestedStates.length; i++) {\n model.nestedStates[i].deactivate(excludingState);\n }\n };\n\n publicAPI.activateOnly = function (subState) {\n if (subState) {\n subState.setActive(true);\n } // deactivate current state, but exclude the sub-state\n\n\n publicAPI.deactivate(subState);\n }; // --------------------------------------------------------------------------\n // Nested state methods\n // --------------------------------------------------------------------------\n\n\n publicAPI.getStatesWithLabel = function (name) {\n return model.labels[name];\n };\n\n publicAPI.getAllNestedStates = function () {\n return model.nestedStates;\n }; // --------------------------------------------------------------------------\n // Clean on delete\n // --------------------------------------------------------------------------\n\n\n publicAPI.delete = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.unbindAll, publicAPI.delete);\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n active: false\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['active']);\n vtkWidgetState(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Core/WidgetState/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Manipulators/LineManipulator/index.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Manipulators/LineManipulator/index.js ***! - \***********************************************************************************/ -/*! exports provided: projectDisplayToLine, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"projectDisplayToLine\", function() { return projectDisplayToLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n\nfunction projectDisplayToLine(x, y, lineOrigin, lineDirection, renderer, glRenderWindow) {\n var near = glRenderWindow.displayToWorld(x, y, 0, renderer);\n var far = glRenderWindow.displayToWorld(x, y, 1, renderer);\n var viewDir = [0, 0, 0];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"subtract\"](far, near, viewDir);\n var normal = [0, 0, 0];\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"cross\"](lineDirection, viewDir, normal);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"cross\"](normal, viewDir, normal);\n var numerator = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"dot\"]([near[0] - lineOrigin[0], near[1] - lineOrigin[1], near[2] - lineOrigin[2]], normal);\n var denominator = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"dot\"](normal, lineDirection);\n var result = lineDirection.slice();\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"multiplyScalar\"](result, numerator / denominator);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"add\"](lineOrigin, result, result);\n return result;\n} // ----------------------------------------------------------------------------\n// vtkLineManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkLineManipulator(publicAPI, model) {\n // Set our classNae\n model.classHierarchy.push('vtkLineManipulator'); // --------------------------------------------------------------------------\n\n publicAPI.handleEvent = function (callData, glRenderWindow) {\n return projectDisplayToLine(callData.position.x, callData.position.y, model.origin, model.normal, callData.pokedRenderer, glRenderWindow);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n origin: [0, 0, 0],\n normal: [0, 0, 1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['origin', 'normal'], 3);\n vtkLineManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkLineManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n projectDisplayToLine: projectDisplayToLine,\n extend: extend,\n newInstance: newInstance\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Manipulators/LineManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Manipulators/PlaneManipulator/index.js": -/*!************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Manipulators/PlaneManipulator/index.js ***! - \************************************************************************************/ -/*! exports provided: intersectDisplayWithPlane, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intersectDisplayWithPlane\", function() { return intersectDisplayWithPlane; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Plane */ \"./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js\");\n\n\nfunction intersectDisplayWithPlane(x, y, planeOrigin, planeNormal, renderer, glRenderWindow) {\n var near = glRenderWindow.displayToWorld(x, y, 0, renderer);\n var far = glRenderWindow.displayToWorld(x, y, 1, renderer);\n return vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_1__[\"default\"].intersectWithLine(near, far, planeOrigin, planeNormal).x;\n} // ----------------------------------------------------------------------------\n// vtkPlaneManipulator methods\n// ----------------------------------------------------------------------------\n\nfunction vtkPlaneManipulator(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkPlaneManipulator'); // --------------------------------------------------------------------------\n\n publicAPI.handleEvent = function (callData, glRenderWindow) {\n return intersectDisplayWithPlane(callData.position.x, callData.position.y, model.origin, model.normal, callData.pokedRenderer, glRenderWindow);\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n normal: [0, 0, 1],\n origin: [0, 0, 0]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].obj(publicAPI, model);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['normal', 'origin'], 3);\n vtkPlaneManipulator(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkPlaneManipulator'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n intersectDisplayWithPlane: intersectDisplayWithPlane,\n extend: extend,\n newInstance: newInstance\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Manipulators/PlaneManipulator/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Representations/ContextRepresentation/index.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Representations/ContextRepresentation/index.js ***! - \********************************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n // ----------------------------------------------------------------------------\n// vtkWidgetRepresentation\n// ----------------------------------------------------------------------------\n\nfunction vtkContextRepresentation(publicAPI, model) {\n model.classHierarchy.push('vtkContextRepresentation');\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n behavior: vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_1__[\"Behavior\"].CONTEXT,\n pickable: false,\n dragable: true\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var newDefault = _objectSpread(_objectSpread({}, DEFAULT_VALUES), initialValues);\n\n vtk_js_Sources_Widgets_Representations_WidgetRepresentation__WEBPACK_IMPORTED_MODULE_0__[\"default\"].extend(publicAPI, model, newDefault);\n vtkContextRepresentation(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Representations/ContextRepresentation/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Representations/CroppingOutlineRepresentation/index.js": -/*!****************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Representations/CroppingOutlineRepresentation/index.js ***! - \****************************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Actor */ \"./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_ContextRepresentation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/ContextRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/ContextRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro; // prettier-ignore\n\nvar OUTLINE_ARRAY = [2, 0, 1, 2, 0, 2, 2, 0, 4, 2, 1, 3, 2, 1, 5, 2, 2, 3, 2, 2, 6, 2, 3, 7, 2, 4, 5, 2, 4, 6, 2, 5, 7, 2, 6, 7]; // ----------------------------------------------------------------------------\n// vtkCroppingOutlineRepresentation methods\n// ----------------------------------------------------------------------------\n// Represents a box outline given 8 points as corners.\n// Does not work with an arbitrary set of points. An oriented bounding box\n// algorithm may be implemented in the future.\n\nfunction vtkCroppingOutlineRepresentation(publicAPI, model) {\n var _model$actor$getPrope;\n\n // Set our className\n model.classHierarchy.push('vtkCroppingOutlineRepresentation'); // --------------------------------------------------------------------------\n // Internal polydata dataset\n // --------------------------------------------------------------------------\n\n model.internalPolyData = vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance({\n mtime: 0\n });\n model.points = new Float32Array(8 * 3);\n model.internalPolyData.getPoints().setData(model.points, 3);\n model.internalPolyData.getLines().setData(Uint16Array.from(OUTLINE_ARRAY)); // --------------------------------------------------------------------------\n // Generic rendering pipeline\n // --------------------------------------------------------------------------\n\n model.mapper = vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n scalarVisibility: false\n });\n model.actor = vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n\n (_model$actor$getPrope = model.actor.getProperty()).setEdgeColor.apply(_model$actor$getPrope, _toConsumableArray(model.edgeColor));\n\n model.mapper.setInputConnection(publicAPI.getOutputPort());\n model.actor.setMapper(model.mapper);\n publicAPI.addActor(model.actor); // --------------------------------------------------------------------------\n\n publicAPI.requestData = function (inData, outData) {\n var list = publicAPI.getRepresentationStates(inData[0]);\n\n if (list.length === 8) {\n var pi = 0;\n\n for (var i = 0; i < list.length; i++) {\n var pt = list[i].getOrigin();\n model.points[pi++] = pt[0];\n model.points[pi++] = pt[1];\n model.points[pi++] = pt[2];\n }\n\n model.internalPolyData.getPoints().modified();\n model.internalPolyData.modified();\n outData[0] = model.internalPolyData;\n } else {\n vtkErrorMacro('CroppingOutlineRepresentation did not get 8 states');\n }\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n edgeColor: [1, 1, 1]\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Widgets_Representations_ContextRepresentation__WEBPACK_IMPORTED_MODULE_2__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGetArray(publicAPI, model, ['edgeColor'], 3);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['mapper', 'actor']); // Object specific methods\n\n vtkCroppingOutlineRepresentation(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkCroppingOutlineRepresentation'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Representations/CroppingOutlineRepresentation/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Representations/HandleRepresentation/index.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Representations/HandleRepresentation/index.js ***! - \*******************************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n // ----------------------------------------------------------------------------\n// vtkHandleRepresentation methods\n// ----------------------------------------------------------------------------\n\nfunction vtkHandleRepresentation(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkHandleRepresentation');\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n activeScaleFactor: 1.2,\n activeColor: 1,\n useActiveColor: true,\n behavior: vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_2__[\"Behavior\"].HANDLE,\n pickable: true,\n dragable: true\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var newDefault = _objectSpread(_objectSpread({}, DEFAULT_VALUES), initialValues);\n\n vtk_js_Sources_Widgets_Representations_WidgetRepresentation__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, newDefault);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['activeScaleFactor', 'activeColor', 'useActiveColor']);\n vtkHandleRepresentation(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Representations/HandleRepresentation/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Representations/SphereHandleRepresentation/index.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Representations/SphereHandleRepresentation/index.js ***! - \*************************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Actor */ \"./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Glyph3DMapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Glyph3DMapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Glyph3DMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_HandleRepresentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/HandleRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/HandleRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js\");\n/* harmony import */ var vtk_js_Sources_Filters_Sources_SphereSource__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Filters/Sources/SphereSource */ \"./node_modules/vtk.js/Sources/Filters/Sources/SphereSource/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/Constants.js\");\n\n\n\n\n\n\n\n\n // ----------------------------------------------------------------------------\n// vtkSphereHandleRepresentation methods\n// ----------------------------------------------------------------------------\n\nfunction vtkSphereHandleRepresentation(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkSphereHandleRepresentation'); // --------------------------------------------------------------------------\n // Internal polydata dataset\n // --------------------------------------------------------------------------\n\n model.internalPolyData = vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_6__[\"default\"].newInstance({\n mtime: 0\n });\n model.internalArrays = {\n points: model.internalPolyData.getPoints(),\n scale: vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n name: 'scale',\n numberOfComponents: 1,\n empty: true\n }),\n color: vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n name: 'color',\n numberOfComponents: 1,\n empty: true\n })\n };\n model.internalPolyData.getPointData().addArray(model.internalArrays.scale);\n model.internalPolyData.getPointData().addArray(model.internalArrays.color); // --------------------------------------------------------------------------\n // Generic rendering pipeline\n // --------------------------------------------------------------------------\n\n /*\n * displayActors and displayMappers are used to render objects in HTML, allowing objects\n * to be 'rendered' internally in a VTK scene without being visible on the final output\n */\n\n model.displayMapper = vtk_js_Sources_Rendering_Core_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\n model.displayActor = vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(); // model.displayActor.getProperty().setOpacity(0); // don't show in 3D\n\n model.displayActor.setMapper(model.displayMapper);\n model.displayMapper.setInputConnection(publicAPI.getOutputPort());\n publicAPI.addActor(model.displayActor);\n model.alwaysVisibleActors = [model.displayActor];\n model.mapper = vtk_js_Sources_Rendering_Core_Glyph3DMapper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n scaleArray: 'scale',\n colorByArrayName: 'color',\n scalarMode: vtk_js_Sources_Rendering_Core_Mapper_Constants__WEBPACK_IMPORTED_MODULE_8__[\"ScalarMode\"].USE_POINT_FIELD_DATA\n });\n model.actor = vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.glyph = vtk_js_Sources_Filters_Sources_SphereSource__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance({\n phiResolution: model.glyphResolution,\n thetaResolution: model.glyphResolution\n });\n model.mapper.setInputConnection(publicAPI.getOutputPort(), 0);\n model.mapper.setInputConnection(model.glyph.getOutputPort(), 1);\n model.actor.setMapper(model.mapper);\n publicAPI.addActor(model.actor); // --------------------------------------------------------------------------\n\n publicAPI.setGlyphResolution = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.setGlyphResolution, function (r) {\n return model.glyph.setPhiResolution(r) && model.glyph.setThetaResolution(r);\n }); // --------------------------------------------------------------------------\n\n function callbackProxy(coords) {\n if (model.displayCallback) {\n var filteredList = [];\n var states = publicAPI.getRepresentationStates();\n\n for (var i = 0; i < states.length; i++) {\n if (states[i].getActive()) {\n filteredList.push(coords[i]);\n }\n }\n\n if (filteredList.length) {\n model.displayCallback(filteredList);\n return;\n }\n }\n\n model.displayCallback();\n }\n\n publicAPI.setDisplayCallback = function (callback) {\n model.displayCallback = callback;\n model.displayMapper.setCallback(callback ? callbackProxy : null);\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.requestData = function (inData, outData) {\n var _model$internalArrays = model.internalArrays,\n points = _model$internalArrays.points,\n scale = _model$internalArrays.scale,\n color = _model$internalArrays.color;\n var list = publicAPI.getRepresentationStates(inData[0]);\n var totalCount = list.length;\n\n if (color.getNumberOfValues() !== totalCount) {\n // Need to resize dataset\n points.setData(new Float32Array(3 * totalCount), 3);\n scale.setData(new Float32Array(totalCount));\n color.setData(new Float32Array(totalCount));\n }\n\n var typedArray = {\n points: points.getData(),\n scale: scale.getData(),\n color: color.getData()\n };\n\n for (var i = 0; i < list.length; i++) {\n var state = list[i];\n var isActive = state.getActive();\n var scaleFactor = isActive ? model.activeScaleFactor : 1;\n var coord = state.getOrigin();\n typedArray.points[i * 3 + 0] = coord[0];\n typedArray.points[i * 3 + 1] = coord[1];\n typedArray.points[i * 3 + 2] = coord[2];\n typedArray.scale[i] = scaleFactor * (!state.isVisible || state.isVisible() ? 1 : 0) * (state.getScale1 ? state.getScale1() : model.defaultScale);\n\n if (publicAPI.getScaleInPixels()) {\n typedArray.scale[i] *= publicAPI.getPixelWorldHeightAtCoord(coord);\n }\n\n typedArray.color[i] = model.useActiveColor && isActive ? model.activeColor : state.getColor();\n }\n\n model.internalPolyData.modified();\n outData[0] = model.internalPolyData;\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n glyphResolution: 8,\n defaultScale: 1\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Widgets_Representations_HandleRepresentation__WEBPACK_IMPORTED_MODULE_4__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['glyph', 'mapper', 'actor']); // Object specific methods\n\n vtkSphereHandleRepresentation(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkSphereHandleRepresentation'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Representations/SphereHandleRepresentation/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js ***! - \***********************************************************************************************/ -/*! exports provided: Behavior, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Behavior\", function() { return Behavior; });\nvar Behavior = {\n HANDLE: 0,\n CONTEXT: 1\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n Behavior: Behavior\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/index.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/index.js ***! - \*******************************************************************************************/ -/*! exports provided: mergeStyles, applyStyles, connectPipeline, extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeStyles\", function() { return mergeStyles; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyStyles\", function() { return applyStyles; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"connectPipeline\", function() { return connectPipeline; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Prop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Prop */ \"./node_modules/vtk.js/Sources/Rendering/Core/Prop/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper_CoincidentTopologyHelper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/CoincidentTopologyHelper.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n\nvar vtkErrorMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkErrorMacro,\n vtkWarningMacro = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].vtkWarningMacro; // ----------------------------------------------------------------------------\n\nvar STYLE_CATEGORIES = ['active', 'inactive', 'static'];\nfunction mergeStyles(elementNames) {\n for (var _len = arguments.length, stylesToMerge = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n stylesToMerge[_key - 1] = arguments[_key];\n }\n\n var newStyleObject = {\n active: {},\n inactive: {},\n static: {}\n };\n STYLE_CATEGORIES.forEach(function (category) {\n var cat = newStyleObject[category];\n elementNames.forEach(function (name) {\n if (!cat[name]) {\n cat[name] = {};\n }\n\n stylesToMerge.filter(function (s) {\n return s && s[category] && s[category][name];\n }).forEach(function (s) {\n return Object.assign(cat[name], s[category][name]);\n });\n });\n });\n return newStyleObject;\n} // ----------------------------------------------------------------------------\n\nfunction applyStyles(pipelines, styles, activeActor) {\n if (!activeActor) {\n // static\n Object.keys(styles.static).forEach(function (name) {\n if (pipelines[name]) {\n pipelines[name].actor.getProperty().set(styles.static[name]);\n }\n }); // inactive\n\n Object.keys(styles.inactive).forEach(function (name) {\n if (pipelines[name]) {\n pipelines[name].actor.getProperty().set(styles.inactive[name]);\n }\n });\n } else {\n Object.keys(pipelines).forEach(function (name) {\n var style = pipelines[name].actor === activeActor ? styles.active[name] : styles.inactive[name];\n\n if (style) {\n pipelines[name].actor.getProperty().set(style);\n }\n });\n }\n} // ----------------------------------------------------------------------------\n\nfunction connectPipeline(pipeline) {\n if (pipeline.source.isA('vtkDataSet')) {\n pipeline.mapper.setInputData(pipeline.source);\n } else {\n pipeline.mapper.setInputConnection(pipeline.source.getOutputPort());\n }\n\n if (pipeline.glyph) {\n pipeline.mapper.setInputConnection(pipeline.glyph.getOutputPort(), 1);\n }\n\n pipeline.actor.setMapper(pipeline.mapper);\n} // ----------------------------------------------------------------------------\n// vtkWidgetRepresentation\n// ----------------------------------------------------------------------------\n\nfunction vtkWidgetRepresentation(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkWidgetRepresentation'); // Internal cache\n\n var cache = {\n mtimes: {},\n states: []\n }; // --------------------------------------------------------------------------\n\n publicAPI.getActors = function () {\n return model.actors;\n };\n\n publicAPI.getNestedProps = publicAPI.getActors; // --------------------------------------------------------------------------\n\n publicAPI.setLabels = function () {\n for (var _len2 = arguments.length, labels = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n labels[_key2] = arguments[_key2];\n }\n\n if (labels.length === 1) {\n model.labels = [].concat(labels[0]);\n } else {\n model.labels = labels;\n }\n\n publicAPI.modified();\n };\n\n publicAPI.getRepresentationStates = function () {\n var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : model.inputData[0];\n\n if (cache.mtimes.representation === publicAPI.getMTime() && cache.mtimes.input === input.getMTime()) {\n return cache.states;\n } // Reinitialize cache\n\n\n cache.mtimes.representation = publicAPI.getMTime();\n cache.mtimes.input = input.getMTime();\n cache.states = []; // Fill states that are going to be used in the representation\n\n model.labels.forEach(function (name) {\n cache.states = cache.states.concat(input.getStatesWithLabel(name) || []);\n });\n return cache.states;\n };\n\n publicAPI.getSelectedState = function (prop, compositeID) {\n var representationStates = publicAPI.getRepresentationStates();\n\n if (compositeID < representationStates.length) {\n return representationStates[compositeID];\n }\n\n vtkErrorMacro(\"Representation \".concat(publicAPI.getClassName(), \" should implement getSelectedState(prop, compositeID) method.\"));\n return null;\n };\n\n publicAPI.updateActorVisibility = function () {\n var renderingType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"RenderingTypes\"].FRONT_BUFFER;\n var widgetVisible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var ctxVisible = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var handleVisible = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var otherFlag = true;\n\n switch (model.behavior) {\n case vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_3__[\"Behavior\"].HANDLE:\n otherFlag = renderingType === vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"RenderingTypes\"].PICKING_BUFFER || handleVisible;\n break;\n\n case vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_3__[\"Behavior\"].CONTEXT:\n otherFlag = renderingType === vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_4__[\"RenderingTypes\"].FRONT_BUFFER && ctxVisible;\n break;\n\n default:\n otherFlag = true;\n break;\n }\n\n var visibilityFlag = widgetVisible && otherFlag;\n\n for (var i = 0; i < model.actors.length; i++) {\n if (model.visibilityFlagArray) {\n model.actors[i].setVisibility(visibilityFlag && model.visibilityFlagArray[i]);\n } else {\n model.actors[i].setVisibility(visibilityFlag);\n }\n }\n\n if (model.alwaysVisibleActors) {\n for (var _i = 0; _i < model.alwaysVisibleActors.length; _i++) {\n model.alwaysVisibleActors[_i].setVisibility(true);\n }\n }\n };\n\n function applyCoincidentTopologyParametersToMapper(mapper, parameters) {\n if (mapper && mapper.setResolveCoincidentTopologyToPolygonOffset) {\n mapper.setResolveCoincidentTopologyToPolygonOffset();\n vtk_js_Sources_Rendering_Core_Mapper_CoincidentTopologyHelper__WEBPACK_IMPORTED_MODULE_5__[\"CATEGORIES\"].forEach(function (category) {\n if (parameters[category]) {\n var methodName = \"setRelativeCoincidentTopology\".concat(category, \"OffsetParameters\");\n\n if (mapper[methodName]) {\n var _parameters$category = parameters[category],\n factor = _parameters$category.factor,\n offset = _parameters$category.offset;\n mapper[methodName](factor, offset);\n }\n }\n });\n }\n } // Add warning to model.actors.push\n\n\n model.actors.push = function () {\n vtkWarningMacro('You should use publicAPI.addActor() to initialize the actor properly');\n\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n args.forEach(function (actor) {\n return publicAPI.addActor(actor);\n });\n };\n\n publicAPI.addActor = function (actor) {\n applyCoincidentTopologyParametersToMapper(actor.getMapper(), model.coincidentTopologyParameters);\n Array.prototype.push.apply(model.actors, [actor]);\n };\n\n publicAPI.setCoincidentTopologyParameters = function (parameters) {\n model.coincidentTopologyParameters = parameters;\n publicAPI.getActors().forEach(function (actor) {\n applyCoincidentTopologyParametersToMapper(actor.getMapper(), model.coincidentTopologyParameters);\n });\n };\n\n publicAPI.getPixelWorldHeightAtCoord = function (worldCoord) {\n var _model$displayScalePa = model.displayScaleParams,\n dispHeightFactor = _model$displayScalePa.dispHeightFactor,\n cameraPosition = _model$displayScalePa.cameraPosition,\n cameraDir = _model$displayScalePa.cameraDir,\n isParallel = _model$displayScalePa.isParallel,\n rendererPixelDims = _model$displayScalePa.rendererPixelDims;\n var scale = 1;\n\n if (isParallel) {\n scale = dispHeightFactor;\n } else {\n var worldCoordToCamera = _toConsumableArray(worldCoord);\n\n Object(vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"subtract\"])(worldCoordToCamera, cameraPosition, worldCoordToCamera);\n scale = Object(vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"dot\"])(worldCoordToCamera, cameraDir) * dispHeightFactor;\n }\n\n var rHeight = rendererPixelDims[1];\n return scale / rHeight;\n }; // Make sure setting the labels at build time works with string/array...\n\n\n publicAPI.setLabels(model.labels);\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {\n actors: [],\n labels: [],\n behavior: vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_3__[\"Behavior\"].CONTEXT,\n coincidentTopologyParameters: {\n Point: {\n factor: -1.0,\n offset: -1.0\n },\n Line: {\n factor: -1.0,\n offset: -1.0\n },\n Polygon: {\n factor: -1.0,\n offset: -1.0\n }\n },\n scaleInPixels: false,\n displayScaleParams: {\n dispHeightFactor: 1,\n cameraPosition: [0, 0, 0],\n cameraDir: [1, 0, 0],\n isParallel: false,\n rendererPixelDims: [1, 1]\n }\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods\n\n vtk_js_Sources_Rendering_Core_Prop__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].algo(publicAPI, model, 1, 1);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, ['labels', 'coincidentTopologyParameters']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].set(publicAPI, model, ['displayScaleParams']);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['scaleInPixels']); // Object specific methods\n\n vtkWidgetRepresentation(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend,\n mergeStyles: mergeStyles,\n applyStyles: applyStyles,\n connectPipeline: connectPipeline\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/SVG/SVGRepresentation/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/SVG/SVGRepresentation/index.js ***! - \****************************************************************************/ -/*! exports provided: extend, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PolyData */ \"./node_modules/vtk.js/Sources/Common/DataModel/PolyData/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Actor */ \"./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Representations/WidgetRepresentation/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js\");\n\n\n\n\n\n\n\nvar SVG_XMLNS = 'http://www.w3.org/2000/svg'; // ----------------------------------------------------------------------------\n\nfunction createSvgElement(tag) {\n return {\n name: tag,\n attrs: {},\n eventListeners: {},\n // implies no children if set\n textContent: null,\n children: [],\n setAttribute: function setAttribute(attr, val) {\n this.attrs[attr] = val;\n },\n removeAttribute: function removeAttribute(attr) {\n delete this.attrs[attr];\n },\n appendChild: function appendChild(n) {\n this.children.push(n);\n },\n addEventListeners: function addEventListeners(event, callback) {\n this.eventListeners[event] = callback;\n }\n };\n} // ----------------------------------------------------------------------------\n\n\nfunction createSvgDomElement(tag) {\n return document.createElementNS(SVG_XMLNS, tag);\n} // ----------------------------------------------------------------------------\n\n\nfunction defer() {\n var resolve;\n var reject;\n var promise = new Promise(function (res, rej) {\n resolve = res;\n reject = rej;\n });\n return {\n promise: promise,\n resolve: resolve,\n reject: reject\n };\n} // ----------------------------------------------------------------------------\n// vtkSVGRepresentation\n// ----------------------------------------------------------------------------\n\n\nfunction vtkSVGRepresentation(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkSVGRepresentation');\n var deferred = null;\n model.psActor = vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n pickable: false\n });\n model.psMapper = vtk_js_Sources_Rendering_Core_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.points = vtk_js_Sources_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n model.psMapper.setInputData(model.points);\n model.psActor.setMapper(model.psMapper);\n model.psMapper.setCallback(function () {\n if (deferred) {\n var d = deferred;\n deferred = null;\n d.resolve({\n coords: arguments.length <= 0 ? undefined : arguments[0],\n camera: arguments.length <= 1 ? undefined : arguments[1],\n aspect: arguments.length <= 2 ? undefined : arguments[2],\n depthValues: arguments.length <= 3 ? undefined : arguments[3],\n windowSize: arguments.length <= 4 ? undefined : arguments[4]\n });\n }\n });\n publicAPI.addActor(model.psActor); // --------------------------------------------------------------------------\n\n publicAPI.worldPointsToPixelSpace = function (points3d) {\n var pts = new Float32Array(points3d.length * 3);\n\n for (var i = 0; i < points3d.length; i++) {\n pts[i * 3 + 0] = points3d[i][0];\n pts[i * 3 + 1] = points3d[i][1];\n pts[i * 3 + 2] = points3d[i][2];\n }\n\n model.points.getPoints().setData(pts);\n model.points.modified();\n deferred = defer();\n return deferred.promise;\n };\n\n publicAPI.createListenableSvgElement = function (tag, id) {\n var element = createSvgElement(tag);\n\n if (model.pickable) {\n element.addEventListeners('mouseenter', function () {\n publicAPI.setHover(id);\n });\n element.addEventListeners('mouseleave', function () {\n if (publicAPI.getHover() === id) {\n publicAPI.setHover(null);\n }\n });\n }\n\n return element;\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.updateActorVisibility = function () {\n var renderingType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_6__[\"RenderingTypes\"].FRONT_BUFFER;\n var widgetVisible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var ctxVisible = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var handleVisible = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n\n if (model.behavior === vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_5__[\"Behavior\"].CONTEXT) {\n publicAPI.setVisibility(widgetVisible && ctxVisible);\n } else if (model.behavior === vtk_js_Sources_Widgets_Representations_WidgetRepresentation_Constants__WEBPACK_IMPORTED_MODULE_5__[\"Behavior\"].HANDLE) {\n publicAPI.setVisibility(widgetVisible && handleVisible);\n }\n }; // --------------------------------------------------------------------------\n // Subclasses must implement this method\n\n\n publicAPI.render = function () {\n throw new Error('Not implemented');\n };\n} // ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\n/**\n * 'hover' is not null when a pickable SVG element is mouse hovered.\n */\n\n\nvar DEFAULT_VALUES = {\n visibility: true\n}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues); // Extend methods\n\n vtk_js_Sources_Widgets_Representations_WidgetRepresentation__WEBPACK_IMPORTED_MODULE_4__[\"default\"].extend(publicAPI, model, initialValues);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, ['visibility', 'hover']); // Object specific methods\n\n vtkSVGRepresentation(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n extend: extend,\n createSvgElement: createSvgElement,\n createSvgDomElement: createSvgDomElement\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/SVG/SVGRepresentation/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/behavior.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/behavior.js ***! - \***************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return widgetBehavior; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers */ \"./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers.js\");\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\nfunction widgetBehavior(publicAPI, model) {\n var isDragging = null;\n\n publicAPI.setDisplayCallback = function (callback) {\n return model.representations[0].setDisplayCallback(callback);\n };\n\n publicAPI.handleLeftButtonPress = function () {\n if (!model.activeState || !model.activeState.getActive() || !model.pickable) {\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].VOID;\n }\n\n isDragging = true;\n model.interactor.requestAnimation(publicAPI);\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENT_ABORT;\n };\n\n publicAPI.handleMouseMove = function (callData) {\n if (isDragging && model.pickable && model.dragable) {\n return publicAPI.handleEvent(callData);\n }\n\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].VOID;\n };\n\n publicAPI.handleLeftButtonRelease = function () {\n if (isDragging && model.pickable) {\n isDragging = false;\n model.interactor.cancelAnimation(publicAPI);\n model.widgetState.deactivate();\n }\n };\n\n publicAPI.handleEvent = function (callData) {\n if (model.pickable && model.activeState && model.activeState.getActive()) {\n var manipulator = model.activeState.getManipulator();\n\n if (manipulator) {\n var name = model.activeState.getName();\n var type = Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"handleTypeFromName\"])(name);\n var index = name.split('').map(function (l) {\n return vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"AXES\"].indexOf(l);\n });\n var planes = model.widgetState.getCroppingPlanes().getPlanes();\n var indexToWorldT = model.widgetState.getIndexToWorldT();\n var worldCoords = [];\n\n if (type === 'corners') {\n // manipulator should be a plane manipulator\n manipulator.setNormal(model.camera.getDirectionOfProjection());\n worldCoords = manipulator.handleEvent(callData, model.apiSpecificRenderWindow);\n }\n\n if (type === 'faces') {\n // constraint axis is line defined by the index and center point.\n // Since our index point is defined inside a box [0, 2, 0, 2, 0, 2],\n // center point is [1, 1, 1].\n var constraintAxis = [1 - index[0], 1 - index[1], 1 - index[2]]; // get center of current crop box\n\n var center = [(planes[0] + planes[1]) / 2, (planes[2] + planes[3]) / 2, (planes[4] + planes[5]) / 2]; // manipulator should be a line manipulator\n\n manipulator.setOrigin(Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"transformVec3\"])(center, indexToWorldT));\n manipulator.setNormal(Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"transformVec3\"])(constraintAxis, indexToWorldT));\n worldCoords = manipulator.handleEvent(callData, model.apiSpecificRenderWindow);\n }\n\n if (type === 'edges') {\n // constrain to a plane with a normal parallel to the edge\n var edgeAxis = index.map(function (a) {\n return a === 1 ? a : 0;\n });\n manipulator.setNormal(Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"transformVec3\"])(edgeAxis, indexToWorldT));\n worldCoords = manipulator.handleEvent(callData, model.apiSpecificRenderWindow);\n }\n\n if (worldCoords.length) {\n var _model$activeState, _model$widgetState$ge;\n\n // transform worldCoords to indexCoords, and then update the croppingPlanes() state with setPlanes().\n var worldToIndexT = model.widgetState.getWorldToIndexT();\n var indexCoords = Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"transformVec3\"])(worldCoords, worldToIndexT);\n\n for (var i = 0; i < 3; i++) {\n if (index[i] === 0) {\n planes[i * 2] = indexCoords[i];\n } else if (index[i] === 2) {\n planes[i * 2 + 1] = indexCoords[i];\n }\n }\n\n (_model$activeState = model.activeState).setOrigin.apply(_model$activeState, _toConsumableArray(worldCoords));\n\n (_model$widgetState$ge = model.widgetState.getCroppingPlanes()).setPlanes.apply(_model$widgetState$ge, _toConsumableArray(planes));\n\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EVENT_ABORT;\n }\n }\n }\n\n return vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].VOID;\n }; // --------------------------------------------------------------------------\n // initialization\n // --------------------------------------------------------------------------\n\n\n model.camera = model.renderer.getActiveCamera();\n model.classHierarchy.push('vtkImageCroppingWidgetProp');\n}\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/behavior.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers.js ***! - \**************************************************************************************/ -/*! exports provided: AXES, transformVec3, handleTypeFromName */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AXES\", function() { return AXES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformVec3\", function() { return transformVec3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"handleTypeFromName\", function() { return handleTypeFromName; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n // Labels used to encode handle position in the handle state's name property\n\nvar AXES = ['-', '=', '+']; // ----------------------------------------------------------------------------\n\nfunction transformVec3(ain, transform) {\n var vout = new Float64Array(3);\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat4(vout, ain, transform);\n return vout;\n} // ----------------------------------------------------------------------------\n\nfunction handleTypeFromName(name) {\n var _name$split$map = name.split('').map(function (l) {\n return AXES.indexOf(l) - 1;\n }),\n _name$split$map2 = _slicedToArray(_name$split$map, 3),\n i = _name$split$map2[0],\n j = _name$split$map2[1],\n k = _name$split$map2[2];\n\n if (i * j * k !== 0) {\n return 'corners';\n }\n\n if (i * j !== 0 || j * k !== 0 || k * i !== 0) {\n return 'edges';\n }\n\n return 'faces';\n}\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/index.js": -/*!************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/index.js ***! - \************************************************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_AbstractWidgetFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/AbstractWidgetFactory */ \"./node_modules/vtk.js/Sources/Widgets/Core/AbstractWidgetFactory/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Manipulators_PlaneManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Manipulators/PlaneManipulator */ \"./node_modules/vtk.js/Sources/Widgets/Manipulators/PlaneManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Manipulators_LineManipulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Manipulators/LineManipulator */ \"./node_modules/vtk.js/Sources/Widgets/Manipulators/LineManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_SphereHandleRepresentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/SphereHandleRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/SphereHandleRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Representations_CroppingOutlineRepresentation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Representations/CroppingOutlineRepresentation */ \"./node_modules/vtk.js/Sources/Widgets/Representations/CroppingOutlineRepresentation/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_behavior__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/behavior */ \"./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/behavior.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_state__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/state */ \"./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/state.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers */ \"./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager/Constants */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/Constants.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n\n\n\n\n // ----------------------------------------------------------------------------\n// ----------------------------------------------------------------------------\n// Factory\n// ----------------------------------------------------------------------------\n\nfunction vtkImageCroppingWidget(publicAPI, model) {\n model.classHierarchy.push('vtkImageCroppingWidget');\n var stateSub = null; // --------------------------------------------------------------------------\n\n function setHandlesEnabled(label, flag) {\n model.widgetState.getStatesWithLabel(label).forEach(function (handle) {\n handle.setVisible(flag);\n });\n } // Set the visibility of the three classes of handles: face, edge, corner\n\n\n publicAPI.setFaceHandlesEnabled = function (flag) {\n return setHandlesEnabled('faces', flag);\n };\n\n publicAPI.setEdgeHandlesEnabled = function (flag) {\n return setHandlesEnabled('edges', flag);\n };\n\n publicAPI.setCornerHandlesEnabled = function (flag) {\n return setHandlesEnabled('corners', flag);\n }; // --------------------------------------------------------------------------\n // Copies the transforms and dimension of a vtkImageData\n\n\n publicAPI.copyImageDataDescription = function (im) {\n var _model$widgetState, _model$widgetState2;\n\n (_model$widgetState = model.widgetState).setIndexToWorldT.apply(_model$widgetState, _toConsumableArray(im.getIndexToWorld()));\n\n (_model$widgetState2 = model.widgetState).setWorldToIndexT.apply(_model$widgetState2, _toConsumableArray(im.getWorldToIndex()));\n\n var dims = im.getDimensions();\n var planeState = model.widgetState.getCroppingPlanes();\n planeState.setPlanes([0, dims[0], 0, dims[1], 0, dims[2]]);\n publicAPI.modified();\n }; // --------------------------------------------------------------------------\n // Updates handle positions based on cropping planes\n\n\n publicAPI.updateHandles = function () {\n var planes = model.widgetState.getCroppingPlanes().getPlanes();\n var midpts = [(planes[0] + planes[1]) / 2, (planes[2] + planes[3]) / 2, (planes[4] + planes[5]) / 2];\n var iAxis = [planes[0], midpts[0], planes[1]];\n var jAxis = [planes[2], midpts[1], planes[3]];\n var kAxis = [planes[4], midpts[2], planes[5]];\n var indexToWorldT = model.widgetState.getIndexToWorldT();\n\n var getAxis = function getAxis(a) {\n return vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_8__[\"AXES\"][a];\n };\n\n for (var i = 0; i < 3; i++) {\n for (var j = 0; j < 3; j++) {\n for (var k = 0; k < 3; k++) {\n // skip center of box\n if (i !== 1 || j !== 1 || k !== 1) {\n var name = [i, j, k].map(getAxis).join('');\n var coord = Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_8__[\"transformVec3\"])([iAxis[i], jAxis[j], kAxis[k]], indexToWorldT);\n\n var _model$widgetState$ge = model.widgetState.getStatesWithLabel(name),\n _model$widgetState$ge2 = _slicedToArray(_model$widgetState$ge, 1),\n handle = _model$widgetState$ge2[0];\n\n handle.setOrigin.apply(handle, _toConsumableArray(coord));\n }\n }\n }\n }\n }; // --------------------------------------------------------------------------\n\n\n publicAPI.delete = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.delete, function () {\n if (stateSub) {\n stateSub.unsubscribe();\n }\n }); // --- Widget Requirement ---------------------------------------------------\n\n model.behavior = vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_behavior__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n model.widgetState = Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_state__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(); // Given a view type (geometry, slice, volume), return a description\n // of what representations to create and what widget state to pass\n // to the respective representations.\n\n publicAPI.getRepresentationsForViewType = function (viewType) {\n switch (viewType) {\n case vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_9__[\"ViewTypes\"].DEFAULT:\n case vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_9__[\"ViewTypes\"].GEOMETRY:\n case vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_9__[\"ViewTypes\"].SLICE:\n case vtk_js_Sources_Widgets_Core_WidgetManager_Constants__WEBPACK_IMPORTED_MODULE_9__[\"ViewTypes\"].VOLUME:\n default:\n return [// Describes constructing a vtkSphereHandleRepresentation, and every\n // time the widget state updates, we will give the representation\n // a list of all handle states (which have the label \"handles\").\n {\n builder: vtk_js_Sources_Widgets_Representations_SphereHandleRepresentation__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n labels: ['handles']\n }, {\n builder: vtk_js_Sources_Widgets_Representations_CroppingOutlineRepresentation__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n // outline is defined by corner points\n labels: ['corners']\n }];\n }\n }; // Update handle positions when cropping planes update\n\n\n stateSub = model.widgetState.getCroppingPlanes().onModified(publicAPI.updateHandles); // Add manipulators to our widgets.\n\n var planeManipulator = vtk_js_Sources_Widgets_Manipulators_PlaneManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\n var lineManipulator = vtk_js_Sources_Widgets_Manipulators_LineManipulator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n model.widgetState.getStatesWithLabel('corners').forEach(function (handle) {\n return handle.setManipulator(planeManipulator);\n });\n model.widgetState.getStatesWithLabel('edges').forEach(function (handle) {\n return handle.setManipulator(planeManipulator);\n });\n model.widgetState.getStatesWithLabel('faces').forEach(function (handle) {\n return handle.setManipulator(lineManipulator);\n });\n} // ----------------------------------------------------------------------------\n\n\nvar DEFAULT_VALUES = {}; // ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model) {\n var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Object.assign(model, DEFAULT_VALUES, initialValues);\n vtk_js_Sources_Widgets_Core_AbstractWidgetFactory__WEBPACK_IMPORTED_MODULE_1__[\"default\"].extend(publicAPI, model, initialValues);\n vtkImageCroppingWidget(publicAPI, model);\n} // ----------------------------------------------------------------------------\n\nvar newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(extend, 'vtkImageCroppingWidget'); // ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n newInstance: newInstance,\n extend: extend\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/index.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/state.js": -/*!************************************************************************************!*\ - !*** ./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/state.js ***! - \************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vtk_js_Sources_Widgets_Core_StateBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/StateBuilder */ \"./node_modules/vtk.js/Sources/Widgets/Core/StateBuilder/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers */ \"./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/helpers.js\");\n\n // create our state builder\n\nvar builder = vtk_js_Sources_Widgets_Core_StateBuilder__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createBuilder(); // add image data description fields\n\nbuilder.addField({\n name: 'indexToWorldT',\n initialValue: Array(16).fill(0)\n}).addField({\n name: 'worldToIndexT',\n initialValue: Array(16).fill(0)\n}); // make cropping planes a sub-state so we can listen to it\n// separately from the rest of the widget state.\n\nvar croppingState = vtk_js_Sources_Widgets_Core_StateBuilder__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createBuilder().addField({\n name: 'planes',\n // index space\n initialValue: [0, 1, 0, 1, 0, 1]\n}).build(); // add cropping planes state to our primary state\n\nbuilder.addStateFromInstance({\n labels: ['croppingPlanes'],\n name: 'croppingPlanes',\n instance: croppingState\n}); // add all handle states\n// default bounds is [-1, 1] in all dimensions\n\nfor (var i = -1; i < 2; i++) {\n for (var j = -1; j < 2; j++) {\n for (var k = -1; k < 2; k++) {\n // skip center of box\n if (i !== 0 || j !== 0 || k !== 0) {\n var name = vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"AXES\"][i + 1] + vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"AXES\"][j + 1] + vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"AXES\"][k + 1];\n var type = Object(vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget_helpers__WEBPACK_IMPORTED_MODULE_1__[\"handleTypeFromName\"])(name); // since handle states are rendered via vtkSphereHandleRepresentation,\n // we can dictate the handle origin, size (scale1), color, and visibility.\n\n builder.addStateFromMixin({\n labels: ['handles', name, type],\n mixins: ['name', 'origin', 'color', 'scale1', 'visible', 'manipulator'],\n name: name,\n initialValues: {\n scale1: 10,\n origin: [i, j, k],\n visible: true,\n name: name\n }\n });\n }\n }\n }\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function () {\n return builder.build();\n});\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/state.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/macro.js": -/*!**********************************************!*\ - !*** ./node_modules/vtk.js/Sources/macro.js ***! - \**********************************************/ -/*! exports provided: VOID, setLoggerFunction, vtkLogMacro, vtkInfoMacro, vtkDebugMacro, vtkErrorMacro, vtkWarningMacro, vtkOnceErrorMacro, TYPED_ARRAYS, newTypedArray, newTypedArrayFrom, capitalize, uncapitalize, formatBytesToProperUnit, formatNumbersWithThousandSeparator, setImmediateVTK, obj, get, set, setGet, getArray, setArray, setGetArray, algo, EVENT_ABORT, event, newInstance, chain, isVtkObject, traverseInstanceTree, debounce, throttle, keystore, proxy, proxyPropertyMapping, proxyPropertyState, normalizeWheel, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VOID\", function() { return VOID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setLoggerFunction\", function() { return setLoggerFunction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkLogMacro\", function() { return vtkLogMacro; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkInfoMacro\", function() { return vtkInfoMacro; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkDebugMacro\", function() { return vtkDebugMacro; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkErrorMacro\", function() { return vtkErrorMacro; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkWarningMacro\", function() { return vtkWarningMacro; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vtkOnceErrorMacro\", function() { return vtkOnceErrorMacro; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TYPED_ARRAYS\", function() { return TYPED_ARRAYS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newTypedArray\", function() { return newTypedArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newTypedArrayFrom\", function() { return newTypedArrayFrom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"capitalize\", function() { return capitalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"uncapitalize\", function() { return uncapitalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"formatBytesToProperUnit\", function() { return formatBytesToProperUnit; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"formatNumbersWithThousandSeparator\", function() { return formatNumbersWithThousandSeparator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setImmediateVTK\", function() { return setImmediateVTK; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"obj\", function() { return obj; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setGet\", function() { return setGet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getArray\", function() { return getArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setArray\", function() { return setArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setGetArray\", function() { return setGetArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"algo\", function() { return algo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EVENT_ABORT\", function() { return EVENT_ABORT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"event\", function() { return event; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"chain\", function() { return chain; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isVtkObject\", function() { return isVtkObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"traverseInstanceTree\", function() { return traverseInstanceTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"debounce\", function() { return debounce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"throttle\", function() { return throttle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keystore\", function() { return keystore; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"proxy\", function() { return proxy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"proxyPropertyMapping\", function() { return proxyPropertyMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"proxyPropertyState\", function() { return proxyPropertyState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalizeWheel\", function() { return normalizeWheel; });\n/* harmony import */ var _vtk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vtk */ \"./node_modules/vtk.js/Sources/vtk.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _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.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n\nvar globalMTime = 0;\nvar VOID = Symbol('void');\n\nfunction getCurrentGlobalMTime() {\n return globalMTime;\n} // ----------------------------------------------------------------------------\n// Logging function calls\n// ----------------------------------------------------------------------------\n\n/* eslint-disable no-prototype-builtins */\n\n\nvar fakeConsole = {};\n\nfunction noOp() {}\n\nvar consoleMethods = ['log', 'debug', 'info', 'warn', 'error', 'time', 'timeEnd', 'group', 'groupEnd'];\nconsoleMethods.forEach(function (methodName) {\n fakeConsole[methodName] = noOp;\n});\nglobal.console = console.hasOwnProperty('log') ? console : fakeConsole;\nvar loggerFunctions = {\n debug: noOp,\n // Don't print debug by default\n error: global.console.error || noOp,\n info: global.console.info || noOp,\n log: global.console.log || noOp,\n warn: global.console.warn || noOp\n};\nfunction setLoggerFunction(name, fn) {\n if (loggerFunctions[name]) {\n loggerFunctions[name] = fn || noOp;\n }\n}\nfunction vtkLogMacro() {\n loggerFunctions.log.apply(loggerFunctions, arguments);\n}\nfunction vtkInfoMacro() {\n loggerFunctions.info.apply(loggerFunctions, arguments);\n}\nfunction vtkDebugMacro() {\n loggerFunctions.debug.apply(loggerFunctions, arguments);\n}\nfunction vtkErrorMacro() {\n loggerFunctions.error.apply(loggerFunctions, arguments);\n}\nfunction vtkWarningMacro() {\n loggerFunctions.warn.apply(loggerFunctions, arguments);\n}\nvar ERROR_ONCE_MAP = {};\nfunction vtkOnceErrorMacro(str) {\n if (!ERROR_ONCE_MAP[str]) {\n loggerFunctions.error(str);\n ERROR_ONCE_MAP[str] = true;\n }\n} // ----------------------------------------------------------------------------\n// TypedArray\n// ----------------------------------------------------------------------------\n\nvar TYPED_ARRAYS = Object.create(null);\nTYPED_ARRAYS.Float32Array = Float32Array;\nTYPED_ARRAYS.Float64Array = Float64Array;\nTYPED_ARRAYS.Uint8Array = Uint8Array;\nTYPED_ARRAYS.Int8Array = Int8Array;\nTYPED_ARRAYS.Uint16Array = Uint16Array;\nTYPED_ARRAYS.Int16Array = Int16Array;\nTYPED_ARRAYS.Uint32Array = Uint32Array;\nTYPED_ARRAYS.Int32Array = Int32Array;\nTYPED_ARRAYS.Uint8ClampedArray = Uint8ClampedArray; // TYPED_ARRAYS.BigInt64Array = BigInt64Array;\n// TYPED_ARRAYS.BigUint64Array = BigUint64Array;\n\nfunction newTypedArray(type) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return _construct(TYPED_ARRAYS[type] || Float64Array, args);\n}\nfunction newTypedArrayFrom(type) {\n var _ref;\n\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return (_ref = TYPED_ARRAYS[type] || Float64Array).from.apply(_ref, args);\n} // ----------------------------------------------------------------------------\n// capitilze provided string\n// ----------------------------------------------------------------------------\n\nfunction capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nfunction uncapitalize(str) {\n return str.charAt(0).toLowerCase() + str.slice(1);\n} // ----------------------------------------------------------------------------\n// Convert byte size into a well formatted string\n// ----------------------------------------------------------------------------\n\nfunction formatBytesToProperUnit(size) {\n var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n var chunkSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;\n var units = ['TB', 'GB', 'MB', 'KB'];\n var value = Number(size);\n var currentUnit = 'B';\n\n while (value > chunkSize) {\n value /= chunkSize;\n currentUnit = units.pop();\n }\n\n return \"\".concat(value.toFixed(precision), \" \").concat(currentUnit);\n} // ----------------------------------------------------------------------------\n// Convert thousand number with proper separator\n// ----------------------------------------------------------------------------\n\nfunction formatNumbersWithThousandSeparator(n) {\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';\n var sections = [];\n var size = n;\n\n while (size > 1000) {\n sections.push(\"000\".concat(size % 1000).slice(-3));\n size = Math.floor(size / 1000);\n }\n\n if (size > 0) {\n sections.push(size);\n }\n\n sections.reverse();\n return sections.join(separator);\n} // ----------------------------------------------------------------------------\n// Array helper\n// ----------------------------------------------------------------------------\n\nfunction safeArrays(model) {\n Object.keys(model).forEach(function (key) {\n if (Array.isArray(model[key])) {\n model[key] = [].concat(model[key]);\n }\n });\n} // ----------------------------------------------------------------------------\n// shallow equals\n// ----------------------------------------------------------------------------\n\n\nfunction shallowEquals(a, b) {\n if (a === b) {\n return true;\n }\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n} // ----------------------------------------------------------------------------\n\n\nfunction enumToString(e, value) {\n return Object.keys(e).find(function (key) {\n return e[key] === value;\n });\n}\n\nfunction getStateArrayMapFunc(item) {\n if (item.isA) {\n return item.getState();\n }\n\n return item;\n} // ----------------------------------------------------------------------------\n// setImmediate\n// ----------------------------------------------------------------------------\n\n\nfunction setImmediateVTK(fn) {\n setTimeout(fn, 0);\n} // ----------------------------------------------------------------------------\n// vtkObject: modified(), onModified(callback), delete()\n// ----------------------------------------------------------------------------\n\nfunction obj() {\n var publicAPI = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var model = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n // Ensure each instance as a unique ref of array\n safeArrays(model);\n var callbacks = [];\n\n if (!Number.isInteger(model.mtime)) {\n model.mtime = ++globalMTime;\n }\n\n model.classHierarchy = ['vtkObject'];\n\n function off(index) {\n callbacks[index] = null;\n }\n\n function on(index) {\n function unsubscribe() {\n off(index);\n }\n\n return Object.freeze({\n unsubscribe: unsubscribe\n });\n }\n\n publicAPI.isDeleted = function () {\n return !!model.deleted;\n };\n\n publicAPI.modified = function (otherMTime) {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n\n if (otherMTime && otherMTime < publicAPI.getMTime()) {\n return;\n }\n\n model.mtime = ++globalMTime;\n callbacks.forEach(function (callback) {\n return callback && callback(publicAPI);\n });\n };\n\n publicAPI.onModified = function (callback) {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return null;\n }\n\n var index = callbacks.length;\n callbacks.push(callback);\n return on(index);\n };\n\n publicAPI.getMTime = function () {\n return model.mtime;\n };\n\n publicAPI.isA = function (className) {\n var count = model.classHierarchy.length; // we go backwards as that is more likely for\n // early termination\n\n while (count--) {\n if (model.classHierarchy[count] === className) {\n return true;\n }\n }\n\n return false;\n };\n\n publicAPI.getClassName = function () {\n var depth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n return model.classHierarchy[model.classHierarchy.length - 1 - depth];\n };\n\n publicAPI.set = function () {\n var map = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var noWarning = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var noFunction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var ret = false;\n Object.keys(map).forEach(function (name) {\n var fn = noFunction ? null : publicAPI[\"set\".concat(capitalize(name))];\n\n if (fn && Array.isArray(map[name]) && fn.length > 1) {\n ret = fn.apply(void 0, _toConsumableArray(map[name])) || ret;\n } else if (fn) {\n ret = fn(map[name]) || ret;\n } else {\n // Set data on model directly\n if (['mtime'].indexOf(name) === -1 && !noWarning) {\n vtkWarningMacro(\"Warning: Set value to model directly \".concat(name, \", \").concat(map[name]));\n }\n\n model[name] = map[name];\n ret = true;\n }\n });\n return ret;\n };\n\n publicAPI.get = function () {\n for (var _len3 = arguments.length, list = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n list[_key3] = arguments[_key3];\n }\n\n if (!list.length) {\n return model;\n }\n\n var subset = {};\n list.forEach(function (name) {\n subset[name] = model[name];\n });\n return subset;\n };\n\n publicAPI.getReferenceByName = function (val) {\n return model[val];\n };\n\n publicAPI.delete = function () {\n Object.keys(model).forEach(function (field) {\n return delete model[field];\n });\n callbacks.forEach(function (el, index) {\n return off(index);\n }); // Flag the instance being deleted\n\n model.deleted = true;\n }; // Add serialization support\n\n\n publicAPI.getState = function () {\n var jsonArchive = _objectSpread(_objectSpread({}, model), {}, {\n vtkClass: publicAPI.getClassName()\n }); // Convert every vtkObject to its serializable form\n\n\n Object.keys(jsonArchive).forEach(function (keyName) {\n if (jsonArchive[keyName] === null || jsonArchive[keyName] === undefined || keyName[0] === '_' // protected members start with _\n ) {\n delete jsonArchive[keyName];\n } else if (jsonArchive[keyName].isA) {\n jsonArchive[keyName] = jsonArchive[keyName].getState();\n } else if (Array.isArray(jsonArchive[keyName])) {\n jsonArchive[keyName] = jsonArchive[keyName].map(getStateArrayMapFunc);\n }\n }); // Sort resulting object by key name\n\n var sortedObj = {};\n Object.keys(jsonArchive).sort().forEach(function (name) {\n sortedObj[name] = jsonArchive[name];\n }); // Remove mtime\n\n if (sortedObj.mtime) {\n delete sortedObj.mtime;\n }\n\n return sortedObj;\n }; // Add shallowCopy(otherInstance) support\n\n\n publicAPI.shallowCopy = function (other) {\n var debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (other.getClassName() !== publicAPI.getClassName()) {\n throw new Error(\"Cannot ShallowCopy \".concat(other.getClassName(), \" into \").concat(publicAPI.getClassName()));\n }\n\n var otherModel = other.get();\n var keyList = Object.keys(model).sort();\n var otherKeyList = Object.keys(otherModel).sort();\n otherKeyList.forEach(function (key) {\n var keyIdx = keyList.indexOf(key);\n\n if (keyIdx === -1) {\n if (debug) {\n vtkDebugMacro(\"add \".concat(key, \" in shallowCopy\"));\n }\n } else {\n keyList.splice(keyIdx, 1);\n }\n\n model[key] = otherModel[key];\n });\n\n if (keyList.length && debug) {\n vtkDebugMacro(\"Untouched keys: \".concat(keyList.join(', ')));\n }\n\n publicAPI.modified();\n }; // Allow usage as decorator\n\n\n return publicAPI;\n} // ----------------------------------------------------------------------------\n// getXXX: add getters\n// ----------------------------------------------------------------------------\n\nfunction get(publicAPI, model, fieldNames) {\n fieldNames.forEach(function (field) {\n if (_typeof(field) === 'object') {\n publicAPI[\"get\".concat(capitalize(field.name))] = function () {\n return model[field.name];\n };\n } else {\n publicAPI[\"get\".concat(capitalize(field))] = function () {\n return model[field];\n };\n }\n });\n} // ----------------------------------------------------------------------------\n// setXXX: add setters\n// ----------------------------------------------------------------------------\n\nvar objectSetterMap = {\n enum: function _enum(publicAPI, model, field) {\n return function (value) {\n if (typeof value === 'string') {\n if (field.enum[value] !== undefined) {\n if (model[field.name] !== field.enum[value]) {\n model[field.name] = field.enum[value];\n publicAPI.modified();\n return true;\n }\n\n return false;\n }\n\n vtkErrorMacro(\"Set Enum with invalid argument \".concat(field, \", \").concat(value));\n throw new RangeError('Set Enum with invalid string argument');\n }\n\n if (typeof value === 'number') {\n if (model[field.name] !== value) {\n if (Object.keys(field.enum).map(function (key) {\n return field.enum[key];\n }).indexOf(value) !== -1) {\n model[field.name] = value;\n publicAPI.modified();\n return true;\n }\n\n vtkErrorMacro(\"Set Enum outside numeric range \".concat(field, \", \").concat(value));\n throw new RangeError('Set Enum outside numeric range');\n }\n\n return false;\n }\n\n vtkErrorMacro(\"Set Enum with invalid argument (String/Number) \".concat(field, \", \").concat(value));\n throw new TypeError('Set Enum with invalid argument (String/Number)');\n };\n }\n};\n\nfunction findSetter(field) {\n if (_typeof(field) === 'object') {\n var fn = objectSetterMap[field.type];\n\n if (fn) {\n return function (publicAPI, model) {\n return fn(publicAPI, model, field);\n };\n }\n\n vtkErrorMacro(\"No setter for field \".concat(field));\n throw new TypeError('No setter for field');\n }\n\n return function getSetter(publicAPI, model) {\n return function setter(value) {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return false;\n }\n\n if (model[field] !== value) {\n model[field] = value;\n publicAPI.modified();\n return true;\n }\n\n return false;\n };\n };\n}\n\nfunction set(publicAPI, model, fields) {\n fields.forEach(function (field) {\n if (_typeof(field) === 'object') {\n publicAPI[\"set\".concat(capitalize(field.name))] = findSetter(field)(publicAPI, model);\n } else {\n publicAPI[\"set\".concat(capitalize(field))] = findSetter(field)(publicAPI, model);\n }\n });\n} // ----------------------------------------------------------------------------\n// set/get XXX: add both setters and getters\n// ----------------------------------------------------------------------------\n\nfunction setGet(publicAPI, model, fieldNames) {\n get(publicAPI, model, fieldNames);\n set(publicAPI, model, fieldNames);\n} // ----------------------------------------------------------------------------\n// getXXX: add getters for object of type array with copy to be safe\n// getXXXByReference: add getters for object of type array without copy\n// ----------------------------------------------------------------------------\n\nfunction getArray(publicAPI, model, fieldNames) {\n fieldNames.forEach(function (field) {\n publicAPI[\"get\".concat(capitalize(field))] = function () {\n return [].concat(model[field]);\n };\n\n publicAPI[\"get\".concat(capitalize(field), \"ByReference\")] = function () {\n return model[field];\n };\n });\n} // ----------------------------------------------------------------------------\n// setXXX: add setter for object of type array\n// if 'defaultVal' is supplied, shorter arrays will be padded to 'size' with 'defaultVal'\n// set...From: fast path to copy the content of an array to the current one without call to modified.\n// ----------------------------------------------------------------------------\n\nfunction setArray(publicAPI, model, fieldNames, size) {\n var defaultVal = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;\n fieldNames.forEach(function (field) {\n publicAPI[\"set\".concat(capitalize(field))] = function () {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return false;\n }\n\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n var array = args; // allow an array passed as a single arg.\n\n if (array.length === 1 && array[0].length) {\n /* eslint-disable prefer-destructuring */\n array = array[0];\n /* eslint-enable prefer-destructuring */\n }\n\n if (array.length !== size) {\n if (array.length < size && defaultVal !== undefined) {\n array = Array.from(array);\n\n while (array.length < size) {\n array.push(defaultVal);\n }\n } else {\n throw new RangeError(\"Invalid number of values for array setter (\".concat(field, \")\"));\n }\n }\n\n var changeDetected = model[field].some(function (item, index) {\n return item !== array[index];\n });\n\n if (changeDetected || model[field].length !== array.length) {\n model[field] = Array.from(array);\n publicAPI.modified();\n return true;\n }\n\n return false;\n };\n\n publicAPI[\"set\".concat(capitalize(field), \"From\")] = function (otherArray) {\n var target = model[field];\n otherArray.forEach(function (v, i) {\n target[i] = v;\n });\n };\n });\n} // ----------------------------------------------------------------------------\n// set/get XXX: add setter and getter for object of type array\n// ----------------------------------------------------------------------------\n\nfunction setGetArray(publicAPI, model, fieldNames, size) {\n var defaultVal = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;\n getArray(publicAPI, model, fieldNames);\n setArray(publicAPI, model, fieldNames, size, defaultVal);\n} // ----------------------------------------------------------------------------\n// vtkAlgorithm: setInputData(), setInputConnection(), getOutputData(), getOutputPort()\n// ----------------------------------------------------------------------------\n\nfunction algo(publicAPI, model, numberOfInputs, numberOfOutputs) {\n if (model.inputData) {\n model.inputData = model.inputData.map(_vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n } else {\n model.inputData = [];\n }\n\n if (model.inputConnection) {\n model.inputConnection = model.inputConnection.map(_vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n } else {\n model.inputConnection = [];\n }\n\n if (model.output) {\n model.output = model.output.map(_vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n } else {\n model.output = [];\n }\n\n if (model.inputArrayToProcess) {\n model.inputArrayToProcess = model.inputArrayToProcess.map(_vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n } else {\n model.inputArrayToProcess = [];\n } // Cache the argument for later manipulation\n\n\n model.numberOfInputs = numberOfInputs; // Methods\n\n function setInputData(dataset) {\n var port = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n\n if (port >= model.numberOfInputs) {\n vtkErrorMacro(\"algorithm \".concat(publicAPI.getClassName(), \" only has \").concat(model.numberOfInputs, \" input ports. To add more input ports, use addInputData()\"));\n return;\n }\n\n if (model.inputData[port] !== dataset || model.inputConnection[port]) {\n model.inputData[port] = dataset;\n model.inputConnection[port] = null;\n\n if (publicAPI.modified) {\n publicAPI.modified();\n }\n }\n }\n\n function getInputData() {\n var port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n if (model.inputConnection[port]) {\n model.inputData[port] = model.inputConnection[port]();\n }\n\n return model.inputData[port];\n }\n\n function setInputConnection(outputPort) {\n var port = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n\n if (port >= model.numberOfInputs) {\n var msg = \"algorithm \".concat(publicAPI.getClassName(), \" only has \");\n msg += \"\".concat(model.numberOfInputs);\n msg += ' input ports. To add more input ports, use addInputConnection()';\n vtkErrorMacro(msg);\n return;\n }\n\n model.inputData[port] = null;\n model.inputConnection[port] = outputPort;\n }\n\n function getInputConnection() {\n var port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n return model.inputConnection[port];\n }\n\n function addInputConnection(outputPort) {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n\n model.numberOfInputs++;\n setInputConnection(outputPort, model.numberOfInputs - 1);\n }\n\n function addInputData(dataset) {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n\n model.numberOfInputs++;\n setInputData(dataset, model.numberOfInputs - 1);\n }\n\n function getOutputData() {\n var port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return null;\n }\n\n if (publicAPI.shouldUpdate()) {\n publicAPI.update();\n }\n\n return model.output[port];\n }\n\n publicAPI.shouldUpdate = function () {\n var localMTime = publicAPI.getMTime();\n var count = numberOfOutputs;\n var minOutputMTime = Infinity;\n\n while (count--) {\n if (!model.output[count]) {\n return true;\n }\n\n var mt = model.output[count].getMTime();\n\n if (mt < localMTime) {\n return true;\n }\n\n if (mt < minOutputMTime) {\n minOutputMTime = mt;\n }\n }\n\n count = model.numberOfInputs;\n\n while (count--) {\n if (model.inputConnection[count] && model.inputConnection[count].filter.shouldUpdate()) {\n return true;\n }\n }\n\n count = model.numberOfInputs;\n\n while (count--) {\n if (publicAPI.getInputData(count) && publicAPI.getInputData(count).getMTime() > minOutputMTime) {\n return true;\n }\n }\n\n return false;\n };\n\n function getOutputPort() {\n var port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n var outputPortAccess = function outputPortAccess() {\n return getOutputData(port);\n }; // Add reference to filter\n\n\n outputPortAccess.filter = publicAPI;\n return outputPortAccess;\n } // Handle input if needed\n\n\n if (model.numberOfInputs) {\n // Reserve inputs\n var count = model.numberOfInputs;\n\n while (count--) {\n model.inputData.push(null);\n model.inputConnection.push(null);\n } // Expose public methods\n\n\n publicAPI.setInputData = setInputData;\n publicAPI.setInputConnection = setInputConnection;\n publicAPI.addInputData = addInputData;\n publicAPI.addInputConnection = addInputConnection;\n publicAPI.getInputData = getInputData;\n publicAPI.getInputConnection = getInputConnection;\n }\n\n if (numberOfOutputs) {\n publicAPI.getOutputData = getOutputData;\n publicAPI.getOutputPort = getOutputPort;\n }\n\n publicAPI.update = function () {\n var ins = [];\n\n if (model.numberOfInputs) {\n var _count = 0;\n\n while (_count < model.numberOfInputs) {\n ins[_count] = publicAPI.getInputData(_count);\n _count++;\n }\n }\n\n if (publicAPI.shouldUpdate() && publicAPI.requestData) {\n publicAPI.requestData(ins, model.output);\n }\n };\n\n publicAPI.getNumberOfInputPorts = function () {\n return model.numberOfInputs;\n };\n\n publicAPI.getNumberOfOutputPorts = function () {\n return numberOfOutputs || model.output.length;\n };\n\n publicAPI.getInputArrayToProcess = function (inputPort) {\n var arrayDesc = model.inputArrayToProcess[inputPort];\n var ds = model.inputData[inputPort];\n\n if (arrayDesc && ds) {\n return ds[\"get\".concat(arrayDesc.fieldAssociation)]().getArray(arrayDesc.arrayName);\n }\n\n return null;\n };\n\n publicAPI.setInputArrayToProcess = function (inputPort, arrayName, fieldAssociation) {\n var attributeType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'Scalars';\n\n while (model.inputArrayToProcess.length < inputPort) {\n model.inputArrayToProcess.push(null);\n }\n\n model.inputArrayToProcess[inputPort] = {\n arrayName: arrayName,\n fieldAssociation: fieldAssociation,\n attributeType: attributeType\n };\n };\n} // ----------------------------------------------------------------------------\n// Event handling: onXXX(callback), invokeXXX(args...)\n// ----------------------------------------------------------------------------\n\nvar EVENT_ABORT = Symbol('Event abort');\nfunction event(publicAPI, model, eventName) {\n var callbacks = [];\n var previousDelete = publicAPI.delete;\n var curCallbackID = 1;\n\n function off(callbackID) {\n for (var i = 0; i < callbacks.length; ++i) {\n var _callbacks$i = _slicedToArray(callbacks[i], 1),\n cbID = _callbacks$i[0];\n\n if (cbID === callbackID) {\n callbacks.splice(i, 1);\n return;\n }\n }\n }\n\n function on(callbackID) {\n function unsubscribe() {\n off(callbackID);\n }\n\n return Object.freeze({\n unsubscribe: unsubscribe\n });\n }\n\n function invoke() {\n var _arguments = arguments;\n\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n /* eslint-disable prefer-rest-params */\n // Go through a copy of the callbacks array in case new callbacks\n // get prepended within previous callbacks\n\n\n var currentCallbacks = callbacks.slice();\n\n var _loop = function _loop(index) {\n var _currentCallbacks$ind = _slicedToArray(currentCallbacks[index], 3),\n cb = _currentCallbacks$ind[1],\n priority = _currentCallbacks$ind[2];\n\n if (!cb) {\n return \"continue\"; // eslint-disable-line\n }\n\n if (priority < 0) {\n setTimeout(function () {\n return cb.apply(publicAPI, _arguments);\n }, 1 - priority);\n } else {\n // Abort only if the callback explicitly returns false\n var continueNext = cb.apply(publicAPI, _arguments);\n\n if (continueNext === EVENT_ABORT) {\n return \"break\";\n }\n }\n };\n\n for (var index = 0; index < currentCallbacks.length; ++index) {\n var _ret = _loop(index);\n\n if (_ret === \"continue\") continue;\n if (_ret === \"break\") break;\n }\n /* eslint-enable prefer-rest-params */\n\n }\n\n publicAPI[\"invoke\".concat(capitalize(eventName))] = invoke;\n\n publicAPI[\"on\".concat(capitalize(eventName))] = function (callback) {\n var priority = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.0;\n\n if (!callback.apply) {\n console.error(\"Invalid callback for event \".concat(eventName));\n return null;\n }\n\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return null;\n }\n\n var callbackID = curCallbackID++;\n callbacks.push([callbackID, callback, priority]);\n callbacks.sort(function (cb1, cb2) {\n return cb2[2] - cb1[2];\n });\n return on(callbackID);\n };\n\n publicAPI.delete = function () {\n previousDelete();\n callbacks.forEach(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 1),\n cbID = _ref3[0];\n\n return off(cbID);\n });\n };\n} // ----------------------------------------------------------------------------\n// newInstance\n// ----------------------------------------------------------------------------\n\nfunction newInstance(extend, className) {\n var constructor = function constructor() {\n var initialValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var model = {};\n var publicAPI = {};\n extend(publicAPI, model, initialValues);\n return Object.freeze(publicAPI);\n }; // Register constructor to factory\n\n\n if (className) {\n _vtk__WEBPACK_IMPORTED_MODULE_0__[\"default\"].register(className, constructor);\n }\n\n return constructor;\n} // ----------------------------------------------------------------------------\n// Chain function calls\n// ----------------------------------------------------------------------------\n\nfunction chain() {\n for (var _len5 = arguments.length, fn = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n fn[_key5] = arguments[_key5];\n }\n\n return function () {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n return fn.filter(function (i) {\n return !!i;\n }).map(function (i) {\n return i.apply(void 0, args);\n });\n };\n} // ----------------------------------------------------------------------------\n// Some utility methods for vtk objects\n// ----------------------------------------------------------------------------\n\nfunction isVtkObject(instance) {\n return instance && instance.isA && instance.isA('vtkObject');\n}\nfunction traverseInstanceTree(instance, extractFunction) {\n var accumulator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n var visitedInstances = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];\n\n if (isVtkObject(instance)) {\n if (visitedInstances.indexOf(instance) >= 0) {\n // avoid cycles\n return accumulator;\n }\n\n visitedInstances.push(instance);\n var result = extractFunction(instance);\n\n if (result !== undefined) {\n accumulator.push(result);\n } // Now go through this instance's model\n\n\n var model = instance.get();\n Object.keys(model).forEach(function (key) {\n var modelObj = model[key];\n\n if (Array.isArray(modelObj)) {\n modelObj.forEach(function (subObj) {\n traverseInstanceTree(subObj, extractFunction, accumulator, visitedInstances);\n });\n } else {\n traverseInstanceTree(modelObj, extractFunction, accumulator, visitedInstances);\n }\n });\n }\n\n return accumulator;\n} // ----------------------------------------------------------------------------\n// Returns a function, that, as long as it continues to be invoked, will not\n// be triggered. The function will be called after it stops being called for\n// N milliseconds. If `immediate` is passed, trigger the function on the\n// leading edge, instead of the trailing.\n\nfunction debounce(func, wait, immediate) {\n var _this = this;\n\n var timeout;\n return function () {\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n\n var context = _this;\n\n var later = function later() {\n timeout = null;\n\n if (!immediate) {\n func.apply(context, args);\n }\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) {\n func.apply(context, args);\n }\n };\n} // ----------------------------------------------------------------------------\n// Creates a throttled function that only invokes `func` at most once per\n// every `wait` milliseconds.\n\nfunction throttle(callback, delay) {\n var isThrottled = false;\n var argsToUse = null;\n\n function next() {\n isThrottled = false;\n\n if (argsToUse !== null) {\n wrapper.apply(void 0, _toConsumableArray(argsToUse)); // eslint-disable-line\n\n argsToUse = null;\n }\n }\n\n function wrapper() {\n for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n args[_key8] = arguments[_key8];\n }\n\n if (isThrottled) {\n argsToUse = args;\n return;\n }\n\n isThrottled = true;\n callback.apply(void 0, args);\n setTimeout(next, delay);\n }\n\n return wrapper;\n} // ----------------------------------------------------------------------------\n// keystore(publicAPI, model, initialKeystore)\n//\n// - initialKeystore: Initial keystore. This can be either a Map or an\n// object.\n//\n// Generated API\n// setKey(key, value) : mixed (returns value)\n// getKey(key) : mixed\n// getAllKeys() : [mixed]\n// deleteKey(key) : Boolean\n// ----------------------------------------------------------------------------\n\nfunction keystore(publicAPI, model) {\n var initialKeystore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n model.keystore = Object.assign(model.keystore || {}, initialKeystore);\n\n publicAPI.setKey = function (key, value) {\n model.keystore[key] = value;\n };\n\n publicAPI.getKey = function (key) {\n return model.keystore[key];\n };\n\n publicAPI.getAllKeys = function () {\n return Object.keys(model.keystore);\n };\n\n publicAPI.deleteKey = function (key) {\n return delete model.keystore[key];\n };\n\n publicAPI.clearKeystore = function () {\n return publicAPI.getAllKeys().forEach(function (key) {\n return delete model.keystore[key];\n });\n };\n} // ----------------------------------------------------------------------------\n// proxy(publicAPI, model, sectionName, propertyUI)\n//\n// - sectionName: Name of the section for UI\n// - propertyUI: List of props with their UI description\n//\n// Generated API\n// getProxyId() : String\n// listProxyProperties() : [string]\n// updateProxyProperty(name, prop)\n// getProxySection() => List of properties for UI generation\n// ----------------------------------------------------------------------------\n\nvar nextProxyId = 1;\nvar ROOT_GROUP_NAME = '__root__';\nfunction proxy(publicAPI, model) {\n // Proxies are keystores\n keystore(publicAPI, model);\n var parentDelete = publicAPI.delete; // getProxyId\n\n model.proxyId = \"\".concat(nextProxyId++); // ui handling\n\n model.ui = JSON.parse(JSON.stringify(model.ui || [])); // deep copy\n\n get(publicAPI, model, ['proxyId', 'proxyGroup', 'proxyName']);\n setGet(publicAPI, model, ['proxyManager']); // group properties\n\n var propertyMap = {};\n var groupChildrenNames = {};\n\n function registerProperties(descriptionList, currentGroupName) {\n if (!groupChildrenNames[currentGroupName]) {\n groupChildrenNames[currentGroupName] = [];\n }\n\n var childrenNames = groupChildrenNames[currentGroupName];\n\n for (var i = 0; i < descriptionList.length; i++) {\n childrenNames.push(descriptionList[i].name);\n propertyMap[descriptionList[i].name] = descriptionList[i];\n\n if (descriptionList[i].children && descriptionList[i].children.length) {\n registerProperties(descriptionList[i].children, descriptionList[i].name);\n }\n }\n }\n\n registerProperties(model.ui, ROOT_GROUP_NAME);\n\n publicAPI.updateUI = function (ui) {\n model.ui = JSON.parse(JSON.stringify(ui || [])); // deep copy\n\n Object.keys(propertyMap).forEach(function (k) {\n return delete propertyMap[k];\n });\n Object.keys(groupChildrenNames).forEach(function (k) {\n return delete groupChildrenNames[k];\n });\n registerProperties(model.ui, ROOT_GROUP_NAME);\n publicAPI.modified();\n };\n\n function listProxyProperties() {\n var gName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ROOT_GROUP_NAME;\n return groupChildrenNames[gName];\n }\n\n publicAPI.updateProxyProperty = function (propertyName, propUI) {\n var prop = propertyMap[propertyName];\n\n if (prop) {\n Object.assign(prop, propUI);\n } else {\n propertyMap[propertyName] = _objectSpread({}, propUI);\n }\n };\n\n publicAPI.activate = function () {\n if (model.proxyManager) {\n var setActiveMethod = \"setActive\".concat(capitalize(publicAPI.getProxyGroup().slice(0, -1)));\n\n if (model.proxyManager[setActiveMethod]) {\n model.proxyManager[setActiveMethod](publicAPI);\n }\n }\n }; // property link\n\n\n model.propertyLinkSubscribers = {};\n\n publicAPI.registerPropertyLinkForGC = function (otherLink, type) {\n if (!(type in model.propertyLinkSubscribers)) {\n model.propertyLinkSubscribers[type] = [];\n }\n\n model.propertyLinkSubscribers[type].push(otherLink);\n };\n\n publicAPI.gcPropertyLinks = function (type) {\n var subscribers = model.propertyLinkSubscribers[type] || [];\n\n while (subscribers.length) {\n subscribers.pop().unbind(publicAPI);\n }\n };\n\n model.propertyLinkMap = {};\n\n publicAPI.getPropertyLink = function (id) {\n var persistent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (model.propertyLinkMap[id]) {\n return model.propertyLinkMap[id];\n }\n\n var value = null;\n var links = [];\n var count = 0;\n var updateInProgress = false;\n\n function update(source) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (updateInProgress) {\n return null;\n }\n\n var needUpdate = [];\n var sourceLink = null;\n count = links.length;\n\n while (count--) {\n var link = links[count];\n\n if (link.instance === source) {\n sourceLink = link;\n } else {\n needUpdate.push(link);\n }\n }\n\n if (!sourceLink) {\n return null;\n }\n\n var newValue = sourceLink.instance[\"get\".concat(capitalize(sourceLink.propertyName))]();\n\n if (!shallowEquals(newValue, value) || force) {\n value = newValue;\n updateInProgress = true;\n\n while (needUpdate.length) {\n var linkToUpdate = needUpdate.pop();\n linkToUpdate.instance.set(_defineProperty({}, linkToUpdate.propertyName, value));\n }\n\n updateInProgress = false;\n }\n\n if (model.propertyLinkMap[id].persistent) {\n model.propertyLinkMap[id].value = newValue;\n }\n\n return newValue;\n }\n\n function unbind(instance, propertyName) {\n var indexToDelete = [];\n count = links.length;\n\n while (count--) {\n var link = links[count];\n\n if (link.instance === instance && (link.propertyName === propertyName || propertyName === undefined)) {\n link.subscription.unsubscribe();\n indexToDelete.push(count);\n }\n }\n\n while (indexToDelete.length) {\n links.splice(indexToDelete.pop(), 1);\n }\n }\n\n function bind(instance, propertyName) {\n var updateMe = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var subscription = instance.onModified(update);\n var other = links[0];\n links.push({\n instance: instance,\n propertyName: propertyName,\n subscription: subscription\n });\n\n if (updateMe) {\n if (model.propertyLinkMap[id].persistent && model.propertyLinkMap[id].value !== undefined) {\n instance.set(_defineProperty({}, propertyName, model.propertyLinkMap[id].value));\n } else if (other) {\n update(other.instance, true);\n }\n }\n\n return {\n unsubscribe: function unsubscribe() {\n return unbind(instance, propertyName);\n }\n };\n }\n\n function unsubscribe() {\n while (links.length) {\n links.pop().subscription.unsubscribe();\n }\n }\n\n var linkHandler = {\n bind: bind,\n unbind: unbind,\n unsubscribe: unsubscribe,\n persistent: persistent\n };\n model.propertyLinkMap[id] = linkHandler;\n return linkHandler;\n }; // extract values\n\n\n function getProperties() {\n var groupName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ROOT_GROUP_NAME;\n var values = [];\n var id = model.proxyId;\n var propertyNames = listProxyProperties(groupName) || [];\n\n for (var i = 0; i < propertyNames.length; i++) {\n var name = propertyNames[i];\n var method = publicAPI[\"get\".concat(capitalize(name))];\n var value = method ? method() : undefined;\n var prop = {\n id: id,\n name: name,\n value: value\n };\n var children = getProperties(name);\n\n if (children.length) {\n prop.children = children;\n }\n\n values.push(prop);\n }\n\n return values;\n }\n\n publicAPI.listPropertyNames = function () {\n return getProperties().map(function (p) {\n return p.name;\n });\n };\n\n publicAPI.getPropertyByName = function (name) {\n return getProperties().find(function (p) {\n return p.name === name;\n });\n };\n\n publicAPI.getPropertyDomainByName = function (name) {\n return (propertyMap[name] || {}).domain;\n }; // ui section\n\n\n publicAPI.getProxySection = function () {\n return {\n id: model.proxyId,\n name: model.proxyGroup,\n ui: model.ui,\n properties: getProperties()\n };\n }; // free resources\n\n\n publicAPI.delete = function () {\n var list = Object.keys(model.propertyLinkMap);\n var count = list.length;\n\n while (count--) {\n model.propertyLinkMap[list[count]].unsubscribe();\n }\n\n Object.keys(model.propertyLinkSubscribers).forEach(publicAPI.gcPropertyLinks);\n parentDelete();\n };\n\n function registerLinks() {\n // Allow dynamic registration of links at the application level\n if (model.links) {\n for (var i = 0; i < model.links.length; i++) {\n var _model$links$i = model.links[i],\n link = _model$links$i.link,\n property = _model$links$i.property,\n persistent = _model$links$i.persistent,\n updateOnBind = _model$links$i.updateOnBind,\n type = _model$links$i.type;\n\n if (type === 'application') {\n var sLink = model.proxyManager.getPropertyLink(link, persistent);\n publicAPI.registerPropertyLinkForGC(sLink, 'application');\n sLink.bind(publicAPI, property, updateOnBind);\n }\n }\n }\n }\n\n setImmediateVTK(registerLinks);\n} // ----------------------------------------------------------------------------\n// proxyPropertyMapping(publicAPI, model, map)\n//\n// map = {\n// opacity: { modelKey: 'property', property: 'opacity' },\n// }\n//\n// Generated API:\n// Elevate set/get methods from internal object stored in the model to current one\n// ----------------------------------------------------------------------------\n\nfunction proxyPropertyMapping(publicAPI, model, map) {\n var parentDelete = publicAPI.delete;\n var subscriptions = [];\n var propertyNames = Object.keys(map);\n var count = propertyNames.length;\n\n while (count--) {\n var propertyName = propertyNames[count];\n var _map$propertyName = map[propertyName],\n modelKey = _map$propertyName.modelKey,\n property = _map$propertyName.property,\n _map$propertyName$mod = _map$propertyName.modified,\n modified = _map$propertyName$mod === void 0 ? true : _map$propertyName$mod;\n var methodSrc = capitalize(property);\n var methodDst = capitalize(propertyName);\n publicAPI[\"get\".concat(methodDst)] = model[modelKey][\"get\".concat(methodSrc)];\n publicAPI[\"set\".concat(methodDst)] = model[modelKey][\"set\".concat(methodSrc)];\n\n if (modified) {\n subscriptions.push(model[modelKey].onModified(publicAPI.modified));\n }\n }\n\n publicAPI.delete = function () {\n while (subscriptions.length) {\n subscriptions.pop().unsubscribe();\n }\n\n parentDelete();\n };\n} // ----------------------------------------------------------------------------\n// proxyPropertyState(publicAPI, model, state, defaults)\n//\n// state = {\n// representation: {\n// 'Surface with edges': { property: { edgeVisibility: true, representation: 2 } },\n// Surface: { property: { edgeVisibility: false, representation: 2 } },\n// Wireframe: { property: { edgeVisibility: false, representation: 1 } },\n// Points: { property: { edgeVisibility: false, representation: 0 } },\n// },\n// }\n//\n// defaults = {\n// representation: 'Surface',\n// }\n//\n// Generated API\n// get / set Representation ( string ) => push state to various internal objects\n// ----------------------------------------------------------------------------\n\nfunction proxyPropertyState(publicAPI, model) {\n var state = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var defaults = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n model.this = publicAPI;\n\n function applyState(map) {\n var modelKeys = Object.keys(map);\n var count = modelKeys.length;\n\n while (count--) {\n var modelKey = modelKeys[count];\n model[modelKey].set(map[modelKey]);\n }\n }\n\n var modelKeys = Object.keys(defaults);\n var count = modelKeys.length;\n\n var _loop2 = function _loop2() {\n // Add default\n var key = modelKeys[count];\n model[key] = defaults[key]; // Add set method\n\n var mapping = state[key];\n\n publicAPI[\"set\".concat(capitalize(key))] = function (value) {\n if (value !== model[key]) {\n model[key] = value;\n var propValues = mapping[value];\n applyState(propValues);\n publicAPI.modified();\n }\n };\n };\n\n while (count--) {\n _loop2();\n } // Add getter\n\n\n if (modelKeys.length) {\n get(publicAPI, model, modelKeys);\n }\n} // ----------------------------------------------------------------------------\n// From : https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js\n//\n//\n// Copyright (c) 2015, Facebook, Inc.\n// All rights reserved.\n//\n// This source code is licensed under the BSD-style license found in the\n// LICENSE file in the root directory of this source tree. An additional grant\n// of patent rights can be found in the PATENTS file in the same directory.\n//\n//\n// Mouse wheel (and 2-finger trackpad) support on the web sucks. It is\n// complicated, thus this doc is long and (hopefully) detailed enough to answer\n// your questions.\n//\n// If you need to react to the mouse wheel in a predictable way, this code is\n// like your bestest friend.// hugs//\n//\n// As of today, there are 4 DOM event types you can listen to:\n//\n// 'wheel' -- Chrome(31+), FF(17+), IE(9+)\n// 'mousewheel' -- Chrome, IE(6+), Opera, Safari\n// 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother!\n// 'DOMMouseScroll' -- FF(0.9.7+) since 2003\n//\n// So what to do? The is the best:\n//\n// normalizeWheel.getEventType();\n//\n// In your event callback, use this code to get sane interpretation of the\n// deltas. This code will return an object with properties:\n//\n// spinX -- normalized spin speed (use for zoom) - x plane\n// spinY -- \" - y plane\n// pixelX -- normalized distance (to pixels) - x plane\n// pixelY -- \" - y plane\n//\n// Wheel values are provided by the browser assuming you are using the wheel to\n// scroll a web page by a number of lines or pixels (or pages). Values can vary\n// significantly on different platforms and browsers, forgetting that you can\n// scroll at different speeds. Some devices (like trackpads) emit more events\n// at smaller increments with fine granularity, and some emit massive jumps with\n// linear speed or acceleration.\n//\n// This code does its best to normalize the deltas for you:\n//\n// - spin is trying to normalize how far the wheel was spun (or trackpad\n// dragged). This is super useful for zoom support where you want to\n// throw away the chunky scroll steps on the PC and make those equal to\n// the slow and smooth tiny steps on the Mac. Key data: This code tries to\n// resolve a single slow step on a wheel to 1.\n//\n// - pixel is normalizing the desired scroll delta in pixel units. You'll\n// get the crazy differences between browsers, but at least it'll be in\n// pixels!\n//\n// - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This\n// should translate to positive value zooming IN, negative zooming OUT.\n// This matches the newer 'wheel' event.\n//\n// Why are there spinX, spinY (or pixels)?\n//\n// - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn\n// with a mouse. It results in side-scrolling in the browser by default.\n//\n// - spinY is what you expect -- it's the classic axis of a mouse wheel.\n//\n// - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and\n// probably is by browsers in conjunction with fancy 3D controllers .. but\n// you know.\n//\n// Implementation info:\n//\n// Examples of 'wheel' event if you scroll slowly (down) by one step with an\n// average mouse:\n//\n// OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120)\n// OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12)\n// OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A)\n// Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120)\n// Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120)\n//\n// On the trackpad:\n//\n// OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6)\n// OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A)\n//\n// On other/older browsers.. it's more complicated as there can be multiple and\n// also missing delta values.\n//\n// The 'wheel' event is more standard:\n//\n// http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents\n//\n// The basics is that it includes a unit, deltaMode (pixels, lines, pages), and\n// deltaX, deltaY and deltaZ. Some browsers provide other values to maintain\n// backward compatibility with older events. Those other values help us\n// better normalize spin speed. Example of what the browsers provide:\n//\n// | event.wheelDelta | event.detail\n// ------------------+------------------+--------------\n// Safari v5/OS X | -120 | 0\n// Safari v5/Win7 | -120 | 0\n// Chrome v17/OS X | -120 | 0\n// Chrome v17/Win7 | -120 | 0\n// IE9/Win7 | -120 | undefined\n// Firefox v4/OS X | undefined | 1\n// Firefox v4/Win7 | undefined | 3\n//\n// ----------------------------------------------------------------------------\n// Reasonable defaults\n\nvar PIXEL_STEP = 10;\nvar LINE_HEIGHT = 40;\nvar PAGE_HEIGHT = 800;\nfunction normalizeWheel(wheelEvent) {\n var sX = 0; // spinX\n\n var sY = 0; // spinY\n\n var pX = 0; // pixelX\n\n var pY = 0; // pixelY\n // Legacy\n\n if ('detail' in wheelEvent) {\n sY = wheelEvent.detail;\n }\n\n if ('wheelDelta' in wheelEvent) {\n sY = -wheelEvent.wheelDelta / 120;\n }\n\n if ('wheelDeltaY' in wheelEvent) {\n sY = -wheelEvent.wheelDeltaY / 120;\n }\n\n if ('wheelDeltaX' in wheelEvent) {\n sX = -wheelEvent.wheelDeltaX / 120;\n } // side scrolling on FF with DOMMouseScroll\n\n\n if ('axis' in wheelEvent && wheelEvent.axis === wheelEvent.HORIZONTAL_AXIS) {\n sX = sY;\n sY = 0;\n }\n\n pX = sX * PIXEL_STEP;\n pY = sY * PIXEL_STEP;\n\n if ('deltaY' in wheelEvent) {\n pY = wheelEvent.deltaY;\n }\n\n if ('deltaX' in wheelEvent) {\n pX = wheelEvent.deltaX;\n }\n\n if ((pX || pY) && wheelEvent.deltaMode) {\n if (wheelEvent.deltaMode === 1) {\n // delta in LINE units\n pX *= LINE_HEIGHT;\n pY *= LINE_HEIGHT;\n } else {\n // delta in PAGE units\n pX *= PAGE_HEIGHT;\n pY *= PAGE_HEIGHT;\n }\n } // Fall-back if spin cannot be determined\n\n\n if (pX && !sX) {\n sX = pX < 1 ? -1 : 1;\n }\n\n if (pY && !sY) {\n sY = pY < 1 ? -1 : 1;\n }\n\n return {\n spinX: sX,\n spinY: sY,\n pixelX: pX,\n pixelY: pY\n };\n} // ----------------------------------------------------------------------------\n// Default export\n// ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n algo: algo,\n capitalize: capitalize,\n chain: chain,\n debounce: debounce,\n enumToString: enumToString,\n event: event,\n EVENT_ABORT: EVENT_ABORT,\n formatBytesToProperUnit: formatBytesToProperUnit,\n formatNumbersWithThousandSeparator: formatNumbersWithThousandSeparator,\n get: get,\n getArray: getArray,\n getCurrentGlobalMTime: getCurrentGlobalMTime,\n getStateArrayMapFunc: getStateArrayMapFunc,\n isVtkObject: isVtkObject,\n keystore: keystore,\n newInstance: newInstance,\n newTypedArray: newTypedArray,\n newTypedArrayFrom: newTypedArrayFrom,\n normalizeWheel: normalizeWheel,\n obj: obj,\n proxy: proxy,\n proxyPropertyMapping: proxyPropertyMapping,\n proxyPropertyState: proxyPropertyState,\n safeArrays: safeArrays,\n set: set,\n setArray: setArray,\n setGet: setGet,\n setGetArray: setGetArray,\n setImmediate: setImmediateVTK,\n setLoggerFunction: setLoggerFunction,\n throttle: throttle,\n traverseInstanceTree: traverseInstanceTree,\n TYPED_ARRAYS: TYPED_ARRAYS,\n // deprecated todo remove on breaking API revision\n uncapitalize: uncapitalize,\n VOID: VOID,\n vtkDebugMacro: vtkDebugMacro,\n vtkErrorMacro: vtkErrorMacro,\n vtkInfoMacro: vtkInfoMacro,\n vtkLogMacro: vtkLogMacro,\n vtkOnceErrorMacro: vtkOnceErrorMacro,\n vtkWarningMacro: vtkWarningMacro\n});\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/macro.js?"); - -/***/ }), - -/***/ "./node_modules/vtk.js/Sources/vtk.js": -/*!********************************************!*\ - !*** ./node_modules/vtk.js/Sources/vtk.js ***! - \********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return vtk; });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar factoryMapping = {\n vtkObject: function vtkObject() {\n return null;\n }\n};\nfunction vtk(obj) {\n if (obj === null || obj === undefined) {\n return obj;\n }\n\n if (obj.isA) {\n return obj;\n }\n\n if (!obj.vtkClass) {\n if (global.console && global.console.error) {\n global.console.error('Invalid VTK object');\n }\n\n return null;\n }\n\n var constructor = factoryMapping[obj.vtkClass];\n\n if (!constructor) {\n if (global.console && global.console.error) {\n global.console.error(\"No vtk class found for Object of type \".concat(obj.vtkClass));\n }\n\n return null;\n } // Shallow copy object\n\n\n var model = _objectSpread({}, obj); // Convert into vtkObject any nested key\n\n\n Object.keys(model).forEach(function (keyName) {\n if (model[keyName] && _typeof(model[keyName]) === 'object' && model[keyName].vtkClass) {\n model[keyName] = vtk(model[keyName]);\n }\n }); // Return the root\n\n var newInst = constructor(model);\n\n if (newInst && newInst.modified) {\n newInst.modified();\n }\n\n return newInst;\n}\n\nfunction register(vtkClassName, constructor) {\n factoryMapping[vtkClassName] = constructor;\n} // Nest register method under the vtk function\n\n\nvtk.register = register;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://diglettk/./node_modules/vtk.js/Sources/vtk.js?"); - -/***/ }), - -/***/ "./node_modules/webpack/buildin/amd-define.js": -/*!***************************************!*\ - !*** (webpack)/buildin/amd-define.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = function() {\n\tthrow new Error(\"define cannot be used indirect\");\n};\n\n\n//# sourceURL=webpack://diglettk/(webpack)/buildin/amd-define.js?"); - -/***/ }), - -/***/ "./node_modules/webpack/buildin/amd-options.js": -/*!****************************************!*\ - !*** (webpack)/buildin/amd-options.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n\n/* WEBPACK VAR INJECTION */}.call(this, {}))\n\n//# sourceURL=webpack://diglettk/(webpack)/buildin/amd-options.js?"); - -/***/ }), - -/***/ "./node_modules/webpack/buildin/global.js": -/*!***********************************!*\ - !*** (webpack)/buildin/global.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n//# sourceURL=webpack://diglettk/(webpack)/buildin/global.js?"); - -/***/ }), - -/***/ "./node_modules/webpack/buildin/module.js": -/*!***********************************!*\ - !*** (webpack)/buildin/module.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n\n\n//# sourceURL=webpack://diglettk/(webpack)/buildin/module.js?"); - -/***/ }), - -/***/ "./node_modules/webworker-promise/lib/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/webworker-promise/lib/index.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TinyEmitter = __webpack_require__(/*! ./tiny-emitter */ \"./node_modules/webworker-promise/lib/tiny-emitter.js\");\n\nvar MESSAGE_RESULT = 0;\nvar MESSAGE_EVENT = 1;\n\nvar RESULT_ERROR = 0;\nvar RESULT_SUCCESS = 1;\n\nvar Worker = function (_TinyEmitter) {\n _inherits(Worker, _TinyEmitter);\n\n /**\n *\n * @param worker {Worker}\n */\n function Worker(worker) {\n _classCallCheck(this, Worker);\n\n var _this = _possibleConstructorReturn(this, (Worker.__proto__ || Object.getPrototypeOf(Worker)).call(this));\n\n _this._messageId = 1;\n _this._messages = new Map();\n\n _this._worker = worker;\n _this._worker.onmessage = _this._onMessage.bind(_this);\n _this._id = Math.ceil(Math.random() * 10000000);\n return _this;\n }\n\n _createClass(Worker, [{\n key: 'terminate',\n value: function terminate() {\n this._worker.terminate();\n }\n\n /**\n * return true if there is no unresolved jobs\n * @returns {boolean}\n */\n\n }, {\n key: 'isFree',\n value: function isFree() {\n return this._messages.size === 0;\n }\n }, {\n key: 'jobsLength',\n value: function jobsLength() {\n return this._messages.size;\n }\n\n /**\n * @param operationName string\n * @param data any\n * @param transferable array\n * @param onEvent function\n * @returns {Promise}\n */\n\n }, {\n key: 'exec',\n value: function exec(operationName) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n var _this2 = this;\n\n var transferable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n var onEvent = arguments[3];\n\n return new Promise(function (res, rej) {\n var messageId = _this2._messageId++;\n _this2._messages.set(messageId, [res, rej, onEvent]);\n _this2._worker.postMessage([messageId, data, operationName], transferable || []);\n });\n }\n\n /**\n *\n * @param data any\n * @param transferable array\n * @param onEvent function\n * @returns {Promise}\n */\n\n }, {\n key: 'postMessage',\n value: function postMessage() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n var _this3 = this;\n\n var transferable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var onEvent = arguments[2];\n\n return new Promise(function (res, rej) {\n var messageId = _this3._messageId++;\n _this3._messages.set(messageId, [res, rej, onEvent]);\n _this3._worker.postMessage([messageId, data], transferable || []);\n });\n }\n }, {\n key: 'emit',\n value: function emit(eventName) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n this._worker.postMessage({ eventName: eventName, args: args });\n }\n }, {\n key: '_onMessage',\n value: function _onMessage(e) {\n //if we got usual event, just emit it locally\n if (!Array.isArray(e.data) && e.data.eventName) {\n var _get2;\n\n return (_get2 = _get(Worker.prototype.__proto__ || Object.getPrototypeOf(Worker.prototype), 'emit', this)).call.apply(_get2, [this, e.data.eventName].concat(_toConsumableArray(e.data.args)));\n }\n\n var _e$data = _toArray(e.data),\n type = _e$data[0],\n args = _e$data.slice(1);\n\n if (type === MESSAGE_EVENT) this._onEvent.apply(this, _toConsumableArray(args));else if (type === MESSAGE_RESULT) this._onResult.apply(this, _toConsumableArray(args));else throw new Error('Wrong message type \\'' + type + '\\'');\n }\n }, {\n key: '_onResult',\n value: function _onResult(messageId, success, payload) {\n var _messages$get = this._messages.get(messageId),\n _messages$get2 = _slicedToArray(_messages$get, 2),\n res = _messages$get2[0],\n rej = _messages$get2[1];\n\n this._messages.delete(messageId);\n\n return success === RESULT_SUCCESS ? res(payload) : rej(payload);\n }\n }, {\n key: '_onEvent',\n value: function _onEvent(messageId, eventName, data) {\n var _messages$get3 = this._messages.get(messageId),\n _messages$get4 = _slicedToArray(_messages$get3, 3),\n onEvent = _messages$get4[2];\n\n if (onEvent) {\n onEvent(eventName, data);\n }\n }\n }]);\n\n return Worker;\n}(TinyEmitter);\n\nmodule.exports = Worker;\n\n//# sourceURL=webpack://diglettk/./node_modules/webworker-promise/lib/index.js?"); - -/***/ }), - -/***/ "./node_modules/webworker-promise/lib/tiny-emitter.js": -/*!************************************************************!*\ - !*** ./node_modules/webworker-promise/lib/tiny-emitter.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar TinyEmitter = function () {\n function TinyEmitter() {\n _classCallCheck(this, TinyEmitter);\n\n Object.defineProperty(this, '__listeners', {\n value: {},\n enumerable: false,\n writable: false\n });\n }\n\n _createClass(TinyEmitter, [{\n key: 'emit',\n value: function emit(eventName) {\n if (!this.__listeners[eventName]) return this;\n\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = this.__listeners[eventName][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var handler = _step.value;\n\n handler.apply(undefined, args);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return this;\n }\n }, {\n key: 'once',\n value: function once(eventName, handler) {\n var _this = this;\n\n var once = function once() {\n _this.off(eventName, once);\n handler.apply(undefined, arguments);\n };\n\n return this.on(eventName, once);\n }\n }, {\n key: 'on',\n value: function on(eventName, handler) {\n if (!this.__listeners[eventName]) this.__listeners[eventName] = [];\n\n this.__listeners[eventName].push(handler);\n\n return this;\n }\n }, {\n key: 'off',\n value: function off(eventName, handler) {\n if (handler) this.__listeners[eventName] = this.__listeners[eventName].filter(function (h) {\n return h !== handler;\n });else this.__listeners[eventName] = [];\n\n return this;\n }\n }]);\n\n return TinyEmitter;\n}();\n\nmodule.exports = TinyEmitter;\n\n//# sourceURL=webpack://diglettk/./node_modules/webworker-promise/lib/tiny-emitter.js?"); - -/***/ }), - -/***/ "./node_modules/worker-loader/dist/runtime/inline.js": -/*!***********************************************************!*\ - !*** ./node_modules/worker-loader/dist/runtime/inline.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\n/* eslint-env browser */\n\n/* eslint-disable no-undef, no-use-before-define, new-cap */\nmodule.exports = function (content, workerConstructor, workerOptions, url) {\n var globalScope = self || window;\n\n try {\n try {\n var blob;\n\n try {\n // New API\n blob = new globalScope.Blob([content]);\n } catch (e) {\n // BlobBuilder = Deprecated, but widely implemented\n var BlobBuilder = globalScope.BlobBuilder || globalScope.WebKitBlobBuilder || globalScope.MozBlobBuilder || globalScope.MSBlobBuilder;\n blob = new BlobBuilder();\n blob.append(content);\n blob = blob.getBlob();\n }\n\n var URL = globalScope.URL || globalScope.webkitURL;\n var objectURL = URL.createObjectURL(blob);\n var worker = new globalScope[workerConstructor](objectURL, workerOptions);\n URL.revokeObjectURL(objectURL);\n return worker;\n } catch (e) {\n return new globalScope[workerConstructor](\"data:application/javascript,\".concat(encodeURIComponent(content)), workerOptions);\n }\n } catch (e) {\n if (!url) {\n throw Error(\"Inline worker is not supported\");\n }\n\n return new globalScope[workerConstructor](url, workerOptions);\n }\n};\n\n//# sourceURL=webpack://diglettk/./node_modules/worker-loader/dist/runtime/inline.js?"); - -/***/ }), - -/***/ "./src/index.js": -/*!**********************!*\ - !*** ./src/index.js ***! - \**********************/ -/*! exports provided: MPRManager, VRView, loadDemoSerieWithLarvitar, buildVtkVolume */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! regenerator-runtime/runtime */ \"./node_modules/regenerator-runtime/runtime.js\");\n/* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var vtk_js_Sources_Rendering_Profiles_Volume__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Profiles/Volume */ \"./node_modules/vtk.js/Sources/Rendering/Profiles/Volume.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Profiles_Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Profiles/Geometry */ \"./node_modules/vtk.js/Sources/Rendering/Profiles/Geometry.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Profiles_Glyph__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Profiles/Glyph */ \"./node_modules/vtk.js/Sources/Rendering/Profiles/Glyph.js\");\n/* harmony import */ var _vrView__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vrView */ \"./src/vrView.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"VRView\", function() { return _vrView__WEBPACK_IMPORTED_MODULE_4__[\"VRView\"]; });\n\n/* harmony import */ var _mprManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mprManager */ \"./src/mprManager.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MPRManager\", function() { return _mprManager__WEBPACK_IMPORTED_MODULE_5__[\"MPRManager\"]; });\n\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"loadDemoSerieWithLarvitar\", function() { return _utils__WEBPACK_IMPORTED_MODULE_6__[\"loadDemoSerieWithLarvitar\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"buildVtkVolume\", function() { return _utils__WEBPACK_IMPORTED_MODULE_6__[\"buildVtkVolume\"]; });\n\n// NOTE: this is necessary as workaround to this issue:\n// https://github.com/Kitware/vtk-js/issues/1882\n\n\n// Load the rendering pieces we want to use (for both WebGL and WebGPU)\n// Without these, nothing will appear into the scene\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://diglettk/./src/index.js?"); - -/***/ }), - -/***/ "./src/mprManager.js": -/*!***************************!*\ - !*** ./src/mprManager.js ***! - \***************************/ -/*! exports provided: MPRManager */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MPRManager\", function() { return MPRManager; });\n/* harmony import */ var _vtk_vtkInteractorStyleMPRWindowLevel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vtk/vtkInteractorStyleMPRWindowLevel */ \"./src/vtk/vtkInteractorStyleMPRWindowLevel.js\");\n/* harmony import */ var _vtk_vtkInteractorStyleMPRCrosshairs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vtk/vtkInteractorStyleMPRCrosshairs */ \"./src/vtk/vtkInteractorStyleMPRCrosshairs.js\");\n/* harmony import */ var _vtk_vtkInteractorStyleMPRPanZoom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vtk/vtkInteractorStyleMPRPanZoom */ \"./src/vtk/vtkInteractorStyleMPRPanZoom.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Coordinate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Coordinate */ \"./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/MatrixBuilder */ \"./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n/* harmony import */ var _mprView__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mprView */ \"./src/mprView.js\");\n// Use modified MPRSlice interactor\n\n\n\n\n\n\n\n\n\n\n/**\n * Internal state of a single view\n * @typedef {Object} State\n * @property {Number[]} slicePlaneNormal - The slice plane normal as [x,y,z]\n * @property {Number[]} sliceViewUp - The up vector as [x,y,z]\n * @property {Number} slicePlaneXRotation - The x axis rotation in deg\n * @property {Number} slicePlaneYRotation - The y axis rotation in deg\n * @property {Number} viewRotation - The view rotation in deg\n * @property {Number} sliceThickness - The MIP slice thickness in px\n * @property {String} blendMode - The active blending mode (\"MIP\", \"MinIP\", \"Average\")\n * @property {Object} window - wwwl\n * @property {Number} window.ww - Window width\n * @property {Number} window.wl - Window level\n */\n\n/** A manager for MPR views */\nclass MPRManager {\n /**\n * Create a manager.\n * @param {Object} elements - The 3 target HTML elements {key1:{}, key2:{}, key3:{}}.\n * @param {HTMLElement} elements.element - The target HTML elements.\n * @param {String} elements.key - The target HTML elements.\n */\n constructor(elements) {\n this.VERBOSE = false; // TODO setter\n this.syncWindowLevels = true; // TODO setter\n this._activeTool = null;\n\n // TODO input sanity check\n\n this.elements = elements;\n\n this.volume = null;\n\n this.sliceIntersection = [0, 0, 0];\n\n this.mprViews = {};\n\n this.initMPR();\n }\n\n /**\n * wwwl\n * @type {Array}\n */\n set wwwl([ww, wl]) {\n const lower = wl - ww / 2.0;\n const upper = wl + ww / 2.0;\n\n this.volume\n .getProperty()\n .getRGBTransferFunction(0)\n .setMappingRange(lower, upper);\n\n Object.keys(this.elements).forEach((key, i) => {\n this.mprViews[key].wwwl = [ww, wl];\n });\n }\n\n /**\n * Initialize the three MPR views\n * @private\n */\n initMPR() {\n Object.keys(this.elements).forEach((key, i) => {\n try {\n this.mprViews[key] = new _mprView__WEBPACK_IMPORTED_MODULE_6__[\"MPRView\"](key, i, this.elements[key].element);\n } catch (err) {\n console.error(\"Error creating MPRView\", key);\n console.error(err);\n }\n });\n\n if (this.VERBOSE) console.log(\"initialized\");\n }\n\n /**\n * Get initial State object\n * @returns {State} The initial internal state\n */\n getInitialState() {\n // cycle on keys, and reduce extracting only useful properties\n // NOTE: initialize reduce with cloned object!\n let viewsState = Object.keys(this.mprViews).reduce((result, key) => {\n let {\n slicePlaneNormal,\n sliceViewUp,\n slicePlaneXRotation,\n slicePlaneYRotation,\n viewRotation,\n _sliceThickness,\n _blendMode,\n window\n } = result[key];\n result[key] = {\n slicePlaneNormal,\n sliceViewUp,\n slicePlaneXRotation,\n slicePlaneYRotation,\n viewRotation,\n sliceThickness: _sliceThickness,\n blendMode: _blendMode,\n window\n };\n return result;\n }, Object.assign({}, this.mprViews));\n\n return {\n // interactorCenters: { top: [0, 0], left: [0, 0], front: [0, 0] },\n interactorCenters: Object.keys(this.elements).reduce(\n (res, key) => ({ ...res, [key]: [0, 0] }),\n {}\n ),\n sliceIntersection: [...this.sliceIntersection], // clone\n views: viewsState\n };\n }\n\n /**\n * Set the image to render\n * @param {State} state - The current manager state\n * @param {Array} image - The pixel data from DICOM serie\n */\n setImage(state, image) {\n let actor = Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"createVolumeActor\"])(image);\n this.volume = actor;\n this.sliceIntersection = Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"getVolumeCenter\"])(actor.getMapper());\n // update external state\n state.sliceIntersection = [...this.sliceIntersection];\n\n Object.keys(this.elements).forEach(key => {\n this.mprViews[key].initView(\n actor,\n state,\n // on scroll callback (it's fired but too early)\n () => {\n this.onScrolled.call(this, state);\n },\n // on initialized callback (fire when all is set)\n () => {\n this.onScrolled.call(this, state);\n }\n );\n });\n\n if (this._activeTool) {\n this.setTool(this._activeTool, state);\n }\n }\n\n /**\n * Set the active tool\n * @param {String} toolName - \"level\" or \"crosshair\"\n * @param {State} state - The current manager state\n */\n setTool(toolName, state) {\n switch (toolName) {\n case \"level\":\n this.setLevelTool(state);\n break;\n case \"crosshair\":\n this.setCrosshairTool(state);\n break;\n case \"zoom\":\n this.setZoomTool(state);\n break;\n case \"pan\":\n this.setPanTool(state);\n break;\n }\n }\n\n /**\n * Set \"pan\" as active tool\n * @private\n * @param {State} state - The current manager state\n */\n setPanTool(state) {\n Object.entries(state.views).forEach(([key]) => {\n const istyle = _vtk_vtkInteractorStyleMPRPanZoom__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n leftButtonTool: \"pan\"\n });\n istyle.setOnScroll(() => {\n this.onScrolled(state);\n });\n // update interactor center\n istyle.setOnPanChanged(() => {\n this.updateInteractorCenters(state);\n });\n this.mprViews[key].setInteractor(istyle);\n });\n this._activeTool = \"pan\";\n }\n\n /**\n * Set \"zoom\" as active tool\n * @private\n * @param {State} state - The current manager state\n */\n setZoomTool(state) {\n Object.entries(state.views).forEach(([key]) => {\n const istyle = _vtk_vtkInteractorStyleMPRPanZoom__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n leftButtonTool: \"zoom\"\n });\n istyle.setOnScroll(() => {\n this.onScrolled(state);\n });\n // update interactor center\n istyle.setOnZoomChanged(() => {\n this.updateInteractorCenters(state);\n });\n this.mprViews[key].setInteractor(istyle);\n });\n this._activeTool = \"zoom\";\n }\n\n /**\n * Set \"level\" as active tool\n * @private\n * @param {State} state - The current manager state\n */\n setLevelTool(state) {\n Object.entries(state.views).forEach(([key]) => {\n const istyle = _vtk_vtkInteractorStyleMPRWindowLevel__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance();\n istyle.setOnScroll(() => {\n this.onScrolled(state);\n });\n istyle.setOnLevelsChanged(levels => {\n this.updateLevels({ ...levels, srcKey: key }, state);\n });\n this.mprViews[key].setInteractor(istyle);\n });\n this._activeTool = \"level\";\n }\n\n /**\n * Set \"crosshair\" as active tool\n * @private\n * @param {State} state - The current manager state\n */\n setCrosshairTool(state) {\n let self = this;\n Object.entries(state.views).forEach(([key]) => {\n const istyle = _vtk_vtkInteractorStyleMPRCrosshairs__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n istyle.setOnScroll(() => {\n self.onScrolled(state);\n });\n istyle.setOnClickCallback(({ worldPos }) => {\n self.onCrosshairPointSelected({ worldPos, srcKey: key }, state);\n });\n this.mprViews[key].setInteractor(istyle);\n });\n this._activeTool = \"crosshair\";\n }\n\n /**\n * Update slice positions on user interaction (for crosshair tool)\n * @private\n * @param {Object} {}\n */\n onCrosshairPointSelected({ srcKey, worldPos }, externalState) {\n Object.keys(this.elements).forEach(key => {\n if (key !== srcKey) {\n // We are basically doing the same as getSlice but with the world coordinate\n // that we want to jump to instead of the camera focal point.\n // I would rather do the camera adjustment directly but I keep\n // doing it wrong and so this is good enough for now.\n // ~ swerik\n const renderWindow = this.mprViews[\n key\n ]._genericRenderWindow.getRenderWindow();\n\n const istyle = renderWindow.getInteractor().getInteractorStyle();\n const sliceNormal = istyle.getSliceNormal();\n const transform = vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n .buildFromDegree()\n .identity()\n .rotateFromDirections(sliceNormal, [1, 0, 0]);\n\n const mutatedWorldPos = worldPos.slice();\n transform.apply(mutatedWorldPos);\n const slice = mutatedWorldPos[0];\n\n istyle.setSlice(slice);\n\n renderWindow.render();\n }\n\n this.updateInteractorCenters(externalState);\n });\n\n // update both internal & external state\n this.sliceIntersection = [...worldPos];\n externalState.sliceIntersection = [...worldPos];\n }\n\n /**\n * Update wwwl on user interaction (for level tool)\n * @private\n * @param {Object} {}\n * @param {State} state - The current manager state\n */\n updateLevels({ windowCenter, windowWidth, srcKey }, state) {\n state.views[srcKey].window.center = windowCenter;\n state.views[srcKey].window.width = windowWidth;\n\n if (this.syncWindowLevels) {\n Object.keys(this.elements)\n .filter(key => key !== srcKey)\n .forEach(k => {\n this.mprViews[k].wwwl = [windowWidth, windowCenter];\n });\n }\n }\n\n /**\n * Update slice position when scrolling\n * @private\n */\n onScrolled(state) {\n let planes = [];\n\n Object.keys(this.elements).forEach(key => {\n const camera = this.mprViews[key].camera;\n planes.push({\n position: camera.getFocalPoint(),\n normal: camera.getDirectionOfProjection()\n // this[viewportIndex].slicePlaneNormal\n });\n });\n\n const newPoint = Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"getPlaneIntersection\"])(...planes);\n\n if (\n !Number.isNaN(newPoint) &&\n !newPoint.some(coord => Number.isNaN(coord))\n ) {\n this.sliceIntersection = [...newPoint];\n state.sliceIntersection = [...newPoint];\n if (this.VERBOSE) console.log(\"updating slice intersection\", newPoint);\n }\n\n this.updateInteractorCenters(state);\n\n return newPoint;\n }\n\n /**\n * Update slice planes on rotation\n * @param {String} key - One of the initially provided keys (identify a view)\n * @param {String} axis - 'x' or 'y' axis\n * @param {Number} angle - The amount of rotation [deg], absolute\n * @param {State} state - The current manager state\n */\n onRotate(key, axis, angle, state) {\n // Match the source axis to the associated plane\n switch (key) {\n case \"top\":\n if (axis === \"x\") state.views.front.slicePlaneYRotation = angle;\n else if (axis === \"y\") state.views.left.slicePlaneYRotation = angle;\n break;\n case \"left\":\n if (axis === \"x\") state.views.top.slicePlaneXRotation = angle;\n else if (axis === \"y\") state.views.front.slicePlaneXRotation = angle;\n break;\n case \"front\":\n if (axis === \"x\") state.views.top.slicePlaneYRotation = angle;\n else if (axis === \"y\") state.views.left.slicePlaneXRotation = angle;\n break;\n }\n\n // dv: this was a watcher in mpr component, update all except myself ?\n\n Object.keys(this.elements)\n .filter(c => c !== key)\n .forEach(k => {\n this.mprViews[k].updateSlicePlane(state.views[k]);\n });\n\n if (this.VERBOSE) console.log(\"afterOnRotate\", state);\n }\n\n /**\n * Update slice planes on rotation\n * @param {String} key - One of the initially provided keys (identify a view)\n * @param {String} axis - 'x' or 'y' axis\n * @param {Number} thickness - The amount of thickness [px], absolute\n * @param {State} state - The current manager state\n */\n onThickness(key, axis, thickness, state) {\n const shouldBeMIP = thickness > 1;\n let target_view;\n switch (key) {\n case \"top\":\n if (axis === \"x\") target_view = \"front\";\n else if (axis === \"y\") target_view = \"left\";\n break;\n case \"left\":\n if (axis === \"x\") target_view = \"top\";\n else if (axis === \"y\") target_view = \"front\";\n break;\n case \"front\":\n if (axis === \"x\") target_view = \"top\";\n else if (axis === \"y\") target_view = \"left\";\n break;\n }\n\n // if thickness > 1 switch to MIP\n if (shouldBeMIP && this.mprViews[target_view].blendMode === \"none\") {\n this.mprViews[target_view].blendMode = \"MIP\";\n state.mprViews[target_view].blendMode = \"MIP\";\n }\n\n // update both internal and external state\n this.mprViews[target_view].sliceThickness = thickness;\n state.views[target_view].sliceThickness = thickness;\n }\n\n /**\n * Update interactor centers coordinates on canvas\n * @private\n * @param {State} state - The current manager state\n */\n updateInteractorCenters(state) {\n Object.keys(this.elements).forEach(key => {\n // compute interactor centers display position\n const renderer = this.mprViews[key]._genericRenderWindow.getRenderer();\n const wPos = vtk_js_Sources_Rendering_Core_Coordinate__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n wPos.setCoordinateSystemToWorld();\n wPos.setValue(...this.sliceIntersection);\n const displayPosition = wPos.getComputedDisplayValue(renderer);\n if (this.VERBOSE) console.log(\"interactor center\", key, displayPosition);\n // set new interactor center on canvas into external state\n state.interactorCenters[key] = displayPosition;\n });\n }\n\n /**\n * Force views resize\n * @param {String} key - If provided, resize just its view, otherwise all views\n */\n resize(state, key) {\n if (key) {\n this.mprViews[key].onResize();\n } else {\n Object.values(this.mprViews).forEach(view => {\n view.onResize();\n });\n }\n this.updateInteractorCenters(state);\n }\n\n /**\n * Destroy webgl content and release listeners\n */\n destroy() {\n Object.keys(this.elements).forEach(k => {\n this.mprViews[k].destroy();\n });\n }\n}\n\n\n//# sourceURL=webpack://diglettk/./src/mprManager.js?"); - -/***/ }), - -/***/ "./src/mprView.js": -/*!************************!*\ - !*** ./src/mprView.js ***! - \************************/ -/*! exports provided: MPRView */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MPRView\", function() { return MPRView; });\n/* harmony import */ var vtk_js_Sources_Rendering_Misc_GenericRenderWindow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Misc/GenericRenderWindow */ \"./node_modules/vtk.js/Sources/Rendering/Misc/GenericRenderWindow/index.js\");\n/* harmony import */ var _vtk_vtkInteractorMPRSlice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vtk/vtkInteractorMPRSlice */ \"./src/vtk/vtkInteractorMPRSlice.js\");\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n\n\n\n\n\n\n\n/**\n * MPRView class\n * This is not intended to be used directly by user\n * Use MPRManager instead: it will create three instances of MPRView\n * @private\n *\n */\n\n// TODO move to constants (calculate from image directions?)\nconst PLANE_NORMALS = [[0, 0, 1], [-1, 0, 0], [0, 1, 0]];\nconst VIEW_UPS = [[0, -1, 0], [0, 0, 1], [0, 0, 1]];\nclass MPRView {\n constructor(key, i, element) {\n this.VERBOSE = false;\n this._key = key;\n this._element = element;\n this._volume = null;\n this._renderer = null;\n this._parallel = true; // TODO setter\n // this.onCreated = null; // TODO\n // this.onDestroyed = null; // TODO\n\n // init global data\n this.slicePlaneNormal = PLANE_NORMALS[i];\n this.sliceViewUp = VIEW_UPS[i];\n this.slicePlaneXRotation = 0;\n this.slicePlaneYRotation = 0;\n this.viewRotation = 0;\n this._sliceThickness = 0.1;\n this._blendMode = \"MIP\";\n this.window = {\n width: 0,\n center: 0\n };\n\n // cache the view vectors so we can apply the rotations without modifying the original value\n this._cachedSlicePlane = [...this.slicePlaneNormal];\n this._cachedSliceViewUp = [...this.sliceViewUp];\n\n this._genericRenderWindow = vtk_js_Sources_Rendering_Misc_GenericRenderWindow__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance({\n background: [0, 0, 0]\n });\n\n this._genericRenderWindow.setContainer(element);\n\n this._renderWindow = this._genericRenderWindow.getRenderWindow();\n this._renderer = this._genericRenderWindow.getRenderer();\n\n if (this._parallel) {\n this._renderer.getActiveCamera().setParallelProjection(true);\n }\n\n // update view node tree so that vtkOpenGLHardwareSelector can access the vtkOpenGLRenderer instance.\n const oglrw = this._genericRenderWindow.getOpenGLRenderWindow();\n oglrw.buildPass(true);\n\n /*\n // Use for maintaining clipping range for MIP (TODO)\n const interactor = this._renderWindow.getInteractor();\n //const clippingRange = renderer.getActiveCamera().getClippingRange();\n\n interactor.onAnimation(() => {\n renderer.getActiveCamera().setClippingRange(...r);\n });\n */\n\n // force the initial draw to set the canvas to the parent bounds.\n this.onResize();\n }\n\n /**\n * blendMode - \"MIP\", \"MinIP\", \"Average\"\n * @type {String}\n */\n set blendMode(blendMode) {\n this._blendMode = blendMode;\n this.updateBlendMode(this._sliceThickness, this._blendMode);\n }\n\n /**\n * sliceThickness\n * @type {Number}\n */\n set sliceThickness(thickness) {\n this._sliceThickness = thickness;\n const istyle = this._renderWindow.getInteractor().getInteractorStyle();\n // set thickness if the current interactor has it (it should, but just in case)\n istyle.setSlabThickness && istyle.setSlabThickness(this._sliceThickness);\n this.updateBlendMode(this._sliceThickness, this._blendMode);\n }\n\n /**\n * wwwl\n * @type {Array}\n */\n set wwwl([ww, wl]) {\n this.window.center = wl;\n this.window.width = ww;\n\n this._genericRenderWindow.getRenderWindow().render();\n }\n\n /**\n * camera\n * @type {vtkCamera}\n */\n get camera() {\n return this._genericRenderWindow.getRenderer().getActiveCamera();\n }\n\n /**\n * Initialize view: add actor to scene and setup controls & props\n * @param {vtkActor} actor\n * @param {State} data\n * @param {Function} onScrollCb\n */\n initView(actor, data, onScrollCb, onInitialized) {\n // dv: store volumes and element in viewport data\n this._volume = actor;\n\n const istyle = _vtk_vtkInteractorMPRSlice__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n istyle.setOnScroll(onScrollCb);\n const inter = this._renderWindow.getInteractor();\n inter.setInteractorStyle(istyle);\n\n // TODO: assumes the volume is always set for this mounted state...Throw an error?\n if (this.VERBOSE) console.log(this._volumes);\n const istyleVolumeMapper = this._volume.getMapper();\n\n istyle.setVolumeMapper(istyleVolumeMapper);\n\n //start with the volume center slice\n const range = istyle.getSliceRange();\n // if (this.VERBOSE) console.log('view mounted: setting the initial range', range)\n istyle.setSlice((range[0] + range[1]) / 2);\n\n // add the current volumes to the vtk renderer\n this.updateVolumesForRendering();\n\n if (this.VERBOSE) console.log(\"view data\", this._key, data.views[this.key]);\n this.updateSlicePlane(data.views[this._key]);\n\n // set camera to fill viewport\n this.fill2DView(this._genericRenderWindow, this._key);\n\n onInitialized();\n }\n\n /**\n * cleanup the scene and add new volume\n * @private\n */\n updateVolumesForRendering() {\n this._renderer.removeAllVolumes();\n if (this._volume) {\n if (!this._volume.isA(\"vtkVolume\")) {\n console.warn(\"Data to is not vtkVolume data\");\n } else {\n this._renderer.addVolume(this._volume);\n }\n }\n this._renderWindow.render();\n }\n\n /**\n * Recompute slice plane after changes\n * @param {State} viewData\n */\n updateSlicePlane(viewData) {\n // cached things are in viewport data\n let cachedSlicePlane = this._cachedSlicePlane;\n let cachedSliceViewUp = this._cachedSliceViewUp;\n if (this.VERBOSE) console.log(viewData);\n // TODO: optimize so you don't have to calculate EVERYTHING every time?\n\n // rotate around the vector of the cross product of the plane and viewup as the X component\n let sliceXRotVector = [];\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].cross(\n sliceXRotVector,\n viewData.sliceViewUp,\n viewData.slicePlaneNormal\n );\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].normalize(sliceXRotVector, sliceXRotVector);\n\n // rotate the viewUp vector as the Y component\n let sliceYRotVector = viewData.sliceViewUp;\n\n const planeMat = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"mat4\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"mat4\"].rotate(\n planeMat,\n planeMat,\n Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"degrees2radians\"])(viewData.slicePlaneYRotation),\n sliceYRotVector\n );\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"mat4\"].rotate(\n planeMat,\n planeMat,\n Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"degrees2radians\"])(viewData.slicePlaneXRotation),\n sliceXRotVector\n );\n\n if (this.VERBOSE)\n console.log(cachedSlicePlane, viewData.slicePlaneNormal, planeMat);\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].transformMat4(cachedSlicePlane, viewData.slicePlaneNormal, planeMat);\n\n // Rotate the viewUp in 90 degree increments\n const viewRotQuat = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].create();\n // Use - degrees since the axis of rotation should really be the direction of projection, which is the negative of the plane normal\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].setAxisAngle(\n viewRotQuat,\n cachedSlicePlane,\n Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"degrees2radians\"])(-viewData.viewRotation)\n );\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].normalize(viewRotQuat, viewRotQuat);\n\n // rotate the ViewUp with the x and z rotations\n const xQuat = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].setAxisAngle(\n xQuat,\n sliceXRotVector,\n Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"degrees2radians\"])(viewData.slicePlaneXRotation)\n );\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].normalize(xQuat, xQuat);\n const viewUpQuat = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"quat\"].add(viewUpQuat, xQuat, viewRotQuat);\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].transformQuat(cachedSliceViewUp, viewData.sliceViewUp, viewRotQuat);\n\n // update the view's slice\n const renderWindow = this._genericRenderWindow.getRenderWindow();\n const istyle = renderWindow.getInteractor().getInteractorStyle();\n if (istyle && istyle.setSliceNormal) {\n istyle.setSliceNormal(cachedSlicePlane, cachedSliceViewUp);\n }\n\n renderWindow.render();\n }\n\n // fit to window (vtk.js 11 version: https://github.com/Kitware/paraview-glance/issues/230)\n fill2DView() {\n // Based this code: https://github.com/Kitware/paraview-glance/issues/230#issuecomment-445779222\n const bounds = this._renderer.computeVisiblePropBounds();\n const dim = [\n (bounds[1] - bounds[0]) / 2,\n (bounds[3] - bounds[2]) / 2,\n (bounds[5] - bounds[4]) / 2\n ];\n const w = this._genericRenderWindow.getContainer().clientWidth;\n const h = this._genericRenderWindow.getContainer().clientHeight;\n const r = w / h;\n\n let x;\n let y;\n if (this._key === \"left\") {\n x = dim[1];\n y = dim[2];\n } else if (this._key === \"front\") {\n x = dim[0];\n y = dim[2];\n } else if (this._key === \"top\") {\n x = dim[0];\n y = dim[1];\n }\n if (r >= x / y) {\n // use width\n this._renderer.getActiveCamera().setParallelScale(y + 1);\n } else {\n // use height\n this._renderer.getActiveCamera().setParallelScale(x / r + 1);\n }\n this.onResize();\n }\n\n /**\n * on resize callback\n * @private\n */\n onResize() {\n // TODO: debounce for performance reasons?\n this._genericRenderWindow.resize();\n }\n\n /**\n * update blending after changes\n * @private\n * @param {Number} thickness\n * @param {String} blendMode\n */\n updateBlendMode(thickness, blendMode) {\n if (thickness >= 1) {\n switch (blendMode) {\n case \"MIP\":\n this._volume.getMapper().setBlendModeToMaximumIntensity();\n break;\n case \"MINIP\":\n this._volume.getMapper().setBlendModeToMinimumIntensity();\n break;\n case \"AVG\":\n this._volume.getMapper().setBlendModeToAverageIntensity();\n break;\n case \"none\":\n default:\n this._volume.getMapper().setBlendModeToComposite();\n break;\n }\n } else {\n this._volume.getMapper().setBlendModeToComposite();\n }\n this._renderWindow.render();\n }\n\n /**\n * Setup interactor\n * @param {vtkInteractorStyle} istyle\n */\n setInteractor(istyle) {\n const renderWindow = this._genericRenderWindow.getRenderWindow();\n // We are assuming the old style is always extended from the MPRSlice style\n const oldStyle = renderWindow.getInteractor().getInteractorStyle();\n\n renderWindow.getInteractor().setInteractorStyle(istyle);\n istyle.setInteractor(renderWindow.getInteractor());\n\n // Make sure to set the style to the interactor itself, because reasons...?!\n const inter = renderWindow.getInteractor();\n inter.setInteractorStyle(istyle);\n\n // Copy previous interactors styles into the new one.\n if (istyle.setSliceNormal && oldStyle.getSliceNormal()) {\n // if (VERBOSE) console.log(\"setting slicenormal from old normal\");\n istyle.setSliceNormal(oldStyle.getSliceNormal(), oldStyle.getViewUp());\n }\n if (istyle.setSlabThickness && oldStyle.getSlabThickness()) {\n istyle.setSlabThickness(oldStyle.getSlabThickness());\n }\n istyle.setVolumeMapper(this._volume);\n\n // set current slice (fake) to make distance widget working\n // istyle.setCurrentImageNumber(0);\n }\n\n /**\n * Destroy webgl content and release listeners\n */\n destroy() {\n if (this.VERBOSE) console.log(\"DESTROY\", this._key);\n\n this.VERBOSE = null;\n this._key = null;\n this._element = null;\n // mapper is in common btw views, check that it has not already been deleted by other view\n if (this._volume.getMapper()) {\n this._volume.getMapper().delete();\n }\n this._volume.delete();\n this._volume = null;\n\n this._renderer.delete();\n this._renderer = null;\n this._parallel = null;\n\n this.slicePlaneNormal = null;\n this.sliceViewUp = null;\n this.slicePlaneXRotation = null;\n this.slicePlaneYRotation = null;\n this.viewRotation = null;\n this._sliceThickness = null;\n this._blendMode = null;\n this.window = null;\n\n this._cachedSlicePlane = null;\n this._cachedSliceViewUp = null;\n\n this._genericRenderWindow.delete();\n\n // delete resize listener ?\n }\n}\n\n\n//# sourceURL=webpack://diglettk/./src/mprView.js?"); - -/***/ }), - -/***/ "./src/strategies.js": -/*!***************************!*\ - !*** ./src/strategies.js ***! - \***************************/ -/*! exports provided: applyStrategy */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyStrategy\", function() { return applyStrategy; });\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n\n\n/**\n * Apply the logic to measure length between two points\n * @param {Object} state - The measurement state\n */\nfunction applyLengthStrategy(state, displayPosition, pickedPoint) {\n if (state.p1[0] && state.p2[0]) {\n state.p1 = displayPosition;\n state.p1_world = pickedPoint;\n state.p2 = [undefined, undefined];\n state.p2_world = [undefined, undefined];\n state.label = undefined;\n } else {\n if (state.p1[0]) {\n state.p2 = displayPosition;\n state.p2_world = pickedPoint;\n } else {\n state.p1 = displayPosition;\n state.p1_world = pickedPoint;\n }\n }\n\n //compute distance\n if (state.p1[0] && state.p2[0]) {\n let dist2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"distance2BetweenPoints\"](state.p1_world, state.p2_world);\n let d = Math.sqrt(dist2).toFixed(1);\n state.label = `${d} mm`;\n } else {\n state.label = \"\";\n }\n}\n\n/**\n * Apply the logic to measure angle between two segments\n * @param {Object} state - The measurement state\n */\nfunction applyAngleStrategy(state, displayPosition, pickedPoint) {\n if (state.p1[0] && state.p2[0] && state.p3[0]) {\n state.p1 = displayPosition;\n state.p1_world = pickedPoint;\n state.p2 = state.p3 = [undefined, undefined];\n state.p2_world = state.p3_world = [undefined, undefined];\n state.label = undefined;\n } else {\n if (state.p1[0] && state.p2[0]) {\n state.p3 = displayPosition;\n state.p3_world = pickedPoint;\n } else if (state.p1[0]) {\n state.p2 = displayPosition;\n state.p2_world = pickedPoint;\n } else {\n state.p1 = displayPosition;\n state.p1_world = pickedPoint;\n }\n }\n\n // compute angle\n if (state.p1[0] && state.p2[0] && state.p3[0]) {\n let vA = new Array(3);\n let vB = new Array(3);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](state.p2_world, state.p3_world, vA);\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"subtract\"](state.p2_world, state.p1_world, vB);\n let angle = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"angleBetweenVectors\"](vA, vB);\n let a = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_0__[\"degreesFromRadians\"](angle).toFixed(1);\n state.label = `${a}°`;\n } else {\n state.label = \"\";\n }\n}\n\nconst STRATEGIES = {\n Length: applyLengthStrategy,\n Angle: applyAngleStrategy\n};\n\nfunction applyStrategy(state, displayPosition, pickedPoint, mode) {\n return STRATEGIES[mode](state, displayPosition, pickedPoint);\n}\n\n\n//# sourceURL=webpack://diglettk/./src/strategies.js?"); - -/***/ }), - -/***/ "./src/utils.js": -/*!**********************!*\ - !*** ./src/utils.js ***! - \**********************/ -/*! exports provided: buildVtkVolume, fitToWindow, loadDemoSerieWithLarvitar, createRGBStringFromRGBValues, degrees2radians, getVolumeCenter, getVOI, getPlaneIntersection, createVolumeActor */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildVtkVolume\", function() { return buildVtkVolume; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fitToWindow\", function() { return fitToWindow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadDemoSerieWithLarvitar\", function() { return loadDemoSerieWithLarvitar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createRGBStringFromRGBValues\", function() { return createRGBStringFromRGBValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"degrees2radians\", function() { return degrees2radians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getVolumeCenter\", function() { return getVolumeCenter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getVOI\", function() { return getVOI; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPlaneIntersection\", function() { return getPlaneIntersection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createVolumeActor\", function() { return createVolumeActor; });\n/* harmony import */ var vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/DataArray */ \"./node_modules/vtk.js/Sources/Common/Core/DataArray/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/ImageData */ \"./node_modules/vtk.js/Sources/Common/DataModel/ImageData/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/Plane */ \"./node_modules/vtk.js/Sources/Common/DataModel/Plane/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Volume__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Volume */ \"./node_modules/vtk.js/Sources/Rendering/Core/Volume/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_VolumeMapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/VolumeMapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/VolumeMapper/index.js\");\n\n\n\n\n\n\nfunction buildVtkVolume(header, data) {\n const dims = [\n header.volume.cols,\n header.volume.rows,\n header.volume.imageIds.length\n ];\n const numScalars = dims[0] * dims[1] * dims[2];\n\n if (numScalars < 1 || dims[1] < 2 || dims[1] < 2 || dims[2] < 2) {\n return;\n }\n\n const volume = vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n const origin = header.volume.imagePosition;\n const spacing = header.volume.pixelSpacing.concat(\n header.volume.sliceThickness // TODO check\n );\n\n volume.setDimensions(dims);\n volume.setOrigin(origin);\n volume.setSpacing(spacing);\n\n const scalars = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance({\n name: \"Scalars\",\n values: data,\n numberOfComponents: 1\n });\n\n volume.getPointData().setScalars(scalars);\n\n volume.modified();\n\n return volume;\n}\n\n// fit to window\nfunction fitToWindow(genericRenderWindow, dir) {\n const bounds = genericRenderWindow.getRenderer().computeVisiblePropBounds();\n const dim = [\n (bounds[1] - bounds[0]) / 2,\n (bounds[3] - bounds[2]) / 2,\n (bounds[5] - bounds[4]) / 2\n ];\n const w = genericRenderWindow.getContainer().clientWidth;\n const h = genericRenderWindow.getContainer().clientHeight;\n const r = w / h;\n\n let x;\n let y;\n if (dir === \"x\") {\n x = dim[1];\n y = dim[2];\n } else if (dir === \"y\") {\n x = dim[0];\n y = dim[2];\n } else if (dir === \"z\") {\n x = dim[0];\n y = dim[1];\n }\n if (r >= x / y) {\n // use width\n genericRenderWindow\n .getRenderer()\n .getActiveCamera()\n .setParallelScale(y + 1);\n } else {\n // use height\n genericRenderWindow\n .getRenderer()\n .getActiveCamera()\n .setParallelScale(x / r + 1);\n }\n}\n\nlet larvitarInitialized = false;\n\nfunction loadDemoSerieWithLarvitar(name, lrv, cb) {\n let demoFiles = [];\n let counter = 0;\n let demoFileList = getDemoFileNames();\n\n function getDemoFileNames() {\n let numberOfFiles = name == \"knee\" ? 24 : 364;\n let demoFileList = [];\n for (let i = 1; i < numberOfFiles; i++) {\n let filename = `${name} (${i})`;\n demoFileList.push(filename);\n }\n return demoFileList;\n }\n\n async function createFile(fileName, cb) {\n let response = await fetch(\"./demo/\" + fileName);\n let data = await response.blob();\n let file = new File([data], fileName);\n demoFiles.push(file);\n counter++;\n if (counter == demoFileList.length) {\n cb();\n }\n }\n\n if (!larvitarInitialized) {\n // init all larvitar\n lrv.initLarvitarStore();\n lrv.initializeImageLoader();\n lrv.initializeCSTools();\n lrv.larvitar_store.addViewport(\"viewer\");\n larvitarInitialized = true;\n }\n\n // load dicom and render\n demoFileList.forEach(function(demoFile) {\n createFile(demoFile, () => {\n lrv.resetImageParsing();\n lrv.readFiles(demoFiles, function(seriesStack, err) {\n // return the first series of the study\n let seriesId = _.keys(seriesStack)[0];\n let serie = seriesStack[seriesId];\n\n // hack to avoid load and cache (render + timeout)\n lrv.renderImage(serie, \"viewer\");\n if (cb) {\n setTimeout(cb, 3000, serie); // increase timeout if \"getPixelData\" error\n }\n });\n });\n });\n}\n\n/**\n * Function to create synthetic image data with correct dimensions\n * Can be use for debug\n * @private\n * @param {Array} dims - Array[int]\n */\n// eslint-disable-next-line no-unused-vars\nfunction createSyntheticImageData(dims) {\n const imageData = vtk_js_Sources_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\n const newArray = new Uint8Array(dims[0] * dims[1] * dims[2]);\n const s = 0.1;\n imageData.setSpacing(s, s, s);\n imageData.setExtent(0, 127, 0, 127, 0, 127);\n let i = 0;\n for (let z = 0; z < dims[2]; z++) {\n for (let y = 0; y < dims[1]; y++) {\n for (let x = 0; x < dims[0]; x++) {\n newArray[i++] = (256 * (i % (dims[0] * dims[1]))) / (dims[0] * dims[1]);\n }\n }\n }\n\n const da = vtk_js_Sources_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance({\n numberOfComponents: 1,\n values: newArray\n });\n da.setName(\"scalars\");\n\n imageData.getPointData().setScalars(da);\n\n return imageData;\n}\n\nfunction createRGBStringFromRGBValues(rgb) {\n if (rgb.length !== 3) {\n return \"rgb(0, 0, 0)\";\n }\n return `rgb(${(rgb[0] * 255).toString()}, ${(rgb[1] * 255).toString()}, ${(\n rgb[2] * 255\n ).toString()})`;\n}\n\nfunction degrees2radians(degrees) {\n return (degrees * Math.PI) / 180;\n}\n\nfunction getVolumeCenter(volumeMapper) {\n const bounds = volumeMapper.getBounds();\n return [\n (bounds[0] + bounds[1]) / 2.0,\n (bounds[2] + bounds[3]) / 2.0,\n (bounds[4] + bounds[5]) / 2.0\n ];\n}\n\nfunction getVOI(volume) {\n // Note: This controls window/level\n\n // TODO: Make this work reactively with onModified...\n const rgbTransferFunction = volume.getProperty().getRGBTransferFunction(0);\n const range = rgbTransferFunction.getMappingRange();\n const windowWidth = range[0] + range[1];\n const windowCenter = range[0] + windowWidth / 2;\n\n return {\n windowCenter,\n windowWidth\n };\n}\n\n/**\n * Planes are of type `{position:[x,y,z], normal:[x,y,z]}`\n * returns an [x,y,z] array, or NaN if they do not intersect.\n * @private\n */\nconst getPlaneIntersection = (plane1, plane2, plane3) => {\n try {\n let line = vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_2__[\"default\"].intersectWithPlane(\n plane1.position,\n plane1.normal,\n plane2.position,\n plane2.normal\n );\n if (line.intersection) {\n const { l0, l1 } = line;\n const intersectionLocation = vtk_js_Sources_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_2__[\"default\"].intersectWithLine(\n l0,\n l1,\n plane3.position,\n plane3.normal\n );\n if (intersectionLocation.intersection) {\n return intersectionLocation.x;\n }\n }\n } catch (err) {\n console.log(\"some issue calculating the plane intersection\", err);\n }\n return NaN;\n};\n\nfunction createVolumeActor(contentData) {\n const volumeActor = vtk_js_Sources_Rendering_Core_Volume__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\n const volumeMapper = vtk_js_Sources_Rendering_Core_VolumeMapper__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\n volumeMapper.setSampleDistance(1);\n volumeActor.setMapper(volumeMapper);\n\n volumeMapper.setInputData(contentData);\n\n // set a default wwwl\n const dataRange = contentData\n .getPointData()\n .getScalars()\n .getRange();\n\n // FIXME: custom range mapping\n const rgbTransferFunction = volumeActor\n .getProperty()\n .getRGBTransferFunction(0);\n rgbTransferFunction.setMappingRange(dataRange[0], dataRange[1]);\n\n // update slice min/max values for interface\n // Crate imageMapper for I,J,K planes\n // const dataRange = data\n // .getPointData()\n // .getScalars()\n // .getRange();\n // const extent = data.getExtent();\n // this.window = {\n // min: 0,\n // max: dataRange[1] * 2,\n // value: dataRange[1]\n // };\n // this.level = {\n // min: -dataRange[1],\n // max: dataRange[1],\n // value: (dataRange[0] + dataRange[1]) / 2\n // };\n // this.updateColorLevel();\n // this.updateColorWindow();\n\n // TODO: find the volume center and set that as the slice intersection point.\n // TODO: Refactor the MPR slice to set the focal point instead of defaulting to volume center\n\n return volumeActor;\n}\n\n\n//# sourceURL=webpack://diglettk/./src/utils.js?"); - -/***/ }), - -/***/ "./src/vrView.js": -/*!***********************!*\ - !*** ./src/vrView.js ***! - \***********************/ -/*! exports provided: VRView */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VRView\", function() { return VRView; });\n/* harmony import */ var vtk_js_Sources_Rendering_Misc_GenericRenderWindow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Misc/GenericRenderWindow */ \"./node_modules/vtk.js/Sources/Rendering/Misc/GenericRenderWindow/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ColorTransferFunction */ \"./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/DataModel/PiecewiseFunction */ \"./node_modules/vtk.js/Sources/Common/DataModel/PiecewiseFunction/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget */ \"./node_modules/vtk.js/Sources/Widgets/Widgets3D/ImageCroppingWidget/index.js\");\n/* harmony import */ var vtk_js_Sources_Filters_General_ImageCropFilter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Filters/General/ImageCropFilter */ \"./node_modules/vtk.js/Sources/Filters/General/ImageCropFilter/index.js\");\n/* harmony import */ var vtk_js_Sources_Widgets_Core_WidgetManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Widgets/Core/WidgetManager */ \"./node_modules/vtk.js/Sources/Widgets/Core/WidgetManager/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps */ \"./node_modules/vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Widgets_PiecewiseGaussianWidget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget */ \"./node_modules/vtk.js/Sources/Interaction/Widgets/PiecewiseGaussianWidget/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Style_InteractorStyleManipulator__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Style/InteractorStyleManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_PointPicker__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/PointPicker */ \"./node_modules/vtk.js/Sources/Rendering/Core/PointPicker/index.js\");\n/* harmony import */ var vtk_js_Sources_Filters_Sources_PlaneSource__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! vtk.js/Sources/Filters/Sources/PlaneSource */ \"./node_modules/vtk.js/Sources/Filters/Sources/PlaneSource/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Mapper */ \"./node_modules/vtk.js/Sources/Rendering/Core/Mapper/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Actor */ \"./node_modules/vtk.js/Sources/Rendering/Core/Actor/index.js\");\n/* harmony import */ var vtk_js_Sources_Filters_Sources_SphereSource__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! vtk.js/Sources/Filters/Sources/SphereSource */ \"./node_modules/vtk.js/Sources/Filters/Sources/SphereSource/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Coordinate__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Coordinate */ \"./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/index.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n/* harmony import */ var _strategies__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./strategies */ \"./src/strategies.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n//TODO interactions:\r\n\r\n/**\r\n * setTool(\"Length/Angle\", {mouseButtonMask:1}, measurementState); => per cambiare interactors tasto sx\r\n * setupMouseButtons(config); => inizializzare il tasto dx del mouse\r\n * measurementState = {\r\n * p1: [0, 0],\r\n * p2: [0, 0],\r\n * p3: [0, 0],\r\n * label: `string`\r\n * }\r\n */\r\n\r\n/** A class representing a Volume Rendering scene */\r\nclass VRView {\r\n /**\r\n * Create a volume rendering scene\r\n * @param {HTMLElement} element - the target html element to render the scene\r\n */\r\n constructor(element) {\r\n this.VERBOSE = false;\r\n\r\n this.element = element;\r\n this.renderer = null;\r\n this.renderWindow = null;\r\n this._genericRenderWindow = null;\r\n this.actor = null;\r\n this._raysDistance = 2.5;\r\n this._blurOnInteraction = null;\r\n this._rescaleLUT = false; // cannot initialize true (must set lut before)\r\n\r\n // piecewise gaussian widget stuff\r\n this.PGwidgetElement = null;\r\n this.PGwidget = null;\r\n this.gaussians = null;\r\n this._PGwidgetLoaded = false;\r\n\r\n // crop widget\r\n this._cropWidget = null;\r\n\r\n // normalized ww wl\r\n this.ww = 0.25;\r\n this.wl = 0.3;\r\n\r\n // absolute ww wl\r\n this.wwwl = [0, 0];\r\n\r\n // measurement state\r\n this._measurementState = null;\r\n\r\n this.initVR();\r\n }\r\n\r\n /**\r\n * wwwl\r\n * @type {Array}\r\n */\r\n set wwwl(value) {\r\n if (!this.actor) {\r\n return;\r\n }\r\n\r\n const dataArray = this.actor\r\n .getMapper()\r\n .getInputData()\r\n .getPointData()\r\n .getScalars();\r\n\r\n const range = dataArray.getRange();\r\n let rel_ww = value[0] / (range[1] - range[0]);\r\n let rel_wl = (value[1] - range[0]) / range[1];\r\n\r\n this.wl = rel_wl;\r\n this.ww = rel_ww;\r\n\r\n if (this.PGwidget) {\r\n this.updateWidget();\r\n }\r\n }\r\n\r\n get wwwl() {\r\n const dataArray = this.actor\r\n .getMapper()\r\n .getInputData()\r\n .getPointData()\r\n .getScalars();\r\n\r\n const range = dataArray.getRange();\r\n\r\n let abs_ww = rel_ww * (range[1] - range[0]);\r\n let abs_wl = rel_wl * range[1] + range[0];\r\n return [abs_ww, abs_wl];\r\n }\r\n\r\n /**\r\n * raysDistance\r\n * @type {Number}\r\n */\r\n set resolution(value) {\r\n this._raysDistance = 5 / value;\r\n this.actor.getMapper().setSampleDistance(this._raysDistance);\r\n this.renderWindow.render();\r\n }\r\n\r\n get resolution() {\r\n return Math.round(this._raysDistance * 5);\r\n }\r\n\r\n /**\r\n * Presets\r\n * @type {Array}\r\n */\r\n get presetsList() {\r\n return vtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_6__[\"default\"].rgbPresetNames;\r\n }\r\n\r\n /**\r\n * PGwidgetElement (set null to hide)\r\n * @type {HTMLelement}\r\n */\r\n set widgetElement(element) {\r\n this.PGwidgetElement = element;\r\n let h = element.offsetHeight ? element.offsetHeight - 5 : 100;\r\n let w = element.offsetWidth ? element.offsetWidth - 5 : 300;\r\n this.PGwidget.setSize(w, h);\r\n this.PGwidget.setContainer(this.PGwidgetElement);\r\n this.PGwidget.render();\r\n }\r\n\r\n /**\r\n * Flag to set lut rescaling on opacity range\r\n * @type {bool}\r\n */\r\n set rescaleLUT(bool) {\r\n this._rescaleLUT = bool;\r\n let range;\r\n if (this._rescaleLUT && this.PGwidget) {\r\n range = this.PGwidget.getOpacityRange();\r\n } else {\r\n range = this.actor\r\n .getMapper()\r\n .getInputData()\r\n .getPointData()\r\n .getScalars()\r\n .getRange();\r\n }\r\n this.ctfun.setMappingRange(...range);\r\n this.ctfun.updateRange();\r\n }\r\n\r\n /**\r\n * Crop widget on / off\r\n * @type {bool}\r\n */\r\n set cropWidget(visible) {\r\n if (!this._cropWidget) this.setupCropWidget();\r\n this._cropWidget.setVisibility(visible);\r\n this._widgetManager.renderWidgets();\r\n this.renderWindow.render();\r\n }\r\n\r\n /**\r\n * Set colormap and opacity function\r\n * lutName - as in presets list\r\n * @type {String}\r\n */\r\n set lut(lutName) {\r\n // set up color transfer function\r\n const lookupTable = vtk_js_Sources_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance();\r\n lookupTable.applyColorMap(vtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getPresetByName(lutName));\r\n\r\n // update lookup table mapping range based on input dataset\r\n let range;\r\n\r\n if (this._rescaleLUT && this._PGwidgetLoaded) {\r\n range = this.PGwidget.getOpacityRange();\r\n } else {\r\n range = this.actor\r\n .getMapper()\r\n .getInputData()\r\n .getPointData()\r\n .getScalars()\r\n .getRange();\r\n }\r\n\r\n lookupTable.setMappingRange(...range);\r\n lookupTable.updateRange();\r\n\r\n this.actor.getProperty().setRGBTransferFunction(0, lookupTable);\r\n\r\n // set up opacity function (values will be set by PGwidget)\r\n const piecewiseFun = vtk_js_Sources_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance();\r\n this.actor.getProperty().setScalarOpacity(0, piecewiseFun);\r\n\r\n this.ctfun = lookupTable;\r\n this.ofun = piecewiseFun;\r\n\r\n this.updateWidget();\r\n }\r\n\r\n /**\r\n * Initialize rendering scene\r\n * @private\r\n */\r\n initVR() {\r\n const genericRenderWindow = vtk_js_Sources_Rendering_Misc_GenericRenderWindow__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance();\r\n genericRenderWindow.setContainer(this.element);\r\n genericRenderWindow.setBackground([0, 0, 0]);\r\n\r\n //add custom resize cb\r\n genericRenderWindow.onResize(() => {\r\n // bypass genericRenderWindow resize method (do not consider devicePixelRatio)\r\n // https://kitware.github.io/vtk-js/api/Rendering_Misc_GenericRenderWindow.html\r\n let size = [\r\n genericRenderWindow.getContainer().getBoundingClientRect().width,\r\n genericRenderWindow.getContainer().getBoundingClientRect().height\r\n ];\r\n genericRenderWindow\r\n .getRenderWindow()\r\n .getViews()[0]\r\n .setSize(size);\r\n\r\n if (this.VERBOSE) console.log(\"resize\", size);\r\n });\r\n\r\n // resize callback\r\n window.addEventListener(\"resize\", evt => {\r\n genericRenderWindow.resize();\r\n });\r\n\r\n genericRenderWindow.resize();\r\n\r\n this.renderer = genericRenderWindow.getRenderer();\r\n this.renderWindow = genericRenderWindow.getRenderWindow();\r\n this._genericRenderWindow = genericRenderWindow;\r\n\r\n this.setupPGwidget();\r\n }\r\n\r\n /**\r\n * Set the image to be rendered\r\n * @param {ArrayBuffer} image - The image content data as buffer array\r\n */\r\n setImage(image) {\r\n // clean scene\r\n this.renderer.removeAllVolumes();\r\n let actor = Object(_utils__WEBPACK_IMPORTED_MODULE_19__[\"createVolumeActor\"])(image);\r\n this.actor = actor;\r\n this.lut = \"Grayscale\";\r\n this.renderer.addVolume(actor);\r\n this.setCamera(actor.getCenter());\r\n\r\n if (this.PGwidget) {\r\n this.updateWidget();\r\n this.setWidgetCallbacks();\r\n }\r\n\r\n // TODO implement a strategy to set rays distance\r\n // TODO interactors switching (ex. blurring or wwwl or crop)\r\n\r\n this.setupInteractor();\r\n\r\n this.blurOnInteraction = true;\r\n\r\n this._genericRenderWindow.resize();\r\n this.renderer.resetCamera();\r\n this.renderWindow.render();\r\n }\r\n\r\n /**\r\n * Set camera lookat point\r\n * @param {Array} center - As [x,y,z]\r\n */\r\n setCamera(center) {\r\n this.renderer.resetCamera();\r\n this.renderer.getActiveCamera().zoom(1.5);\r\n this.renderer.getActiveCamera().elevation(70);\r\n this.renderer.getActiveCamera().setViewUp(0, 0, 1);\r\n this.renderer\r\n .getActiveCamera()\r\n .setFocalPoint(center[0], center[1], center[2]);\r\n this.renderer\r\n .getActiveCamera()\r\n .setPosition(center[0], center[1] - 2000, center[2]);\r\n this.renderer.getActiveCamera().setThickness(10000);\r\n this.renderer.getActiveCamera().setParallelProjection(true);\r\n }\r\n\r\n /**\r\n * Get vtk LUTs list\r\n * @returns {Array} - Lut list as array of strings\r\n */\r\n getLutList() {\r\n return vtk_js_Sources_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_6__[\"default\"].rgbPresetNames;\r\n }\r\n\r\n /**\r\n * Set actor appearance properties\r\n * TODO\r\n */\r\n setActorProperties() {\r\n // this.actor.getProperty().setRGBTransferFunction(0, lutFuncs.ctfun);\r\n // this.actor.getProperty().setScalarOpacity(0, lutFuncs.ofun);\r\n this.actor.getProperty().setScalarOpacityUnitDistance(0, 30.0);\r\n this.actor.getProperty().setInterpolationTypeToLinear();\r\n this.actor.getProperty().setUseGradientOpacity(0, true);\r\n this.actor.getProperty().setGradientOpacityMinimumValue(0, 2);\r\n this.actor.getProperty().setGradientOpacityMinimumOpacity(0, 0.0);\r\n this.actor.getProperty().setGradientOpacityMaximumValue(0, 20);\r\n this.actor.getProperty().setGradientOpacityMaximumOpacity(0, 2.0);\r\n this.actor.getProperty().setShade(true);\r\n this.actor.getProperty().setAmbient(state.ambient);\r\n this.actor.getProperty().setDiffuse(state.diffuse);\r\n this.actor.getProperty().setSpecular(state.specular);\r\n this.actor.getProperty().setSpecularPower(state.specularPower);\r\n }\r\n\r\n /**\r\n * Setup crop widget\r\n */\r\n setupCropWidget() {\r\n // setup widget manager and widget\r\n const widgetManager = vtk_js_Sources_Widgets_Core_WidgetManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance();\r\n // widgetManager.setUseSvgLayer(false);\r\n widgetManager.setRenderer(this.renderer);\r\n\r\n // widget factory\r\n const widget = vtk_js_Sources_Widgets_Widgets3D_ImageCroppingWidget__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance();\r\n // instance of a widget associated with a renderer\r\n const viewWidget = widgetManager.addWidget(widget);\r\n\r\n // setup crop filter\r\n const cropFilter = vtk_js_Sources_Filters_General_ImageCropFilter__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance();\r\n // listen to cropping widget state to inform the crop filter\r\n const cropState = widget.getWidgetState().getCroppingPlanes();\r\n cropState.onModified(() => {\r\n cropFilter.setCroppingPlanes(cropState.getPlanes());\r\n });\r\n\r\n // wire up the reader, crop filter, and mapper\r\n let mapper = this.actor.getMapper();\r\n let image = mapper.getInputData();\r\n cropFilter.setCroppingPlanes(...image.getExtent());\r\n widget.copyImageDataDescription(image);\r\n\r\n widget.set({\r\n faceHandlesEnabled: true,\r\n edgeHandlesEnabled: true,\r\n cornerHandlesEnabled: true\r\n });\r\n\r\n cropFilter.setInputData(image);\r\n mapper.setInputConnection(cropFilter.getOutputPort());\r\n\r\n widgetManager.enablePicking();\r\n\r\n this._widgetManager = widgetManager;\r\n this._cropWidget = widget; // or viewWidget ?\r\n\r\n this.renderWindow.render();\r\n }\r\n\r\n /**\r\n * Append a vtkPiecewiseGaussianWidget into the target element\r\n * @private\r\n * @param {HTMLElement} widgetContainer - The target element to place the widget\r\n */\r\n setupPGwidget() {\r\n let containerWidth = this.PGwidgetElement\r\n ? this.PGwidgetElement.offsetWidth - 5\r\n : 300;\r\n let containerHeight = this.PGwidgetElement\r\n ? this.PGwidgetElement.offsetHeight - 5\r\n : 100;\r\n\r\n const PGwidget = vtk_js_Sources_Interaction_Widgets_PiecewiseGaussianWidget__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance({\r\n numberOfBins: 256,\r\n size: [containerWidth, containerHeight]\r\n });\r\n // TODO expose style\r\n PGwidget.updateStyle({\r\n backgroundColor: \"rgba(255, 255, 255, 0.6)\",\r\n histogramColor: \"rgba(50, 50, 50, 0.8)\",\r\n strokeColor: \"rgb(0, 0, 0)\",\r\n activeColor: \"rgb(255, 255, 255)\",\r\n handleColor: \"rgb(50, 150, 50)\",\r\n buttonDisableFillColor: \"rgba(255, 255, 255, 0.5)\",\r\n buttonDisableStrokeColor: \"rgba(0, 0, 0, 0.5)\",\r\n buttonStrokeColor: \"rgba(0, 0, 0, 1)\",\r\n buttonFillColor: \"rgba(255, 255, 255, 1)\",\r\n strokeWidth: 1,\r\n activeStrokeWidth: 1.5,\r\n buttonStrokeWidth: 1,\r\n handleWidth: 1,\r\n iconSize: 0, // Can be 0 if you want to remove buttons (dblClick for (+) / rightClick for (-))\r\n padding: 1\r\n });\r\n\r\n // to hide widget\r\n PGwidget.setContainer(this.PGwidgetElement); // Set to null to hide\r\n\r\n // resize callback\r\n window.addEventListener(\"resize\", evt => {\r\n PGwidget.setSize(\r\n this.PGwidgetElement.offsetWidth - 5,\r\n this.PGwidgetElement.offsetHeight - 5\r\n );\r\n PGwidget.render();\r\n });\r\n\r\n this.PGwidget = PGwidget;\r\n }\r\n\r\n /**\r\n * Update the PGwidget after an image has been loaded\r\n * @private\r\n */\r\n updateWidget() {\r\n const dataArray = this.actor\r\n .getMapper()\r\n .getInputData()\r\n .getPointData()\r\n .getScalars();\r\n\r\n this.PGwidget.setDataArray(dataArray.getData());\r\n\r\n let gaussians = this.PGwidget.getGaussians();\r\n\r\n if (gaussians.length > 0) {\r\n let gaussian = gaussians[0];\r\n\r\n gaussian.position = this.wl;\r\n gaussian.width = this.ww;\r\n\r\n this.PGwidget.setGaussians([gaussian]);\r\n } else {\r\n // TODO initilize in a smarter way\r\n const default_opacity = 1.0;\r\n const default_skew = 0.0;\r\n const default_bias = 0.0;\r\n this.PGwidget.addGaussian(\r\n this.wl,\r\n default_opacity,\r\n this.ww,\r\n default_bias,\r\n default_skew\r\n ); // x, y, ampiezza, sbilanciamento, andamento\r\n }\r\n\r\n this.PGwidget.applyOpacity(this.ofun);\r\n this.PGwidget.setColorTransferFunction(this.ctfun);\r\n this.ctfun.onModified(() => {\r\n this.PGwidget.render();\r\n this.renderWindow.render();\r\n });\r\n\r\n this._PGwidgetLoaded = true;\r\n }\r\n\r\n /**\r\n * Binds callbacks to user interactions on PGwidget\r\n * @private\r\n */\r\n setWidgetCallbacks() {\r\n this.PGwidget.bindMouseListeners();\r\n\r\n this.PGwidget.onAnimation(start => {\r\n if (start) {\r\n this.renderWindow.getInteractor().requestAnimation(this.PGwidget);\r\n } else {\r\n this.renderWindow.getInteractor().cancelAnimation(this.PGwidget);\r\n }\r\n });\r\n\r\n this.PGwidget.onOpacityChange(widget => {\r\n this.PGwidget = widget;\r\n this.gaussians = widget.getGaussians().slice(); // store\r\n this.PGwidget.applyOpacity(this.ofun);\r\n if (!this.renderWindow.getInteractor().isAnimating()) {\r\n this.renderWindow.render();\r\n }\r\n\r\n if (this._rescaleLUT && this.PGwidget) {\r\n const range = this.PGwidget.getOpacityRange();\r\n this.ctfun.setMappingRange(...range);\r\n this.ctfun.updateRange();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Set distance between rays\r\n * @param {*} distance\r\n */\r\n setSampleDistance(distance) {\r\n this.actor.getMapper().setSampleDistance(distance);\r\n }\r\n\r\n /**\r\n * Toggle blurring on interaction (Increase performance)\r\n * @type {bool} toggle - if true, blur on interaction\r\n */\r\n set blurOnInteraction(toggle) {\r\n this._blurOnInteraction = toggle;\r\n let interactor = this.renderWindow.getInteractor();\r\n let mapper = this.actor.getMapper();\r\n\r\n if (toggle) {\r\n interactor.onLeftButtonPress(() => {\r\n mapper.setSampleDistance(this._raysDistance * 5);\r\n });\r\n\r\n interactor.onLeftButtonRelease(() => {\r\n mapper.setSampleDistance(this._raysDistance);\r\n // update picking plane\r\n let camera = this.renderer.getActiveCamera();\r\n if (this._pickingPlane)\r\n this._pickingPlane.setNormal(camera.getDirectionOfProjection());\r\n this.renderWindow.render();\r\n });\r\n } else {\r\n interactor.onLeftButtonPress(() => {\r\n mapper.setSampleDistance(this._raysDistance);\r\n });\r\n\r\n interactor.onLeftButtonRelease(() => {\r\n mapper.setSampleDistance(this._raysDistance);\r\n // update picking plane\r\n let camera = this.renderer.getActiveCamera();\r\n if (this._pickingPlane)\r\n this._pickingPlane.setNormal(camera.getDirectionOfProjection());\r\n this.renderWindow.render();\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Init interactor\r\n * @private\r\n */\r\n setupInteractor() {\r\n // TODO setup from user\r\n const rotateManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_8__[\"default\"].newInstance(\r\n { button: 1 }\r\n );\r\n const panManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_9__[\"default\"].newInstance({\r\n button: 3,\r\n control: true\r\n });\r\n const zoomManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_10__[\"default\"].newInstance({\r\n button: 3,\r\n scrollEnabled: true\r\n });\r\n const rangeManipulator = vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_11__[\"default\"].newInstance({\r\n button: 1,\r\n shift: true\r\n });\r\n\r\n let self = this;\r\n\r\n function getWL() {\r\n return self.wl;\r\n }\r\n\r\n function getWW() {\r\n return self.ww;\r\n }\r\n\r\n function setWL(v) {\r\n let wl = self.wl + (v - self.wl) / 25;\r\n self.wl = wl;\r\n\r\n let gaussians = self.PGwidget.getGaussians().slice(); // NOTE: slice() to clone!\r\n gaussians[0].position = self.wl; //TODO: foreach\r\n self.PGwidget.setGaussians(gaussians);\r\n }\r\n\r\n function setWW(v) {\r\n let ww = self.ww + (v - self.ww) / 5;\r\n self.ww = ww;\r\n\r\n let gaussians = self.PGwidget.getGaussians().slice(); // NOTE: slice() to clone!\r\n gaussians[0].width = self.ww; //TODO: foreach\r\n self.PGwidget.setGaussians(gaussians);\r\n }\r\n\r\n rangeManipulator.setVerticalListener(-1, 1, 0.001, getWL, setWL);\r\n rangeManipulator.setHorizontalListener(0.1, 2.1, 0.001, getWW, setWW);\r\n\r\n const interactorStyle = vtk_js_Sources_Interaction_Style_InteractorStyleManipulator__WEBPACK_IMPORTED_MODULE_12__[\"default\"].newInstance();\r\n interactorStyle.addMouseManipulator(rangeManipulator);\r\n interactorStyle.addMouseManipulator(rotateManipulator);\r\n interactorStyle.addMouseManipulator(panManipulator);\r\n interactorStyle.addMouseManipulator(zoomManipulator);\r\n interactorStyle.setCenterOfRotation(this.actor.getCenter());\r\n this.renderWindow.getInteractor().setInteractorStyle(interactorStyle);\r\n\r\n // clear measurements on interactions\r\n this.renderWindow\r\n .getInteractor()\r\n .onMouseWheel(() => this.resetMeasurementState());\r\n this.renderWindow\r\n .getInteractor()\r\n .onRightButtonPress(() => this.resetMeasurementState());\r\n }\r\n\r\n /**\r\n * Reset measurement state to default\r\n * @param {*} measurementState\r\n */\r\n resetMeasurementState(state) {\r\n if (this._measurementState) {\r\n this._measurementState.p1 = new Array(2);\r\n this._measurementState.p2 = new Array(2);\r\n this._measurementState.p3 = new Array(2);\r\n this._measurementState.p1_world = new Array(2);\r\n this._measurementState.p2_world = new Array(2);\r\n this._measurementState.p3_world = new Array(2);\r\n this._measurementState.label = null;\r\n } else if (state) {\r\n state.p1 = new Array(2);\r\n state.p2 = new Array(2);\r\n state.p3 = new Array(2);\r\n state.p1_world = new Array(2);\r\n state.p2_world = new Array(2);\r\n state.p3_world = new Array(2);\r\n state.label = null;\r\n }\r\n }\r\n\r\n /**\r\n * Set active tool\r\n * (\"Length/Angle\", {mouseButtonMask:1}, measurementState)\r\n * * @param {*} toolName\r\n * @param {*} options\r\n * @param {*} measurementState\r\n */\r\n setTool(toolName, options, measurementState) {\r\n if (this._leftButtonCb) {\r\n this._leftButtonCb.unsubscribe();\r\n }\r\n\r\n switch (toolName) {\r\n case \"Length\":\r\n this._initPicker(measurementState, toolName);\r\n break;\r\n case \"Angle\":\r\n this._initPicker(measurementState, toolName);\r\n break;\r\n case \"Rotation\":\r\n this.resetMeasurementState(measurementState);\r\n this.setupInteractor();\r\n break;\r\n default:\r\n console.warn(\"No tool found for\", toolName);\r\n }\r\n }\r\n\r\n /**\r\n * initPicker\r\n */\r\n _initPicker(state, mode) {\r\n // no blur when measure\r\n this.blurOnInteraction = false;\r\n\r\n // de-activate rotation\r\n let rotateManipulator = this.renderWindow\r\n .getInteractor()\r\n .getInteractorStyle()\r\n .getMouseManipulators()\r\n .filter(i => {\r\n return i.getClassName() == \"vtkMouseCameraTrackballRotateManipulator\";\r\n })\r\n .pop();\r\n this.renderWindow\r\n .getInteractor()\r\n .getInteractorStyle()\r\n .removeMouseManipulator(rotateManipulator);\r\n\r\n // ----------------------------------------------------------------------------\r\n // Setup picking interaction\r\n // ----------------------------------------------------------------------------\r\n // Only try to pick points\r\n const picker = vtk_js_Sources_Rendering_Core_PointPicker__WEBPACK_IMPORTED_MODULE_13__[\"default\"].newInstance();\r\n picker.setPickFromList(1);\r\n picker.initializePickList();\r\n\r\n if (!this._pickingPlane) {\r\n // add a 1000x1000 plane\r\n // TODO this is slow the first time we pick, maybe we could use cellPicker and decrease resolution\r\n const plane = vtk_js_Sources_Filters_Sources_PlaneSource__WEBPACK_IMPORTED_MODULE_14__[\"default\"].newInstance({\r\n xResolution: 1000,\r\n yResolution: 1000\r\n });\r\n let camera = this.renderer.getActiveCamera();\r\n plane.setPoint1(0, 0, 1000);\r\n plane.setPoint2(1000, 0, 0);\r\n plane.setCenter(this.actor.getCenter());\r\n plane.setNormal(camera.getDirectionOfProjection());\r\n\r\n const mapper = vtk_js_Sources_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_15__[\"default\"].newInstance();\r\n mapper.setInputConnection(plane.getOutputPort());\r\n const planeActor = vtk_js_Sources_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_16__[\"default\"].newInstance();\r\n planeActor.setMapper(mapper);\r\n planeActor.getProperty().setOpacity(0.01); // with opacity = 0 it is ignored by picking\r\n this.renderer.addActor(planeActor);\r\n\r\n this._pickingPlane = plane;\r\n this._planeActor = planeActor;\r\n }\r\n\r\n // add picking plane to pick list\r\n picker.addPickList(this._planeActor);\r\n\r\n // Pick on mouse left click\r\n this._leftButtonCb = this.renderWindow\r\n .getInteractor()\r\n .onLeftButtonPress(callData => {\r\n if (this.renderer !== callData.pokedRenderer) {\r\n return;\r\n }\r\n\r\n const pos = callData.position;\r\n const point = [pos.x, pos.y, 0.0];\r\n picker.pick(point, this.renderer);\r\n\r\n if (picker.getActors().length === 0) {\r\n const pickedPoint = picker.getPickPosition();\r\n if (this.VERBOSE)\r\n console.log(`No point picked, default: ${pickedPoint}`);\r\n // const sphere = vtkSphereSource.newInstance();\r\n // sphere.setCenter(pickedPoint);\r\n // sphere.setRadius(0.01);\r\n // const sphereMapper = vtkMapper.newInstance();\r\n // sphereMapper.setInputData(sphere.getOutputData());\r\n // const sphereActor = vtkActor.newInstance();\r\n // sphereActor.setMapper(sphereMapper);\r\n // sphereActor.getProperty().setColor(1.0, 0.0, 0.0);\r\n // this.renderer.addActor(sphereActor);\r\n } else {\r\n const pickedPoints = picker.getPickedPositions();\r\n const pickedPoint = pickedPoints[0]; // always a single point on a plane\r\n if (this.VERBOSE) console.log(`Picked: ${pickedPoint}`);\r\n // const sphere = vtkSphereSource.newInstance();\r\n // sphere.setCenter(pickedPoint);\r\n // sphere.setRadius(10);\r\n // const sphereMapper = vtkMapper.newInstance();\r\n // sphereMapper.setInputData(sphere.getOutputData());\r\n // const sphereActor = vtkActor.newInstance();\r\n // sphereActor.setMapper(sphereMapper);\r\n // sphereActor.getProperty().setColor(0.0, 1.0, 0.0);\r\n // this.renderer.addActor(sphereActor);\r\n\r\n // canvas coord\r\n const wPos = vtk_js_Sources_Rendering_Core_Coordinate__WEBPACK_IMPORTED_MODULE_18__[\"default\"].newInstance();\r\n wPos.setCoordinateSystemToWorld();\r\n wPos.setValue(...pickedPoint);\r\n const displayPosition = wPos.getComputedDisplayValue(this.renderer);\r\n\r\n // apply changes on state based on active tool\r\n Object(_strategies__WEBPACK_IMPORTED_MODULE_20__[\"applyStrategy\"])(state, displayPosition, pickedPoint, mode);\r\n\r\n if (this.VERBOSE) console.log(state);\r\n this._measurementState = state;\r\n }\r\n\r\n this.renderWindow.render();\r\n });\r\n }\r\n\r\n /**\r\n * Reset view\r\n */\r\n resetView() {\r\n let center = this.actor.getCenter();\r\n console.log(center);\r\n this.setCamera(center);\r\n this.renderWindow.render();\r\n }\r\n\r\n /**\r\n * on resize callback\r\n */\r\n resize() {\r\n // TODO: debounce for performance reasons?\r\n this._genericRenderWindow.resize();\r\n }\r\n\r\n /**\r\n * Destroy webgl content and release listeners\r\n */\r\n destroy() {\r\n // leave these comments for now\r\n\r\n // this.PGwidget.delete();\r\n // this.actor.getMapper().delete();\r\n // this.actor.delete();\r\n // this.renderWindow.getInteractor().delete();\r\n // this.renderWindow.delete();\r\n // this.renderer.delete();\r\n\r\n // this.renderer.delete();\r\n // this.renderer = null;\r\n // this.renderWindow.getInteractor().delete();\r\n // this.renderWindow.delete();\r\n // this.renderWindow = null;\r\n\r\n this.element = null;\r\n this._genericRenderWindow.delete();\r\n this._genericRenderWindow = null;\r\n this.actor.getMapper().delete();\r\n this.actor.delete();\r\n this.actor = null;\r\n\r\n if (this._planeActor) {\r\n this._planeActor.getMapper().delete();\r\n this._planeActor.delete();\r\n this._planeActor = null;\r\n }\r\n\r\n if (this.PGwidgetElement) {\r\n this.PGwidgetElement = null;\r\n this.PGwidget.delete();\r\n this.PGwidget = null;\r\n this.gaussians = null;\r\n }\r\n\r\n if (this._cropWidget) {\r\n this._cropWidget.delete();\r\n this._cropWidget = null;\r\n }\r\n }\r\n}\r\n\n\n//# sourceURL=webpack://diglettk/./src/vrView.js?"); - -/***/ }), - -/***/ "./src/vtk/vtkInteractorMPRSlice.js": -/*!******************************************!*\ - !*** ./src/vtk/vtkInteractorMPRSlice.js ***! - \******************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/Math */ \"./node_modules/vtk.js/Sources/Common/Core/Math/index.js\");\n/* harmony import */ var vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Common/Core/MatrixBuilder */ \"./node_modules/vtk.js/Sources/Common/Core/MatrixBuilder/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Style_InteractorStyleManipulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Style/InteractorStyleManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Style/InteractorStyleManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js\");\n/**\n * Based on the vtk.js's MPR Slice interactor Style, but with improvements.\n */\n\n// Temporarily using a modified version of this interactor to deal with a camera subscription issue\n\n\n\n\n\n\n\n\n\n// ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\nfunction boundsToCorners(bounds) {\n return [\n [bounds[0], bounds[2], bounds[4]],\n [bounds[0], bounds[2], bounds[5]],\n [bounds[0], bounds[3], bounds[4]],\n [bounds[0], bounds[3], bounds[5]],\n [bounds[1], bounds[2], bounds[4]],\n [bounds[1], bounds[2], bounds[5]],\n [bounds[1], bounds[3], bounds[4]],\n [bounds[1], bounds[3], bounds[5]]\n ];\n}\n\n// ----------------------------------------------------------------------------\n\nfunction clamp(value, min, max) {\n if (value < min) {\n return min;\n }\n if (value > max) {\n return max;\n }\n return value;\n}\n\n// ----------------------------------------------------------------------------\n// vtkInteractorStyleMPRSlice methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyleMPRSlice(publicAPI, model) {\n // Set our className\n model.classHierarchy.push(\"vtkInteractorStyleMPRSlice\");\n\n model.trackballManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance(\n {\n button: 1\n }\n );\n model.panManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_5__[\"default\"].newInstance({\n button: 1,\n shift: true\n });\n model.zoomManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_6__[\"default\"].newInstance({\n button: 3\n });\n\n model.scrollManipulator = vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance({\n scrollEnabled: true,\n dragEnabled: false\n });\n\n // cache for sliceRange\n const cache = {\n sliceNormal: [0, 0, 0],\n sliceRange: [0, 0],\n slicePosition: [0, 0, 0]\n };\n\n function updateScrollManipulator() {\n const range = publicAPI.getSliceRange();\n // console.log(\"updating the manipulator\", range);\n model.scrollManipulator.removeScrollListener();\n // The Scroll listener has min, max, step, and getValue setValue as params.\n // Internally, it checks that the result of the GET has changed, and only calls SET if it is new.\n model.scrollManipulator.setScrollListener(\n range[0],\n range[1],\n 1,\n publicAPI.getSlice,\n publicAPI.setSlice\n );\n }\n\n function setManipulators() {\n publicAPI.removeAllMouseManipulators();\n publicAPI.addMouseManipulator(model.trackballManipulator);\n publicAPI.addMouseManipulator(model.panManipulator);\n publicAPI.addMouseManipulator(model.zoomManipulator);\n publicAPI.addMouseManipulator(model.scrollManipulator);\n updateScrollManipulator();\n }\n\n let cameraSub = null;\n let interactorSub = null;\n const superSetInteractor = publicAPI.setInteractor;\n publicAPI.setInteractor = interactor => {\n superSetInteractor(interactor);\n if (cameraSub) {\n cameraSub.unsubscribe();\n cameraSub = null;\n }\n\n if (interactorSub) {\n interactorSub.unsubscribe();\n interactorSub = null;\n }\n\n if (interactor) {\n const renderer = interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n\n cameraSub = camera.onModified(() => {\n updateScrollManipulator();\n publicAPI.modified();\n });\n\n interactorSub = interactor.onAnimation(() => {\n const { slabThickness } = model;\n\n const dist = camera.getDistance();\n const near = dist - slabThickness / 2;\n const far = dist + slabThickness / 2;\n\n camera.setClippingRange(near, far);\n });\n }\n };\n\n publicAPI.handleMouseMove = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].chain(publicAPI.handleMouseMove, () => {\n const renderer = model.interactor.getCurrentRenderer();\n const { slabThickness } = model;\n const camera = renderer.getActiveCamera();\n const dist = camera.getDistance();\n const near = dist - slabThickness / 2;\n const far = dist + slabThickness / 2;\n\n camera.setClippingRange(near, far);\n });\n\n const superSetVolumeMapper = publicAPI.setVolumeMapper;\n publicAPI.setVolumeMapper = mapper => {\n if (superSetVolumeMapper(mapper)) {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n if (mapper) {\n // prevent zoom manipulator from messing with our focal point\n // TODO: remove the zoom maninipulator instead?\n camera.setFreezeFocalPoint(true);\n\n // NOTE: Disabling this because it makes it more difficult to switch\n // interactor styles. Need to find a better way to do this!\n //publicAPI.setSliceNormal(...publicAPI.getSliceNormal());\n } else {\n camera.setFreezeFocalPoint(false);\n }\n }\n };\n\n publicAPI.getSlice = () => {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n const sliceNormal = publicAPI.getSliceNormal();\n\n // Get rotation matrix from normal to +X (since bounds is aligned to XYZ)\n const transform = vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n .buildFromDegree()\n .identity()\n .rotateFromDirections(sliceNormal, [1, 0, 0]);\n\n const fp = camera.getFocalPoint();\n transform.apply(fp);\n return fp[0];\n };\n\n publicAPI.setSlice = slice => {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n\n // console.log(\"slice\", slice);\n\n if (model.volumeMapper) {\n const range = publicAPI.getSliceRange();\n const bounds = model.volumeMapper.getBounds();\n\n const clampedSlice = clamp(slice, ...range);\n\n const center = [\n (bounds[0] + bounds[1]) / 2.0,\n (bounds[2] + bounds[3]) / 2.0,\n (bounds[4] + bounds[5]) / 2.0\n ];\n\n const distance = camera.getDistance();\n const dop = camera.getDirectionOfProjection();\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalize(dop);\n\n const midPoint = (range[1] + range[0]) / 2.0;\n const zeroPoint = [\n center[0] - dop[0] * midPoint,\n center[1] - dop[1] * midPoint,\n center[2] - dop[2] * midPoint\n ];\n const slicePoint = [\n zeroPoint[0] + dop[0] * clampedSlice,\n zeroPoint[1] + dop[1] * clampedSlice,\n zeroPoint[2] + dop[2] * clampedSlice\n ];\n\n const cameraPos = [\n slicePoint[0] - dop[0] * distance,\n slicePoint[1] - dop[1] * distance,\n slicePoint[2] - dop[2] * distance\n ];\n\n camera.setPosition(...cameraPos);\n camera.setFocalPoint(...slicePoint);\n\n // run Callback\n const onScroll = publicAPI.getOnScroll();\n if (onScroll) onScroll(slicePoint);\n }\n };\n\n publicAPI.getSliceRange = () => {\n if (model.volumeMapper) {\n const sliceNormal = publicAPI.getSliceNormal();\n\n if (\n sliceNormal[0] === cache.sliceNormal[0] &&\n sliceNormal[1] === cache.sliceNormal[1] &&\n sliceNormal[2] === cache.sliceNormal[2]\n ) {\n return cache.sliceRange;\n }\n\n const bounds = model.volumeMapper.getBounds();\n const points = boundsToCorners(bounds);\n\n // Get rotation matrix from normal to +X (since bounds is aligned to XYZ)\n const transform = vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n .buildFromDegree()\n .identity()\n .rotateFromDirections(sliceNormal, [1, 0, 0]);\n\n points.forEach(pt => transform.apply(pt));\n\n // range is now maximum X distance\n let minX = Infinity;\n let maxX = -Infinity;\n for (let i = 0; i < 8; i++) {\n const x = points[i][0];\n if (x > maxX) {\n maxX = x;\n }\n if (x < minX) {\n minX = x;\n }\n }\n\n cache.sliceNormal = sliceNormal;\n cache.sliceRange = [minX, maxX];\n return cache.sliceRange;\n }\n return [0, 0];\n };\n\n // Slice normal is just camera DOP\n publicAPI.getSliceNormal = () => {\n if (model.volumeMapper && model.interactor) {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n return camera.getDirectionOfProjection();\n }\n return [0, 0, 0];\n };\n\n // Thought this was a good idea, but no.\n // publicAPI.getSliceNormal = () => cache.sliceNormal;\n\n /**\n * Move the camera to the given slice normal and viewup direction. Viewup can be used to rotate the display of the image around the direction of view.\n *\n * TODO: setting the slice ALWAYS resets to the volume center, but we need to be able to rotate from an arbitrary position, AKA the intersection of all 3 slice planes.\n */\n // in world space\n publicAPI.setSliceNormal = (normal, viewUp = [0, 1, 0]) => {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n\n // Copy arguments to the model, so they can be GET-ed later\n model.sliceNormal = [...normal];\n model.viewUp = [...viewUp];\n\n //copy arguments for internal editing so we don't cause sideeffects\n const _normal = [...normal];\n const _viewUp = [...viewUp];\n\n if (model.volumeMapper) {\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"default\"].normalize(_normal);\n let mapper = model.volumeMapper;\n // get the mapper if the model is actually the actor, not the mapper\n if (!model.volumeMapper.getInputData && model.volumeMapper.getMapper) {\n mapper = model.volumeMapper.getMapper();\n }\n let volumeCoordinateSpace = vec9toMat3(\n mapper.getInputData().getDirection()\n );\n // Transpose the volume's coordinate space to create a transformation matrix\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"default\"].transpose3x3(volumeCoordinateSpace, volumeCoordinateSpace);\n // Convert the provided normal into the volume's space\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"default\"].multiply3x3_vect3(volumeCoordinateSpace, _normal, _normal);\n\n let center = camera.getFocalPoint();\n let dist = camera.getDistance();\n let angle = camera.getViewAngle();\n\n if (Number.isNaN(dist) || dist === undefined) {\n // Default the volume center\n const bounds = model.volumeMapper.getBounds();\n // diagonal will be used as \"width\" of camera scene\n const diagonal = Math.sqrt(\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"default\"].distance2BetweenPoints(\n [bounds[0], bounds[2], bounds[4]],\n [bounds[1], bounds[3], bounds[5]]\n )\n );\n\n // center will be used as initial focal point\n center = [\n (bounds[0] + bounds[1]) / 2.0,\n (bounds[2] + bounds[3]) / 2.0,\n (bounds[4] + bounds[5]) / 2.0\n ];\n\n angle = 90;\n\n // distance from camera to focal point\n dist = diagonal / (2 * Math.tan((angle / 360) * Math.PI));\n }\n\n const cameraPos = [\n center[0] - _normal[0] * dist,\n center[1] - _normal[1] * dist,\n center[2] - _normal[2] * dist\n ];\n\n // set viewUp based on DOP rotation\n // const oldDop = camera.getDirectionOfProjection();\n // const transform = vtkMatrixBuilder\n // .buildFromDegree()\n // .identity()\n // .rotateFromDirections(oldDop, normal);\n // const viewUp = [0, 1, 0];\n // transform.apply(viewUp);\n\n vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_1__[\"default\"].multiply3x3_vect3(volumeCoordinateSpace, _viewUp, _viewUp);\n\n const { slabThickness } = model;\n\n camera.setPosition(...cameraPos);\n camera.setDistance(dist);\n // should be set after pos and distance\n camera.setDirectionOfProjection(..._normal);\n camera.setViewUp(..._viewUp);\n camera.setViewAngle(angle);\n camera.setClippingRange(\n dist - slabThickness / 2,\n dist + slabThickness / 2\n );\n\n publicAPI.setCenterOfRotation(center);\n }\n };\n\n publicAPI.setSlabThickness = slabThickness => {\n model.slabThickness = slabThickness;\n\n // Update the camera clipping range if the slab\n // thickness property is changed\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n const dist = camera.getDistance();\n\n camera.setClippingRange(dist - slabThickness / 2, dist + slabThickness / 2);\n };\n\n setManipulators();\n}\n\n// ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\nconst DEFAULT_VALUES = {\n slabThickness: 0.1\n};\n\n// ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model, initialValues = {}) {\n Object.assign(model, DEFAULT_VALUES, initialValues);\n\n // Inheritance\n vtk_js_Sources_Interaction_Style_InteractorStyleManipulator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].extend(publicAPI, model, initialValues);\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, [\"volumeMapper\", \"onScroll\"]);\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(publicAPI, model, [\"slabThickness\", \"viewUp\"]);\n\n // Object specific methods\n vtkInteractorStyleMPRSlice(publicAPI, model);\n}\n\n// ----------------------------------------------------------------------------\n\nconst newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(\n extend,\n \"vtkInteractorStyleMPRSlice\"\n);\n\n// ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object.assign({ newInstance, extend }));\n\n// TODO: work with VTK to change the internal formatting of arrays.\nfunction vec9toMat3(vec9) {\n if (vec9.length !== 9) {\n throw Error(\"Array not length 9\");\n }\n //prettier-ignore\n return [\n [vec9[0], vec9[1], vec9[2]],\n [vec9[3], vec9[4], vec9[5]],\n [vec9[6], vec9[7], vec9[8]],\n ];\n}\n\n\n//# sourceURL=webpack://diglettk/./src/vtk/vtkInteractorMPRSlice.js?"); - -/***/ }), - -/***/ "./src/vtk/vtkInteractorStyleMPRCrosshairs.js": -/*!****************************************************!*\ - !*** ./src/vtk/vtkInteractorStyleMPRCrosshairs.js ***! - \****************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js\");\n/* harmony import */ var _vtkInteractorMPRSlice_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./vtkInteractorMPRSlice.js */ \"./src/vtk/vtkInteractorMPRSlice.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_Coordinate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/Coordinate */ \"./node_modules/vtk.js/Sources/Rendering/Core/Coordinate/index.js\");\n/**\n * Extends the vtkInteractorStyleMPRSlice by adding a click handler for selecting a point in rendered space and converting to 3d space, then calling the registered callback to update other views to that same point.\n */\n\n\n\n\n\n\n\n\n\n\nconst { States } = vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n\n// ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\n// ----------------------------------------------------------------------------\n// vtkInteractorStyleMPRCrosshairs methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyleMPRCrosshairs(publicAPI, model) {\n // Set our className\n model.classHierarchy.push(\"vtkInteractorStyleMPRCrosshairs\");\n\n // set fixed manipulators\n model.trackballManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(\n {\n button: 1\n }\n );\n model.panManipulatorShift = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance(\n {\n button: 3,\n shift: true\n }\n );\n model.panManipulatorCtrl = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n button: 3,\n control: true\n });\n model.zoomManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n button: 3\n });\n model.scrollManipulator = vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance({\n scrollEnabled: true,\n dragEnabled: false\n });\n\n function updateScrollManipulator() {\n const range = publicAPI.getSliceRange();\n model.scrollManipulator.removeScrollListener();\n model.scrollManipulator.setScrollListener(\n range[0],\n range[1],\n 1,\n publicAPI.getSlice,\n publicAPI.setSlice\n );\n }\n\n function setManipulators() {\n publicAPI.removeAllMouseManipulators();\n publicAPI.addMouseManipulator(model.trackballManipulator);\n publicAPI.addMouseManipulator(model.panManipulatorShift);\n publicAPI.addMouseManipulator(model.panManipulatorCtrl);\n publicAPI.addMouseManipulator(model.zoomManipulator);\n publicAPI.addMouseManipulator(model.scrollManipulator);\n updateScrollManipulator();\n }\n\n function launchCallback(callData) {\n // console.log(callData);\n const pos = [callData.position.x, callData.position.y];\n const renderer = callData.pokedRenderer;\n const onClickCallback = publicAPI.getOnClickCallback();\n const dPos = vtk_js_Sources_Rendering_Core_Coordinate__WEBPACK_IMPORTED_MODULE_7__[\"default\"].newInstance();\n dPos.setCoordinateSystemToDisplay();\n dPos.setValue(pos[0], pos[1], 0);\n const worldPos = dPos.getComputedWorldValue(renderer);\n\n if (worldPos.length) {\n onClickCallback({ worldPos, displayPos: pos });\n }\n\n publicAPI.invokeInteractionEvent({ type: \"InteractionEvent\" });\n }\n\n const superHandleMouseMove = publicAPI.handleMouseMove;\n publicAPI.handleMouseMove = callData => {\n if (model.state === States.IS_SLICE) {\n launchCallback(callData);\n }\n\n if (superHandleMouseMove) {\n superHandleMouseMove(callData);\n }\n };\n\n const superHandleLeftButtonPress = publicAPI.handleLeftButtonPress;\n publicAPI.handleLeftButtonPress = callData => {\n if (!callData.shiftKey && !callData.controlKey) {\n if (model.volumeMapper) {\n launchCallback(callData);\n publicAPI.startSlice();\n }\n } else if (superHandleLeftButtonPress) {\n superHandleLeftButtonPress(callData);\n }\n };\n\n const superSetVolumeMapper = publicAPI.setVolumeMapper;\n publicAPI.setVolumeMapper = mapper => {\n if (superSetVolumeMapper(mapper)) {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n if (mapper) {\n // prevent zoom manipulator from messing with our focal point\n camera.setFreezeFocalPoint(true);\n\n // NOTE: Disabling this because it makes it more difficult to switch\n // interactor styles. Need to find a better way to do this!\n //publicAPI.setSliceNormal(...publicAPI.getSliceNormal());\n } else {\n camera.setFreezeFocalPoint(false);\n }\n }\n };\n\n publicAPI.superHandleLeftButtonRelease = publicAPI.handleLeftButtonRelease;\n publicAPI.handleLeftButtonRelease = () => {\n switch (model.state) {\n case States.IS_SLICE:\n publicAPI.endSlice();\n break;\n\n default:\n publicAPI.superHandleLeftButtonRelease();\n break;\n }\n };\n\n setManipulators();\n}\n\n// ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\nconst DEFAULT_VALUES = {};\n\n// ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model, initialValues = {}) {\n Object.assign(model, DEFAULT_VALUES, initialValues);\n\n // Inheritance\n _vtkInteractorMPRSlice_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].extend(publicAPI, model, initialValues);\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, [\"volumeMapper\", \"onClickCallback\"]);\n\n // Object specific methods\n vtkInteractorStyleMPRCrosshairs(publicAPI, model);\n}\n\n// ----------------------------------------------------------------------------\n\nconst newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(\n extend,\n \"vtkInteractorStyleMPRCrosshairs\"\n);\n\n// ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object.assign({ newInstance, extend }));\n\n\n//# sourceURL=webpack://diglettk/./src/vtk/vtkInteractorStyleMPRCrosshairs.js?"); - -/***/ }), - -/***/ "./src/vtk/vtkInteractorStyleMPRPanZoom.js": -/*!*************************************************!*\ - !*** ./src/vtk/vtkInteractorStyleMPRPanZoom.js ***! - \*************************************************/ -/*! exports provided: extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js\");\n/* harmony import */ var _vtkInteractorMPRSlice_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./vtkInteractorMPRSlice.js */ \"./src/vtk/vtkInteractorMPRSlice.js\");\n\n\n\n\n\n\n\n\nconst { States } = vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\n\n// ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\n// ----------------------------------------------------------------------------\n// vtkInteractorStyleMPRPan methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyleMPRPanZoom(publicAPI, model) {\n // Set our className\n model.classHierarchy.push(\"vtkInteractorStyleMPRPanZoom\");\n\n // set fixed manipulators\n model.panManipulatorShift = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(\n {\n button: 3,\n shift: true\n }\n );\n\n model.panManipulatorCtrl = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance({\n button: 3,\n control: true\n });\n\n // TODO: The inherited zoom manipulator does not appear to be working?\n model.zoomManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n button: 3\n });\n model.scrollManipulator = vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n scrollEnabled: true,\n dragEnabled: false\n });\n\n function updateScrollManipulator() {\n const range = publicAPI.getSliceRange();\n model.scrollManipulator.removeScrollListener();\n model.scrollManipulator.setScrollListener(\n range[0],\n range[1],\n 1,\n publicAPI.getSlice,\n publicAPI.setSlice\n );\n }\n\n function setManipulators() {\n publicAPI.removeAllMouseManipulators();\n publicAPI.addMouseManipulator(model.panManipulatorShift);\n publicAPI.addMouseManipulator(model.panManipulatorCtrl);\n publicAPI.addMouseManipulator(model.zoomManipulator);\n publicAPI.addMouseManipulator(model.scrollManipulator);\n publicAPI.addMouseManipulator(model.leftManipulator);\n updateScrollManipulator();\n }\n\n publicAPI.setLeftButton = tool => {\n if (tool == \"zoom\") {\n model.leftManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance(\n {\n button: 1\n }\n );\n } else if (tool == \"pan\") {\n model.leftManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(\n {\n button: 1\n }\n );\n } else {\n console.error(\"No tool found for\", tool);\n }\n setManipulators();\n };\n\n // set default left button manipulator\n if (!model.leftButtonTool) {\n model.leftButtonTool = \"pan\";\n }\n publicAPI.setLeftButton(model.leftButtonTool);\n\n setManipulators();\n\n // chain a callback to super interactor\n const superSetInteractor = publicAPI.setInteractor;\n publicAPI.setInteractor = interactor => {\n superSetInteractor(interactor);\n\n if (interactor === null) {\n // NOTE: check null AFTER calling super setInteractor\n return;\n }\n\n let interactionCb =\n model.leftButtonTool == \"pan\"\n ? publicAPI.getOnPanChanged()\n : publicAPI.getOnZoomChanged();\n interactor.onAnimation(interactionCb);\n };\n}\n\n// ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\nconst DEFAULT_VALUES = {\n wlStartPos: [0, 0],\n levelScale: 1\n};\n\n// ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model, initialValues = {}) {\n Object.assign(model, DEFAULT_VALUES, initialValues);\n\n // Inheritance\n _vtkInteractorMPRSlice_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].extend(publicAPI, model, initialValues);\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, [\n \"volumeMapper\",\n \"onPanChanged\",\n \"onZoomChanged\",\n \"levelScale\"\n ]);\n\n // Object specific methods\n vtkInteractorStyleMPRPanZoom(publicAPI, model);\n}\n\n// ----------------------------------------------------------------------------\n\nconst newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(\n extend,\n \"vtkInteractorStyleMPRPanZoom\"\n);\n\n// ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object.assign({ newInstance, extend }));\n\n\n//# sourceURL=webpack://diglettk/./src/vtk/vtkInteractorStyleMPRPanZoom.js?"); - -/***/ }), - -/***/ "./src/vtk/vtkInteractorStyleMPRWindowLevel.js": -/*!*****************************************************!*\ - !*** ./src/vtk/vtkInteractorStyleMPRWindowLevel.js ***! - \*****************************************************/ -/*! exports provided: toWindowLevel, toLowHighRange, extend, newInstance, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toWindowLevel\", function() { return toWindowLevel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toLowHighRange\", function() { return toLowHighRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newInstance\", function() { return newInstance; });\n/* harmony import */ var vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vtk.js/Sources/macro */ \"./node_modules/vtk.js/Sources/macro.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballRotateManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballPanManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator */ \"./node_modules/vtk.js/Sources/Interaction/Manipulators/MouseRangeManipulator/index.js\");\n/* harmony import */ var vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vtk.js/Sources/Rendering/Core/InteractorStyle/Constants */ \"./node_modules/vtk.js/Sources/Rendering/Core/InteractorStyle/Constants.js\");\n/* harmony import */ var _vtkInteractorMPRSlice_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./vtkInteractorMPRSlice.js */ \"./src/vtk/vtkInteractorMPRSlice.js\");\n\n\n\n\n\n\n\n\n\n// import {\n// toWindowLevel,\n// toLowHighRange\n// } from \"../lib/windowLevelRangeConverter\";\n\nfunction toWindowLevel(low, high) {\n const windowWidth = Math.abs(low - high);\n const windowCenter = low + windowWidth / 2;\n\n return { windowWidth, windowCenter };\n}\n\nfunction toLowHighRange(windowWidth, windowCenter) {\n const lower = windowCenter - windowWidth / 2.0;\n const upper = windowCenter + windowWidth / 2.0;\n\n return { lower, upper };\n}\n\nconst { States } = vtk_js_Sources_Rendering_Core_InteractorStyle_Constants__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n\n// ----------------------------------------------------------------------------\n// Global methods\n// ----------------------------------------------------------------------------\n\n// ----------------------------------------------------------------------------\n// vtkInteractorStyleMPRWindowLevel methods\n// ----------------------------------------------------------------------------\n\nfunction vtkInteractorStyleMPRWindowLevel(publicAPI, model) {\n // Set our className\n model.classHierarchy.push(\"vtkInteractorStyleMPRWindowLevel\");\n\n model.trackballManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballRotateManipulator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].newInstance(\n {\n button: 1\n }\n );\n model.panManipulatorShift = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance(\n {\n button: 3,\n shift: true\n }\n );\n model.panManipulatorCtrl = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballPanManipulator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].newInstance({\n button: 3,\n control: true\n });\n // TODO: The inherited zoom manipulator does not appear to be working?\n model.zoomManipulator = vtk_js_Sources_Interaction_Manipulators_MouseCameraTrackballZoomManipulator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].newInstance({\n button: 3\n });\n model.scrollManipulator = vtk_js_Sources_Interaction_Manipulators_MouseRangeManipulator__WEBPACK_IMPORTED_MODULE_4__[\"default\"].newInstance({\n scrollEnabled: true,\n dragEnabled: false\n });\n\n function updateScrollManipulator() {\n const range = publicAPI.getSliceRange();\n model.scrollManipulator.removeScrollListener();\n model.scrollManipulator.setScrollListener(\n range[0],\n range[1],\n 1,\n publicAPI.getSlice,\n publicAPI.setSlice\n );\n }\n\n function setManipulators() {\n publicAPI.removeAllMouseManipulators();\n publicAPI.addMouseManipulator(model.trackballManipulator);\n publicAPI.addMouseManipulator(model.panManipulatorShift);\n publicAPI.addMouseManipulator(model.panManipulatorCtrl);\n publicAPI.addMouseManipulator(model.zoomManipulator);\n publicAPI.addMouseManipulator(model.scrollManipulator);\n updateScrollManipulator();\n }\n\n const superHandleMouseMove = publicAPI.handleMouseMove;\n publicAPI.handleMouseMove = callData => {\n const pos = [callData.position.x, callData.position.y];\n\n if (model.state === States.IS_WINDOW_LEVEL) {\n publicAPI.windowLevelFromMouse(pos);\n publicAPI.invokeInteractionEvent({ type: \"InteractionEvent\" });\n }\n\n if (superHandleMouseMove) {\n superHandleMouseMove(callData);\n }\n };\n\n const superSetVolumeMapper = publicAPI.setVolumeMapper;\n publicAPI.setVolumeMapper = mapper => {\n if (superSetVolumeMapper(mapper)) {\n const renderer = model.interactor.getCurrentRenderer();\n const camera = renderer.getActiveCamera();\n if (mapper) {\n // prevent zoom manipulator from messing with our focal point\n camera.setFreezeFocalPoint(true);\n\n // NOTE: Disabling this because it makes it more difficult to switch\n // interactor styles. Need to find a better way to do this!\n // publicAPI.setSliceNormal(...publicAPI.getSliceNormal());\n } else {\n camera.setFreezeFocalPoint(false);\n }\n }\n };\n\n publicAPI.windowLevelFromMouse = ([mx, my]) => {\n const range = model.volumeMapper\n .getMapper()\n .getInputData()\n .getPointData()\n .getScalars()\n .getRange();\n const imageDynamicRange = range[1] - range[0];\n const multiplier = (imageDynamicRange / 1024) * model.levelScale;\n\n const dx = (mx - model.wlStartPos[0]) * multiplier;\n // scale the center at a smaller scale\n const dy = (my - model.wlStartPos[1]) * multiplier * 0.5;\n\n let { windowWidth, windowCenter } = publicAPI.getWindowLevel();\n\n windowWidth = Math.max(1, Math.round(windowWidth + dx));\n windowCenter = Math.round(windowCenter + dy);\n\n publicAPI.setWindowLevel(windowWidth, windowCenter);\n\n model.wlStartPos = [mx, my];\n\n const onLevelsChanged = publicAPI.getOnLevelsChanged();\n if (onLevelsChanged) {\n onLevelsChanged({ windowCenter, windowWidth });\n }\n };\n\n publicAPI.getWindowLevel = () => {\n const range = model.volumeMapper\n .getProperty()\n .getRGBTransferFunction(0)\n .getMappingRange()\n .slice();\n return toWindowLevel(...range);\n };\n publicAPI.setWindowLevel = (windowWidth, windowCenter) => {\n const lowHigh = toLowHighRange(windowWidth, windowCenter);\n\n model.volumeMapper\n .getProperty()\n .getRGBTransferFunction(0)\n .setMappingRange(lowHigh.lower, lowHigh.upper);\n };\n\n const superHandleLeftButtonPress = publicAPI.handleLeftButtonPress;\n publicAPI.handleLeftButtonPress = callData => {\n model.wlStartPos = [callData.position.x, callData.position.y];\n if (!callData.shiftKey && !callData.controlKey) {\n publicAPI.startWindowLevel();\n } else if (superHandleLeftButtonPress) {\n superHandleLeftButtonPress(callData);\n }\n };\n\n publicAPI.superHandleLeftButtonRelease = publicAPI.handleLeftButtonRelease;\n publicAPI.handleLeftButtonRelease = () => {\n switch (model.state) {\n case States.IS_WINDOW_LEVEL:\n publicAPI.endWindowLevel();\n break;\n\n default:\n publicAPI.superHandleLeftButtonRelease();\n break;\n }\n };\n\n setManipulators();\n}\n\n// ----------------------------------------------------------------------------\n// Object factory\n// ----------------------------------------------------------------------------\n\nconst DEFAULT_VALUES = {\n wlStartPos: [0, 0],\n levelScale: 1\n};\n\n// ----------------------------------------------------------------------------\n\nfunction extend(publicAPI, model, initialValues = {}) {\n Object.assign(model, DEFAULT_VALUES, initialValues);\n\n // Inheritance\n _vtkInteractorMPRSlice_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].extend(publicAPI, model, initialValues);\n\n vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setGet(publicAPI, model, [\n \"volumeMapper\",\n \"onLevelsChanged\",\n \"levelScale\"\n ]);\n\n // Object specific methods\n vtkInteractorStyleMPRWindowLevel(publicAPI, model);\n}\n\n// ----------------------------------------------------------------------------\n\nconst newInstance = vtk_js_Sources_macro__WEBPACK_IMPORTED_MODULE_0__[\"default\"].newInstance(\n extend,\n \"vtkInteractorStyleMPRWindowLevel\"\n);\n\n// ----------------------------------------------------------------------------\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object.assign({ newInstance, extend }));\n\n\n//# sourceURL=webpack://diglettk/./src/vtk/vtkInteractorStyleMPRWindowLevel.js?"); - -/***/ }), - -/***/ 0: -/*!************************!*\ - !*** crypto (ignored) ***! - \************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("/* (ignored) */\n\n//# sourceURL=webpack://diglettk/crypto_(ignored)?"); - -/***/ }) - -/******/ }); -}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.diglettk=t():e.diglettk=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=29)}([function(e,t,n){"use strict";(function(e){n.d(t,"k",function(){return b}),n.d(t,"l",function(){return T}),n.d(t,"m",function(){return C}),n.d(t,"e",function(){return w}),n.d(t,"f",function(){return x}),n.d(t,"g",function(){return R}),n.d(t,"b",function(){return E}),n.d(t,"h",function(){return L}),n.d(t,"i",function(){return N}),n.d(t,"c",function(){return B}),n.d(t,"j",function(){return F}),n.d(t,"d",function(){return _});var r=n(1);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e){"@babel/helpers - typeof";return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?t-1:0),r=1;r1?n-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};M(t);var n=[];function r(e){n[e]=null}return Number.isInteger(t.mtime)||(t.mtime=++g),t.classHierarchy=["vtkObject"],e.isDeleted=function(){return!!t.deleted},e.modified=function(r){t.deleted?T("instance deleted - cannot call any method"):r&&r0&&void 0!==arguments[0]?arguments[0]:0;return t.classHierarchy[t.classHierarchy.length-1-e]},e.set=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1;return Object.keys(n).forEach(function(i){var s=a?null:e["set".concat(O(i))];s&&Array.isArray(n[i])&&s.length>1?o=s.apply(void 0,u(n[i]))||o:s?o=s(n[i])||o:(-1!==["mtime"].indexOf(i)||r||C("Warning: Set value to model directly ".concat(i,", ").concat(n[i])),t[i]=n[i],o=!0)}),o},e.get=function(){for(var e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]&&arguments[1];if(n.getClassName()!==e.getClassName())throw new Error("Cannot ShallowCopy ".concat(n.getClassName()," into ").concat(e.getClassName()));var a=n.get(),o=Object.keys(t).sort();Object.keys(a).sort().forEach(function(e){var n=o.indexOf(e);-1===n?r&&b("add ".concat(e," in shallowCopy")):o.splice(n,1),t[e]=a[e]}),o.length&&r&&b("Untouched keys: ".concat(o.join(", "))),e.modified()},e}function E(e,t,n){n.forEach(function(n){"object"===o(n)?e["get".concat(O(n.name))]=function(){return t[n.name]}:e["get".concat(O(n))]=function(){return t[n]}})}P.Float32Array=Float32Array,P.Float64Array=Float64Array,P.Uint8Array=Uint8Array,P.Int8Array=Int8Array,P.Uint16Array=Uint16Array,P.Int16Array=Int16Array,P.Uint32Array=Uint32Array,P.Int32Array=Int32Array,P.Uint8ClampedArray=Uint8ClampedArray;var D={enum:function(e,t,n){return function(r){if("string"==typeof r){if(void 0!==n.enum[r])return t[n.name]!==n.enum[r]&&(t[n.name]=n.enum[r],e.modified(),!0);throw T("Set Enum with invalid argument ".concat(n,", ").concat(r)),new RangeError("Set Enum with invalid string argument")}if("number"==typeof r){if(t[n.name]!==r){if(-1!==Object.keys(n.enum).map(function(e){return n.enum[e]}).indexOf(r))return t[n.name]=r,e.modified(),!0;throw T("Set Enum outside numeric range ".concat(n,", ").concat(r)),new RangeError("Set Enum outside numeric range")}return!1}throw T("Set Enum with invalid argument (String/Number) ".concat(n,", ").concat(r)),new TypeError("Set Enum with invalid argument (String/Number)")}}};function V(e){if("object"===o(e)){var t=D[e.type];if(t)return function(n,r){return t(n,r,e)};throw T("No setter for field ".concat(e)),new TypeError("No setter for field")}return function(t,n){return function(r){return n.deleted?(T("instance deleted - cannot call any method"),!1):n[e]!==r&&(n[e]=r,t.modified(),!0)}}}function L(e,t,n){n.forEach(function(n){"object"===o(n)?e["set".concat(O(n.name))]=V(n)(e,t):e["set".concat(O(n))]=V(n)(e,t)})}function N(e,t,n){E(e,t,n),L(e,t,n)}function B(e,t,n){n.forEach(function(n){e["get".concat(O(n))]=function(){return[].concat(t[n])},e["get".concat(O(n),"ByReference")]=function(){return t[n]}})}function k(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;n.forEach(function(n){e["set".concat(O(n))]=function(){if(t.deleted)return T("instance deleted - cannot call any method"),!1;for(var o=arguments.length,i=new Array(o),s=0;s4&&void 0!==arguments[4]?arguments[4]:void 0;B(e,t,n),k(e,t,n,r,a)}var G=Symbol("Event abort");function _(e,t){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={};return e(n,{},t),Object.freeze(n)};return t&&r.a.register(t,n),n}function U(e){return e&&e.isA&&e.isA("vtkObject")}function j(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.keystore=Object.assign(t.keystore||{},n),e.setKey=function(e,n){t.keystore[e]=n},e.getKey=function(e){return t.keystore[e]},e.getAllKeys=function(){return Object.keys(t.keystore)},e.deleteKey=function(e){return delete t.keystore[e]},e.clearKeystore=function(){return e.getAllKeys().forEach(function(e){return delete t.keystore[e]})}}var W=1,z="__root__";var H=10,K=40,X=800;t.a={algo:function(e,t,n,a){function o(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.deleted?T("instance deleted - cannot call any method"):r>=t.numberOfInputs?T("algorithm ".concat(e.getClassName()," only has ").concat(t.numberOfInputs," input ports. To add more input ports, use addInputData()")):(t.inputData[r]!==n||t.inputConnection[r])&&(t.inputData[r]=n,t.inputConnection[r]=null,e.modified&&e.modified())}function i(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t.deleted)T("instance deleted - cannot call any method");else{if(r>=t.numberOfInputs){var a="algorithm ".concat(e.getClassName()," only has ");return a+="".concat(t.numberOfInputs),void T(a+=" input ports. To add more input ports, use addInputConnection()")}t.inputData[r]=null,t.inputConnection[r]=n}}function s(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.deleted?(T("instance deleted - cannot call any method"),null):(e.shouldUpdate()&&e.update(),t.output[n])}if(t.inputData?t.inputData=t.inputData.map(r.a):t.inputData=[],t.inputConnection?t.inputConnection=t.inputConnection.map(r.a):t.inputConnection=[],t.output?t.output=t.output.map(r.a):t.output=[],t.inputArrayToProcess?t.inputArrayToProcess=t.inputArrayToProcess.map(r.a):t.inputArrayToProcess=[],t.numberOfInputs=n,e.shouldUpdate=function(){for(var n=e.getMTime(),r=a,o=1/0;r--;){if(!t.output[r])return!0;var i=t.output[r].getMTime();if(io)return!0;return!1},t.numberOfInputs){for(var l=t.numberOfInputs;l--;)t.inputData.push(null),t.inputConnection.push(null);e.setInputData=o,e.setInputConnection=i,e.addInputData=function(e){t.deleted?T("instance deleted - cannot call any method"):(t.numberOfInputs++,o(e,t.numberOfInputs-1))},e.addInputConnection=function(e){t.deleted?T("instance deleted - cannot call any method"):(t.numberOfInputs++,i(e,t.numberOfInputs-1))},e.getInputData=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.inputConnection[e]&&(t.inputData[e]=t.inputConnection[e]()),t.inputData[e]},e.getInputConnection=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.inputConnection[e]}}a&&(e.getOutputData=s,e.getOutputPort=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=function(){return s(t)};return n.filter=e,n}),e.update=function(){var n=[];if(t.numberOfInputs)for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:"Scalars";t.inputArrayToProcess.length1&&void 0!==arguments[1]?arguments[1]:0;if(!e.apply)return console.error("Invalid callback for event ".concat(n)),null;if(t.deleted)return T("instance deleted - cannot call any method"),null;var o=i++;return r.push([o,e,a]),r.sort(function(e,t){return t[2]-e[2]}),function(e){return Object.freeze({unsubscribe:function(){s(e)}})}(o)},e.delete=function(){o(),r.forEach(function(e){return s(a(e,1)[0])})}},EVENT_ABORT:G,formatBytesToProperUnit:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,r=["TB","GB","MB","KB"],a=Number(e),o="B";a>n;)a/=n,o=r.pop();return"".concat(a.toFixed(t)," ").concat(o)},formatNumbersWithThousandSeparator:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",n=[],r=e;r>1e3;)n.push("000".concat(r%1e3).slice(-3)),r=Math.floor(r/1e3);return r>0&&n.push(r),n.reverse(),n.join(t)},get:E,getArray:B,getCurrentGlobalMTime:function(){return g},getStateArrayMapFunc:A,isVtkObject:U,keystore:j,newInstance:_,newTypedArray:w,newTypedArrayFrom:x,normalizeWheel:function(e){var t=0,n=0,r=0,a=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=t*H,a=n*H,"deltaY"in e&&(a=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||a)&&e.deltaMode&&(1===e.deltaMode?(r*=K,a*=K):(r*=X,a*=X)),r&&!t&&(t=r<1?-1:1),a&&!n&&(n=a<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:a}},obj:R,proxy:function(e,t){j(e,t);var n=e.delete;t.proxyId="".concat(W++),t.ui=JSON.parse(JSON.stringify(t.ui||[])),E(e,t,["proxyId","proxyGroup","proxyName"]),N(e,t,["proxyManager"]);var r={},a={};function o(e,t){a[t]||(a[t]=[]);for(var n=a[t],i=0;i0&&void 0!==arguments[0]?arguments[0]:z,r=[],o=t.proxyId,s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z;return a[e]}(n)||[],l=0;l1&&void 0!==arguments[1]&&arguments[1];if(t.propertyLinkMap[e])return t.propertyLinkMap[e];var r=null,a=[],o=0,i=!1;function s(n){var s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(i)return null;var u=[],c=null;for(o=a.length;o--;){var d=a[o];d.instance===n?c=d:u.push(d)}if(!c)return null;var f=c.instance["get".concat(O(c.propertyName))]();if(!function(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],i=n.onModified(s),c=a[0];return a.push({instance:n,propertyName:r,subscription:i}),o&&(t.propertyLinkMap[e].persistent&&void 0!==t.propertyLinkMap[e].value?n.set(l({},r,t.propertyLinkMap[e].value)):c&&s(c.instance,!0)),{unsubscribe:function(){return u(n,r)}}},unbind:u,unsubscribe:function(){for(;a.length;)a.pop().subscription.unsubscribe()},persistent:n};return t.propertyLinkMap[e]=c,c},e.listPropertyNames=function(){return i().map(function(e){return e.name})},e.getPropertyByName=function(e){return i().find(function(t){return t.name===e})},e.getPropertyDomainByName=function(e){return(r[e]||{}).domain},e.getProxySection=function(){return{id:t.proxyId,name:t.proxyGroup,ui:t.ui,properties:i()}},e.delete=function(){for(var r=Object.keys(t.propertyLinkMap),a=r.length;a--;)t.propertyLinkMap[r[a]].unsubscribe();Object.keys(t.propertyLinkSubscribers).forEach(e.gcPropertyLinks),n()},I(function(){if(t.links)for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.this=e;for(var a=Object.keys(r),o=a.length,i=function(){var i=a[o];t[i]=r[i];var s=n[i];e["set".concat(O(i))]=function(n){n!==t[i]&&(t[i]=n,function(e){for(var n=Object.keys(e),r=n.length;r--;){var a=n[r];t[a].set(e[a])}}(s[n]),e.modified())}};o--;)i();a.length&&E(e,t,a)},safeArrays:M,set:L,setArray:k,setGet:N,setGetArray:F,setImmediate:I,setLoggerFunction:function(e,t){y[e]&&(y[e]=t||h)},throttle:function(e,t){var n=!1,r=null;function a(){n=!1,null!==r&&(o.apply(void 0,u(r)),r=null)}function o(){for(var o=arguments.length,i=new Array(o),s=0;s2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(U(t)){if(a.indexOf(t)>=0)return r;a.push(t);var o=n(t);void 0!==o&&r.push(o);var i=t.get();Object.keys(i).forEach(function(t){var o=i[t];Array.isArray(o)?o.forEach(function(t){e(t,n,r,a)}):e(o,n,r,a)})}return r},TYPED_ARRAYS:P,uncapitalize:function(e){return e.charAt(0).toLowerCase()+e.slice(1)},VOID:m,vtkDebugMacro:b,vtkErrorMacro:T,vtkInfoMacro:function(){y.info.apply(y,arguments)},vtkLogMacro:function(){y.log.apply(y,arguments)},vtkOnceErrorMacro:function(e){S[e]||(y.error(e),S[e]=!0)},vtkWarningMacro:C}}).call(this,n(7))},function(e,t,n){"use strict";(function(e){function r(e){"@babel/helpers - typeof";return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",function(){return s});var i={vtkObject:function(){return null}};function s(t){if(null===t||void 0===t)return t;if(t.isA)return t;if(!t.vtkClass)return e.console&&e.console.error&&e.console.error("Invalid VTK object"),null;var n=i[t.vtkClass];if(!n)return e.console&&e.console.error&&e.console.error("No vtk class found for Object of type ".concat(t.vtkClass)),null;var l=function(e){for(var t=1;t 0\nuniform float vSpecularPower;\nuniform float vAmbient;\nuniform float vDiffuse;\nuniform float vSpecular;\n//VTK::Light::Dec\n#endif\n\n// possibly define vtkGradientOpacityOn\n//VTK::GradientOpacityOn\n#ifdef vtkGradientOpacityOn\nuniform float goscale0;\nuniform float goshift0;\nuniform float gomin0;\nuniform float gomax0;\n#if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\nuniform float goscale1;\nuniform float goshift1;\nuniform float gomin1;\nuniform float gomax1;\n#if vtkNumComponents >= 3\nuniform float goscale2;\nuniform float goshift2;\nuniform float gomin2;\nuniform float gomax2;\n#endif\n#if vtkNumComponents >= 4\nuniform float goscale3;\nuniform float goshift3;\nuniform float gomin3;\nuniform float gomax3;\n#endif\n#endif\n#endif\n\n// if you want to see the raw tiled\n// data in webgl1 uncomment the following line\n// #define debugtile\n\n// camera values\nuniform float camThick;\nuniform float camNear;\nuniform float camFar;\nuniform int cameraParallel;\n\n// values describing the volume geometry\nuniform vec3 vOriginVC;\nuniform vec3 vSpacing;\nuniform ivec3 volumeDimensions; // 3d texture dimensions\nuniform vec3 vPlaneNormal0;\nuniform float vPlaneDistance0;\nuniform vec3 vPlaneNormal1;\nuniform float vPlaneDistance1;\nuniform vec3 vPlaneNormal2;\nuniform float vPlaneDistance2;\nuniform vec3 vPlaneNormal3;\nuniform float vPlaneDistance3;\nuniform vec3 vPlaneNormal4;\nuniform float vPlaneDistance4;\nuniform vec3 vPlaneNormal5;\nuniform float vPlaneDistance5;\n\n//VTK::ClipPlane::Dec\n\n// opacity and color textures\nuniform sampler2D otexture;\nuniform float oshift0;\nuniform float oscale0;\nuniform sampler2D ctexture;\nuniform float cshift0;\nuniform float cscale0;\n\n// jitter texture\nuniform sampler2D jtexture;\n\n// some 3D texture values\nuniform float sampleDistance;\nuniform vec3 vVCToIJK;\n\n// the heights defined below are the locations\n// for the up to four components of the tfuns\n// the tfuns have a height of 2XnumComps pixels so the\n// values are computed to hit the middle of the two rows\n// for that component\n#ifdef vtkIndependentComponentsOn\n#if vtkNumComponents == 2\nuniform float mix0;\nuniform float mix1;\n#define height0 0.25\n#define height1 0.75\n#endif\n#if vtkNumComponents == 3\nuniform float mix0;\nuniform float mix1;\nuniform float mix2;\n#define height0 0.17\n#define height1 0.5\n#define height2 0.83\n#endif\n#if vtkNumComponents == 4\nuniform float mix0;\nuniform float mix1;\nuniform float mix2;\nuniform float mix3;\n#define height0 0.125\n#define height1 0.375\n#define height2 0.625\n#define height3 0.875\n#endif\n#endif\n\n#if vtkNumComponents >= 2\nuniform float oshift1;\nuniform float oscale1;\nuniform float cshift1;\nuniform float cscale1;\n#endif\n#if vtkNumComponents >= 3\nuniform float oshift2;\nuniform float oscale2;\nuniform float cshift2;\nuniform float cscale2;\n#endif\n#if vtkNumComponents >= 4\nuniform float oshift3;\nuniform float oscale3;\nuniform float cshift3;\nuniform float cscale3;\n#endif\n\n// declaration for intermixed geometry\n//VTK::ZBuffer::Dec\n\n// Lighting values\n//VTK::Light::Dec\n\n//=======================================================================\n// Webgl2 specific version of functions\n#if __VERSION__ == 300\n\nuniform highp sampler3D texture1;\n\nvec4 getTextureValue(vec3 pos)\n{\n vec4 tmp = texture(texture1, pos);\n#if vtkNumComponents == 1\n tmp.a = tmp.r;\n#endif\n#if vtkNumComponents == 2\n tmp.a = tmp.g;\n#endif\n#if vtkNumComponents == 3\n tmp.a = length(tmp.rgb);\n#endif\n return tmp;\n}\n\n//=======================================================================\n// WebGL1 specific version of functions\n#else\n\nuniform sampler2D texture1;\n\nuniform float texWidth;\nuniform float texHeight;\nuniform int xreps;\nuniform int xstride;\nuniform int ystride;\n\n// if computing triliear values from multiple z slices\n#ifdef vtkTriliearOn\nvec4 getTextureValue(vec3 ijk)\n{\n float zoff = 1.0/float(volumeDimensions.z);\n vec4 val1 = getOneTextureValue(ijk);\n vec4 val2 = getOneTextureValue(vec3(ijk.xy, ijk.z + zoff));\n\n float indexZ = float(volumeDimensions)*ijk.z;\n float zmix = indexZ - floor(indexZ);\n\n return mix(val1, val2, zmix);\n}\n\nvec4 getOneTextureValue(vec3 ijk)\n#else // nearest or fast linear\nvec4 getTextureValue(vec3 ijk)\n#endif\n{\n vec3 tdims = vec3(volumeDimensions);\n\n#ifdef debugtile\n vec2 tpos = vec2(ijk.x, ijk.y);\n vec4 tmp = texture2D(texture1, tpos);\n tmp.a = 1.0;\n\n#else\n int z = int(ijk.z * tdims.z);\n int yz = z / xreps;\n int xz = z - yz*xreps;\n\n int tileWidth = volumeDimensions.x/xstride;\n int tileHeight = volumeDimensions.y/ystride;\n\n xz *= tileWidth;\n yz *= tileHeight;\n\n float ni = float(xz) + (ijk.x*float(tileWidth));\n float nj = float(yz) + (ijk.y*float(tileHeight));\n\n vec2 tpos = vec2(ni/texWidth, nj/texHeight);\n\n vec4 tmp = texture2D(texture1, tpos);\n\n#if vtkNumComponents == 1\n tmp.a = tmp.r;\n#endif\n#if vtkNumComponents == 2\n tmp.g = tmp.a;\n#endif\n#if vtkNumComponents == 3\n tmp.a = length(tmp.rgb);\n#endif\n#endif\n\n return tmp;\n}\n\n// End of Webgl1 specific code\n//=======================================================================\n#endif\n\n//=======================================================================\n// compute the normal and gradient magnitude for a position\nvec4 computeNormal(vec3 pos, float scalar, vec3 tstep)\n{\n vec4 result;\n\n result.x = getTextureValue(pos + vec3(tstep.x, 0.0, 0.0)).a - scalar;\n result.y = getTextureValue(pos + vec3(0.0, tstep.y, 0.0)).a - scalar;\n result.z = getTextureValue(pos + vec3(0.0, 0.0, tstep.z)).a - scalar;\n\n // divide by spacing\n result.xyz /= vSpacing;\n\n result.w = length(result.xyz);\n\n // rotate to View Coords\n result.xyz =\n result.x * vPlaneNormal0 +\n result.y * vPlaneNormal2 +\n result.z * vPlaneNormal4;\n\n if (result.w > 0.0)\n {\n result.xyz /= result.w;\n }\n return result;\n}\n\n#ifdef vtkImageLabelOutlineOn\nvec3 fragCoordToIndexSpace(vec4 fragCoord) {\n vec4 pcPos = vec4(\n (fragCoord.x / vpWidth - 0.5) * 2.0,\n (fragCoord.y / vpHeight - 0.5) * 2.0,\n (fragCoord.z - 0.5) * 2.0,\n 1.0);\n\n vec4 worldCoord = PCWCMatrix * pcPos;\n vec4 vertex = (worldCoord/worldCoord.w);\n\n return (vWCtoIDX * vertex).xyz / vec3(volumeDimensions);\n}\n#endif\n\n//=======================================================================\n// compute the normals and gradient magnitudes for a position\n// for independent components\nmat4 computeMat4Normal(vec3 pos, vec4 tValue, vec3 tstep)\n{\n mat4 result;\n vec4 distX = getTextureValue(pos + vec3(tstep.x, 0.0, 0.0)) - tValue;\n vec4 distY = getTextureValue(pos + vec3(0.0, tstep.y, 0.0)) - tValue;\n vec4 distZ = getTextureValue(pos + vec3(0.0, 0.0, tstep.z)) - tValue;\n\n // divide by spacing\n distX /= vSpacing.x;\n distY /= vSpacing.y;\n distZ /= vSpacing.z;\n\n mat3 rot;\n rot[0] = vPlaneNormal0;\n rot[1] = vPlaneNormal2;\n rot[2] = vPlaneNormal4;\n\n#if !defined(vtkComponent0Proportional)\n result[0].xyz = vec3(distX.r, distY.r, distZ.r);\n result[0].a = length(result[0].xyz);\n result[0].xyz *= rot;\n if (result[0].w > 0.0)\n {\n result[0].xyz /= result[0].w;\n }\n#endif\n\n// optionally compute the 2nd component\n#if vtkNumComponents >= 2 && !defined(vtkComponent1Proportional)\n result[1].xyz = vec3(distX.g, distY.g, distZ.g);\n result[1].a = length(result[1].xyz);\n result[1].xyz *= rot;\n if (result[1].w > 0.0)\n {\n result[1].xyz /= result[1].w;\n }\n#endif\n\n// optionally compute the 3rd component\n#if vtkNumComponents >= 3 && !defined(vtkComponent2Proportional)\n result[2].xyz = vec3(distX.b, distY.b, distZ.b);\n result[2].a = length(result[2].xyz);\n result[2].xyz *= rot;\n if (result[2].w > 0.0)\n {\n result[2].xyz /= result[2].w;\n }\n#endif\n\n// optionally compute the 4th component\n#if vtkNumComponents >= 4 && !defined(vtkComponent3Proportional)\n result[3].xyz = vec3(distX.a, distY.a, distZ.a);\n result[3].a = length(result[3].xyz);\n result[3].xyz *= rot;\n if (result[3].w > 0.0)\n {\n result[3].xyz /= result[3].w;\n }\n#endif\n\n return result;\n}\n\n//=======================================================================\n// Given a normal compute the gradient opacity factors\n//\nfloat computeGradientOpacityFactor(\n vec4 normal, float goscale, float goshift, float gomin, float gomax)\n{\n#if defined(vtkGradientOpacityOn)\n return clamp(normal.a*goscale + goshift, gomin, gomax);\n#else\n return 1.0;\n#endif\n}\n\n#if vtkLightComplexity > 0\nvoid applyLighting(inout vec3 tColor, vec4 normal)\n{\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n //VTK::Light::Impl\n tColor.rgb = tColor.rgb*(diffuse*vDiffuse + vAmbient) + specular*vSpecular;\n}\n#endif\n\n//=======================================================================\n// Given a texture value compute the color and opacity\n//\nvec4 getColorForValue(vec4 tValue, vec3 posIS, vec3 tstep)\n{\n#ifdef vtkImageLabelOutlineOn\n vec3 centerPosIS = fragCoordToIndexSpace(gl_FragCoord); // pos in texture space\n vec4 centerValue = getTextureValue(centerPosIS);\n bool pixelOnBorder = false;\n vec4 tColor = texture2D(ctexture, vec2(centerValue.r * cscale0 + cshift0, 0.5));\n\n // Get alpha of segment from opacity function.\n tColor.a = texture2D(otexture, vec2(centerValue.r * oscale0 + oshift0, 0.5)).r;\n\n // Only perform outline check on fragments rendering voxels that aren't invisible.\n // Saves a bunch of needless checks on the background.\n // TODO define epsilon when building shader?\n if (float(tColor.a) > 0.01) {\n for (int i = -outlineThickness; i <= outlineThickness; i++) {\n for (int j = -outlineThickness; j <= outlineThickness; j++) {\n if (i == 0 || j == 0) {\n continue;\n }\n\n vec4 neighborPixelCoord = vec4(gl_FragCoord.x + float(i),\n gl_FragCoord.y + float(j),\n gl_FragCoord.z, gl_FragCoord.w);\n\n vec3 neighborPosIS = fragCoordToIndexSpace(neighborPixelCoord);\n vec4 value = getTextureValue(neighborPosIS);\n\n // If any of my neighbours are not the same value as I\n // am, this means I am on the border of the segment.\n // We can break the loops\n if (any(notEqual(value, centerValue))) {\n pixelOnBorder = true;\n break;\n }\n }\n\n if (pixelOnBorder == true) {\n break;\n }\n }\n\n // If I am on the border, I am displayed at full opacity\n if (pixelOnBorder == true) {\n tColor.a = 1.0;\n }\n }\n\n#else\n // compute the normal and gradient magnitude if needed\n // We compute it as a vec4 if possible otherwise a mat4\n //\n vec4 goFactor = vec4(1.0,1.0,1.0,1.0);\n\n // compute the normal vectors as needed\n #if (vtkLightComplexity > 0) || defined(vtkGradientOpacityOn)\n #if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\n mat4 normalMat = computeMat4Normal(posIS, tValue, tstep);\n #if !defined(vtkComponent0Proportional)\n vec4 normal0 = normalMat[0];\n #endif\n #if !defined(vtkComponent1Proportional)\n vec4 normal1 = normalMat[1];\n #endif\n #if vtkNumComponents > 2\n #if !defined(vtkComponent2Proportional)\n vec4 normal2 = normalMat[2];\n #endif\n #if vtkNumComponents > 3\n #if !defined(vtkComponent3Proportional)\n vec4 normal3 = normalMat[3];\n #endif\n #endif\n #endif\n #else\n vec4 normal0 = computeNormal(posIS, tValue.a, tstep);\n #endif\n #endif\n\n // compute gradient opacity factors as needed\n #if defined(vtkGradientOpacityOn)\n #if !defined(vtkComponent0Proportional)\n goFactor.x =\n computeGradientOpacityFactor(normal0, goscale0, goshift0, gomin0, gomax0);\n #endif\n #if defined(vtkIndependentComponentsOn) && (vtkNumComponents > 1)\n #if !defined(vtkComponent1Proportional)\n goFactor.y =\n computeGradientOpacityFactor(normal1, goscale1, goshift1, gomin1, gomax1);\n #endif\n #if vtkNumComponents > 2\n #if !defined(vtkComponent2Proportional)\n goFactor.z =\n computeGradientOpacityFactor(normal2, goscale2, goshift2, gomin2, gomax2);\n #endif\n #if vtkNumComponents > 3\n #if !defined(vtkComponent3Proportional)\n goFactor.w =\n computeGradientOpacityFactor(normal3, goscale3, goshift3, gomin3, gomax3);\n #endif\n #endif\n #endif\n #endif\n #endif\n\n // single component is always independent\n #if vtkNumComponents == 1\n vec4 tColor = texture2D(ctexture, vec2(tValue.r * cscale0 + cshift0, 0.5));\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, 0.5)).r;\n #endif\n\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\n vec4 tColor = mix0*texture2D(ctexture, vec2(tValue.r * cscale0 + cshift0, height0));\n #if !defined(vtkComponent0Proportional)\n tColor.a = goFactor.x*mix0*texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, height0)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.r * oscale0 + oshift0, height0)).r;\n tColor *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix0));\n #endif\n\n vec3 tColor1 = mix1*texture2D(ctexture, vec2(tValue.g * cscale1 + cshift1, height1)).rgb;\n #if !defined(vtkComponent1Proportional)\n tColor.a += goFactor.y*mix1*texture2D(otexture, vec2(tValue.g * oscale1 + oshift1, height1)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.g * oscale1 + oshift1, height1)).r;\n tColor1 *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix1));\n #endif\n\n #if vtkNumComponents >= 3\n vec3 tColor2 = mix2*texture2D(ctexture, vec2(tValue.b * cscale2 + cshift2, height2)).rgb;\n #if !defined(vtkComponent2Proportional)\n tColor.a += goFactor.z*mix2*texture2D(otexture, vec2(tValue.b * oscale2 + oshift2, height2)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.b * oscale2 + oshift2, height2)).r;\n tColor2 *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix2));\n #endif\n\n #if vtkNumComponents >= 4\n vec3 tColor3 = mix3*texture2D(ctexture, vec2(tValue.a * cscale3 + cshift3, height3)).rgb;\n #if !defined(vtkComponent3Proportional)\n tColor.a += goFactor.w*mix3*texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, height3)).r;\n #else\n float pwfValue = texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, height3)).r;\n tColor3 *= pwfValue;\n tColor.a *= mix(pwfValue, 1.0, (1.0 - mix3));\n #endif\n #endif\n #endif\n #else // then not independent\n\n #if vtkNumComponents == 2\n float lum = tValue.r * cscale0 + cshift0;\n float alpha = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale1 + oshift1, 0.5)).r;\n vec4 tColor = vec4(lum, lum, lum, alpha);\n #endif\n #if vtkNumComponents == 3\n vec4 tColor;\n tColor.r = tValue.r * cscale0 + cshift0;\n tColor.g = tValue.g * cscale1 + cshift1;\n tColor.b = tValue.b * cscale2 + cshift2;\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale0 + oshift0, 0.5)).r;\n #endif\n #if vtkNumComponents == 4\n vec4 tColor;\n tColor.r = tValue.r * cscale0 + cshift0;\n tColor.g = tValue.g * cscale1 + cshift1;\n tColor.b = tValue.b * cscale2 + cshift2;\n tColor.a = goFactor.x*texture2D(otexture, vec2(tValue.a * oscale3 + oshift3, 0.5)).r;\n #endif\n #endif // dependent\n\n // apply lighting if requested as appropriate\n #if vtkLightComplexity > 0\n #if !defined(vtkComponent0Proportional)\n applyLighting(tColor.rgb, normal0);\n #endif\n #if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\n #if !defined(vtkComponent1Proportional)\n applyLighting(tColor1, normal1);\n #endif\n #if vtkNumComponents >= 3\n #if !defined(vtkComponent2Proportional)\n applyLighting(tColor2, normal2);\n #endif\n #if vtkNumComponents >= 4\n #if !defined(vtkComponent3Proportional)\n applyLighting(tColor3, normal3);\n #endif\n #endif\n #endif\n #endif\n#endif\n\n// perform final independent blend as needed\n#if defined(vtkIndependentComponentsOn) && vtkNumComponents >= 2\n tColor.rgb += tColor1;\n#if vtkNumComponents >= 3\n tColor.rgb += tColor2;\n#if vtkNumComponents >= 4\n tColor.rgb += tColor3;\n#endif\n#endif\n#endif\n\n#endif\n\n\n\n\n\n\n\nreturn tColor;\n}\n\n\n\n//=======================================================================\n// Apply the specified blend mode operation along the ray's path.\n//\nvoid applyBlend(vec3 posIS, vec3 endIS, float sampleDistanceIS, vec3 tdims)\n{\n vec3 tstep = 1.0/tdims;\n\n // start slightly inside and apply some jitter\n vec3 delta = endIS - posIS;\n vec3 stepIS = normalize(delta)*sampleDistanceIS;\n float raySteps = length(delta)/sampleDistanceIS;\n\n // avoid 0.0 jitter\n float jitter = 0.01 + 0.99*texture2D(jtexture, gl_FragCoord.xy/32.0).r;\n float stepsTraveled = jitter;\n\n // local vars for the loop\n vec4 color = vec4(0.0, 0.0, 0.0, 0.0);\n vec4 tValue;\n vec4 tColor;\n\n // if we have less than one step then pick the middle point\n // as our value\n // if (raySteps <= 1.0)\n // {\n // posIS = (posIS + endIS)*0.5;\n // }\n\n // Perform initial step at the volume boundary\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n #if vtkBlendMode == 0 // COMPOSITE_BLEND\n // now map through opacity and color\n tColor = getColorForValue(tValue, posIS, tstep);\n\n // handle very thin volumes\n if (raySteps <= 1.0)\n {\n tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps);\n gl_FragData[0] = tColor;\n return;\n }\n\n tColor.a = 1.0 - pow(1.0 - tColor.a, jitter);\n color = vec4(tColor.rgb*tColor.a, tColor.a);\n posIS += (jitter*stepIS);\n\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\n {\n if (stepsTraveled + 1.0 >= raySteps) { break; }\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // now map through opacity and color\n tColor = getColorForValue(tValue, posIS, tstep);\n\n float mix = (1.0 - color.a);\n\n // this line should not be needed but nvidia seems to not handle\n // the break correctly on windows/chrome 58 angle\n //mix = mix * sign(max(raySteps - stepsTraveled - 1.0, 0.0));\n\n color = color + vec4(tColor.rgb*tColor.a, tColor.a)*mix;\n stepsTraveled++;\n posIS += stepIS;\n if (color.a > 0.99) { color.a = 1.0; break; }\n }\n\n if (color.a < 0.99 && (raySteps - stepsTraveled) > 0.0)\n {\n posIS = endIS;\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // now map through opacity and color\n tColor = getColorForValue(tValue, posIS, tstep);\n tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps - stepsTraveled);\n\n float mix = (1.0 - color.a);\n color = color + vec4(tColor.rgb*tColor.a, tColor.a)*mix;\n }\n\n gl_FragData[0] = vec4(color.rgb/color.a, color.a);\n #endif\n #if vtkBlendMode == 1 || vtkBlendMode == 2\n // MAXIMUM_INTENSITY_BLEND || MINIMUM_INTENSITY_BLEND\n // Find maximum/minimum intensity along the ray.\n\n // Define the operation we will use (min or max)\n #if vtkBlendMode == 1\n #define OP max\n #else\n #define OP min\n #endif\n\n // If the clipping range is shorter than the sample distance\n // we can skip the sampling loop along the ray.\n if (raySteps <= 1.0)\n {\n gl_FragData[0] = getColorForValue(tValue, posIS, tstep);\n return;\n }\n\n vec4 value = tValue;\n posIS += (jitter*stepIS);\n\n // Sample along the ray until MaximumSamplesValue,\n // ending slightly inside the total distance\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\n {\n // If we have reached the last step, break\n if (stepsTraveled + 1.0 >= raySteps) { break; }\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // Update the maximum value if necessary\n value = OP(tValue, value);\n\n // Otherwise, continue along the ray\n stepsTraveled++;\n posIS += stepIS;\n }\n\n // Perform the last step along the ray using the\n // residual distance\n posIS = endIS;\n tValue = getTextureValue(posIS);\n value = OP(tValue, value);\n\n // Now map through opacity and color\n gl_FragData[0] = getColorForValue(value, posIS, tstep);\n #endif\n #if vtkBlendMode == 3 //AVERAGE_INTENSITY_BLEND\n vec4 averageIPScalarRangeMin = vec4 (\n //VTK::AverageIPScalarRangeMin,\n //VTK::AverageIPScalarRangeMin,\n //VTK::AverageIPScalarRangeMin,\n 1.0);\n vec4 averageIPScalarRangeMax = vec4(\n //VTK::AverageIPScalarRangeMax,\n //VTK::AverageIPScalarRangeMax,\n //VTK::AverageIPScalarRangeMax,\n 1.0);\n\n vec4 sum = vec4(0.);\n\n averageIPScalarRangeMin.a = tValue.a;\n averageIPScalarRangeMax.a = tValue.a;\n\n if (all(greaterThanEqual(tValue, averageIPScalarRangeMin)) &&\n all(lessThanEqual(tValue, averageIPScalarRangeMax))) {\n sum += tValue;\n }\n\n if (raySteps <= 1.0) {\n gl_FragData[0] = getColorForValue(sum, posIS, tstep);\n return;\n }\n\n posIS += (jitter*stepIS);\n\n // Sample along the ray until MaximumSamplesValue,\n // ending slightly inside the total distance\n for (int i = 0; i < //VTK::MaximumSamplesValue ; ++i)\n {\n // If we have reached the last step, break\n if (stepsTraveled + 1.0 >= raySteps) { break; }\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // One can control the scalar range by setting the AverageIPScalarRange to disregard scalar values, not in the range of interest, from the average computation.\n // Notes:\n // - We are comparing all values in the texture to see if any of them\n // are outside of the scalar range. In the future we might want to allow\n // scalar ranges for each component.\n // - We are setting the alpha channel for averageIPScalarRangeMin and\n // averageIPScalarRangeMax so that we do not trigger this 'continue'\n // based on the alpha channel comparison.\n // - There might be a better way to do this. I'm not sure if there is an\n // equivalent of 'any' which only operates on RGB, though I suppose\n // we could write an 'anyRGB' function and see if that is faster.\n averageIPScalarRangeMin.a = tValue.a;\n averageIPScalarRangeMax.a = tValue.a;\n if (any(lessThan(tValue, averageIPScalarRangeMin)) ||\n any(greaterThan(tValue, averageIPScalarRangeMax))) {\n continue;\n }\n\n // Sum the values across each step in the path\n sum += tValue;\n\n // Otherwise, continue along the ray\n stepsTraveled++;\n posIS += stepIS;\n }\n\n // Perform the last step along the ray using the\n // residual distance\n posIS = endIS;\n\n // compute the scalar\n tValue = getTextureValue(posIS);\n\n // One can control the scalar range by setting the AverageIPScalarRange to disregard scalar values, not in the range of interest, from the average computation\n if (all(greaterThanEqual(tValue, averageIPScalarRangeMin)) &&\n all(lessThanEqual(tValue, averageIPScalarRangeMax))) {\n sum += tValue;\n\n stepsTraveled++;\n }\n\n sum /= vec4(stepsTraveled, stepsTraveled, stepsTraveled, 1.0);\n\n gl_FragData[0] = getColorForValue(sum, posIS, tstep);\n #endif\n}\n\n//=======================================================================\n// Compute a new start and end point for a given ray based\n// on the provided bounded clipping plane (aka a rectangle)\nvoid getRayPointIntersectionBounds(\n vec3 rayPos, vec3 rayDir,\n vec3 planeDir, float planeDist,\n inout vec2 tbounds, vec3 vPlaneX, vec3 vPlaneY,\n float vSize1, float vSize2)\n{\n float result = dot(rayDir, planeDir);\n if (result == 0.0)\n {\n return;\n }\n result = -1.0 * (dot(rayPos, planeDir) + planeDist) / result;\n vec3 xposVC = rayPos + rayDir*result;\n vec3 vxpos = xposVC - vOriginVC;\n vec2 vpos = vec2(\n dot(vxpos, vPlaneX),\n dot(vxpos, vPlaneY));\n\n // on some apple nvidia systems this does not work\n // if (vpos.x < 0.0 || vpos.x > vSize1 ||\n // vpos.y < 0.0 || vpos.y > vSize2)\n // even just\n // if (vpos.x < 0.0 || vpos.y < 0.0)\n // fails\n // so instead we compute a value that represents in and out\n //and then compute the return using this value\n float xcheck = max(0.0, vpos.x * (vpos.x - vSize1)); // 0 means in bounds\n float check = sign(max(xcheck, vpos.y * (vpos.y - vSize2))); // 0 means in bounds, 1 = out\n\n tbounds = mix(\n vec2(min(tbounds.x, result), max(tbounds.y, result)), // in value\n tbounds, // out value\n check); // 0 in 1 out\n}\n\n//=======================================================================\n// given a\n// - ray direction (rayDir)\n// - starting point (vertexVCVSOutput)\n// - bounding planes of the volume\n// - optionally depth buffer values\n// - far clipping plane\n// compute the start/end distances of the ray we need to cast\nvec2 computeRayDistances(vec3 rayDir, vec3 tdims)\n{\n vec2 dists = vec2(100.0*camFar, -1.0);\n\n vec3 vSize = vSpacing*(tdims - 1.0);\n\n // all this is in View Coordinates\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal0, vPlaneDistance0, dists, vPlaneNormal2, vPlaneNormal4,\n vSize.y, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal1, vPlaneDistance1, dists, vPlaneNormal2, vPlaneNormal4,\n vSize.y, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal2, vPlaneDistance2, dists, vPlaneNormal0, vPlaneNormal4,\n vSize.x, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal3, vPlaneDistance3, dists, vPlaneNormal0, vPlaneNormal4,\n vSize.x, vSize.z);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal4, vPlaneDistance4, dists, vPlaneNormal0, vPlaneNormal2,\n vSize.x, vSize.y);\n getRayPointIntersectionBounds(vertexVCVSOutput, rayDir,\n vPlaneNormal5, vPlaneDistance5, dists, vPlaneNormal0, vPlaneNormal2,\n vSize.x, vSize.y);\n\n //VTK::ClipPlane::Impl\n\n // do not go behind front clipping plane\n dists.x = max(0.0,dists.x);\n\n // do not go PAST far clipping plane\n float farDist = -camThick/rayDir.z;\n dists.y = min(farDist,dists.y);\n\n // Do not go past the zbuffer value if set\n // This is used for intermixing opaque geometry\n //VTK::ZBuffer::Impl\n\n return dists;\n}\n\n//=======================================================================\n// Compute the index space starting position (pos) and end\n// position\n//\nvoid computeIndexSpaceValues(out vec3 pos, out vec3 endPos, out float sampleDistanceIS, vec3 rayDir, vec2 dists)\n{\n // compute starting and ending values in volume space\n pos = vertexVCVSOutput + dists.x*rayDir;\n pos = pos - vOriginVC;\n // convert to volume basis and origin\n pos = vec3(\n dot(pos, vPlaneNormal0),\n dot(pos, vPlaneNormal2),\n dot(pos, vPlaneNormal4));\n\n endPos = vertexVCVSOutput + dists.y*rayDir;\n endPos = endPos - vOriginVC;\n endPos = vec3(\n dot(endPos, vPlaneNormal0),\n dot(endPos, vPlaneNormal2),\n dot(endPos, vPlaneNormal4));\n\n float delta = length(endPos - pos);\n\n pos *= vVCToIJK;\n endPos *= vVCToIJK;\n\n float delta2 = length(endPos - pos);\n sampleDistanceIS = sampleDistance*delta2/delta;\n}\n\nvoid main()\n{\n\n vec3 rayDirVC;\n\n if (cameraParallel == 1)\n {\n // Camera is parallel, so the rayDir is just the direction of the camera.\n rayDirVC = vec3(0.0, 0.0, -1.0);\n } else {\n // camera is at 0,0,0 so rayDir for perspective is just the vc coord\n rayDirVC = normalize(vertexVCVSOutput);\n }\n\n vec3 tdims = vec3(volumeDimensions);\n\n // compute the start and end points for the ray\n vec2 rayStartEndDistancesVC = computeRayDistances(rayDirVC, tdims);\n\n // do we need to composite? aka does the ray have any length\n // If not, bail out early\n if (rayStartEndDistancesVC.y <= rayStartEndDistancesVC.x)\n {\n discard;\n }\n\n // IS = Index Space\n vec3 posIS;\n vec3 endIS;\n float sampleDistanceIS;\n computeIndexSpaceValues(posIS, endIS, sampleDistanceIS, rayDirVC, rayStartEndDistancesVC);\n\n // Perform the blending operation along the ray\n applyBlend(posIS, endIS, sampleDistanceIS, tdims);\n}\n"},function(e,t,n){var r;!function(a){"use strict";function o(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function i(e,t,n,r,a,i){return o(function(e,t){return e<>>32-t}(o(o(t,e),o(r,i)),a),n)}function s(e,t,n,r,a,o,s){return i(t&n|~t&r,e,t,a,o,s)}function l(e,t,n,r,a,o,s){return i(t&r|n&~r,e,t,a,o,s)}function u(e,t,n,r,a,o,s){return i(t^n^r,e,t,a,o,s)}function c(e,t,n,r,a,o,s){return i(n^(t|~r),e,t,a,o,s)}function d(e,t){var n,r,a,i,d;e[t>>5]|=128<>>9<<4)]=t;var f=1732584193,p=-271733879,g=-1732584194,m=271733878;for(n=0;n>5]>>>t%32&255);return n}function p(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<>>4&15)+"0123456789abcdef".charAt(15&t);return r}function m(e){return unescape(encodeURIComponent(e))}function v(e){return function(e){return f(d(p(e),8*e.length))}(m(e))}function h(e,t){return function(e,t){var n,r,a=p(e),o=[],i=[];for(o[15]=i[15]=void 0,a.length>16&&(a=d(a,8*e.length)),n=0;n<16;n+=1)o[n]=909522486^a[n],i[n]=1549556828^a[n];return r=d(o.concat(p(t)),512+8*t.length),f(d(i.concat(r),640))}(m(e),m(t))}function y(e,t,n){return t?n?h(t,e):function(e,t){return g(h(e,t))}(t,e):n?v(e):function(e){return g(v(e))}(e)}void 0===(r=function(){return y}.call(t,n,t,e))||(e.exports=r)}()},function(e){e.exports=[{Name:"KAAMS",IndexedColors:[1,1,1,1,0,0,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,.63,.63,1,.67,.5,.33,1,.5,.75,.53,.35,.7,1,.75,.5],Annotations:[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11]},{ColorSpace:"Diverging",Name:"Cool to Warm",NanColor:[1,1,0],RGBPoints:[0,.23137254902,.298039215686,.752941176471,.5,.865,.865,.865,1,.705882352941,.0156862745098,.149019607843]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Cool to Warm (Extended)",NanColor:[.25,0,0],RGBPoints:[0,0,0,.34902,.03125,.039216,.062745,.380392,.0625,.062745,.117647,.411765,.09375,.090196,.184314,.45098,.125,.12549,.262745,.501961,.15625,.160784,.337255,.541176,.1875,.2,.396078,.568627,.21875,.239216,.454902,.6,.25,.286275,.521569,.65098,.28125,.337255,.592157,.701961,.3125,.388235,.654902,.74902,.34375,.466667,.737255,.819608,.375,.572549,.819608,.878431,.40625,.654902,.866667,.909804,.4375,.752941,.917647,.941176,.46875,.823529,.956863,.968627,.5,.988235,.960784,.901961,.5,.941176,.984314,.988235,.52,.988235,.945098,.85098,.54,.980392,.898039,.784314,.5625,.968627,.835294,.698039,.59375,.94902,.733333,.588235,.625,.929412,.65098,.509804,.65625,.909804,.564706,.435294,.6875,.878431,.458824,.352941,.71875,.839216,.388235,.286275,.75,.760784,.294118,.211765,.78125,.701961,.211765,.168627,.8125,.65098,.156863,.129412,.84375,.6,.094118,.094118,.875,.54902,.066667,.098039,.90625,.501961,.05098,.12549,.9375,.45098,.054902,.172549,.96875,.4,.054902,.192157,1,.34902,.070588,.211765]},{ColorSpace:"Diverging",Name:"Warm to Cool",NanColor:[1,1,0],RGBPoints:[0,.705882352941,.0156862745098,.149019607843,.5,.865,.865,.865,1,.23137254902,.298039215686,.752941176471]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Warm to Cool (Extended)",NanColor:[.250004,0,0],RGBPoints:[0,.34902,0,.129412,.025,.4,.00392157,.101961,.05,.470588,.0156863,.0901961,.075,.54902,.027451,.0705882,.1,.619608,.0627451,.0431373,.125,.690196,.12549,.0627451,.15,.741176,.184314,.0745098,.175,.788235,.266667,.0941176,.2,.811765,.345098,.113725,.225,.831373,.411765,.133333,.25,.85098,.47451,.145098,.275,.870588,.54902,.156863,.3,.878431,.619608,.168627,.325,.890196,.658824,.196078,.35,.909804,.717647,.235294,.375,.929412,.776471,.278431,.395522,.94902,.823529,.321569,.418905,.968627,.87451,.407843,.444278,.980392,.917647,.509804,.470149,.988235,.956863,.643137,.483582,.992157,.964706,.713725,.499,.988235,.980392,.870588,.5,1,1,1,.501,.913725,.988235,.937255,.516418,.827451,.980392,.886275,.531343,.764706,.980392,.866667,.546766,.658824,.980392,.843137,.564179,.572549,.964706,.835294,.587562,.423529,.941176,.87451,.60597,.262745,.901961,.862745,.629851,.0705882,.854902,.870588,.651741,.0509804,.8,.85098,.681592,.0235294,.709804,.831373,.712935,.0313725,.615686,.811765,.75,.0313725,.537255,.788235,.775,.0392157,.466667,.768627,.8,.0509804,.396078,.741176,.825,.054902,.317647,.709804,.85,.054902,.243137,.678431,.875,.0431373,.164706,.639216,.9,.0313725,.0980392,.6,.925,.0392157,.0392157,.560784,.95,.105882,.0509804,.509804,.975,.113725,.0235294,.45098,1,.12549,0,.380392]},{ColorSpace:"RGB",Name:"Rainbow Desaturated",NanColor:[1,1,0],RGBPoints:[0,.278431372549,.278431372549,.858823529412,.143,0,0,.360784313725,.285,0,1,1,.429,0,.501960784314,0,.571,1,1,0,.714,1,.380392156863,0,.857,.419607843137,0,0,1,.878431372549,.301960784314,.301960784314]},{ColorSpace:"RGB",Name:"Cold and Hot",NanColor:[1,1,0],RGBPoints:[0,0,1,1,.45,0,0,1,.5,0,0,.501960784314,.55,1,0,0,1,1,1,0]},{ColorSpace:"RGB",Name:"Black-Body Radiation",NanColor:[0,.498039215686,1],RGBPoints:[0,0,0,0,.4,.901960784314,0,0,.8,.901960784314,.901960784314,0,1,1,1,1]},{ColorSpace:"RGB",Name:"X Ray",NanColor:[1,0,0],RGBPoints:[0,1,1,1,1,0,0,0]},{ColorSpace:"RGB",Name:"Grayscale",NanColor:[1,0,0],RGBPoints:[0,0,0,0,1,1,1,1]},{ColorSpace:"RGB",Name:"BkRd",NanColor:[0,1,1],RGBPoints:[0,0,0,0,1,1,0,0]},{ColorSpace:"RGB",Name:"BkGn",NanColor:[1,0,1],RGBPoints:[0,0,0,0,1,0,1,0]},{ColorSpace:"RGB",Name:"BkBu",NanColor:[1,1,0],RGBPoints:[0,0,0,0,1,0,0,1]},{ColorSpace:"RGB",Name:"BkMa",NanColor:[0,1,0],RGBPoints:[0,0,0,0,1,1,0,1]},{ColorSpace:"RGB",Name:"BkCy",NanColor:[0,1,1],RGBPoints:[0,0,0,0,1,0,1,1]},{ColorSpace:"RGB",Name:"Black, Blue and White",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.333,0,0,.501960784314,.666,0,.501960784314,1,1,1,1,1]},{ColorSpace:"RGB",Name:"Black, Orange and White",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.333,.501960784314,0,0,.666,1,.501960784314,0,1,1,1,1]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Linear YGB 1211g",NanColor:[.25,0,0],RGBPoints:[0,1,.988235,.968627,.02,1,.952941,.878431,.05,.968627,.905882,.776471,.1,.94902,.898039,.647059,.15,.901961,.878431,.556863,.2,.847059,.858824,.482353,.25,.690196,.819608,.435294,.3,.513725,.768627,.384314,.35,.337255,.721569,.337255,.4,.278431,.658824,.392157,.45,.231373,.639216,.435294,.5,.203922,.6,.486275,.55,.172549,.568627,.537255,.6,.141176,.517647,.54902,.65,.133333,.458824,.541176,.7,.12549,.396078,.529412,.75,.117647,.321569,.521569,.8,.121569,.258824,.509804,.85,.133333,.227451,.501961,.9,.145098,.192157,.490196,.95,.188235,.164706,.470588,1,.258824,.196078,.439216]},{ColorSpace:"CIELAB",Creator:"Francesca Samsel",Name:"Linear Green (Gr4L)",NanColor:[.25,0,0],RGBPoints:[0,.054902,.109804,.121569,.05,.07451,.172549,.180392,.1,.086275,.231373,.219608,.15,.094118,.278431,.25098,.2,.109804,.34902,.278431,.25,.113725,.4,.278431,.3,.117647,.45098,.270588,.35,.117647,.490196,.243137,.4,.113725,.521569,.203922,.45,.109804,.54902,.152941,.5,.082353,.588235,.082353,.55,.109804,.631373,.05098,.6,.211765,.678431,.082353,.65,.317647,.721569,.113725,.7,.431373,.760784,.160784,.75,.556863,.8,.239216,.8,.666667,.839216,.294118,.85,.784314,.878431,.396078,.9,.886275,.921569,.533333,.95,.960784,.94902,.670588,1,1,.984314,.901961]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Linear Blue (8_31f)",NanColor:[.25,0,0],RGBPoints:[0,.960784,1,.980392,.05,.815686,.960784,.913725,.1,.670588,.929412,.870588,.15,.556863,.901961,.843137,.2,.478431,.870588,.823529,.25,.439216,.831373,.803922,.3,.4,.8,.788235,.35,.376471,.768627,.768627,.4,.34902,.709804,.729412,.45,.32549,.654902,.690196,.5,.301961,.607843,.658824,.55,.247059,.545098,.619608,.6,.239216,.494118,.580392,.65,.227451,.439216,.541176,.7,.227451,.403922,.521569,.75,.231373,.368627,.501961,.8,.227451,.321569,.470588,.85,.219608,.282353,.439216,.9,.192157,.235294,.4,.95,.160784,.184314,.34902,1,.133333,.12549,.301961]},{ColorSpace:"HSV",Name:"Blue to Red Rainbow",NanColor:[.498039215686,.498039215686,.498039215686],RGBPoints:[0,0,0,1,1,1,0,0]},{ColorSpace:"HSV",Name:"Red to Blue Rainbow",NanColor:[.498039215686,.498039215686,.498039215686],RGBPoints:[0,1,0,0,1,0,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended White",NanColor:[1,1,0],RGBPoints:[0,1,1,1,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended Grey",NanColor:[1,1,0],RGBPoints:[0,.317647058824,.341176470588,.43137254902,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended Black",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Blue to Yellow",NanColor:[1,0,0],RGBPoints:[0,.0392156862745,.0392156862745,.949019607843,1,.949019607843,.949019607843,.0392156862745]},{ColorSpace:"HSV",Name:"blot",RGBPoints:[0,0,0,1,.166,0,0,1,.167,1,0,1,.332,1,0,1,.333,0,1,1,.5,0,1,1,.501,0,1,0,.666,0,1,0,.667,1,1,0,.832,1,1,0,.833,1,0,0,1,1,0,0]},{ColorSpace:"Lab",Name:"CIELab Blue to Red",NanColor:[1,1,0],RGBPoints:[0,0,.6,.749019607843,1,.76862745098,.466666666667,.341176470588]},{ColorSpace:"RGB",Name:"jet",RGBPoints:[-1,0,0,.5625,-.777778,0,0,1,-.269841,0,1,1,-.015873,.5,1,.5,.238095,1,1,0,.746032,1,0,0,1,.5,0,0]},{ColorSpace:"RGB",Name:"rainbow",RGBPoints:[-1,0,0,1,-.5,0,1,1,0,0,1,0,.5,1,1,0,1,1,0,0]},{ColorSpace:"Lab",Name:"erdc_rainbow_bright",RGBPoints:[-1,.32549,.14902,.960784,-.866221,.297047,.375586,.963836,-.732441,.180302,.536818,.964627,-.598662,.1302,.649207,.929647,-.464883,.0445143,.749654,.855998,-.331104,.0271325,.830713,.721527,-.197324,.259504,.866145,.543555,-.0635452,.428364,.890725,.329819,.0702341,.568503,.898508,.187623,.204013,.738259,.890317,.0825461,.337793,.84546,.86136,.0147555,.471572,.912191,.808018,0,.605351,.962848,.710445,0,.73913,.999469,.600258,.0176284,.87291,.994156,.445975,.193912,1,.980407,.247105,.262699]},{ColorSpace:"Lab",Name:"erdc_rainbow_dark",RGBPoints:[-1,0,0,.423499,-.866221,0,.119346,.529237,-.732441,0,.238691,.634976,-.598662,0,.346852,.68788,-.464883,0,.45022,.718141,-.331104,0,.553554,.664839,-.197324,0,.651082,.519303,-.0635452,.115841,.72479,.352857,.0702341,.326771,.781195,.140187,.204013,.522765,.798524,.0284624,.337793,.703162,.788685,.00885756,.471572,.845118,.751133,0,.605351,.955734,.690825,0,.73913,.995402,.567916,.0618524,.87291,.987712,.403398,.164851,1,.980407,.247105,.262699]},{ColorSpace:"Lab",Name:"nic_CubicL",RGBPoints:[-1,.479965,.0118108,.5307,-.87451,.522213,.0551282,.706919,-.74902,.50839,.237278,.867764,-.623529,.451617,.373834,.987255,-.498039,.39365,.497255,.97506,-.372549,.328631,.599639,.891843,-.247059,.250043,.690286,.778553,-.121569,.249656,.764905,.645857,.00392157,.297954,.821466,.50449,.129412,.337509,.872595,.358447,.254902,.430011,.913789,.297079,.380392,.587191,.931381,.333353,.505882,.727937,.93591,.353742,.631373,.826403,.921081,.365066,.756863,.893201,.846317,.372662,.882353,.965347,.73884,.378506,1,.983235,.597451,.366856]},{ColorSpace:"Lab",Name:"nic_CubicYF",RGBPoints:[-1,.5151,.0482,.6697,-.87451,.520711,.168955,.800574,-.74902,.493694,.278596,.911824,-.623529,.440026,.369475,.984978,-.498039,.398932,.457593,.987053,-.372549,.350651,.540644,.929608,-.247059,.298827,.615625,.857729,-.121569,.239928,.685061,.769531,.00392157,.228832,.739349,.673287,.129412,.263297,.78608,.569988,.254902,.298107,.828337,.460214,.380392,.33092,.864071,.352674,.505882,.38306,.898169,.287309,.631373,.49023,.917481,.307961,.756863,.62372,.926026,.332309,.882353,.717458,.92527,.342476,1,.8,.9255,.3529]},{ColorSpace:"Lab",Name:"gist_earth",RGBPoints:[-1,0,0,0,-.87451,.239216,.027451,.415686,-.74902,.0901961,.254902,.556863,-.623529,.0941176,.352941,.54902,-.498039,.105882,.435294,.533333,-.372549,.12549,.52549,.501961,-.247059,.156863,.596078,.443137,-.121569,.196078,.65098,.380392,.00392157,.282353,.717647,.301961,.129412,.466667,.772549,.27451,.254902,.678431,.784314,.309804,.380392,.901961,.756863,.376471,.505882,.992157,.705882,.521569,.631373,1,.721569,.701961,.756863,1,.784314,.784314,.882353,1,.866667,.866667,1,1,1,1]},{ColorSpace:"Lab",Name:"2hot",RGBPoints:[-1,.0416667,0,0,-.873016,.208333,0,0,-.746032,.375,0,0,-.619048,.541667,0,0,-.492063,.708333,0,0,-.365079,.854137,0,0,-.238095,.937488,.039062,0,-.111111,1,.208333,0,.015873,1,.375,0,.142857,1,.541667,0,.269841,1,.708333,0,.396825,1,.858805,.03125,.52381,1,.947392,.15625,.650794,1,1,.3125,.777778,1,1,.5625,.904762,1,1,.8125,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_red2yellow_BW",RGBPoints:[-1,7.54296e-7,0,109827e-10,-.87451,.18285,.0264094,0,-.74902,.3066,0,0,-.623529,.422841,0,0,-.498039,.522945,0,0,-.372549,.605721,0,0,-.247059,.672502,.14168,0,-.121569,.728167,.244025,0,.00392157,.781215,.333454,0,.129412,.825,.423586,0,.254902,.855893,.516793,0,.380392,.880491,.608846,0,.505882,.910305,.695505,0,.631373,.94109,.779067,.223528,.756863,.967873,.858572,.473521,.882353,.986815,.933211,.751583,1,1,1,.999997]},{ColorSpace:"Lab",Name:"erdc_marine2gold_BW",RGBPoints:[-1,1.11641e-7,0,162551e-11,-.87451,.0413146,.0619808,.209857,-.74902,.0185557,.101341,.350684,-.623529,.00486405,.149847,.461054,-.498039,.0836345,.210845,.517906,-.372549,.173222,.276134,.541793,-.247059,.259857,.343877,.535869,-.121569,.362299,.408124,.504293,.00392157,.468266,.468276,.468257,.129412,.582781,.527545,.374914,.254902,.691591,.585251,.274266,.380392,.784454,.645091,.247332,.505882,.862299,.710383,.27518,.631373,.920863,.782923,.351563,.756863,.955792,.859699,.533541,.882353,.976162,.93433,.780671,1,1,1,.999983]},{ColorSpace:"Lab",Name:"erdc_blue2gold_BW",RGBPoints:[-1,0,0,0,-.87451,.0742735,.0440331,.230013,-.74902,.125276,.0258685,.415826,-.623529,.143879,.0163031,.591346,-.498039,.212261,.0627855,.705239,-.372549,.306048,.141178,.763636,-.247059,.391537,.232286,.773263,-.121569,.461734,.336633,.708321,.00392157,.54209,.427581,.590007,.129412,.61704,.508623,.460978,.254902,.702703,.579586,.309117,.380392,.790336,.644811,.170397,.505882,.870173,.710733,.117134,.631373,.93656,.781991,.157144,.756863,.965672,.862068,.409836,.882353,.985751,.936296,.714162,1,1,1,.999999]},{ColorSpace:"Lab",Name:"erdc_sapphire2gold_BW",RGBPoints:[-1,.107704,.107708,.107694,-.87451,.1851,.112354,.308554,-.74902,.236782,.114233,.48788,-.623529,.28296,.126187,.639464,-.498039,.344787,.171643,.739713,-.372549,.413325,.242371,.76913,-.247059,.481863,.3131,.719841,-.121569,.550402,.383829,.612222,.00392157,.61894,.454558,.51126,.129412,.687478,.525287,.39993,.254902,.756017,.596016,.289923,.380392,.824555,.666745,.255498,.505882,.892979,.736822,.27696,.631373,.938851,.804966,.351734,.756863,.966491,.874853,.53572,.882353,.982105,.94153,.782579,1,1,1,.999986]},{ColorSpace:"Lab",Name:"erdc_red2purple_BW",RGBPoints:[-1,0,0,0,-.87451,.167793,.0166271,.0431278,-.74902,.262608,.0107595,.0791181,-.623529,.351902,.0101858,.100926,-.498039,.441257,.0160835,.131919,-.372549,.5221,.0555972,.195625,-.247059,.593852,.104294,.310234,-.121569,.654628,.158115,.448486,.00392157,.707443,.220914,.570253,.129412,.749504,.293268,.67897,.254902,.781587,.370517,.779269,.380392,.809951,.451099,.855831,.505882,.84424,.531462,.900451,.631373,.865174,.620901,.91606,.756863,.875041,.714054,.910284,.882353,.880764,.80554,.896276,1,.887572,.887591,.887556]},{ColorSpace:"Lab",Name:"erdc_purple2pink_BW",RGBPoints:[-1,0,0,0,-.87451,.117562,.0291202,.175876,-.74902,.178368,.0458476,.285454,-.623529,.237731,.0680173,.387717,-.498039,.300877,.0956291,.484802,-.372549,.370929,.136858,.554985,-.247059,.449033,.189273,.58863,-.121569,.529971,.245796,.598587,.00392157,.609914,.300643,.610244,.129412,.697079,.351286,.616371,.254902,.785858,.401991,.617376,.380392,.862517,.45745,.64463,.505882,.91359,.525462,.705336,.631373,.932583,.61064,.767412,.756863,.922478,.706966,.817522,.882353,.901302,.803071,.856311,1,.887571,.887591,.887549]},{ColorSpace:"Lab",Name:"erdc_pbj_lin",RGBPoints:[-1,0,0,0,-.87451,.091821,.0611476,.10617,-.74902,.160311,.0900022,.192713,-.623529,.22484,.12126,.272128,-.498039,.291263,.157469,.340828,-.372549,.360015,.200388,.388903,-.247059,.437497,.250058,.387201,-.121569,.512636,.304969,.355955,.00392157,.582603,.360874,.33488,.129412,.655126,.416374,.306351,.254902,.725889,.473329,.279051,.380392,.778125,.537928,.302697,.505882,.815894,.606931,.382431,.631373,.839159,.679308,.497608,.756863,.854748,.751666,.631792,.882353,.869483,.822508,.768592,1,.887572,.887589,.887565]},{ColorSpace:"Lab",Name:"erdc_blue2green_muted",RGBPoints:[-1,.107704,.107708,.107695,-.87451,.141522,.13066,.270741,-.74902,.180123,.146119,.42308,-.623529,.210161,.169674,.551795,-.498039,.239701,.212939,.634969,-.372549,.253916,.282947,.653641,-.247059,.242791,.366933,.608521,-.121569,.226302,.446776,.52693,.00392157,.236237,.514689,.458798,.129412,.274641,.577589,.376069,.254902,.349625,.633993,.288131,.380392,.4437,.683677,.260497,.505882,.536247,.731214,.285424,.631373,.628472,.777128,.349151,.756863,.718259,.819287,.496825,.882353,.804768,.856164,.703299,1,.887571,.887591,.887548]},{ColorSpace:"Lab",Name:"erdc_blue2green_BW",RGBPoints:[-1,3.63578e-7,0,529374e-11,-.87451,.0539915,.0577948,.212806,-.74902,.0620393,.0758942,.388959,-.623529,.0697499,.102032,.54177,-.498039,.113295,.156156,.64334,-.372549,.152047,.243196,.670283,-.247059,.158096,.344084,.622864,-.121569,.151142,.43922,.532767,.00392157,.17155,.521588,.457719,.129412,.225861,.599141,.363997,.254902,.32328,.67007,.259083,.380392,.442344,.733697,.223754,.505882,.558409,.794941,.257411,.631373,.673875,.854344,.340822,.756863,.787244,.909326,.524717,.882353,.896483,.958063,.775914,1,1,1,.999982]},{ColorSpace:"Lab",Name:"GREEN-WHITE_LINEAR",RGBPoints:[-1,0,0,0,-.87451,0,.062745,0,-.74902,0,.12549,0,-.623529,0,.188235,0,-.498039,0,.25098,0,-.372549,0,.313725,0,-.247059,0,.376471,0,-.121569,.094118,.439216,0,.00392157,.196078,.501961,0,.129412,.294118,.564706,0,.254902,.396078,.627451,0,.380392,.498039,.690196,0,.505882,.6,.752941,.145098,.631373,.701961,.815686,.364706,.756863,.8,.878431,.580392,.882353,.901961,.941176,.796078,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_green2yellow_BW",RGBPoints:[-1,0,0,0,-.87451,0,.105542,.0603919,-.74902,0,.159454,.104148,-.623529,0,.219502,.15542,-.498039,0,.282276,.203811,-.372549,0,.346331,.235652,-.247059,0,.411765,.235428,-.121569,0,.477177,.217977,.00392157,.0593644,.541635,.21361,.129412,.233081,.604722,.210591,.254902,.369803,.664942,.226536,.380392,.498446,.722367,.288237,.505882,.601929,.782244,.380815,.631373,.703207,.840497,.512134,.756863,.803186,.896433,.674462,.882353,.903834,.950266,.846715,1,1,1,.999981]},{ColorSpace:"Lab",Name:"blue2cyan",RGBPoints:[-1,0,0,0,-.87451,0,.152941,.364706,-.74902,0,.254902,.470588,-.623529,0,.34902,.572549,-.498039,0,.443137,.670588,-.372549,0,.537255,.772549,-.247059,0,.627451,.870588,-.121569,0,.717647,.964706,.00392157,.0784314,.772549,1,.129412,.207843,.858824,1,.254902,.32549,.941176,1,.380392,.45098,1,1,.505882,.560784,1,1,.631373,.662745,1,1,.756863,.760784,1,1,.882353,.870588,1,1,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_blue2cyan_BW",RGBPoints:[-1,4.05298e-7,0,59012e-10,-.87451,.0207526,.0740933,.18093,-.74902,0,.121033,.30343,-.623529,0,.166892,.416095,-.498039,0,.216768,.524796,-.372549,.0164769,.275471,.608585,-.247059,.0544527,.344824,.659267,-.121569,.0880643,.419118,.688675,.00392157,.127938,.492556,.720256,.129412,.149476,.566946,.756918,.254902,.188961,.641333,.792122,.380392,.245482,.715336,.827609,.505882,.329216,.786235,.874761,.631373,.453558,.852803,.918466,.756863,.626281,.910493,.954,.882353,.82257,.958709,.980146,1,1,1,.999989]},{ColorSpace:"Lab",Name:"erdc_blue_BW",RGBPoints:[-1,0,0,0,-.87451,.0425591,.0763529,.150682,-.74902,.0569472,.119154,.275403,-.623529,.0635978,.164772,.395427,-.498039,.0774342,.213851,.510014,-.372549,.106815,.267034,.615102,-.247059,.122093,.324649,.720068,-.121569,.160851,.387068,.806956,.00392157,.213754,.453516,.878012,.129412,.26722,.524656,.932436,.254902,.326844,.599279,.968038,.380392,.403403,.674712,.984784,.505882,.499703,.745519,1,.631373,.615055,.813983,1,.756863,.74405,.879228,1,.882353,.877909,.941913,1,1,1,1,.999996]},{ColorSpace:"Lab",Name:"BLUE-WHITE",RGBPoints:[-1,0,0,0,-.87451,0,0,.082353,-.74902,0,0,.168627,-.623529,0,0,.254902,-.498039,0,0,.337255,-.372549,0,0,.423529,-.247059,0,0,.509804,-.121569,0,.101961,.592157,.00392157,0,.203922,.678431,.129412,0,.301961,.764706,.254902,0,.403922,.85098,.380392,0,.505882,.933333,.505882,0,.603922,1,.631373,.254902,.705882,1,.756863,.509804,.807843,1,.882353,.764706,.905882,1,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_purple_BW",RGBPoints:[-1,4.264e-8,0,6.20844e-7,-.87451,.100579,.0593111,.145666,-.74902,.167794,.0889224,.254953,-.623529,.231446,.123339,.360511,-.498039,.296699,.163027,.461278,-.372549,.363211,.209286,.55306,-.247059,.431136,.260776,.637195,-.121569,.498202,.320012,.705799,.00392157,.567456,.380459,.778091,.129412,.629381,.445284,.8448,.254902,.688373,.517374,.895694,.380392,.74891,.590906,.93976,.505882,.805017,.667956,.977626,.631373,.850914,.752618,.992396,.756863,.89724,.838454,.994093,.882353,.948461,.922603,.994449,1,1,1,.999967]},{ColorSpace:"Lab",Name:"erdc_magenta_BW",RGBPoints:[-1,0,0,254023e-10,-.87451,.128696,.0456782,.11635,-.74902,.228133,.0476299,.201452,-.623529,.327273,.0374065,.282107,-.498039,.420953,.0408166,.35709,-.372549,.511562,.0642203,.430511,-.247059,.599552,.102686,.504257,-.121569,.684646,.150536,.579429,.00392157,.765817,.205978,.656062,.129412,.839176,.27229,.731807,.254902,.89536,.357594,.797309,.380392,.930238,.457825,.846984,.505882,.945921,.564536,.880571,.631373,.948995,.670753,.902279,.756863,.947124,.772819,.918171,.882353,.947265,.869424,.934352,1,.954719,.95475,.954726]},{ColorSpace:"Lab",Name:"magenta",RGBPoints:[-1,0,0,0,-.87451,.364706,0,.152941,-.74902,.470588,0,.254902,-.623529,.572549,0,.34902,-.498039,.670588,0,.443137,-.372549,.772549,0,.537255,-.247059,.870588,0,.627451,-.121569,.964706,0,.717647,.00392157,1,.0784314,.772549,.129412,1,.207843,.858824,.254902,1,.32549,.941176,.380392,1,.45098,1,.505882,1,.560784,1,.631373,1,.662745,1,.756863,1,.760784,1,.882353,1,.870588,1,1,1,1,1]},{ColorSpace:"Lab",Name:"RED-PURPLE",RGBPoints:[-1,0,0,0,-.87451,.188235,0,.007843,-.74902,.345098,0,.035294,-.623529,.439216,0,.098039,-.498039,.533333,0,.152941,-.372549,.627451,.015686,.211765,-.247059,.721569,.031373,.266667,-.121569,.8,.047059,.329412,.00392157,.862745,.047059,.403922,.129412,.941176,.062745,.466667,.254902,.988235,.078431,.54902,.380392,.988235,.141176,.643137,.505882,.988235,.25098,.729412,.631373,.988235,.376471,.811765,.756863,.988235,.54902,.886275,.882353,.988235,.752941,.952941,1,.996078,.996078,.996078]},{ColorSpace:"Lab",Name:"erdc_red_BW",RGBPoints:[-1,0,0,0,-.87451,.147204,.0480135,.0401815,-.74902,.253411,.0617478,.0301333,-.623529,.356059,.0746331,.0446897,-.498039,.457731,.0934935,.0636931,-.372549,.557199,.122714,.0860013,-.247059,.665179,.144238,.105585,-.121569,.763833,.187056,.138326,.00392157,.847035,.254558,.189407,.129412,.905663,.345937,.258215,.254902,.941431,.447111,.346277,.380392,.962608,.546927,.457571,.505882,.987833,.637276,.569944,.631373,.994202,.732176,.687958,.756863,.993304,.826268,.800567,.882353,.994413,.917205,.906393,1,1,1,.999979]},{ColorSpace:"Lab",Name:"RED_TEMPERATURE",RGBPoints:[-1,0,0,0,-.87451,.090196,0,0,-.74902,.180392,0,0,-.623529,.270588,0,0,-.498039,.360784,0,0,-.372549,.45098,0,0,-.247059,.545098,0,0,-.121569,.635294,0,0,.00392157,.72549,.058824,0,.129412,.815686,.176471,0,.254902,.905882,.294118,0,.380392,1,.411765,0,.505882,1,.533333,.027451,.631373,1,.65098,.27451,.756863,1,.768627,.521569,.882353,1,.886275,.768627,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_orange_BW",RGBPoints:[-1,0,0,253806e-10,-.87451,.135871,.0593824,0,-.74902,.224328,.0907216,0,-.623529,.318083,.119647,0,-.498039,.414443,.150246,0,-.372549,.511077,.184884,0,-.247059,.605501,.226033,0,-.121569,.695274,.275491,0,.00392157,.777826,.334445,0,.129412,.851498,.402441,0,.254902,.915899,.47759,602975e-9,.380392,.971984,.557882,.0361443,.505882,1,.641287,.135967,.631373,1,.725198,.27997,.756863,1,.808205,.438135,.882353,1,.89306,.587036,1,1,.977928,.721599]},{ColorSpace:"Lab",Name:"heated_object",RGBPoints:[-1,0,0,0,-.87451,.34902,.0862745,0,-.74902,.45098,.172549,0,-.623529,.52549,.231373,0,-.498039,.580392,.278431,0,-.372549,.623529,.313725,0,-.247059,.670588,.352941,0,-.121569,.717647,.392157,0,.00392157,.772549,.439216,0,.129412,.839216,.494118,0,.254902,.901961,.541176,0,.380392,.968627,.6,0,.505882,1,.658824,0,.631373,1,.721569,0,.756863,1,.827451,.298039,.882353,1,.976471,.72549,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_gold_BW",RGBPoints:[-1,0,0,190933e-10,-.87451,.128363,.0636265,0,-.74902,.193795,.111057,0,-.623529,.25976,.15987,0,-.498039,.328546,.210589,0,-.372549,.399726,.26332,0,-.247059,.472969,.318261,0,-.121569,.546245,.375827,0,.00392157,.61745,.436719,0,.129412,.685545,.501113,0,.254902,.749578,.568799,0,.380392,.80962,.6394,0,.505882,.865572,.712699,.10257,.631373,.917709,.787569,.233665,.756863,.966914,.863138,.369608,.882353,1,.939405,.496104,1,.999225,1,.612275]},{ColorSpace:"Lab",Name:"erdc_brown_BW",RGBPoints:[-1,3.3216e-7,0,483629e-11,-.87451,.14693,.0518172,0,-.74902,.225806,.0814996,0,-.623529,.301681,.111452,0,-.498039,.370487,.150664,0,-.372549,.43108,.199477,0,-.247059,.4849,.255107,0,-.121569,.536798,.313486,0,.00392157,.59286,.371167,0,.129412,.653119,.428135,0,.254902,.714589,.485917,.0379541,.380392,.774667,.54565,.116634,.505882,.831222,.608047,.183895,.631373,.880305,.674199,.260298,.756863,.922314,.742472,.367086,.882353,.959408,.811222,.497258,1,.993548,.875183,.622093]},{ColorSpace:"Lab",Name:"copper_Matlab",RGBPoints:[-1,0,0,0,-.87451,.0784314,.0501961,.0313725,-.74902,.156863,.100392,.0627451,-.623529,.235294,.150588,.0941176,-.498039,.313725,.200784,.12549,-.372549,.392157,.25098,.156863,-.247059,.470588,.301176,.188235,-.121569,.54902,.351373,.219608,.00392157,.627451,.401569,.25098,.129412,.705882,.451765,.282353,.254902,.784314,.501961,.313725,.380392,.862745,.552157,.345098,.505882,.941176,.602353,.376471,.631373,1,.652549,.407843,.756863,1,.702745,.439216,.882353,1,.752941,.470588,1,1,.8,.5]},{ColorSpace:"Lab",Name:"pink_Matlab",RGBPoints:[-1,0,0,0,-.87451,.312416,.204524,.204524,-.74902,.441822,.289241,.289241,-.623529,.54112,.354246,.354246,-.498039,.624831,.409048,.409048,-.372549,.698582,.45733,.45733,-.247059,.764404,.502282,.500979,-.121569,.791292,.591516,.54112,.00392157,.817297,.66895,.578481,.129412,.842499,.738308,.613572,.254902,.866968,.801687,.646762,.380392,.890766,.86041,.678329,.505882,.913944,.913944,.711254,.631373,.936549,.936549,.79459,.756863,.958621,.958621,.869979,.882353,.980196,.980196,.939336,1,1,1,1]},{ColorSpace:"Lab",Name:"bone_Matlab",RGBPoints:[-1,0,0,0,-.87451,.054902,.054902,.075817,-.74902,.109804,.109804,.151634,-.623529,.164706,.164706,.227451,-.498039,.219608,.219608,.303268,-.372549,.27451,.27451,.379085,-.247059,.329412,.329902,.454412,-.121569,.384314,.405719,.509314,.00392157,.439216,.481536,.564216,.129412,.494118,.557353,.619118,.254902,.54902,.63317,.67402,.380392,.603922,.708987,.728922,.505882,.660294,.783824,.783824,.631373,.746569,.838725,.838725,.756863,.832843,.893627,.893627,.882353,.919118,.948529,.948529,1,1,1,1]},{ColorSpace:"Lab",Name:"gray_Matlab",RGBPoints:[-1,0,0,0,-.87451,.0627451,.0627451,.0627451,-.74902,.12549,.12549,.12549,-.623529,.188235,.188235,.188235,-.498039,.25098,.25098,.25098,-.372549,.313725,.313725,.313725,-.247059,.376471,.376471,.376471,-.121569,.439216,.439216,.439216,.00392157,.501961,.501961,.501961,.129412,.564706,.564706,.564706,.254902,.627451,.627451,.627451,.380392,.690196,.690196,.690196,.505882,.752941,.752941,.752941,.631373,.815686,.815686,.815686,.756863,.878431,.878431,.878431,.882353,.941176,.941176,.941176,1,1,1,1]},{ColorSpace:"Lab",Name:"Purples",RGBPoints:[-1,.247059,0,.490196,-.87451,.288397,.07677,.525629,-.74902,.32975,.153587,.561092,-.623529,.373057,.236263,.600461,-.498039,.416363,.319,.639923,-.372549,.459669,.405613,.685198,-.247059,.503345,.491534,.730058,-.121569,.562399,.54862,.757616,.00392157,.621453,.606075,.785544,.129412,.680508,.674971,.824914,.254902,.739562,.743406,.863899,.380392,.798616,.800492,.893426,.505882,.85684,.856655,.922491,.631373,.898178,.894056,.942176,.756863,.938654,.930919,.961646,.882353,.964245,.958478,.977393,1,.988235,.984314,.992157]},{ColorSpace:"Lab",Name:"Blues",RGBPoints:[-1,.031373,.188235,.419608,-.87451,.031373,.253195,.516063,-.74902,.031757,.318139,.612149,-.623529,.080969,.38113,.661361,-.498039,.130427,.444152,.710327,-.372549,.195386,.509112,.743791,-.247059,.260715,.573841,.777209,-.121569,.341423,.628958,.808704,.00392157,.422745,.684075,.839892,.129412,.523137,.739193,.861546,.254902,.622684,.793464,.883429,.380392,.701423,.826928,.910988,.505882,.778685,.8603,.937993,.631373,.825928,.891795,.953741,.756863,.87328,.923291,.969489,.882353,.922491,.954787,.985236,1,.968627,.984314,1]},{ColorSpace:"Lab",Name:"Greens",RGBPoints:[-1,0,.266667,.105882,-.87451,0,.347374,.139346,-.74902,538e-6,.427912,.172933,-.623529,.069435,.486967,.222145,-.498039,.138178,.546082,.271326,-.372549,.197232,.609073,.31857,-.247059,.257255,.671742,.365859,-.121569,.357647,.720953,.415071,.00392157,.45767,.769919,.465021,.129412,.546251,.811257,.537855,.254902,.634295,.852211,.610688,.380392,.709097,.883706,.683522,.505882,.78316,.914833,.755894,.631373,.842215,.938454,.818885,.756863,.899977,.961538,.880692,.882353,.935409,.975317,.92203,1,.968627,.988235,.960784]},{ColorSpace:"Lab",Name:"PuBu",RGBPoints:[-1,.301961,0,.294118,-.87451,.404321,.029527,.390573,-.74902,.50599,.059592,.486782,-.623529,.519769,.158016,.551742,-.498039,.533456,.256194,.616301,-.372549,.54133,.33887,.655671,-.247059,.54902,.421592,.695087,-.121569,.54902,.506236,.736424,.00392157,.550127,.590573,.777701,.129412,.585559,.665375,.81707,.254902,.622145,.739023,.855825,.380392,.687105,.784298,.879446,.505882,.752065,.829758,.903253,.631373,.817024,.87897,.930811,.756863,.880907,.927213,.957832,.882353,.926182,.958708,.975548,1,.968627,.988235,.992157]},{ColorSpace:"Lab",Name:"BuPu",RGBPoints:[-1,.007843,.219608,.345098,-.87451,.01178,.286536,.449427,-.74902,.015702,.35328,.553479,-.623529,.01767,.396586,.622376,-.498039,.021115,.4402,.690688,-.372549,.11757,.503191,.722184,-.247059,.214625,.565859,.753633,-.121569,.336671,.615071,.78316,.00392157,.457978,.663975,.812503,.129412,.556401,.703345,.836125,.254902,.65421,.742714,.859669,.380392,.736886,.782084,.881323,.505882,.81827,.821638,.903068,.631373,.873387,.864944,.92669,.756863,.927536,.907605,.949988,.882353,.964937,.9391,.967705,1,1,.968627,.984314]},{ColorSpace:"Lab",Name:"BuGn",RGBPoints:[-1,.031373,.25098,.505882,-.87451,.031373,.329719,.590527,-.74902,.031911,.408397,.674787,-.623529,.100807,.479262,.710219,-.498039,.169704,.550219,.745744,-.372549,.238601,.62699,.787082,-.247059,.307958,.703114,.826759,-.121569,.39654,.752326,.797232,.00392157,.485121,.801046,.767705,.129412,.573702,.83451,.738178,.254902,.661592,.867743,.711034,.380392,.732457,.895302,.74253,.505882,.801845,.922307,.774579,.631373,.841215,.938055,.817885,.756863,.880907,.95391,.861084,.882353,.926182,.971626,.902422,1,.968627,.988235,.941176]},{ColorSpace:"Lab",Name:"GnBu",RGBPoints:[-1,0,.266667,.105882,-.87451,0,.347374,.139346,-.74902,538e-6,.427912,.172933,-.623529,.069435,.486967,.222145,-.498039,.138178,.546175,.272095,-.372549,.197232,.615071,.368551,-.247059,.256609,.683276,.464867,-.121569,.329443,.722645,.555417,.00392157,.403137,.762138,.645413,.129412,.503529,.805444,.718247,.254902,.603922,.848597,.790465,.380392,.704314,.887966,.847551,.505882,.802307,.926321,.903714,.631373,.851519,.944037,.941115,.756863,.899977,.961538,.976901,.882353,.935409,.975317,.984775,1,.968627,.988235,.992157]},{ColorSpace:"Lab",Name:"GnBuPu",RGBPoints:[-1,.003922,.27451,.211765,-.87451,.003922,.349312,.280661,-.74902,.003937,.423852,.349773,-.623529,.005905,.46519,.446228,-.498039,.009443,.506344,.542837,-.372549,.111803,.535871,.649135,-.247059,.214025,.565859,.753633,-.121569,.310481,.615071,.78316,.00392157,.407797,.663975,.812503,.129412,.531811,.703345,.836125,.254902,.65421,.742714,.859669,.380392,.736886,.782084,.881323,.505882,.81827,.821176,.902884,.631373,.873387,.854641,.922568,.756863,.927536,.888535,.942361,.882353,.964937,.929873,.964014,1,1,.968627,.984314]},{ColorSpace:"Lab",Name:"BuGnYl",RGBPoints:[-1,.031373,.113725,.345098,-.87451,.088458,.159,.463206,-.74902,.145052,.204567,.5807,-.623529,.139146,.287243,.620069,-.498039,.13318,.370196,.659562,-.372549,.123337,.470588,.706805,-.247059,.115386,.570335,.753126,-.121569,.186251,.643168,.761,.00392157,.258716,.71514,.768074,.129412,.380761,.760415,.750358,.254902,.503576,.806075,.732795,.380392,.645306,.861192,.719016,.505882,.783899,.91511,.705606,.631373,.858701,.944637,.6997,.756863,.931349,.973303,.698424,.882353,.966782,.987082,.777163,1,1,1,.85098]},{ColorSpace:"Lab",Name:"PuRd",RGBPoints:[-1,.286275,0,.415686,-.87451,.38273,.001968,.441276,-.74902,.479231,.003922,.466774,-.623529,.581592,.003922,.480554,-.498039,.683799,.00549,.494887,-.372549,.776317,.105882,.544098,-.247059,.867866,.206321,.592618,-.121569,.919047,.308681,.612303,.00392157,.968812,.411226,.632603,.129412,.974717,.519493,.671972,.254902,.980546,.626451,.71065,.380392,.984483,.701253,.732303,.505882,.988328,.77504,.755617,.631373,.990296,.828189,.812703,.756863,.992372,.880907,.869035,.882353,.996309,.926182,.912341,1,1,.968627,.952941]},{ColorSpace:"Lab",Name:"RdPu",RGBPoints:[-1,.403922,0,.121569,-.87451,.500377,0,.192434,-.74902,.596909,277e-6,.263037,-.623529,.703206,.035709,.300438,-.498039,.808612,.071296,.338854,-.372549,.857824,.116571,.441215,-.247059,.905513,.163552,.54293,-.121569,.889765,.281661,.617732,.00392157,.873156,.39897,.691611,.129412,.82985,.491488,.736886,.254902,.789081,.583237,.781853,.380392,.810734,.656071,.819254,.505882,.833126,.729181,.85684,.631373,.870527,.80792,.898178,.756863,.907605,.884398,.938331,.882353,.9391,.921799,.958016,1,.968627,.956863,.976471]},{ColorSpace:"Lab",Name:"Oranges",RGBPoints:[-1,.498039,.152941,.015686,-.87451,.57481,.182468,.013718,-.74902,.651765,.212042,.011734,-.623529,.752157,.247474,.007797,-.498039,.851719,.283368,.004475,-.372549,.898962,.348328,.039908,-.247059,.945652,.413426,.076401,-.121569,.969273,.484291,.157109,.00392157,.992157,.554971,.238185,.129412,.992157,.619931,.330704,.254902,.992157,.684967,.423837,.380392,.992157,.751895,.532103,.505882,.992249,.817716,.639354,.631373,.994218,.861023,.725967,.756863,.996186,.903576,.810965,.882353,.998155,.933103,.868051,1,1,.960784,.921569]},{ColorSpace:"Lab",Name:"Reds",RGBPoints:[-1,.403922,0,.05098,-.87451,.525967,.029527,.066728,-.74902,.647643,.058962,.082476,-.623529,.722445,.076678,.098224,-.498039,.797186,.095194,.114187,-.372549,.868051,.164091,.143714,-.247059,.937809,.233541,.173933,-.121569,.96143,.326059,.232987,.00392157,.984375,.418147,.292657,.129412,.986344,.496886,.371396,.254902,.988235,.575702,.450673,.380392,.988235,.656409,.543191,.505882,.98842,.736747,.635894,.631373,.992357,.809581,.732349,.756863,.996186,.880692,.826759,.882353,.998155,.92203,.885813,1,1,.960784,.941176]},{ColorSpace:"Lab",Name:"RdOr",RGBPoints:[-1,.498039,0,0,-.87451,.6004,0,0,-.74902,.702514,738e-6,477e-6,-.623529,.773379,.095225,.061499,-.498039,.843875,.189865,.12283,-.372549,.891119,.294195,.203537,-.247059,.937855,.397924,.283137,-.121569,.963445,.476663,.316601,.00392157,.988297,.555771,.351665,.129412,.990265,.646321,.436309,.254902,.992157,.735256,.519646,.380392,.992157,.784468,.570827,.505882,.992249,.833218,.623483,.631373,.994218,.872587,.706159,.756863,.996186,.911419,.788189,.882353,.998155,.940946,.859054,1,1,.968627,.92549]},{ColorSpace:"Lab",Name:"BrOrYl",RGBPoints:[-1,.4,.145098,.023529,-.87451,.500392,.174625,.019592,-.74902,.600784,.204291,.015656,-.623529,.701176,.251534,.011719,-.498039,.800984,.299146,.008397,-.372549,.863975,.370012,.043829,-.247059,.926321,.441107,.0794,-.121569,.961753,.521815,.120738,.00392157,.996078,.602645,.163122,.129412,.996078,.68729,.237924,.254902,.996078,.771011,.314879,.380392,.996078,.832034,.444798,.505882,.996171,.892042,.572595,.631373,.998139,.931411,.65724,.756863,1,.969489,.741669,.882353,1,.985236,.822376,1,1,1,.898039]},{ColorSpace:"Lab",Name:"RdOrYl",RGBPoints:[-1,.501961,0,.14902,-.87451,.622038,0,.14902,-.74902,.741761,4e-4,.148866,-.623529,.816563,.05158,.129181,-.498039,.890965,.10356,.110235,-.372549,.940177,.205921,.137793,-.247059,.988281,.308789,.165536,-.121569,.99025,.432803,.200969,.00392157,.992218,.555217,.236278,.129412,.994187,.628051,.267774,.254902,.996078,.701038,.301269,.380392,.996078,.777809,.383945,.505882,.996171,.852826,.466621,.631373,.998139,.892195,.549296,.756863,1,.931349,.632188,.882353,1,.966782,.7188,1,1,1,.8]},{ColorSpace:"Lab",Name:"CIELab_blue2red",RGBPoints:[-1,0,.6,.74902,1,.76863,.46667,.34118]},{ColorSpace:"Lab",Name:"blue2yellow",RGBPoints:[-1,0,0,1,0,.5,.5,.5,1,1,1,0]},{ColorSpace:"Lab",Name:"erdc_blue2gold",RGBPoints:[-1,.175119,.0438468,1,-.874016,.22383,.159771,.94557,-.748031,.27254,.233611,.891216,-.622047,.321251,.296526,.836857,-.496063,.369962,.354296,.782359,-.370079,.418672,.409139,.72754,-.244094,.467383,.462152,.672148,-.11811,.51609,.51396,.615825,.00787402,.572863,.55452,.559172,.133858,.630269,.593822,.517729,.259843,.689588,.624668,.47446,.385827,.745394,.656113,.428638,.511811,.798624,.688104,.379105,.637795,.849926,.720593,.323834,.76378,.899765,.753543,.258657,.889764,.948487,.78692,.171778,1,.990413,.816451,.00729848]},{ColorSpace:"Lab",Name:"erdc_blue2yellow",RGBPoints:[-1,.0830122,0,.495617,-.87451,.141973,.0551288,.57363,-.74902,.193048,.110258,.604561,-.623529,.234231,.165386,.57643,-.498039,.275413,.220515,.548299,-.372549,.316596,.275644,.520169,-.247059,.357778,.330773,.492038,-.121569,.398961,.385901,.463908,.00392157,.449929,.438487,.426815,.129412,.511572,.488299,.379944,.254902,.581222,.53603,.325741,.380392,.650871,.583761,.271538,.505882,.720521,.631493,.217335,.631373,.79017,.679224,.163132,.756863,.85982,.726955,.108929,.882353,.910254,.774159,.14112,1,.927513,.81759,.306289]},{ColorSpace:"Lab",Name:"erdc_cyan2orange",RGBPoints:[-1,.0471513,.213874,.414329,-.87451,.0674702,.256648,.439027,-.74902,.0959957,.299331,.462089,-.623529,.132428,.341872,.483212,-.498039,.188743,.38277,.500597,-.372549,.268511,.420229,.512179,-.247059,.352945,.455602,.519101,-.121569,.43893,.489368,.521538,.00392157,.522445,.522495,.522436,.129412,.600089,.555682,.53205,.254902,.67988,.587981,.539163,.380392,.761011,.619586,.544439,.505882,.84278,.650741,.548567,.631373,.910713,.687347,.557822,.756863,.952232,.734972,.577775,.882353,.975642,.789858,.604868,1,.990752,.843643,.632857]},{ColorSpace:"Lab",Name:"erdc_purple2green",RGBPoints:[-1,.235006,.0483128,.530899,-.87451,.302968,.108419,.552391,-.74902,.360241,.166059,.569502,-.623529,.406746,.226782,.579373,-.498039,.444073,.28964,.582094,-.372549,.473648,.353774,.577947,-.247059,.497636,.418154,.567911,-.121569,.519086,.481741,.553968,.00392157,.542884,.542914,.542875,.129412,.566303,.603989,.527499,.254902,.595218,.662965,.516857,.380392,.628641,.720701,.510673,.505882,.665373,.777849,.508165,.631373,.704182,.834921,.508303,.756863,.743846,.892328,.50999,.882353,.783158,.950422,.512181,1,.818617,1,.513888]},{ColorSpace:"Lab",Name:"erdc_purple2green_dark",RGBPoints:[-1,.107656,0,.428682,-.87451,.1924,0,.449799,-.74902,.255118,.0648939,.466726,-.623529,.304256,.133066,.476703,-.498039,.343202,.19716,.479793,-.372549,.373876,.260353,.476241,-.247059,.398497,.322872,.466953,-.121569,.420016,.384252,.453785,.00392157,.44319,.443216,.443186,.129412,.465553,.502139,.428233,.254902,.492959,.559151,.417591,.380392,.524654,.615092,.411016,.505882,.55959,.670583,.40779,.631373,.596614,.726102,.406948,.756863,.634544,.782032,.407439,.882353,.672183,.838703,.408237,1,.706131,.892759,.408452]},{ColorSpace:"Lab",Name:"coolwarm",RGBPoints:[-1,.229806,.298718,.753683,-.875,.303869,.406535,.844959,-.75,.383013,.509419,.917388,-.625,.466667,.604563,.968155,-.5,.552953,.688929,.995376,-.375,.639176,.7596,.998151,-.25,.722193,.813953,.976575,-.125,.798692,.849786,.931689,0,.865395,.86541,.865396,.125,.924128,.827385,.774508,.25,.958853,.769768,.678008,.375,.969954,.694267,.579375,.5,.958003,.602842,.481776,.625,.923945,.497309,.38797,.75,.869187,.378313,.300267,.875,.795632,.241284,.220526,1,.705673,.0155562,.150233]},{ColorSpace:"Lab",Name:"BuRd",RGBPoints:[-1,.019608,.188235,.380392,-.87451,.088504,.321107,.564937,-.74902,.163399,.444983,.697501,-.623529,.247059,.555709,.754095,-.498039,.420684,.676432,.818685,-.372549,.606459,.789773,.880277,-.247059,.761476,.868512,.924567,-.121569,.878047,.925721,.951942,.00392157,.969089,.966474,.964937,.129412,.983852,.897578,.846828,.254902,.982468,.800692,.706113,.380392,.960323,.66782,.536332,.505882,.894579,.503806,.399769,.631373,.81707,.33218,.281046,.756863,.728489,.155017,.197386,.882353,.576932,.055363,.14925,1,.403922,0,.121569]},{ColorSpace:"Lab",Name:"Spectral_lowBlue",RGBPoints:[-1,.368627,.309804,.635294,-.87451,.260361,.450058,.70173,-.74902,.248058,.591311,.717186,-.623529,.376009,.734025,.658132,-.498039,.537947,.814764,.64506,-.372549,.702345,.879585,.636678,-.247059,.84752,.938639,.607151,-.121569,.940408,.976163,.656055,.00392157,.999923,.997616,.745021,.129412,.997463,.921338,.61707,.254902,.995002,.824606,.499885,.380392,.992541,.701576,.39654,.505882,.973472,.547405,.318108,.631373,.937793,.398539,.270127,.756863,.861515,.282891,.299654,.882353,.746482,.144637,.288812,1,.619608,.003922,.258824]},{ColorSpace:"Lab",Name:"GnRP",RGBPoints:[-1,0,.266667,.105882,-.87451,.066436,.394617,.174779,-.74902,.168858,.524567,.25767,-.623529,.323875,.657439,.361015,-.498039,.504883,.772318,.506344,-.372549,.678431,.870127,.654902,-.247059,.803922,.921799,.780392,-.121569,.897116,.951942,.882814,.00392157,.967397,.965936,.967474,.129412,.928028,.879815,.930565,.254902,.866052,.780777,.882891,.380392,.77501,.665129,.821376,.505882,.675663,.537024,.737024,.631373,.57847,.396155,.645982,.756863,.492349,.223914,.547559,.882353,.375548,.096886,.423299,1,.25098,0,.294118]},{ColorSpace:"Lab",Name:"GYPi",RGBPoints:[-1,.152941,.392157,.098039,-.87451,.246444,.505344,.117724,-.74902,.351942,.614533,.161399,-.623529,.474971,.717878,.240138,-.498039,.611995,.811226,.392849,-.372549,.746328,.893118,.565321,-.247059,.859516,.94233,.747405,-.121569,.928105,.96386,.875663,.00392157,.969089,.966859,.968012,.129412,.983852,.910265,.948328,.254902,.979239,.833218,.914648,.380392,.949712,.729873,.862976,.505882,.905652,.58293,.763552,.631373,.85521,.410073,.652211,.756863,.793695,.183699,.531642,.882353,.683737,.063899,.420761,1,.556863,.003922,.321569]},{ColorSpace:"Lab",Name:"GnYlRd",RGBPoints:[-1,0,.407843,.215686,-.87451,.063975,.525952,.277201,-.74902,.177932,.633064,.332718,-.623529,.364937,.724106,.379469,-.498039,.527951,.797155,.40223,-.372549,.678431,.862822,.433449,-.247059,.803922,.916955,.514648,-.121569,.909419,.961861,.625067,.00392157,.999923,.997616,.745021,.129412,.997463,.921338,.61707,.254902,.995002,.824606,.499885,.380392,.992541,.701576,.39654,.505882,.973472,.547405,.318108,.631373,.939023,.389927,.245521,.756863,.867666,.239831,.176624,.882353,.762399,.110727,.151326,1,.647059,0,.14902]},{ColorSpace:"Lab",Name:"GBBr",RGBPoints:[-1,0,.235294,.188235,-.87451,.002461,.338639,.301423,-.74902,.055902,.448981,.417609,-.623529,.183852,.56955,.538178,-.498039,.357785,.700115,.660746,-.372549,.540177,.819531,.77624,-.247059,.714879,.890888,.864821,-.121569,.851134,.934564,.922645,.00392157,.960861,.959785,.95694,.129412,.963322,.927797,.83391,.254902,.939946,.868897,.68935,.380392,.883353,.775394,.517109,.505882,.808074,.625836,.324106,.631373,.717647,.476355,.15494,.756863,.592157,.358247,.06882,.882353,.458593,.26436,.031142,1,.329412,.188235,.019608]},{ColorSpace:"Lab",Name:"PuOr",RGBPoints:[-1,.498039,.231373,.031373,-.87451,.62599,.30273,.026451,-.74902,.746943,.387082,.037524,-.623529,.85767,.490427,.071972,-.498039,.936409,.617762,.236371,-.372549,.992695,.743099,.43291,-.247059,.995156,.841523,.63714,-.121569,.985313,.913802,.813687,.00392157,.966244,.966398,.967705,.129412,.889965,.89504,.938178,.254902,.806151,.804306,.894656,.380392,.712649,.688658,.833141,.505882,.594233,.554325,.744637,.631373,.474894,.404229,.652364,.756863,.366628,.217224,.563783,.882353,.266436,.089965,.434833,1,.176471,0,.294118]},{ColorSpace:"Lab",Name:"PRGn",RGBPoints:[-1,.25098,0,.294118,-.87451,.383852,.103345,.431911,-.74902,.497732,.234679,.55371,-.623529,.583852,.40692,.652134,-.498039,.681968,.545175,.742561,-.372549,.7807,.672357,.825221,-.247059,.871742,.788005,.886736,-.121569,.930488,.885198,.932872,.00392157,.966321,.968089,.965859,.129412,.892503,.950865,.877278,.254902,.796078,.91857,.772549,.380392,.670588,.866897,.647059,.505882,.493195,.765398,.496655,.631373,.314187,.649135,.354556,.756863,.15917,.516263,.251211,.882353,.062284,.386621,.170473,1,0,.266667,.105882]},{ColorSpace:"Lab",Name:"PiYG",RGBPoints:[-1,.556863,.003922,.321569,-.87451,.692195,.067897,.427374,-.74902,.797539,.197847,.539177,-.623529,.859054,.424221,.659746,-.498039,.908574,.592618,.770319,-.372549,.951557,.736332,.866205,-.247059,.981084,.839677,.917878,-.121569,.98293,.913802,.949558,.00392157,.96732,.968474,.965629,.129412,.92549,.963552,.869666,.254902,.852441,.939254,.736025,.380392,.739254,.890042,.553941,.505882,.60323,.805536,.382238,.631373,.467282,.711419,.235217,.756863,.344252,.608074,.156478,.882353,.2406,.49827,.116494,1,.152941,.392157,.098039]},{ColorSpace:"Lab",Name:"OrPu",RGBPoints:[-1,.176471,0,.294118,-.87451,.272434,.095963,.444214,-.74902,.373395,.228912,.56932,-.623529,.481661,.415917,.657901,-.498039,.601922,.562937,.750481,-.372549,.718493,.695886,.836986,-.247059,.811995,.811534,.898501,-.121569,.894733,.8995,.940023,.00392157,.969166,.966859,.963629,.129412,.98639,.910265,.803691,.254902,.995002,.835371,.624375,.380392,.992541,.736947,.420146,.505882,.931949,.609458,.224221,.631373,.85075,.483968,.069819,.756863,.740023,.380623,.035371,.882353,.617993,.29827,.026759,1,.498039,.231373,.031373]},{ColorSpace:"Lab",Name:"BrBG",RGBPoints:[-1,.329412,.188235,.019608,-.87451,.467205,.269435,.031911,-.74902,.6,.365629,.074202,-.623529,.72549,.483737,.160323,-.498039,.812995,.635832,.336409,-.372549,.88689,.781238,.527874,-.247059,.943483,.87474,.700115,-.121569,.963168,.929796,.841599,.00392157,.957247,.959938,.959554,.129412,.84406,.932872,.920185,.254902,.70396,.886428,.859285,.380392,.529258,.815071,.770704,.505882,.346251,.691811,.653057,.631373,.175855,.562015,.530642,.756863,.047905,.441446,.410073,.882353,.002307,.33218,.294348,1,0,.235294,.188235]},{ColorSpace:"Lab",Name:"GyRd",RGBPoints:[-1,.101961,.101961,.101961,-.87451,.227451,.227451,.227451,-.74902,.359939,.359939,.359939,-.623529,.502653,.502653,.502653,-.498039,.631373,.631373,.631373,-.372549,.749865,.749865,.749865,-.247059,.843368,.843368,.843368,-.121569,.926105,.926105,.926105,.00392157,.999846,.997232,.995694,.129412,.994925,.908651,.857901,.254902,.982468,.800692,.706113,.380392,.960323,.66782,.536332,.505882,.894579,.503806,.399769,.631373,.81707,.33218,.281046,.756863,.728489,.155017,.197386,.882353,.576932,.055363,.14925,1,.403922,0,.121569]},{ColorSpace:"Lab",Name:"erdc_divHi_purpleGreen",RGBPoints:[-1,.297553,0,.489074,-.87451,.40259,.151146,.567754,-.74902,.516038,.284843,.658231,-.623529,.629783,.423646,.750938,-.498039,.735198,.563697,.835956,-.372549,.82408,.695541,.903582,-.247059,.889091,.807454,.944862,-.121569,.92334,.886917,.951839,.00392157,.921045,.921084,.921003,.129412,.877324,.907455,.845381,.254902,.797649,.849713,.734695,.380392,.691646,.75964,.600532,.505882,.568981,.649159,.453807,.631373,.438945,.529756,.304259,.756863,.30973,.412001,.158303,.882353,.187078,.305111,.00251458,1,.101655,.220836,0]},{ColorSpace:"Lab",Name:"erdc_divHi_purpleGreen_dim",RGBPoints:[-1,.404088,.131038,.592767,-.87451,.486469,.230957,.651243,-.74902,.575165,.339335,.717723,-.623529,.662741,.454332,.784263,-.498039,.742071,.570213,.842918,-.372549,.806935,.678992,.886227,-.247059,.852219,.771315,.90763,-.121569,.873345,.837327,.901572,.00392157,.866783,.86682,.866745,.129412,.82839,.858225,.796812,.254902,.762578,.814287,.700202,.380392,.676429,.744229,.585735,.505882,.577033,.65732,.461526,.631373,.47128,.562476,.33476,.756863,.365461,.467957,.21076,.882353,.264758,.381138,.0878313,1,.182591,.312249,0]},{ColorSpace:"Lab",Name:"erdc_divLow_icePeach",RGBPoints:[-1,.480048,.817441,.998056,-.87451,.425898,.726921,.883187,-.74902,.366682,.629445,.761936,-.623529,.308756,.531002,.640217,-.498039,.258021,.43705,.523433,-.372549,.219244,.352381,.416348,-.247059,.195127,.281032,.322979,-.121569,.186286,.22627,.246525,.00392157,.192352,.19236,.192364,.129412,.255927,.214469,.191756,.254902,.340459,.254426,.206666,.380392,.444655,.309315,.234029,.505882,.565353,.376004,.270969,.631373,.697917,.450748,.314293,.756863,.836657,.529064,.360227,.882353,.972695,.614884,.413123,1,1,.705904,.472699]},{ColorSpace:"Lab",Name:"erdc_divLow_purpleGreen",RGBPoints:[-1,.956034,.666487,.952663,-.87451,.874457,.572698,.936352,-.74902,.753465,.488253,.909063,-.623529,.63309,.413507,.763833,-.498039,.514491,.345878,.620015,-.372549,.405008,.288141,.484376,-.247059,.311388,.241986,.363556,-.121569,.238722,.209044,.263449,.00392157,.192352,.192366,.192362,.129412,.200379,.233201,.168618,.254902,.230151,.291737,.165227,.380392,.279481,.366076,.178607,.505882,.344927,.453267,.205703,.631373,.421554,.549449,.242643,.756863,.503334,.649999,.284377,.882353,.583497,.749672,.324969,1,.650705,.837228,.356264]},{ColorSpace:"Lab",Name:"Haze_green",RGBPoints:[-1,1,.835294,.886275,-.87451,.937255,.756863,.870443,-.74902,.875817,.666376,.857807,-.623529,.778359,.583007,.808134,-.498039,.676253,.494118,.745098,-.372549,.561365,.390123,.682353,-.247059,.438344,.262745,.621496,-.121569,.321133,.141031,.558751,.00392157,.203922,.0217865,.495861,.129412,.265505,.129412,.433261,.254902,.311692,.255338,.37008,.380392,.356282,.377342,.310821,.505882,.39971,.488889,.258243,.631373,.442556,.604357,.205519,.756863,.48671,.71968,.152941,.882353,.529847,.830356,.100944,1,.572549,.933333,.054902]},{ColorSpace:"Lab",Name:"Haze_lime",RGBPoints:[-1,.704034,.784196,1,-.87451,.633111,.691418,.956078,-.74902,.564021,.600606,.912157,-.623529,.496827,.51189,.868235,-.498039,.43157,.425416,.824314,-.372549,.368248,.341347,.780392,-.247059,.306767,.259855,.736471,-.121569,.246862,.181069,.692549,.00392157,.191619,.109542,.648627,.129412,.257404,.194031,.604706,.254902,.321794,.278775,.560784,.380392,.387909,.364617,.516863,.505882,.456569,.451881,.472941,.631373,.527424,.540773,.42902,.756863,.599759,.631427,.385098,.882353,.673065,.723898,.341176,1,.742751,.812252,.3]},{ColorSpace:"RGB",Name:"Haze",RGBPoints:[-1,1,.835294,.996078,-.00392157,.023529,.141176,.498039,.00392157,.015686,.137255,.494118,1,.984314,.764706,0]},{ColorSpace:"Lab",Name:"Haze_cyan",RGBPoints:[-1,.956863,1,.835294,-.87451,.933188,.921714,.760784,-.74902,.870588,.803486,.671605,-.623529,.807843,.684096,.583297,-.498039,.745098,.569208,.494118,-.372549,.682353,.437763,.390123,-.247059,.621496,.288163,.262745,-.121569,.558751,.144517,.141031,.00392157,.495861,.0217865,.0413943,.129412,.433261,.137255,.129412,.254902,.37008,.263181,.255338,.380392,.306318,.381845,.372694,.505882,.243137,.503994,.494263,.631373,.180392,.629484,.619753,.756863,.117647,.754975,.747131,.882353,.054902,.876398,.866812,1,0,.988235,.976471]},{ColorSpace:"Lab",Name:"nic_Edge",RGBPoints:[-1,.191208,.191208,.191208,-.87451,.239484,.00545035,.614821,-.74902,.220593,.0617459,.863547,-.623529,.17509,.278988,.97794,-.498039,.143526,.576069,.998553,-.372549,.166456,.871883,.96594,-.247059,.376202,.993555,.981833,-.121569,.681996,.991297,.999239,.00392157,.954172,.952734,.94374,.129412,.999735,.99301,.662896,.254902,.979399,.991466,.357973,.380392,.968771,.854967,.162659,.505882,.999245,.556697,.144323,.631373,.973959,.26223,.177946,.756863,.852358,.0526707,.222974,.882353,.593889,.00912724,.238855,1,.191208,.191208,.191208]},{ColorSpace:"Lab",Name:"erdc_iceFire_H",RGBPoints:[-1,4.05432e-7,0,590122e-11,-.87451,0,.120401,.302675,-.74902,0,.216583,.524574,-.623529,.0552475,.345025,.6595,-.498039,.128047,.492588,.720288,-.372549,.188955,.641309,.792092,-.247059,.327673,.784935,.873434,-.121569,.60824,.892164,.935547,.00392157,.881371,.912178,.818099,.129412,.951407,.835621,.449279,.254902,.904481,.690489,0,.380392,.85407,.510864,0,.505882,.777093,.33018,88199e-8,.631373,.672862,.139087,.00269398,.756863,.508815,0,0,.882353,.299417,366289e-9,547829e-9,1,.0157519,.00332021,4.55569e-8]},{ColorSpace:"Lab",Name:"erdc_iceFire_L",RGBPoints:[-1,.870485,.913768,.832905,-.87451,.586919,.887865,.934003,-.74902,.31583,.776442,.867858,-.623529,.18302,.632034,.787722,-.498039,.117909,.484134,.713825,-.372549,.0507239,.335979,.654741,-.247059,0,.209874,.511832,-.121569,0,.114689,.28935,.00392157,.0157519,.00332021,4.55569e-8,.129412,.312914,0,0,.254902,.520865,0,0,.380392,.680105,.15255,.0025996,.505882,.785109,.339479,797922e-9,.631373,.857354,.522494,0,.756863,.910974,.699774,0,.882353,.951921,.842817,.478545,1,.881371,.912178,.818099]},{ColorSpace:"RGB",Name:"hsv",RGBPoints:[-1,1,0,0,-.666666,1,0,1,-.333333,0,0,1,0,0,1,1,.33333,0,1,0,.66666,1,1,0,1,1,0,0]},{ColorSpace:"Lab",Name:"hue_L60",RGBPoints:[-1,.964784,.400592,.349549,-.87451,.964915,.372498,.53785,-.74902,.892353,.401039,.759569,-.623529,.79263,.446956,.903017,-.498039,.682208,.49954,.966673,-.372549,.56392,.553082,.968836,-.247059,.442031,.606396,.901601,-.121569,.305499,.65701,.765784,.00392157,.197251,.687914,.620914,.129412,.193882,.701887,.472654,.254902,.249866,.706123,.320005,.380392,.35132,.697417,.202919,.505882,.498097,.669467,.125232,.631373,.637477,.626239,.107431,.756863,.762115,.56872,.155812,.882353,.889434,.481116,.240445,1,.964784,.400592,.349549]},{IndexedColors:[0,0,0,.8941176470588236,.1019607843137255,.1098039215686274,.2156862745098039,.4941176470588236,.7215686274509804,.3019607843137255,.6862745098039216,.2901960784313726,.596078431372549,.3058823529411765,.6392156862745098,1,.4980392156862745,0,.6509803921568628,.3372549019607843,.1568627450980392],Name:"Spectrum",NanColor:[.6509803921568628,.3372549019607843,.1568627450980392]},{IndexedColors:[.4745098039215686,.09019607843137255,.09019607843137255,.7098039215686275,.00392156862745098,.00392156862745098,.9372549019607843,.2784313725490196,.09803921568627451,.9764705882352941,.5137254901960784,.1411764705882353,1,.7058823529411765,0,1,.8980392156862745,.02352941176470588],Name:"Warm",NanColor:[1,.8980392156862745,.02352941176470588]},{IndexedColors:[.4588235294117647,.6941176470588235,.00392156862745098,.3450980392156863,.5019607843137255,.1607843137254902,.3137254901960784,.8431372549019608,.7490196078431373,.1098039215686274,.5843137254901961,.803921568627451,.2313725490196079,.407843137254902,.6705882352941176,.6039215686274509,.407843137254902,1,.3725490196078431,.2,.5019607843137255],Name:"Cool",NanColor:[.3725490196078431,.2,.5019607843137255]},{IndexedColors:[.2313725490196079,.407843137254902,.6705882352941176,.1098039215686274,.5843137254901961,.803921568627451,.3058823529411765,.8509803921568627,.9176470588235294,.4509803921568628,.6039215686274509,.8352941176470589,.2588235294117647,.2392156862745098,.6627450980392157,.3137254901960784,.3294117647058823,.5294117647058824,.06274509803921569,.1647058823529412,.3215686274509804],Name:"Blues",NanColor:[.06274509803921569,.1647058823529412,.3215686274509804]},{IndexedColors:[.1098039215686274,.5843137254901961,.803921568627451,.2313725490196079,.407843137254902,.6705882352941176,.4,.2431372549019608,.7176470588235294,.6352941176470588,.3294117647058823,.8117647058823529,.8705882352941177,.3803921568627451,.807843137254902,.8627450980392157,.3803921568627451,.5843137254901961,.2392156862745098,.06274509803921569,.3215686274509804],Name:"Wild Flower",NanColor:[.2392156862745098,.06274509803921569,.3215686274509804]},{IndexedColors:[.396078431372549,.4862745098039216,.2156862745098039,.4588235294117647,.6941176470588235,.00392156862745098,.6980392156862745,.7294117647058823,.1882352941176471,1,.8980392156862745,.02352941176470588,1,.7058823529411765,0,.9764705882352941,.5137254901960784,.1411764705882353],Name:"Citrus",NanColor:[.9764705882352941,.5137254901960784,.1411764705882353]},{IndexedColors:[.4980392156862745,.2313725490196079,.03137254901960784,.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333,.1764705882352941,0,.2941176470588235],Name:"Brewer Diverging Purple-Orange (11)",NanColor:[.1764705882352941,0,.2941176470588235]},{IndexedColors:[.4980392156862745,.2313725490196079,.03137254901960784,.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333,.1764705882352941,0,.2941176470588235],Name:"Brewer Diverging Purple-Orange (10)",NanColor:[.1764705882352941,0,.2941176470588235]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (9)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (8)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.9450980392156862,.6392156862745098,.2509803921568627,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6,.5568627450980392,.7647058823529411,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (7)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.9450980392156862,.6392156862745098,.2509803921568627,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6,.5568627450980392,.7647058823529411,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (6)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.9019607843137255,.3803921568627451,.00392156862745098,.9921568627450981,.7215686274509804,.3882352941176471,.9686274509803922,.9686274509803922,.9686274509803922,.6980392156862745,.6705882352941176,.8235294117647058,.3686274509803922,.2352941176470588,.6],Name:"Brewer Diverging Purple-Orange (5)",NanColor:[.3686274509803922,.2352941176470588,.6]},{IndexedColors:[.9019607843137255,.3803921568627451,.00392156862745098,.9921568627450981,.7215686274509804,.3882352941176471,.6980392156862745,.6705882352941176,.8235294117647058,.3686274509803922,.2352941176470588,.6],Name:"Brewer Diverging Purple-Orange (4)",NanColor:[.3686274509803922,.2352941176470588,.6]},{IndexedColors:[.9450980392156862,.6392156862745098,.2509803921568627,.9686274509803922,.9686274509803922,.9686274509803922,.6,.5568627450980392,.7647058823529411],Name:"Brewer Diverging Purple-Orange (3)",NanColor:[.6,.5568627450980392,.7647058823529411]},{IndexedColors:[.6196078431372549,.00392156862745098,.2588235294117647,.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353,.3686274509803922,.3098039215686275,.6352941176470588],Name:"Brewer Diverging Spectral (11)",NanColor:[.3686274509803922,.3098039215686275,.6352941176470588]},{IndexedColors:[.6196078431372549,.00392156862745098,.2588235294117647,.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353,.3686274509803922,.3098039215686275,.6352941176470588],Name:"Brewer Diverging Spectral (10)",NanColor:[.3686274509803922,.3098039215686275,.6352941176470588]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (9)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (8)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9882352941176471,.5529411764705883,.3490196078431372,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6,.8352941176470589,.5803921568627451,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (7)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9882352941176471,.5529411764705883,.3490196078431372,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6,.8352941176470589,.5803921568627451,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (6)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8431372549019608,.09803921568627451,.1098039215686274,.9921568627450981,.6823529411764706,.3803921568627451,1,1,.7490196078431373,.6705882352941176,.8666666666666667,.6431372549019608,.1686274509803922,.5137254901960784,.7294117647058823],Name:"Brewer Diverging Spectral (5)",NanColor:[.1686274509803922,.5137254901960784,.7294117647058823]},{IndexedColors:[.8431372549019608,.09803921568627451,.1098039215686274,.9921568627450981,.6823529411764706,.3803921568627451,.6705882352941176,.8666666666666667,.6431372549019608,.1686274509803922,.5137254901960784,.7294117647058823],Name:"Brewer Diverging Spectral (4)",NanColor:[.1686274509803922,.5137254901960784,.7294117647058823]},{IndexedColors:[.9882352941176471,.5529411764705883,.3490196078431372,1,1,.7490196078431373,.6,.8352941176470589,.5803921568627451],Name:"Brewer Diverging Spectral (3)",NanColor:[.6,.8352941176470589,.5803921568627451]},{IndexedColors:[.3294117647058823,.1882352941176471,.0196078431372549,.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922,0,.2352941176470588,.1882352941176471],Name:"Brewer Diverging Brown-Blue-Green (11)",NanColor:[0,.2352941176470588,.1882352941176471]},{IndexedColors:[.3294117647058823,.1882352941176471,.0196078431372549,.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922,0,.2352941176470588,.1882352941176471],Name:"Brewer Diverging Brown-Blue-Green (10)",NanColor:[0,.2352941176470588,.1882352941176471]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (9)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (8)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.8470588235294118,.7019607843137254,.396078431372549,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.3529411764705883,.7058823529411765,.6745098039215687,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (7)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.8470588235294118,.7019607843137254,.396078431372549,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.3529411764705883,.7058823529411765,.6745098039215687,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (6)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.6509803921568628,.3803921568627451,.1019607843137255,.8745098039215686,.7607843137254902,.4901960784313725,.9607843137254902,.9607843137254902,.9607843137254902,.5019607843137255,.803921568627451,.7568627450980392,.00392156862745098,.5215686274509804,.4431372549019608],Name:"Brewer Diverging Brown-Blue-Green (5)",NanColor:[.00392156862745098,.5215686274509804,.4431372549019608]},{IndexedColors:[.6509803921568628,.3803921568627451,.1019607843137255,.8745098039215686,.7607843137254902,.4901960784313725,.5019607843137255,.803921568627451,.7568627450980392,.00392156862745098,.5215686274509804,.4431372549019608],Name:"Brewer Diverging Brown-Blue-Green (4)",NanColor:[.00392156862745098,.5215686274509804,.4431372549019608]},{IndexedColors:[.8470588235294118,.7019607843137254,.396078431372549,.9607843137254902,.9607843137254902,.9607843137254902,.3529411764705883,.7058823529411765,.6745098039215687],Name:"Brewer Diverging Brown-Blue-Green (3)",NanColor:[.3529411764705883,.7058823529411765,.6745098039215687]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8980392156862745,.9607843137254902,.9764705882352941,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.4274509803921568,.1725490196078431,0,.2666666666666667,.1058823529411765],Name:"Brewer Sequential Blue-Green (9)",NanColor:[0,.2666666666666667,.1058823529411765]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8980392156862745,.9607843137254902,.9764705882352941,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.3450980392156863,.1411764705882353],Name:"Brewer Sequential Blue-Green (8)",NanColor:[0,.3450980392156863,.1411764705882353]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.8,.9254901960784314,.9019607843137255,.8,.9254901960784314,.9019607843137255,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.3450980392156863,.1411764705882353],Name:"Brewer Sequential Blue-Green (7)",NanColor:[0,.3450980392156863,.1411764705882353]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.1725490196078431,.6352941176470588,.3725490196078431,0,.4274509803921568,.1725490196078431],Name:"Brewer Sequential Blue-Green (6)",NanColor:[0,.4274509803921568,.1725490196078431]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.6980392156862745,.8862745098039215,.8862745098039215,.4,.7607843137254902,.6431372549019608,.1725490196078431,.6352941176470588,.3725490196078431,0,.4274509803921568,.1725490196078431],Name:"Brewer Sequential Blue-Green (5)",NanColor:[0,.4274509803921568,.1725490196078431]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.6980392156862745,.8862745098039215,.8862745098039215,.4,.7607843137254902,.6431372549019608,.1372549019607843,.5450980392156862,.2705882352941176],Name:"Brewer Sequential Blue-Green (4)",NanColor:[.1372549019607843,.5450980392156862,.2705882352941176]},{IndexedColors:[.8980392156862745,.9607843137254902,.9764705882352941,.6,.8470588235294118,.788235294117647,.1725490196078431,.6352941176470588,.3725490196078431],Name:"Brewer Sequential Blue-Green (3)",NanColor:[.1725490196078431,.6352941176470588,.3725490196078431]},{IndexedColors:[1,1,.8980392156862745,1,.9686274509803922,.7372549019607844,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.6,.203921568627451,.01568627450980392,.4,.1450980392156863,.02352941176470588],Name:"Brewer Sequential Yellow-Orange-Brown (9)",NanColor:[.4,.1450980392156863,.02352941176470588]},{IndexedColors:[1,1,.8980392156862745,1,.9686274509803922,.7372549019607844,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.5490196078431373,.1764705882352941,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (8)",NanColor:[.5490196078431373,.1764705882352941,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.5490196078431373,.1764705882352941,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (7)",NanColor:[.5490196078431373,.1764705882352941,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.8509803921568627,.3725490196078431,.05490196078431372,.6,.203921568627451,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (6)",NanColor:[.6,.203921568627451,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8509803921568627,.5568627450980392,.996078431372549,.6,.1607843137254902,.8509803921568627,.3725490196078431,.05490196078431372,.6,.203921568627451,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (5)",NanColor:[.6,.203921568627451,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8509803921568627,.5568627450980392,.996078431372549,.6,.1607843137254902,.8,.2980392156862745,.00784313725490196],Name:"Brewer Sequential Yellow-Orange-Brown (4)",NanColor:[.8,.2980392156862745,.00784313725490196]},{IndexedColors:[1,.9686274509803922,.7372549019607844,.996078431372549,.7686274509803922,.3098039215686275,.8509803921568627,.3725490196078431,.05490196078431372],Name:"Brewer Sequential Yellow-Orange-Brown (3)",NanColor:[.8509803921568627,.3725490196078431,.05490196078431372]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8784313725490196,.9254901960784314,.9568627450980393,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.5058823529411764,.05882352941176471,.4862745098039216,.3019607843137255,0,.2941176470588235],Name:"Brewer Sequential Blue-Purple (9)",NanColor:[.3019607843137255,0,.2941176470588235]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8784313725490196,.9254901960784314,.9568627450980393,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.4313725490196079,.00392156862745098,.4196078431372549],Name:"Brewer Sequential Blue-Purple (8)",NanColor:[.4313725490196079,.00392156862745098,.4196078431372549]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.4313725490196079,.00392156862745098,.4196078431372549],Name:"Brewer Sequential Blue-Purple (7)",NanColor:[.4313725490196079,.00392156862745098,.4196078431372549]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.3372549019607843,.6549019607843137,.5058823529411764,.05882352941176471,.4862745098039216],Name:"Brewer Sequential Blue-Purple (6)",NanColor:[.5058823529411764,.05882352941176471,.4862745098039216]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7019607843137254,.803921568627451,.8901960784313725,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.3372549019607843,.6549019607843137,.5058823529411764,.05882352941176471,.4862745098039216],Name:"Brewer Sequential Blue-Purple (5)",NanColor:[.5058823529411764,.05882352941176471,.4862745098039216]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7019607843137254,.803921568627451,.8901960784313725,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.2549019607843137,.615686274509804],Name:"Brewer Sequential Blue-Purple (4)",NanColor:[.5333333333333333,.2549019607843137,.615686274509804]},{IndexedColors:[.8784313725490196,.9254901960784314,.9568627450980393,.6196078431372549,.7372549019607844,.8549019607843137,.5333333333333333,.3372549019607843,.6549019607843137],Name:"Brewer Sequential Blue-Purple (3)",NanColor:[.5333333333333333,.3372549019607843,.6549019607843137]},{IndexedColors:[.4980392156862745,.788235294117647,.4980392156862745,.7450980392156863,.6823529411764706,.8313725490196079,.9921568627450981,.7529411764705882,.5254901960784314,1,1,.6,.2196078431372549,.4235294117647059,.6901960784313725,.9411764705882353,.00784313725490196,.4980392156862745,.7490196078431373,.3568627450980392,.09019607843137255,.4,.4,.4],Name:"Brewer Qualitative Accent",NanColor:[.4,.4,.4]},{IndexedColors:[.1058823529411765,.6196078431372549,.4666666666666667,.8509803921568627,.3725490196078431,.00784313725490196,.4588235294117647,.4392156862745098,.7019607843137254,.9058823529411765,.1607843137254902,.5411764705882353,.4,.6509803921568628,.1176470588235294,.9019607843137255,.6705882352941176,.00784313725490196,.6509803921568628,.4627450980392157,.1137254901960784,.4,.4,.4],Name:"Brewer Qualitative Dark2",NanColor:[.4,.4,.4]},{IndexedColors:[.4,.7607843137254902,.6470588235294118,.9882352941176471,.5529411764705883,.3843137254901961,.5529411764705883,.6274509803921569,.796078431372549,.9058823529411765,.5411764705882353,.7647058823529411,.6509803921568628,.8470588235294118,.3294117647058823,1,.8509803921568627,.1843137254901961,.8980392156862745,.7686274509803922,.5803921568627451,.7019607843137254,.7019607843137254,.7019607843137254],Name:"Brewer Qualitative Set2",NanColor:[.7019607843137254,.7019607843137254,.7019607843137254]},{IndexedColors:[.7019607843137254,.8862745098039215,.803921568627451,.9921568627450981,.803921568627451,.6745098039215687,.796078431372549,.8352941176470589,.9098039215686274,.9568627450980393,.792156862745098,.8941176470588236,.9019607843137255,.9607843137254902,.788235294117647,1,.9490196078431372,.6823529411764706,.9450980392156862,.8862745098039215,.8,.8,.8,.8],Name:"Brewer Qualitative Pastel2",NanColor:[.8,.8,.8]},{IndexedColors:[.984313725490196,.7058823529411765,.6823529411764706,.7019607843137254,.803921568627451,.8901960784313725,.8,.9215686274509803,.7725490196078432,.8705882352941177,.796078431372549,.8941176470588236,.996078431372549,.8509803921568627,.6509803921568628,1,1,.8,.8980392156862745,.8470588235294118,.7411764705882353,.9921568627450981,.8549019607843137,.9254901960784314,.9490196078431372,.9490196078431372,.9490196078431372],Name:"Brewer Qualitative Pastel1",NanColor:[.9490196078431372,.9490196078431372,.9490196078431372]},{IndexedColors:[.8941176470588236,.1019607843137255,.1098039215686274,.2156862745098039,.4941176470588236,.7215686274509804,.3019607843137255,.6862745098039216,.2901960784313726,.596078431372549,.3058823529411765,.6392156862745098,1,.4980392156862745,0,1,1,.2,.6509803921568628,.3372549019607843,.1568627450980392,.9686274509803922,.5058823529411764,.7490196078431373,.6,.6,.6],Name:"Brewer Qualitative Set1",NanColor:[.6,.6,.6]},{IndexedColors:[.6509803921568628,.807843137254902,.8901960784313725,.1215686274509804,.4705882352941176,.7058823529411765,.6980392156862745,.8745098039215686,.5411764705882353,.2,.6274509803921569,.1725490196078431,.984313725490196,.6039215686274509,.6,.8901960784313725,.1019607843137255,.1098039215686274,.9921568627450981,.7490196078431373,.4352941176470588,1,.4980392156862745,0,.792156862745098,.6980392156862745,.8392156862745098,.4156862745098039,.2392156862745098,.6039215686274509,1,1,.6],Name:"Brewer Qualitative Paired",NanColor:[1,1,.6]},{IndexedColors:[.5529411764705883,.8274509803921568,.7803921568627451,1,1,.7019607843137254,.7450980392156863,.7294117647058823,.8549019607843137,.984313725490196,.5019607843137255,.4470588235294118,.5019607843137255,.6941176470588235,.8274509803921568,.9921568627450981,.7058823529411765,.3843137254901961,.7019607843137254,.8705882352941177,.4117647058823529,.9882352941176471,.803921568627451,.8980392156862745,.8509803921568627,.8509803921568627,.8509803921568627,.7372549019607844,.5019607843137255,.7411764705882353,.8,.9215686274509803,.7725490196078432,1,.9294117647058824,.4352941176470588],Name:"Brewer Qualitative Set3",NanColor:[1,.9294117647058824,.4352941176470588]},{IndexedColors:[1,0,0,1,.862745,0,0,.695201,0],Name:"Traffic Lights",NanColor:[.803922,0,.803922]},{IndexedColors:[.908659,.604013,.581857,1,.862745,0,0,.695201,0],Name:"Traffic Lights For Deuteranopes",NanColor:[.803922,0,.803922]},{IndexedColors:[.4196078431372549,0,.07058823529411765,.9019607843137255,.9411764705882353,.0196078431372549,.01568627450980392,.6196078431372549,.00784313725490196],Name:"Traffic Lights For Deuteranopes 2",NanColor:[.803922,0,.803922]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Muted Blue-Green",NanColor:[.25,0,0],RGBPoints:[0,.109804,.27451,.301961,.02,.129412,.309804,.341176,.05,.14902,.341176,.380392,.1,.188235,.403922,.458824,.15,.227451,.447059,.521569,.2,.290196,.494118,.588235,.25,.368627,.552941,.670588,.3,.458824,.619608,.74902,.35,.588235,.713725,.85098,.4,.72549,.815686,.941176,.45,.831373,.882353,.980392,.475,.909804,.933333,1,.5,.980392,.984314,1,.5,.996078,1,.94902,.5,1,1,.980392,.5,.980392,.984314,1,.525,.972549,.988235,.890196,.55,.917647,.960784,.835294,.6,.835294,.921569,.772549,.65,.768627,.901961,.737255,.7,.670588,.831373,.654902,.75,.576471,.760784,.584314,.8,.498039,.678431,.521569,.85,.392157,.560784,.427451,.9,.294118,.45098,.333333,.95,.211765,.34902,.254902,1,.152941,.278431,.196078]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Green-Blue Asymmetric Divergent (62Blbc)",NanColor:[.25,0,0],RGBPoints:[0,.121569,.2,.145098,.05,.196078,.301961,.223529,.1,.258824,.4,.278431,.2,.341176,.54902,.341176,.25,.419608,.619608,.376471,.3,.545098,.701961,.392157,.35,.643137,.780392,.403922,.4,.729412,.819608,.45098,.45,.811765,.870588,.521569,.5,.898039,.909804,.564706,.55,.941176,.92549,.686275,.6,.960784,.94902,.776471,.64,1,1,1,.65,.890196,.988235,.972549,.7,.721569,.894118,.901961,.75,.631373,.823529,.839216,.8,.517647,.662745,.701961,.85,.384314,.494118,.54902,.9,.298039,.360784,.45098,.95,.223529,.25098,.34902,.99,.156863,.172549,.25098,1,.137255,.137255,.188235]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Asymmtrical Earth Tones (6_21b)",NanColor:[.25,0,0],RGBPoints:[0,.141176,.14902,.2,.05,.215686,.258824,.321569,.1,.243137,.368627,.380392,.15,.27451,.439216,.4,.2,.32549,.501961,.384314,.25,.403922,.6,.419608,.3,.486275,.701961,.454902,.35,.556863,.74902,.494118,.4,.670588,.8,.545098,.5,.854902,.901961,.631373,.55,.92549,.941176,.694118,.6,.960784,.94902,.776471,.65,.988235,.968627,.909804,.7,.839216,.815686,.772549,.75,.701961,.662745,.615686,.8,.6,.529412,.478431,.85,.501961,.403922,.360784,.9,.439216,.313725,.290196,1,.301961,.164706,.176471]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Yellow 15",NanColor:[.25,0,0],RGBPoints:[0,1,1,.988235,.002,1,1,.988235,.05,.984314,.988235,.843137,.1,.988235,.988235,.741176,.15,.980392,.968627,.654902,.2,.980392,.945098,.576471,.25,.968627,.905882,.486275,.3,.968627,.862745,.388235,.35,.960784,.803922,.286275,.4,.94902,.741176,.219608,.45,.941176,.678431,.14902,.5,.929412,.607843,.094118,.55,.921569,.545098,.054902,.6,.909804,.486275,.035294,.65,.890196,.411765,.019608,.7,.8,.305882,0,.75,.760784,.239216,0,.8,.678431,.180392,.011765,.85,.6,.121569,.023529,.9,.501961,.054902,.031373,.95,.4,.039216,.058824,1,.301961,.047059,.090196]},{ColorSpace:"Diverging",Name:"Magma (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.001462,466e-6,.013866,.003922,.002258,.001295,.018331,.007843,.003279,.002305,.023708,.011765,.004512,.00349,.029965,.015686,.00595,.004843,.03713,.019608,.007588,.006356,.044973,.023529,.009426,.008022,.052844,.027451,.011465,.009828,.06075,.031373,.013708,.011771,.068667,.035294,.016156,.01384,.076603,.039216,.018815,.016026,.084584,.043137,.021692,.01832,.09261,.047059,.024792,.020715,.100676,.05098,.028123,.023201,.108787,.054902,.031696,.025765,.116965,.058824,.03552,.028397,.125209,.062745,.039608,.03109,.133515,.066667,.04383,.03383,.141886,.070588,.048062,.036607,.150327,.07451,.05232,.039407,.158841,.078431,.056615,.04216,.167446,.082353,.060949,.044794,.176129,.086275,.06533,.047318,.184892,.090196,.069764,.049726,.193735,.094118,.074257,.052017,.20266,.098039,.078815,.054184,.211667,.101961,.083446,.056225,.220755,.105882,.088155,.058133,.229922,.109804,.092949,.059904,.239164,.113725,.097833,.061531,.248477,.117647,.102815,.06301,.257854,.121569,.107899,.064335,.267289,.12549,.113094,.065492,.276784,.129412,.118405,.066479,.286321,.133333,.123833,.067295,.295879,.137255,.12938,.067935,.305443,.141176,.135053,.068391,.315,.145098,.140858,.068654,.324538,.14902,.146785,.068738,.334011,.152941,.152839,.068637,.343404,.156863,.159018,.068354,.352688,.160784,.165308,.067911,.361816,.164706,.171713,.067305,.370771,.168627,.178212,.066576,.379497,.172549,.184801,.065732,.387973,.176471,.19146,.064818,.396152,.180392,.198177,.063862,.404009,.184314,.204935,.062907,.411514,.188235,.211718,.061992,.418647,.192157,.218512,.061158,.425392,.196078,.225302,.060445,.431742,.2,.232077,.059889,.437695,.203922,.238826,.059517,.443256,.207843,.245543,.059352,.448436,.211765,.25222,.059415,.453248,.215686,.258857,.059706,.45771,.219608,.265447,.060237,.46184,.223529,.271994,.060994,.46566,.227451,.278493,.061978,.46919,.231373,.284951,.063168,.472451,.235294,.291366,.064553,.475462,.239216,.29774,.066117,.478243,.243137,.304081,.067835,.480812,.247059,.310382,.069702,.483186,.25098,.316654,.07169,.48538,.254902,.322899,.073782,.487408,.258824,.329114,.075972,.489287,.262745,.335308,.078236,.491024,.266667,.341482,.080564,.492631,.270588,.347636,.082946,.494121,.27451,.353773,.085373,.495501,.278431,.359898,.087831,.496778,.282353,.366012,.090314,.49796,.286275,.372116,.092816,.499053,.290196,.378211,.095332,.500067,.294118,.384299,.097855,.501002,.298039,.390384,.100379,.501864,.301961,.396467,.102902,.502658,.305882,.402548,.10542,.503386,.309804,.408629,.10793,.504052,.313725,.414709,.110431,.504662,.317647,.420791,.11292,.505215,.321569,.426877,.115395,.505714,.32549,.432967,.117855,.50616,.329412,.439062,.120298,.506555,.333333,.445163,.122724,.506901,.337255,.451271,.125132,.507198,.341176,.457386,.127522,.507448,.345098,.463508,.129893,.507652,.34902,.46964,.132245,.507809,.352941,.47578,.134577,.507921,.356863,.481929,.136891,.507989,.360784,.488088,.139186,.508011,.364706,.494258,.141462,.507988,.368627,.500438,.143719,.50792,.372549,.506629,.145958,.507806,.376471,.512831,.148179,.507648,.380392,.519045,.150383,.507443,.384314,.52527,.152569,.507192,.388235,.531507,.154739,.506895,.392157,.537755,.156894,.506551,.396078,.544015,.159033,.506159,.4,.550287,.161158,.505719,.403922,.556571,.163269,.50523,.407843,.562866,.165368,.504692,.411765,.569172,.167454,.504105,.415686,.57549,.16953,.503466,.419608,.581819,.171596,.502777,.423529,.588158,.173652,.502035,.427451,.594508,.175701,.501241,.431373,.600868,.177743,.500394,.435294,.607238,.179779,.499492,.439216,.613617,.181811,.498536,.443137,.620005,.18384,.497524,.447059,.626401,.185867,.496456,.45098,.632805,.187893,.495332,.454902,.639216,.189921,.49415,.458824,.645633,.191952,.49291,.462745,.652056,.193986,.491611,.466667,.658483,.196027,.490253,.470588,.664915,.198075,.488836,.47451,.671349,.200133,.487358,.478431,.677786,.202203,.485819,.482353,.684224,.204286,.484219,.486275,.690661,.206384,.482558,.490196,.697098,.208501,.480835,.494118,.703532,.210638,.479049,.498039,.709962,.212797,.477201,.501961,.716387,.214982,.47529,.505882,.722805,.217194,.473316,.509804,.729216,.219437,.471279,.513725,.735616,.221713,.46918,.517647,.742004,.224025,.467018,.521569,.748378,.226377,.464794,.52549,.754737,.228772,.462509,.529412,.761077,.231214,.460162,.533333,.767398,.233705,.457755,.537255,.773695,.236249,.455289,.541176,.779968,.238851,.452765,.545098,.786212,.241514,.450184,.54902,.792427,.244242,.447543,.552941,.798608,.24704,.444848,.556863,.804752,.249911,.442102,.560784,.810855,.252861,.439305,.564706,.816914,.255895,.436461,.568627,.822926,.259016,.433573,.572549,.828886,.262229,.430644,.576471,.834791,.26554,.427671,.580392,.840636,.268953,.424666,.584314,.846416,.272473,.421631,.588235,.852126,.276106,.418573,.592157,.857763,.279857,.415496,.596078,.86332,.283729,.412403,.6,.868793,.287728,.409303,.603922,.874176,.291859,.406205,.607843,.879464,.296125,.403118,.611765,.884651,.30053,.400047,.615686,.889731,.305079,.397002,.619608,.8947,.309773,.393995,.623529,.899552,.314616,.391037,.627451,.904281,.31961,.388137,.631373,.908884,.324755,.385308,.635294,.913354,.330052,.382563,.639216,.917689,.3355,.379915,.643137,.921884,.341098,.377376,.647059,.925937,.346844,.374959,.65098,.929845,.352734,.372677,.654902,.933606,.358764,.370541,.658824,.937221,.364929,.368567,.662745,.940687,.371224,.366762,.666667,.944006,.377643,.365136,.670588,.94718,.384178,.363701,.67451,.95021,.39082,.362468,.678431,.953099,.397563,.361438,.682353,.955849,.4044,.360619,.686275,.958464,.411324,.360014,.690196,.960949,.418323,.35963,.694118,.96331,.42539,.359469,.698039,.965549,.432519,.359529,.701961,.967671,.439703,.35981,.705882,.96968,.446936,.360311,.709804,.971582,.45421,.36103,.713725,.973381,.46152,.361965,.717647,.975082,.468861,.363111,.721569,.97669,.476226,.364466,.72549,.97821,.483612,.366025,.729412,.979645,.491014,.367783,.733333,.981,.498428,.369734,.737255,.982279,.505851,.371874,.741176,.983485,.51328,.374198,.745098,.984622,.520713,.376698,.74902,.985693,.528148,.379371,.752941,.9867,.535582,.38221,.756863,.987646,.543015,.38521,.760784,.988533,.550446,.388365,.764706,.989363,.557873,.391671,.768627,.990138,.565296,.395122,.772549,.990871,.572706,.398714,.776471,.991558,.580107,.402441,.780392,.992196,.587502,.406299,.784314,.992785,.594891,.410283,.788235,.993326,.602275,.41439,.792157,.993834,.609644,.418613,.796078,.994309,.616999,.42295,.8,.994738,.62435,.427397,.803922,.995122,.631696,.431951,.807843,.99548,.639027,.436607,.811765,.99581,.646344,.441361,.815686,.996096,.653659,.446213,.819608,.996341,.660969,.45116,.823529,.99658,.668256,.456192,.827451,.996775,.675541,.461314,.831373,.996925,.682828,.466526,.835294,.997077,.690088,.471811,.839216,.997186,.697349,.477182,.843137,.997254,.704611,.482635,.847059,.997325,.711848,.488154,.85098,.997351,.719089,.493755,.854902,.997351,.726324,.499428,.858824,.997341,.733545,.505167,.862745,.997285,.740772,.510983,.866667,.997228,.747981,.516859,.870588,.997138,.75519,.522806,.87451,.997019,.762398,.528821,.878431,.996898,.769591,.534892,.882353,.996727,.776795,.541039,.886275,.996571,.783977,.547233,.890196,.996369,.791167,.553499,.894118,.996162,.798348,.55982,.898039,.995932,.805527,.566202,.901961,.99568,.812706,.572645,.905882,.995424,.819875,.57914,.909804,.995131,.827052,.585701,.913725,.994851,.834213,.592307,.917647,.994524,.841387,.598983,.921569,.994222,.84854,.605696,.92549,.993866,.855711,.612482,.929412,.993545,.862859,.619299,.933333,.99317,.870024,.626189,.937255,.992831,.877168,.633109,.941176,.99244,.88433,.640099,.945098,.992089,.89147,.647116,.94902,.991688,.898627,.654202,.952941,.991332,.905763,.661309,.956863,.99093,.912915,.668481,.960784,.99057,.920049,.675675,.964706,.990175,.927196,.682926,.968627,.989815,.934329,.690198,.972549,.989434,.94147,.697519,.976471,.989077,.948604,.704863,.980392,.988717,.955742,.712242,.984314,.988367,.962878,.719649,.988235,.988033,.970012,.727077,.992157,.987691,.977154,.734536,.996078,.987387,.984288,.742002,1,.987053,.991438,.749504]},{ColorSpace:"Diverging",Name:"Inferno (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.001462,466e-6,.013866,.003922,.002267,.00127,.01857,.007843,.003299,.002249,.024239,.011765,.004547,.003392,.030909,.015686,.006006,.004692,.038558,.019608,.007676,.006136,.046836,.023529,.009561,.007713,.055143,.027451,.011663,.009417,.06346,.031373,.013995,.011225,.071862,.035294,.016561,.013136,.080282,.039216,.019373,.015133,.088767,.043137,.022447,.017199,.097327,.047059,.025793,.019331,.10593,.05098,.029432,.021503,.114621,.054902,.033385,.023702,.123397,.058824,.037668,.025921,.132232,.062745,.042253,.028139,.141141,.066667,.046915,.030324,.150164,.070588,.051644,.032474,.159254,.07451,.056449,.034569,.168414,.078431,.06134,.03659,.177642,.082353,.066331,.038504,.186962,.086275,.071429,.040294,.196354,.090196,.076637,.041905,.205799,.094118,.081962,.043328,.215289,.098039,.087411,.044556,.224813,.101961,.09299,.045583,.234358,.105882,.098702,.046402,.243904,.109804,.104551,.047008,.25343,.113725,.110536,.047399,.262912,.117647,.116656,.047574,.272321,.121569,.122908,.047536,.281624,.12549,.129285,.047293,.290788,.129412,.135778,.046856,.299776,.133333,.142378,.046242,.308553,.137255,.149073,.045468,.317085,.141176,.15585,.044559,.325338,.145098,.162689,.043554,.333277,.14902,.169575,.042489,.340874,.152941,.176493,.041402,.348111,.156863,.183429,.040329,.354971,.160784,.190367,.039309,.361447,.164706,.197297,.0384,.367535,.168627,.204209,.037632,.373238,.172549,.211095,.03703,.378563,.176471,.217949,.036615,.383522,.180392,.224763,.036405,.388129,.184314,.231538,.036405,.3924,.188235,.238273,.036621,.396353,.192157,.244967,.037055,.400007,.196078,.25162,.037705,.403378,.2,.258234,.038571,.406485,.203922,.26481,.039647,.409345,.207843,.271347,.040922,.411976,.211765,.27785,.042353,.414392,.215686,.284321,.043933,.416608,.219608,.290763,.045644,.418637,.223529,.297178,.04747,.420491,.227451,.303568,.049396,.422182,.231373,.309935,.051407,.423721,.235294,.316282,.05349,.425116,.239216,.32261,.055634,.426377,.243137,.328921,.057827,.427511,.247059,.335217,.06006,.428524,.25098,.3415,.062325,.429425,.254902,.347771,.064616,.430217,.258824,.354032,.066925,.430906,.262745,.360284,.069247,.431497,.266667,.366529,.071579,.431994,.270588,.372768,.073915,.4324,.27451,.379001,.076253,.432719,.278431,.385228,.078591,.432955,.282353,.391453,.080927,.433109,.286275,.397674,.083257,.433183,.290196,.403894,.08558,.433179,.294118,.410113,.087896,.433098,.298039,.416331,.090203,.432943,.301961,.422549,.092501,.432714,.305882,.428768,.09479,.432412,.309804,.434987,.097069,.432039,.313725,.441207,.099338,.431594,.317647,.447428,.101597,.43108,.321569,.453651,.103848,.430498,.32549,.459875,.106089,.429846,.329412,.4661,.108322,.429125,.333333,.472328,.110547,.428334,.337255,.478558,.112764,.427475,.341176,.484789,.114974,.426548,.345098,.491022,.117179,.425552,.34902,.497257,.119379,.424488,.352941,.503493,.121575,.423356,.356863,.50973,.123769,.422156,.360784,.515967,.12596,.420887,.364706,.522206,.12815,.419549,.368627,.528444,.130341,.418142,.372549,.534683,.132534,.416667,.376471,.54092,.134729,.415123,.380392,.547157,.136929,.413511,.384314,.553392,.139134,.411829,.388235,.559624,.141346,.410078,.392157,.565854,.143567,.408258,.396078,.572081,.145797,.406369,.4,.578304,.148039,.404411,.403922,.584521,.150294,.402385,.407843,.590734,.152563,.40029,.411765,.59694,.154848,.398125,.415686,.603139,.157151,.395891,.419608,.60933,.159474,.393589,.423529,.615513,.161817,.391219,.427451,.621685,.164184,.388781,.431373,.627847,.166575,.386276,.435294,.633998,.168992,.383704,.439216,.640135,.171438,.381065,.443137,.64626,.173914,.378359,.447059,.652369,.176421,.375586,.45098,.658463,.178962,.372748,.454902,.66454,.181539,.369846,.458824,.670599,.184153,.366879,.462745,.676638,.186807,.363849,.466667,.682656,.189501,.360757,.470588,.688653,.192239,.357603,.47451,.694627,.195021,.354388,.478431,.700576,.197851,.351113,.482353,.7065,.200728,.347777,.486275,.712396,.203656,.344383,.490196,.718264,.206636,.340931,.494118,.724103,.20967,.337424,.498039,.729909,.212759,.333861,.501961,.735683,.215906,.330245,.505882,.741423,.219112,.326576,.509804,.747127,.222378,.322856,.513725,.752794,.225706,.319085,.517647,.758422,.229097,.315266,.521569,.76401,.232554,.311399,.52549,.769556,.236077,.307485,.529412,.775059,.239667,.303526,.533333,.780517,.243327,.299523,.537255,.785929,.247056,.295477,.541176,.791293,.250856,.29139,.545098,.796607,.254728,.287264,.54902,.801871,.258674,.283099,.552941,.807082,.262692,.278898,.556863,.812239,.266786,.274661,.560784,.817341,.270954,.27039,.564706,.822386,.275197,.266085,.568627,.827372,.279517,.26175,.572549,.832299,.283913,.257383,.576471,.837165,.288385,.252988,.580392,.841969,.292933,.248564,.584314,.846709,.297559,.244113,.588235,.851384,.30226,.239636,.592157,.855992,.307038,.235133,.596078,.860533,.311892,.230606,.6,.865006,.316822,.226055,.603922,.869409,.321827,.221482,.607843,.873741,.326906,.216886,.611765,.878001,.33206,.212268,.615686,.882188,.337287,.207628,.619608,.886302,.342586,.202968,.623529,.890341,.347957,.198286,.627451,.894305,.353399,.193584,.631373,.898192,.358911,.18886,.635294,.902003,.364492,.184116,.639216,.905735,.37014,.17935,.643137,.90939,.375856,.174563,.647059,.912966,.381636,.169755,.65098,.916462,.387481,.164924,.654902,.919879,.393389,.16007,.658824,.923215,.399359,.155193,.662745,.92647,.405389,.150292,.666667,.929644,.411479,.145367,.670588,.932737,.417627,.140417,.67451,.935747,.423831,.13544,.678431,.938675,.430091,.130438,.682353,.941521,.436405,.125409,.686275,.944285,.442772,.120354,.690196,.946965,.449191,.115272,.694118,.949562,.45566,.110164,.698039,.952075,.462178,.105031,.701961,.954506,.468744,.099874,.705882,.956852,.475356,.094695,.709804,.959114,.482014,.089499,.713725,.961293,.488716,.084289,.717647,.963387,.495462,.079073,.721569,.965397,.502249,.073859,.72549,.967322,.509078,.068659,.729412,.969163,.515946,.063488,.733333,.970919,.522853,.058367,.737255,.97259,.529798,.053324,.741176,.974176,.53678,.048392,.745098,.975677,.543798,.043618,.74902,.977092,.55085,.03905,.752941,.978422,.557937,.034931,.756863,.979666,.565057,.031409,.760784,.980824,.572209,.028508,.764706,.981895,.579392,.02625,.768627,.982881,.586606,.024661,.772549,.983779,.593849,.02377,.776471,.984591,.601122,.023606,.780392,.985315,.608422,.024202,.784314,.985952,.61575,.025592,.788235,.986502,.623105,.027814,.792157,.986964,.630485,.030908,.796078,.987337,.63789,.034916,.8,.987622,.64532,.039886,.803922,.987819,.652773,.045581,.807843,.987926,.66025,.05175,.811765,.987945,.667748,.058329,.815686,.987874,.675267,.065257,.819608,.987714,.682807,.072489,.823529,.987464,.690366,.07999,.827451,.987124,.697944,.087731,.831373,.986694,.70554,.095694,.835294,.986175,.713153,.103863,.839216,.985566,.720782,.112229,.843137,.984865,.728427,.120785,.847059,.984075,.736087,.129527,.85098,.983196,.743758,.138453,.854902,.982228,.751442,.147565,.858824,.981173,.759135,.156863,.862745,.980032,.766837,.166353,.866667,.978806,.774545,.176037,.870588,.977497,.782258,.185923,.87451,.976108,.789974,.196018,.878431,.974638,.797692,.206332,.882353,.973088,.805409,.216877,.886275,.971468,.813122,.227658,.890196,.969783,.820825,.238686,.894118,.968041,.828515,.249972,.898039,.966243,.836191,.261534,.901961,.964394,.843848,.273391,.905882,.962517,.851476,.285546,.909804,.960626,.859069,.29801,.913725,.95872,.866624,.31082,.917647,.956834,.874129,.323974,.921569,.954997,.881569,.337475,.92549,.953215,.888942,.351369,.929412,.951546,.896226,.365627,.933333,.950018,.903409,.380271,.937255,.948683,.910473,.395289,.941176,.947594,.917399,.410665,.945098,.946809,.924168,.426373,.94902,.946392,.930761,.442367,.952941,.946403,.937159,.458592,.956863,.946903,.943348,.47497,.960784,.947937,.949318,.491426,.964706,.949545,.955063,.50786,.968627,.95174,.960587,.524203,.972549,.954529,.965896,.540361,.976471,.957896,.971003,.556275,.980392,.961812,.975924,.571925,.984314,.966249,.980678,.587206,.988235,.971162,.985282,.602154,.992157,.976511,.989753,.61676,.996078,.982257,.994109,.631017,1,.988362,.998364,.644924]},{ColorSpace:"Diverging",Name:"Plasma (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.050383,.029803,.527975,.003922,.063536,.028426,.533124,.007843,.075353,.027206,.538007,.011765,.086222,.026125,.542658,.015686,.096379,.025165,.547103,.019608,.10598,.024309,.551368,.023529,.115124,.023556,.555468,.027451,.123903,.022878,.559423,.031373,.132381,.022258,.56325,.035294,.140603,.021687,.566959,.039216,.148607,.021154,.570562,.043137,.156421,.020651,.574065,.047059,.16407,.020171,.577478,.05098,.171574,.019706,.580806,.054902,.17895,.019252,.584054,.058824,.186213,.018803,.587228,.062745,.193374,.018354,.59033,.066667,.200445,.017902,.593364,.070588,.207435,.017442,.596333,.07451,.21435,.016973,.599239,.078431,.221197,.016497,.602083,.082353,.227983,.016007,.604867,.086275,.234715,.015502,.607592,.090196,.241396,.014979,.610259,.094118,.248032,.014439,.612868,.098039,.254627,.013882,.615419,.101961,.261183,.013308,.617911,.105882,.267703,.012716,.620346,.109804,.274191,.012109,.622722,.113725,.280648,.011488,.625038,.117647,.287076,.010855,.627295,.121569,.293478,.010213,.62949,.12549,.299855,.009561,.631624,.129412,.30621,.008902,.633694,.133333,.312543,.008239,.6357,.137255,.318856,.007576,.63764,.141176,.32515,.006915,.639512,.145098,.331426,.006261,.641316,.14902,.337683,.005618,.643049,.152941,.343925,.004991,.64471,.156863,.35015,.004382,.646298,.160784,.356359,.003798,.64781,.164706,.362553,.003243,.649245,.168627,.368733,.002724,.650601,.172549,.374897,.002245,.651876,.176471,.381047,.001814,.653068,.180392,.387183,.001434,.654177,.184314,.393304,.001114,.655199,.188235,.399411,859e-6,.656133,.192157,.405503,678e-6,.656977,.196078,.41158,577e-6,.65773,.2,.417642,564e-6,.65839,.203922,.423689,646e-6,.658956,.207843,.429719,831e-6,.659425,.211765,.435734,.001127,.659797,.215686,.441732,.00154,.660069,.219608,.447714,.00208,.66024,.223529,.453677,.002755,.66031,.227451,.459623,.003574,.660277,.231373,.46555,.004545,.660139,.235294,.471457,.005678,.659897,.239216,.477344,.00698,.659549,.243137,.48321,.00846,.659095,.247059,.489055,.010127,.658534,.25098,.494877,.01199,.657865,.254902,.500678,.014055,.657088,.258824,.506454,.016333,.656202,.262745,.512206,.018833,.655209,.266667,.517933,.021563,.654109,.270588,.523633,.024532,.652901,.27451,.529306,.027747,.651586,.278431,.534952,.031217,.650165,.282353,.54057,.03495,.64864,.286275,.546157,.038954,.64701,.290196,.551715,.043136,.645277,.294118,.557243,.047331,.643443,.298039,.562738,.051545,.641509,.301961,.568201,.055778,.639477,.305882,.573632,.060028,.637349,.309804,.579029,.064296,.635126,.313725,.584391,.068579,.632812,.317647,.589719,.072878,.630408,.321569,.595011,.07719,.627917,.32549,.600266,.081516,.625342,.329412,.605485,.085854,.622686,.333333,.610667,.090204,.619951,.337255,.615812,.094564,.61714,.341176,.620919,.098934,.614257,.345098,.625987,.103312,.611305,.34902,.631017,.107699,.608287,.352941,.636008,.112092,.605205,.356863,.640959,.116492,.602065,.360784,.645872,.120898,.598867,.364706,.650746,.125309,.595617,.368627,.65558,.129725,.592317,.372549,.660374,.134144,.588971,.376471,.665129,.138566,.585582,.380392,.669845,.142992,.582154,.384314,.674522,.147419,.578688,.388235,.67916,.151848,.575189,.392157,.683758,.156278,.57166,.396078,.688318,.160709,.568103,.4,.69284,.165141,.564522,.403922,.697324,.169573,.560919,.407843,.701769,.174005,.557296,.411765,.706178,.178437,.553657,.415686,.710549,.182868,.550004,.419608,.714883,.187299,.546338,.423529,.719181,.191729,.542663,.427451,.723444,.196158,.538981,.431373,.72767,.200586,.535293,.435294,.731862,.205013,.531601,.439216,.736019,.209439,.527908,.443137,.740143,.213864,.524216,.447059,.744232,.218288,.520524,.45098,.748289,.222711,.516834,.454902,.752312,.227133,.513149,.458824,.756304,.231555,.509468,.462745,.760264,.235976,.505794,.466667,.764193,.240396,.502126,.470588,.76809,.244817,.498465,.47451,.771958,.249237,.494813,.478431,.775796,.253658,.491171,.482353,.779604,.258078,.487539,.486275,.783383,.2625,.483918,.490196,.787133,.266922,.480307,.494118,.790855,.271345,.476706,.498039,.794549,.27577,.473117,.501961,.798216,.280197,.469538,.505882,.801855,.284626,.465971,.509804,.805467,.289057,.462415,.513725,.809052,.293491,.45887,.517647,.812612,.297928,.455338,.521569,.816144,.302368,.451816,.52549,.819651,.306812,.448306,.529412,.823132,.311261,.444806,.533333,.826588,.315714,.441316,.537255,.830018,.320172,.437836,.541176,.833422,.324635,.434366,.545098,.836801,.329105,.430905,.54902,.840155,.33358,.427455,.552941,.843484,.338062,.424013,.556863,.846788,.342551,.420579,.560784,.850066,.347048,.417153,.564706,.853319,.351553,.413734,.568627,.856547,.356066,.410322,.572549,.85975,.360588,.406917,.576471,.862927,.365119,.403519,.580392,.866078,.36966,.400126,.584314,.869203,.374212,.396738,.588235,.872303,.378774,.393355,.592157,.875376,.383347,.389976,.596078,.878423,.387932,.3866,.6,.881443,.392529,.383229,.603922,.884436,.397139,.37986,.607843,.887402,.401762,.376494,.611765,.89034,.406398,.37313,.615686,.89325,.411048,.369768,.619608,.896131,.415712,.366407,.623529,.898984,.420392,.363047,.627451,.901807,.425087,.359688,.631373,.904601,.429797,.356329,.635294,.907365,.434524,.35297,.639216,.910098,.439268,.34961,.643137,.9128,.444029,.346251,.647059,.915471,.448807,.34289,.65098,.918109,.453603,.339529,.654902,.920714,.458417,.336166,.658824,.923287,.463251,.332801,.662745,.925825,.468103,.329435,.666667,.928329,.472975,.326067,.670588,.930798,.477867,.322697,.67451,.933232,.48278,.319325,.678431,.93563,.487712,.315952,.682353,.93799,.492667,.312575,.686275,.940313,.497642,.309197,.690196,.942598,.502639,.305816,.694118,.944844,.507658,.302433,.698039,.947051,.512699,.299049,.701961,.949217,.517763,.295662,.705882,.951344,.52285,.292275,.709804,.953428,.52796,.288883,.713725,.95547,.533093,.28549,.717647,.957469,.53825,.282096,.721569,.959424,.543431,.278701,.72549,.961336,.548636,.275305,.729412,.963203,.553865,.271909,.733333,.965024,.559118,.268513,.737255,.966798,.564396,.265118,.741176,.968526,.5697,.261721,.745098,.970205,.575028,.258325,.74902,.971835,.580382,.254931,.752941,.973416,.585761,.25154,.756863,.974947,.591165,.248151,.760784,.976428,.596595,.244767,.764706,.977856,.602051,.241387,.768627,.979233,.607532,.238013,.772549,.980556,.613039,.234646,.776471,.981826,.618572,.231287,.780392,.983041,.624131,.227937,.784314,.984199,.629718,.224595,.788235,.985301,.63533,.221265,.792157,.986345,.640969,.217948,.796078,.987332,.646633,.214648,.8,.98826,.652325,.211364,.803922,.989128,.658043,.2081,.807843,.989935,.663787,.204859,.811765,.990681,.669558,.201642,.815686,.991365,.675355,.198453,.819608,.991985,.681179,.195295,.823529,.992541,.68703,.19217,.827451,.993032,.692907,.189084,.831373,.993456,.69881,.186041,.835294,.993814,.704741,.183043,.839216,.994103,.710698,.180097,.843137,.994324,.716681,.177208,.847059,.994474,.722691,.174381,.85098,.994553,.728728,.171622,.854902,.994561,.734791,.168938,.858824,.994495,.74088,.166335,.862745,.994355,.746995,.163821,.866667,.994141,.753137,.161404,.870588,.993851,.759304,.159092,.87451,.993482,.765499,.156891,.878431,.993033,.77172,.154808,.882353,.992505,.777967,.152855,.886275,.991897,.784239,.151042,.890196,.991209,.790537,.149377,.894118,.990439,.796859,.14787,.898039,.989587,.803205,.146529,.901961,.988648,.809579,.145357,.905882,.987621,.815978,.144363,.909804,.986509,.822401,.143557,.913725,.985314,.828846,.142945,.917647,.984031,.835315,.142528,.921569,.982653,.841812,.142303,.92549,.98119,.848329,.142279,.929412,.979644,.854866,.142453,.933333,.977995,.861432,.142808,.937255,.976265,.868016,.143351,.941176,.974443,.874622,.144061,.945098,.97253,.88125,.144923,.94902,.970533,.887896,.145919,.952941,.968443,.894564,.147014,.956863,.966271,.901249,.14818,.960784,.964021,.90795,.14937,.964706,.961681,.914672,.15052,.968627,.959276,.921407,.151566,.972549,.956808,.928152,.152409,.976471,.954287,.934908,.152921,.980392,.951726,.941671,.152925,.984314,.949151,.948435,.152178,.988235,.946602,.95519,.150328,.992157,.944152,.961916,.146861,.996078,.941896,.96859,.140956,1,.940015,.975158,.131326]},{ColorSpace:"Diverging",Name:"Viridis (matplotlib)",NanColor:[1,0,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Eric Firing",RGBPoints:[0,.267004,.004874,.329415,.003922,.26851,.009605,.335427,.007843,.269944,.014625,.341379,.011765,.271305,.019942,.347269,.015686,.272594,.025563,.353093,.019608,.273809,.031497,.358853,.023529,.274952,.037752,.364543,.027451,.276022,.044167,.370164,.031373,.277018,.050344,.375715,.035294,.277941,.056324,.381191,.039216,.278791,.062145,.386592,.043137,.279566,.067836,.391917,.047059,.280267,.073417,.397163,.05098,.280894,.078907,.402329,.054902,.281446,.08432,.407414,.058824,.281924,.089666,.412415,.062745,.282327,.094955,.417331,.066667,.282656,.100196,.42216,.070588,.28291,.105393,.426902,.07451,.283091,.110553,.431554,.078431,.283197,.11568,.436115,.082353,.283229,.120777,.440584,.086275,.283187,.125848,.44496,.090196,.283072,.130895,.449241,.094118,.282884,.13592,.453427,.098039,.282623,.140926,.457517,.101961,.28229,.145912,.46151,.105882,.281887,.150881,.465405,.109804,.281412,.155834,.469201,.113725,.280868,.160771,.472899,.117647,.280255,.165693,.476498,.121569,.279574,.170599,.479997,.12549,.278826,.17549,.483397,.129412,.278012,.180367,.486697,.133333,.277134,.185228,.489898,.137255,.276194,.190074,.493001,.141176,.275191,.194905,.496005,.145098,.274128,.199721,.498911,.14902,.273006,.20452,.501721,.152941,.271828,.209303,.504434,.156863,.270595,.214069,.507052,.160784,.269308,.218818,.509577,.164706,.267968,.223549,.512008,.168627,.26658,.228262,.514349,.172549,.265145,.232956,.516599,.176471,.263663,.237631,.518762,.180392,.262138,.242286,.520837,.184314,.260571,.246922,.522828,.188235,.258965,.251537,.524736,.192157,.257322,.25613,.526563,.196078,.255645,.260703,.528312,.2,.253935,.265254,.529983,.203922,.252194,.269783,.531579,.207843,.250425,.27429,.533103,.211765,.248629,.278775,.534556,.215686,.246811,.283237,.535941,.219608,.244972,.287675,.53726,.223529,.243113,.292092,.538516,.227451,.241237,.296485,.539709,.231373,.239346,.300855,.540844,.235294,.237441,.305202,.541921,.239216,.235526,.309527,.542944,.243137,.233603,.313828,.543914,.247059,.231674,.318106,.544834,.25098,.229739,.322361,.545706,.254902,.227802,.326594,.546532,.258824,.225863,.330805,.547314,.262745,.223925,.334994,.548053,.266667,.221989,.339161,.548752,.270588,.220057,.343307,.549413,.27451,.21813,.347432,.550038,.278431,.21621,.351535,.550627,.282353,.214298,.355619,.551184,.286275,.212395,.359683,.55171,.290196,.210503,.363727,.552206,.294118,.208623,.367752,.552675,.298039,.206756,.371758,.553117,.301961,.204903,.375746,.553533,.305882,.203063,.379716,.553925,.309804,.201239,.38367,.554294,.313725,.19943,.387607,.554642,.317647,.197636,.391528,.554969,.321569,.19586,.395433,.555276,.32549,.1941,.399323,.555565,.329412,.192357,.403199,.555836,.333333,.190631,.407061,.556089,.337255,.188923,.41091,.556326,.341176,.187231,.414746,.556547,.345098,.185556,.41857,.556753,.34902,.183898,.422383,.556944,.352941,.182256,.426184,.55712,.356863,.180629,.429975,.557282,.360784,.179019,.433756,.55743,.364706,.177423,.437527,.557565,.368627,.175841,.44129,.557685,.372549,.174274,.445044,.557792,.376471,.172719,.448791,.557885,.380392,.171176,.45253,.557965,.384314,.169646,.456262,.55803,.388235,.168126,.459988,.558082,.392157,.166617,.463708,.558119,.396078,.165117,.467423,.558141,.4,.163625,.471133,.558148,.403922,.162142,.474838,.55814,.407843,.160665,.47854,.558115,.411765,.159194,.482237,.558073,.415686,.157729,.485932,.558013,.419608,.15627,.489624,.557936,.423529,.154815,.493313,.55784,.427451,.153364,.497,.557724,.431373,.151918,.500685,.557587,.435294,.150476,.504369,.55743,.439216,.149039,.508051,.55725,.443137,.147607,.511733,.557049,.447059,.14618,.515413,.556823,.45098,.144759,.519093,.556572,.454902,.143343,.522773,.556295,.458824,.141935,.526453,.555991,.462745,.140536,.530132,.555659,.466667,.139147,.533812,.555298,.470588,.13777,.537492,.554906,.47451,.136408,.541173,.554483,.478431,.135066,.544853,.554029,.482353,.133743,.548535,.553541,.486275,.132444,.552216,.553018,.490196,.131172,.555899,.552459,.494118,.129933,.559582,.551864,.498039,.128729,.563265,.551229,.501961,.127568,.566949,.550556,.505882,.126453,.570633,.549841,.509804,.125394,.574318,.549086,.513725,.124395,.578002,.548287,.517647,.123463,.581687,.547445,.521569,.122606,.585371,.546557,.52549,.121831,.589055,.545623,.529412,.121148,.592739,.544641,.533333,.120565,.596422,.543611,.537255,.120092,.600104,.54253,.541176,.119738,.603785,.5414,.545098,.119512,.607464,.540218,.54902,.119423,.611141,.538982,.552941,.119483,.614817,.537692,.556863,.119699,.61849,.536347,.560784,.120081,.622161,.534946,.564706,.120638,.625828,.533488,.568627,.12138,.629492,.531973,.572549,.122312,.633153,.530398,.576471,.123444,.636809,.528763,.580392,.12478,.640461,.527068,.584314,.126326,.644107,.525311,.588235,.128087,.647749,.523491,.592157,.130067,.651384,.521608,.596078,.132268,.655014,.519661,.6,.134692,.658636,.517649,.603922,.137339,.662252,.515571,.607843,.14021,.665859,.513427,.611765,.143303,.669459,.511215,.615686,.146616,.67305,.508936,.619608,.150148,.676631,.506589,.623529,.153894,.680203,.504172,.627451,.157851,.683765,.501686,.631373,.162016,.687316,.499129,.635294,.166383,.690856,.496502,.639216,.170948,.694384,.493803,.643137,.175707,.6979,.491033,.647059,.180653,.701402,.488189,.65098,.185783,.704891,.485273,.654902,.19109,.708366,.482284,.658824,.196571,.711827,.479221,.662745,.202219,.715272,.476084,.666667,.20803,.718701,.472873,.670588,.214,.722114,.469588,.67451,.220124,.725509,.466226,.678431,.226397,.728888,.462789,.682353,.232815,.732247,.459277,.686275,.239374,.735588,.455688,.690196,.24607,.73891,.452024,.694118,.252899,.742211,.448284,.698039,.259857,.745492,.444467,.701961,.266941,.748751,.440573,.705882,.274149,.751988,.436601,.709804,.281477,.755203,.432552,.713725,.288921,.758394,.428426,.717647,.296479,.761561,.424223,.721569,.304148,.764704,.419943,.72549,.311925,.767822,.415586,.729412,.319809,.770914,.411152,.733333,.327796,.77398,.40664,.737255,.335885,.777018,.402049,.741176,.344074,.780029,.397381,.745098,.35236,.783011,.392636,.74902,.360741,.785964,.387814,.752941,.369214,.788888,.382914,.756863,.377779,.791781,.377939,.760784,.386433,.794644,.372886,.764706,.395174,.797475,.367757,.768627,.404001,.800275,.362552,.772549,.412913,.803041,.357269,.776471,.421908,.805774,.35191,.780392,.430983,.808473,.346476,.784314,.440137,.811138,.340967,.788235,.449368,.813768,.335384,.792157,.458674,.816363,.329727,.796078,.468053,.818921,.323998,.8,.477504,.821444,.318195,.803922,.487026,.823929,.312321,.807843,.496615,.826376,.306377,.811765,.506271,.828786,.300362,.815686,.515992,.831158,.294279,.819608,.525776,.833491,.288127,.823529,.535621,.835785,.281908,.827451,.545524,.838039,.275626,.831373,.555484,.840254,.269281,.835294,.565498,.84243,.262877,.839216,.575563,.844566,.256415,.843137,.585678,.846661,.249897,.847059,.595839,.848717,.243329,.85098,.606045,.850733,.236712,.854902,.616293,.852709,.230052,.858824,.626579,.854645,.223353,.862745,.636902,.856542,.21662,.866667,.647257,.8584,.209861,.870588,.657642,.860219,.203082,.87451,.668054,.861999,.196293,.878431,.678489,.863742,.189503,.882353,.688944,.865448,.182725,.886275,.699415,.867117,.175971,.890196,.709898,.868751,.169257,.894118,.720391,.87035,.162603,.898039,.730889,.871916,.156029,.901961,.741388,.873449,.149561,.905882,.751884,.874951,.143228,.909804,.762373,.876424,.137064,.913725,.772852,.877868,.131109,.917647,.783315,.879285,.125405,.921569,.79376,.880678,.120005,.92549,.804182,.882046,.114965,.929412,.814576,.883393,.110347,.933333,.82494,.88472,.106217,.937255,.83527,.886029,.102646,.941176,.845561,.887322,.099702,.945098,.85581,.888601,.097452,.94902,.866013,.889868,.095953,.952941,.876168,.891125,.09525,.956863,.886271,.892374,.095374,.960784,.89632,.893616,.096335,.964706,.906311,.894855,.098125,.968627,.916242,.896091,.100717,.972549,.926106,.89733,.104071,.976471,.935904,.89857,.108131,.980392,.945636,.899815,.112838,.984314,.9553,.901065,.118128,.988235,.964894,.902323,.123941,.992157,.974417,.90359,.130215,.996078,.983868,.904867,.136897,1,.993248,.906157,.143936]},{ShowIndexedColorActiveValues:1,IndexedColors:[.07,.5,.7,1,1,1,.85,1,1,.8,.5,1,.76,1,0,1,.71,.71,.5,.5,.5,.05,.05,1,1,.05,.05,.7,1,1,.7,.89,.96,.67,.36,.95,.54,1,0,.75,.65,.65,.5,.6,.6,1,.5,0,1,1,.19,.12,.94,.12,.5,.82,.89,.56,.25,.83,.24,1,0,.9,.9,.9,.75,.76,.78,.65,.65,.67,.54,.6,.78,.61,.48,.78,.5,.48,.78,.44,.48,.78,.36,.48,.76,1,.48,.38,.49,.5,.69,.76,.56,.56,.4,.56,.56,.74,.5,.89,1,.63,0,.65,.16,.16,.36,.72,.82,.44,.18,.69,0,1,0,.58,1,1,.58,.88,.88,.45,.76,.79,.33,.71,.71,.23,.62,.62,.14,.56,.56,.04,.49,.55,0,.41,.52,.88,.88,1,1,.85,.56,.65,.46,.45,.4,.5,.5,.62,.39,.71,.83,.48,0,.58,0,.58,.26,.62,.69,.34,.09,.56,0,.79,0,.44,.83,1,1,1,.78,.85,1,.78,.78,1,.78,.64,1,.78,.56,1,.78,.38,1,.78,.27,1,.78,.19,1,.78,.12,1,.78,0,1,.61,0,.9,.46,0,.83,.32,0,.75,.22,0,.67,.14,.3,.76,1,.3,.65,1,.13,.58,.84,.15,.49,.67,.15,.4,.59,.09,.33,.53,.96,.93,.82,.8,.82,.12,.71,.71,.76,.65,.33,.3,.34,.35,.38,.62,.31,.71,.67,.36,0,.46,.31,.27,.26,.51,.59,.26,0,.4,0,.49,0,.44,.67,.98,0,.73,1,0,.63,1,0,.56,1,0,.5,1,0,.42,1,.33,.36,.95,.47,.36,.89,.54,.31,.89,.63,.21,.83,.7,.12,.83,.7,.12,.73,.7,.05,.65,.74,.05,.53,.78,0,.4,.8,0,.35,.82,0,.31,.85,0,.27,.88,0,.22,.9,0,.18,.91,0,.15,.92,0,.14,.93,0,.13,.94,0,.12,.95,0,.11,.96,0,.1,.97,0,.09,.98,0,.08,.99,0,.07,1,0,.06],Annotations:[0,"Xx",1,"H",2,"He",3,"Li",4,"Be",5,"B",6,"C",7,"N",8,"O",9,"F",10,"Ne",11,"Na",12,"Mg",13,"Al",14,"Si",15,"P",16,"S",17,"Cl",18,"Ar",19,"K",20,"Ca",21,"Sc",22,"Ti",23,"V",24,"Cr",25,"Mn",26,"Fe",27,"Co",28,"Ni",29,"Cu",30,"Zn",31,"Ga",32,"Ge",33,"As",34,"Se",35,"Br",36,"Kr",37,"Rb",38,"Sr",39,"Y",40,"Zr",41,"Nb",42,"Mo",43,"Tc",44,"Ru",45,"Rh",46,"Pd",47,"Ag",48,"Cd",49,"In",50,"Sn",51,"Sb",52,"Te",53,"I",54,"Xe",55,"Cs",56,"Ba",57,"La",58,"Ce",59,"Pr",60,"Nd",61,"Pm",62,"Sm",63,"Eu",64,"Gd",65,"Tb",66,"Dy",67,"Ho",68,"Er",69,"Tm",70,"Yb",71,"Lu",72,"Hf",73,"Ta",74,"W",75,"Re",76,"Os",77,"Ir",78,"Pt",79,"Au",80,"Hg",81,"Tl",82,"Pb",83,"Bi",84,"Po",85,"At",86,"Rn",87,"Fr",88,"Ra",89,"Ac",90,"Th",91,"Pa",92,"U",93,"Np",94,"Pu",95,"Am",96,"Cm",97,"Bk",98,"Cf",99,"Es",100,"Fm",101,"Md",102,"No",103,"Lr",104,"Rf",105,"Db",106,"Sg",107,"Bh",108,"Hs",109,"Mt",110,"Ds",111,"Rg",112,"Cn",113,"Uut",114,"Uuq",115,"Uup",116,"Uuh",117,"Uus",118,"Uuo"],Name:"BlueObeliskElements"}]},function(e,t,n){"use strict";var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments[3];return new Promise(function(o,i){var s=n._messageId++;n._messages.set(s,[o,i,a]),n._worker.postMessage([s,t,e],r||[])})}},{key:"postMessage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2];return new Promise(function(a,o){var i=t._messageId++;t._messages.set(i,[a,o,r]),t._worker.postMessage([i,e],n||[])})}},{key:"emit",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(l&&u){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;M(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){(function(e){var r;!function(e,a,o){function i(e){var t=this,n=function(){var e=4022871197;return function(t){t=String(t);for(var n=0;n>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)}}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=n(" "),t.s1=n(" "),t.s2=n(" "),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var n=new i(e),r=t&&t.state,a=n.next;return a.int32=function(){return 4294967296*n.next()|0},a.double=function(){return a()+1.1102230246251565e-16*(2097152*a()|0)},a.quick=a,r&&("object"==typeof r&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=l:n(2)&&n(4)?void 0===(r=function(){return l}.call(t,n,t,a))||(a.exports=r):this.alea=l}(0,e,n(2))}).call(this,n(3)(e))},function(e,t,n){(function(e){var r;!function(e,a,o){function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function s(e,t){var n=new function(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=s:n(2)&&n(4)?void 0===(r=function(){return s}.call(t,n,t,a))||(a.exports=r):this.xor128=s}(0,e,n(2))}).call(this,n(3)(e))},function(e,t,n){(function(e){var r;!function(e,a,o){function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function s(e,t){var n=new function(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r>>4),t.next()}(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=s:n(2)&&n(4)?void 0===(r=function(){return s}.call(t,n,t,a))||(a.exports=r):this.xorwow=s}(0,e,n(2))}).call(this,n(3)(e))},function(e,t,n){(function(e){var r;!function(e,a,o){function i(e,t){return t.x=e.x.slice(),t.i=e.i,t}function s(e,t){null==e&&(e=+new Date);var n=new function(e){var t=this;t.next=function(){var e,n,r=t.x,a=t.i;return e=r[a],n=(e^=e>>>7)^e<<24,n^=(e=r[a+1&7])^e>>>10,n^=(e=r[a+3&7])^e>>>3,n^=(e=r[a+4&7])^e<<7,e=r[a+7&7],n^=(e^=e<<13)^e<<9,r[a]=n,t.i=a+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n0;--n)e.next()}(t,e)}(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&(r.x&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=s:n(2)&&n(4)?void 0===(r=function(){return s}.call(t,n,t,a))||(a.exports=r):this.xorshift7=s}(0,e,n(2))}).call(this,n(3)(e))},function(e,t,n){(function(e){var r;!function(e,a,o){function i(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function s(e,t){null==e&&(e=+new Date);var n=new function(e){var t=this;t.next=function(){var e,n,r=t.w,a=t.X,o=t.i;return t.w=r=r+1640531527|0,n=a[o+34&127],e=a[o=o+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=a[o]=n^e,t.i=o,n+(r^r>>>16)|0},function(e,t){var n,r,a,o,i,s=[],l=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,l=Math.max(l,t.length)),a=0,o=-32;o>>15,r^=r<<4,r^=r>>>13,o>=0&&(i=i+1640531527|0,a=0==(n=s[127&o]^=r+i)?a+1:0);for(a>=128&&(s[127&(t&&t.length||0)]=-1),a=127,o=512;o>0;--o)r=s[a+34&127],n=s[a=a+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[a]=r^n;e.w=i,e.X=s,e.i=a}(t,e)}(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&(r.X&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=s:n(2)&&n(4)?void 0===(r=function(){return s}.call(t,n,t,a))||(a.exports=r):this.xor4096=s}(0,e,n(2))}).call(this,n(3)(e))},function(e,t,n){(function(e){var r;!function(e,a,o){function i(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function s(e,t){var n=new function(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,a=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^a,t.a=a-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=s:n(2)&&n(4)?void 0===(r=function(){return s}.call(t,n,t,a))||(a.exports=r):this.tychei=s}(0,e,n(2))}).call(this,n(3)(e))},function(e,t,n){var r;!function(a,o,i){var s,l=256,u=6,c="random",d=i.pow(l,u),f=i.pow(2,52),p=2*f,g=l-1;function m(e,t,n){var r=[],m=h(function e(t,n){var r,a=[],o=typeof t;if(n&&"object"==o)for(r in t)try{a.push(e(t[r],n-1))}catch(e){}return a.length?a:"string"==o?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(o)]:null==e?function(){try{var e;return s&&(e=s.randomBytes)?e=e(l):(e=new Uint8Array(l),(a.crypto||a.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=a.navigator,n=t&&t.plugins;return[+new Date,a,n,a.screen,y(o)]}}():e,3),r),b=new function(e){var t,n=e.length,r=this,a=0,o=r.i=r.j=0,i=r.S=[];n||(e=[n++]);for(;a=p;)e/=2,t/=2,n>>>=1;return(e+n)/t};return T.int32=function(){return 0|b.g(4)},T.quick=function(){return b.g(4)/4294967296},T.double=T,h(y(b.S),o),(t.pass||n||function(e,t,n,r){return r&&(r.S&&v(r,b),e.state=function(){return v(b,{})}),n?(i[c]=e,t):e})(T,m,"global"in t?t.global:this==i,t.state)}function v(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function h(e,t){for(var n,r=e+"",a=0;a1?t-1:0),r=1;r0?(n[0]=2*(s*i+d*r+l*o-u*a)/f,n[1]=2*(l*i+d*a+u*r-s*o)/f,n[2]=2*(u*i+d*o+s*a-l*r)/f):(n[0]=2*(s*i+d*r+l*o-u*a),n[1]=2*(l*i+d*a+u*r-s*o),n[2]=2*(u*i+d*o+s*a-l*r)),ye(e,t,n),e}function Te(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Ce(e,t){var n=t[0],r=t[1],a=t[2],o=t[4],i=t[5],s=t[6],l=t[8],u=t[9],c=t[10];return e[0]=Math.hypot(n,r,a),e[1]=Math.hypot(o,i,s),e[2]=Math.hypot(l,u,c),e}function Se(e,t){var n=new c(3);Ce(n,t);var r=1/n[0],a=1/n[1],o=1/n[2],i=t[0]*r,s=t[1]*a,l=t[2]*o,u=t[4]*r,d=t[5]*a,f=t[6]*o,p=t[8]*r,g=t[9]*a,m=t[10]*o,v=i+d+m,h=0;return v>0?(h=2*Math.sqrt(v+1),e[3]=.25*h,e[0]=(f-g)/h,e[1]=(p-l)/h,e[2]=(s-u)/h):i>d&&i>m?(h=2*Math.sqrt(1+i-d-m),e[3]=(f-g)/h,e[0]=.25*h,e[1]=(s+u)/h,e[2]=(p+l)/h):d>m?(h=2*Math.sqrt(1+d-i-m),e[3]=(p-l)/h,e[0]=(s+u)/h,e[1]=.25*h,e[2]=(f+g)/h):(h=2*Math.sqrt(1+m-i-d),e[3]=(s-u)/h,e[0]=(p+l)/h,e[1]=(f+g)/h,e[2]=.25*h),e}function Pe(e,t,n,r){var a=t[0],o=t[1],i=t[2],s=t[3],l=a+a,u=o+o,c=i+i,d=a*l,f=a*u,p=a*c,g=o*u,m=o*c,v=i*c,h=s*l,y=s*u,b=s*c,T=r[0],C=r[1],S=r[2];return e[0]=(1-(g+v))*T,e[1]=(f+b)*T,e[2]=(p-y)*T,e[3]=0,e[4]=(f-b)*C,e[5]=(1-(d+v))*C,e[6]=(m+h)*C,e[7]=0,e[8]=(p+y)*S,e[9]=(m-h)*S,e[10]=(1-(d+g))*S,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function we(e,t,n,r,a){var o=t[0],i=t[1],s=t[2],l=t[3],u=o+o,c=i+i,d=s+s,f=o*u,p=o*c,g=o*d,m=i*c,v=i*d,h=s*d,y=l*u,b=l*c,T=l*d,C=r[0],S=r[1],P=r[2],w=a[0],x=a[1],O=a[2],M=(1-(m+h))*C,A=(p+T)*C,I=(g-b)*C,R=(p-T)*S,E=(1-(f+h))*S,D=(v+y)*S,V=(g+b)*P,L=(v-y)*P,N=(1-(f+m))*P;return e[0]=M,e[1]=A,e[2]=I,e[3]=0,e[4]=R,e[5]=E,e[6]=D,e[7]=0,e[8]=V,e[9]=L,e[10]=N,e[11]=0,e[12]=n[0]+w-(M*w+R*x+V*O),e[13]=n[1]+x-(A*w+E*x+L*O),e[14]=n[2]+O-(I*w+D*x+N*O),e[15]=1,e}function xe(e,t){var n=t[0],r=t[1],a=t[2],o=t[3],i=n+n,s=r+r,l=a+a,u=n*i,c=r*i,d=r*s,f=a*i,p=a*s,g=a*l,m=o*i,v=o*s,h=o*l;return e[0]=1-d-g,e[1]=c+h,e[2]=f-v,e[3]=0,e[4]=c-h,e[5]=1-u-g,e[6]=p+m,e[7]=0,e[8]=f+v,e[9]=p-m,e[10]=1-u-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Oe(e,t,n,r,a,o,i){var s=1/(n-t),l=1/(a-r),u=1/(o-i);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(a+r)*l,e[10]=(i+o)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*o*2*u,e[15]=0,e}function Me(e,t,n,r,a){var o,i=1/Math.tan(t/2);return e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=a&&a!==1/0?(o=1/(r-a),e[10]=(a+r)*o,e[14]=2*a*r*o):(e[10]=-1,e[14]=-2*r),e}function Ae(e,t,n,r){var a=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(i+s),u=2/(a+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(i-s)*l*.5,e[9]=(a-o)*u*.5,e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e}function Ie(e,t,n,r,a,o,i){var s=1/(t-n),l=1/(r-a),u=1/(o-i);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+n)*s,e[13]=(a+r)*l,e[14]=(i+o)*u,e[15]=1,e}function Re(e,t,n,r){var a,o,i,s,l,c,d,f,p,g,m=t[0],v=t[1],h=t[2],y=r[0],b=r[1],T=r[2],C=n[0],S=n[1],P=n[2];return Math.abs(m-C)0&&(c*=p=1/Math.sqrt(p),d*=p,f*=p);var g=l*f-u*d,m=u*c-s*f,v=s*d-l*c;return(p=g*g+m*m+v*v)>0&&(g*=p=1/Math.sqrt(p),m*=p,v*=p),e[0]=g,e[1]=m,e[2]=v,e[3]=0,e[4]=d*v-f*m,e[5]=f*g-c*v,e[6]=c*m-d*g,e[7]=0,e[8]=c,e[9]=d,e[10]=f,e[11]=0,e[12]=a,e[13]=o,e[14]=i,e[15]=1,e}function De(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function Ve(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Le(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function Ne(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function Be(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}function ke(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e[9]=t[9]+n[9]*r,e[10]=t[10]+n[10]*r,e[11]=t[11]+n[11]*r,e[12]=t[12]+n[12]*r,e[13]=t[13]+n[13]*r,e[14]=t[14]+n[14]*r,e[15]=t[15]+n[15]*r,e}function Fe(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function Ge(e,t){var n=e[0],r=e[1],a=e[2],o=e[3],i=e[4],s=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],m=e[12],v=e[13],h=e[14],y=e[15],b=t[0],T=t[1],C=t[2],S=t[3],P=t[4],w=t[5],x=t[6],O=t[7],M=t[8],A=t[9],I=t[10],R=t[11],E=t[12],D=t[13],V=t[14],L=t[15];return Math.abs(n-b)<=u*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(r-T)<=u*Math.max(1,Math.abs(r),Math.abs(T))&&Math.abs(a-C)<=u*Math.max(1,Math.abs(a),Math.abs(C))&&Math.abs(o-S)<=u*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(i-P)<=u*Math.max(1,Math.abs(i),Math.abs(P))&&Math.abs(s-w)<=u*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(l-x)<=u*Math.max(1,Math.abs(l),Math.abs(x))&&Math.abs(c-O)<=u*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(d-M)<=u*Math.max(1,Math.abs(d),Math.abs(M))&&Math.abs(f-A)<=u*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(p-I)<=u*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(g-R)<=u*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(m-E)<=u*Math.max(1,Math.abs(m),Math.abs(E))&&Math.abs(v-D)<=u*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(h-V)<=u*Math.max(1,Math.abs(h),Math.abs(V))&&Math.abs(y-L)<=u*Math.max(1,Math.abs(y),Math.abs(L))}var _e=oe,Ue=Ne;function je(){var e=new c(3);return c!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function We(e){var t=new c(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ze(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function He(e,t,n){var r=new c(3);return r[0]=e,r[1]=t,r[2]=n,r}function Ke(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Xe(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function qe(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function Ye(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function Ze(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function Qe(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function $e(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function Je(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function et(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function tt(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function nt(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}function rt(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function at(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e}function ot(e,t){var n=t[0]-e[0],r=t[1]-e[1],a=t[2]-e[2];return Math.hypot(n,r,a)}function it(e,t){var n=t[0]-e[0],r=t[1]-e[1],a=t[2]-e[2];return n*n+r*r+a*a}function st(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r}function lt(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function ut(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function ct(e,t){var n=t[0],r=t[1],a=t[2],o=n*n+r*r+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function dt(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ft(e,t,n){var r=t[0],a=t[1],o=t[2],i=n[0],s=n[1],l=n[2];return e[0]=a*l-o*s,e[1]=o*i-r*l,e[2]=r*s-a*i,e}function pt(e,t,n,r){var a=t[0],o=t[1],i=t[2];return e[0]=a+r*(n[0]-a),e[1]=o+r*(n[1]-o),e[2]=i+r*(n[2]-i),e}function gt(e,t,n,r,a,o){var i=o*o,s=i*(2*o-3)+1,l=i*(o-2)+o,u=i*(o-1),c=i*(3-2*o);return e[0]=t[0]*s+n[0]*l+r[0]*u+a[0]*c,e[1]=t[1]*s+n[1]*l+r[1]*u+a[1]*c,e[2]=t[2]*s+n[2]*l+r[2]*u+a[2]*c,e}function mt(e,t,n,r,a,o){var i=1-o,s=i*i,l=o*o,u=s*i,c=3*o*s,d=3*l*i,f=l*o;return e[0]=t[0]*u+n[0]*c+r[0]*d+a[0]*f,e[1]=t[1]*u+n[1]*c+r[1]*d+a[1]*f,e[2]=t[2]*u+n[2]*c+r[2]*d+a[2]*f,e}function vt(e,t){t=t||1;var n=2*d()*Math.PI,r=2*d()-1,a=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(n)*a,e[1]=Math.sin(n)*a,e[2]=r*t,e}function ht(e,t,n){var r=t[0],a=t[1],o=t[2],i=n[3]*r+n[7]*a+n[11]*o+n[15];return i=i||1,e[0]=(n[0]*r+n[4]*a+n[8]*o+n[12])/i,e[1]=(n[1]*r+n[5]*a+n[9]*o+n[13])/i,e[2]=(n[2]*r+n[6]*a+n[10]*o+n[14])/i,e}function yt(e,t,n){var r=t[0],a=t[1],o=t[2];return e[0]=r*n[0]+a*n[3]+o*n[6],e[1]=r*n[1]+a*n[4]+o*n[7],e[2]=r*n[2]+a*n[5]+o*n[8],e}function bt(e,t,n){var r=n[0],a=n[1],o=n[2],i=n[3],s=t[0],l=t[1],u=t[2],c=a*u-o*l,d=o*s-r*u,f=r*l-a*s,p=a*f-o*d,g=o*c-r*f,m=r*d-a*c,v=2*i;return c*=v,d*=v,f*=v,p*=2,g*=2,m*=2,e[0]=s+c+p,e[1]=l+d+g,e[2]=u+f+m,e}function Tt(e,t,n,r){var a=[],o=[];return a[0]=t[0]-n[0],a[1]=t[1]-n[1],a[2]=t[2]-n[2],o[0]=a[0],o[1]=a[1]*Math.cos(r)-a[2]*Math.sin(r),o[2]=a[1]*Math.sin(r)+a[2]*Math.cos(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function Ct(e,t,n,r){var a=[],o=[];return a[0]=t[0]-n[0],a[1]=t[1]-n[1],a[2]=t[2]-n[2],o[0]=a[2]*Math.sin(r)+a[0]*Math.cos(r),o[1]=a[1],o[2]=a[2]*Math.cos(r)-a[0]*Math.sin(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function St(e,t,n,r){var a=[],o=[];return a[0]=t[0]-n[0],a[1]=t[1]-n[1],a[2]=t[2]-n[2],o[0]=a[0]*Math.cos(r)-a[1]*Math.sin(r),o[1]=a[0]*Math.sin(r)+a[1]*Math.cos(r),o[2]=a[2],e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function Pt(e,t){var n=e[0],r=e[1],a=e[2],o=t[0],i=t[1],s=t[2],l=Math.sqrt(n*n+r*r+a*a)*Math.sqrt(o*o+i*i+s*s),u=l&&dt(e,t)/l;return Math.acos(Math.min(Math.max(u,-1),1))}function wt(e){return e[0]=0,e[1]=0,e[2]=0,e}function xt(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function Ot(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Mt(e,t){var n=e[0],r=e[1],a=e[2],o=t[0],i=t[1],s=t[2];return Math.abs(n-o)<=u*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-i)<=u*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(a-s)<=u*Math.max(1,Math.abs(a),Math.abs(s))}var At=Ye,It=Ze,Rt=Qe,Et=ot,Dt=it,Vt=ze,Lt=st,Nt=function(){var e=je();return function(t,n,r,a,o,i){var s,l;for(n||(n=3),r||(r=0),l=a?Math.min(a*n+r,t.length):t.length,s=r;s0&&(i=1/Math.sqrt(i)),e[0]=n*i,e[1]=r*i,e[2]=a*i,e[3]=o*i,e}function on(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function sn(e,t,n,r){var a=n[0]*r[1]-n[1]*r[0],o=n[0]*r[2]-n[2]*r[0],i=n[0]*r[3]-n[3]*r[0],s=n[1]*r[2]-n[2]*r[1],l=n[1]*r[3]-n[3]*r[1],u=n[2]*r[3]-n[3]*r[2],c=t[0],d=t[1],f=t[2],p=t[3];return e[0]=d*u-f*l+p*s,e[1]=-c*u+f*i-p*o,e[2]=c*l-d*i+p*a,e[3]=-c*s+d*o-f*a,e}function ln(e,t,n,r){var a=t[0],o=t[1],i=t[2],s=t[3];return e[0]=a+r*(n[0]-a),e[1]=o+r*(n[1]-o),e[2]=i+r*(n[2]-i),e[3]=s+r*(n[3]-s),e}function un(e,t){var n,r,a,o,i,s;t=t||1;do{i=(n=2*d()-1)*n+(r=2*d()-1)*r}while(i>=1);do{s=(a=2*d()-1)*a+(o=2*d()-1)*o}while(s>=1);var l=Math.sqrt((1-i)/s);return e[0]=t*n,e[1]=t*r,e[2]=t*a*l,e[3]=t*o*l,e}function cn(e,t,n){var r=t[0],a=t[1],o=t[2],i=t[3];return e[0]=n[0]*r+n[4]*a+n[8]*o+n[12]*i,e[1]=n[1]*r+n[5]*a+n[9]*o+n[13]*i,e[2]=n[2]*r+n[6]*a+n[10]*o+n[14]*i,e[3]=n[3]*r+n[7]*a+n[11]*o+n[15]*i,e}function dn(e,t,n){var r=t[0],a=t[1],o=t[2],i=n[0],s=n[1],l=n[2],u=n[3],c=u*r+s*o-l*a,d=u*a+l*r-i*o,f=u*o+i*a-s*r,p=-i*r-s*a-l*o;return e[0]=c*u+p*-i+d*-l-f*-s,e[1]=d*u+p*-s+f*-i-c*-l,e[2]=f*u+p*-l+c*-s-d*-i,e[3]=t[3],e}function fn(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function pn(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function gn(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function mn(e,t){var n=e[0],r=e[1],a=e[2],o=e[3],i=t[0],s=t[1],l=t[2],c=t[3];return Math.abs(n-i)<=u*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-s)<=u*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(a-l)<=u*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(o-c)<=u*Math.max(1,Math.abs(o),Math.abs(c))}var vn=jt,hn=Wt,yn=zt,bn=$t,Tn=Jt,Cn=en,Sn=tn,Pn=function(){var e=Bt();return function(t,n,r,a,o,i){var s,l;for(n||(n=4),r||(r=0),l=a?Math.min(a*n+r,t.length):t.length,s=r;su?(e[0]=t[0]/r,e[1]=t[1]/r,e[2]=t[2]/r):(e[0]=1,e[1]=0,e[2]=0),n}function An(e,t){var n=Qn(e,t);return Math.acos(2*n*n-1)}function In(e,t,n){var r=t[0],a=t[1],o=t[2],i=t[3],s=n[0],l=n[1],u=n[2],c=n[3];return e[0]=r*c+i*s+a*u-o*l,e[1]=a*c+i*l+o*s-r*u,e[2]=o*c+i*u+r*l-a*s,e[3]=i*c-r*s-a*l-o*u,e}function Rn(e,t,n){n*=.5;var r=t[0],a=t[1],o=t[2],i=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+i*s,e[1]=a*l+o*s,e[2]=o*l-a*s,e[3]=i*l-r*s,e}function En(e,t,n){n*=.5;var r=t[0],a=t[1],o=t[2],i=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l-o*s,e[1]=a*l+i*s,e[2]=o*l+r*s,e[3]=i*l-a*s,e}function Dn(e,t,n){n*=.5;var r=t[0],a=t[1],o=t[2],i=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+a*s,e[1]=a*l-r*s,e[2]=o*l+i*s,e[3]=i*l-o*s,e}function Vn(e,t){var n=t[0],r=t[1],a=t[2];return e[0]=n,e[1]=r,e[2]=a,e[3]=Math.sqrt(Math.abs(1-n*n-r*r-a*a)),e}function Ln(e,t){var n=t[0],r=t[1],a=t[2],o=t[3],i=Math.sqrt(n*n+r*r+a*a),s=Math.exp(o),l=i>0?s*Math.sin(i)/i:0;return e[0]=n*l,e[1]=r*l,e[2]=a*l,e[3]=s*Math.cos(i),e}function Nn(e,t){var n=t[0],r=t[1],a=t[2],o=t[3],i=Math.sqrt(n*n+r*r+a*a),s=i>0?Math.atan2(i,o)/i:0;return e[0]=n*s,e[1]=r*s,e[2]=a*s,e[3]=.5*Math.log(n*n+r*r+a*a+o*o),e}function Bn(e,t,n){return Nn(e,t),Zn(e,e,n),Ln(e,e),e}function kn(e,t,n,r){var a,o,i,s,l,c=t[0],d=t[1],f=t[2],p=t[3],g=n[0],m=n[1],v=n[2],h=n[3];return(o=c*g+d*m+f*v+p*h)<0&&(o=-o,g=-g,m=-m,v=-v,h=-h),1-o>u?(a=Math.acos(o),i=Math.sin(a),s=Math.sin((1-r)*a)/i,l=Math.sin(r*a)/i):(s=1-r,l=r),e[0]=s*c+l*g,e[1]=s*d+l*m,e[2]=s*f+l*v,e[3]=s*p+l*h,e}function Fn(e){var t=d(),n=d(),r=d(),a=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=a*Math.sin(2*Math.PI*n),e[1]=a*Math.cos(2*Math.PI*n),e[2]=o*Math.sin(2*Math.PI*r),e[3]=o*Math.cos(2*Math.PI*r),e}function Gn(e,t){var n=t[0],r=t[1],a=t[2],o=t[3],i=n*n+r*r+a*a+o*o,s=i?1/i:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-a*s,e[3]=o*s,e}function _n(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function Un(e,t){var n,r=t[0]+t[4]+t[8];if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var a=0;t[4]>t[0]&&(a=1),t[8]>t[3*a+a]&&(a=2);var o=(a+1)%3,i=(a+2)%3;n=Math.sqrt(t[3*a+a]-t[3*o+o]-t[3*i+i]+1),e[a]=.5*n,n=.5/n,e[3]=(t[3*o+i]-t[3*i+o])*n,e[o]=(t[3*o+a]+t[3*a+o])*n,e[i]=(t[3*i+a]+t[3*a+i])*n}return e}function jn(e,t,n,r){var a=.5*Math.PI/180;t*=a,n*=a,r*=a;var o=Math.sin(t),i=Math.cos(t),s=Math.sin(n),l=Math.cos(n),u=Math.sin(r),c=Math.cos(r);return e[0]=o*l*c-i*s*u,e[1]=i*s*c+o*l*u,e[2]=i*l*u-o*s*c,e[3]=i*l*c+o*s*u,e}function Wn(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var zn=kt,Hn=Ft,Kn=Gt,Xn=_t,qn=Ut,Yn=In,Zn=Zt,Qn=on,$n=ln,Jn=en,er=Jn,tr=tn,nr=tr,rr=an,ar=gn,or=mn,ir=function(){var e=je(),t=He(1,0,0),n=He(0,1,0);return function(r,a,o){var i=dt(a,o);return i<-.999999?(ft(e,t,a),Vt(e)<1e-6&&ft(e,n,a),ct(e,e),On(r,e,Math.PI),r):i>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(ft(e,a,o),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+i,rr(r,r))}}(),sr=function(){var e=wn(),t=wn();return function(n,r,a,o,i,s){return kn(e,r,i,s),kn(t,a,o,s),kn(n,e,t,2*s*(1-s)),n}}(),lr=function(){var e=v();return function(t,n,r,a){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=a[0],e[4]=a[1],e[7]=a[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],rr(t,Un(t,e))}}(),ur=n(0),cr=ur.a.vtkErrorMacro;var dr={parent:null,renderable:null,myFactory:null,children:[],visited:!1};function fr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dr,n),ur.a.obj(e,t),ur.a.event(e,t,"event"),t._renderableChildMap=new Map,ur.a.get(e,t,["visited"]),ur.a.setGet(e,t,["parent","renderable","myFactory"]),ur.a.getArray(e,t,["children"]),function(e,t){t.classHierarchy.push("vtkViewNode"),e.build=function(e){},e.render=function(e){},e.traverse=function(n){var r=n.getTraverseOperation(),a=e[r];if(a)a(n);else{e.apply(n,!0);for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gr,n),ur.a.obj(e,t),function(e,t){t.overrides||(t.overrides={}),t.classHierarchy.push("vtkViewNodeFactory"),e.createNode=function(n){if(n.isDeleted())return null;for(var r=0,a=n.getClassName(r++),o=!1,i=Object.keys(t.overrides);a&&!o;)-1!==i.indexOf(a)?o=!0:a=n.getClassName(r++);if(!o)return null;var s=t.overrides[a]();return s.setMyFactory(e),s},e.registerOverride=function(e,n){t.overrides[e]=n}}(e,t)}var vr={newInstance:ur.a.newInstance(mr,"vtkViewNodeFactory"),extend:mr},hr=Object.create(null);function yr(e,t){hr[e]=t}var br={};function Tr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,br,n),t.overrides=hr,vr.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkOpenGLViewNodeFactory")}(0,t)}var Cr={newInstance:ur.a.newInstance(Tr,"vtkOpenGLViewNodeFactory"),extend:Tr};var Sr={context:null,lastRenderer:null,keyMatrixTime:null,keyMatrices:null};function Pr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Sr,n),pr.extend(e,t,n),t.keyMatrixTime={},ur.g(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(9),vcpc:new Float64Array(16),wcvc:new Float64Array(16),wcpc:new Float64Array(16)},ur.i(e,t,["context","keyMatrixTime"]),function(e,t){t.classHierarchy.push("vtkOpenGLCamera"),e.buildPass=function(n){n&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext())},e.opaquePass=function(e){if(e){var n=t.openGLRenderer.getTiledSizeAndOrigin();t.context.viewport(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize),t.context.scissor(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize)}},e.translucentPass=e.opaquePass,e.opaqueZBufferPass=e.opaquePass,e.volumePass=e.opaquePass,e.getKeyMatrices=function(n){if(n!==t.lastRenderer||t.openGLRenderWindow.getMTime()>t.keyMatrixTime.getMTime()||e.getMTime()>t.keyMatrixTime.getMTime()||n.getMTime()>t.keyMatrixTime.getMTime()||t.renderable.getMTime()>t.keyMatrixTime.getMTime()){o.copy(t.keyMatrices.wcvc,t.renderable.getViewMatrix()),a.fromMat4(t.keyMatrices.normalMatrix,t.keyMatrices.wcvc),a.invert(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),o.transpose(t.keyMatrices.wcvc,t.keyMatrices.wcvc);var r=t.openGLRenderer.getAspectRatio();o.copy(t.keyMatrices.vcpc,t.renderable.getProjectionMatrix(r,-1,1)),o.transpose(t.keyMatrices.vcpc,t.keyMatrices.vcpc),o.multiply(t.keyMatrices.wcpc,t.keyMatrices.vcpc,t.keyMatrices.wcvc),t.keyMatrixTime.modified(),t.lastRenderer=n}return t.keyMatrices}}(e,t)}var wr=ur.d(Pr);yr("vtkCamera",wr);var xr=n(8),Or=n.n(xr);function Mr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ar(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ar(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:3,t=[];t.length1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=1/0,a=-1/0,o=t,i=e.length;o1&&void 0!==arguments[1]?arguments[1]:3;switch(t){case 1:return Math.abs(e);case 2:return Math.sqrt(e[0]*e[0]+e[1]*e[1]);case 3:return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);default:for(var n=0,r=0;r2&&void 0!==arguments[2]?arguments[2]:1e-6;if(e.length!==t.length)return!1;return e.every(function(e,r){return Math.abs(e-t[r])<=n})}var ma=ga;function va(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!"".concat(e).includes("e"))return+"".concat(Math.round("".concat(e,"e+").concat(t)),"e-").concat(t);var n="".concat(e).split("e"),r="";return+n[1]+t>0&&(r="+"),+"".concat(Math.round("".concat(+n[0],"e").concat(r).concat(+n[1]+t)),"e-").concat(t)}function ha(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t[0]=va(e[0],n),t[1]=va(e[1],n),t[2]=va(e[2],n),t}function ya(e,t,n,r){var a,o,i,s,l,u,c,d,f,p,g,m,v,h,y,b,T=Br(t),C=Br(t),S=function(e,t,n,r,a){h=e[t][n],v=e[r][a],e[t][n]=h-m*(v+h*p),e[r][a]=v+m*(h-v*p)};for(l=0;l3&&Math.abs(n[l])+h===Math.abs(n[l])&&Math.abs(n[s])+h===Math.abs(n[s]))e[l][s]=0;else if(Math.abs(e[l][s])>c){for(v=n[s]-n[l],Math.abs(v)+h===Math.abs(v)?f=e[l][s]/v:(d=.5*v/e[l][s],f=1/(Math.abs(d)+Math.sqrt(1+d*d)),d<0&&(f=-f)),y=1/Math.sqrt(1+f*f),p=(m=f*y)/(1+y),v=f*e[l][s],C[l]-=v,C[s]+=v,n[l]-=v,n[s]+=v,e[l][s]=0,o=0;o<=l-1;o++)S(e,o,l,o,s);for(o=l+1;o<=s-1;o++)S(e,l,o,o,s);for(o=s+1;o=Dr)return Rr("vtkMath::Jacobi: Error extracting eigenfunctions"),0;for(o=0;o=b&&(b=n[i=a]);if(i!==o)for(n[i]=n[o],n[o]=b,a=0;a>1)+(1&t);for(o=0;o=0&&u++;if(u(r=l>s?l:s)?u:r,a[i]=1,0!==r&&(a[i]/=r)}var c=Math.abs(t[0][0])*a[0],d=Math.abs(t[1][0])*a[1],f=Math.abs(t[2][0])*a[2];o[0]=0,d>=(r=c)&&(r=d,o[0]=1),f>=r&&(o[0]=2),0!==o[0]&&(Nr(t[o[0]],t[0]),a[o[0]]=a[0]);var p=Math.abs(t[1][1])*a[1],g=Math.abs(t[2][1])*a[2];o[1]=1,g>=(r=p)&&(o[1]=2,Nr(t[2],t[1])),o[2]=2;var m=0;if(fa(t)<0){m=1;for(var v=0;v<3;v++)t[0][v]=-t[0][v],t[1][v]=-t[1][v],t[2][v]=-t[2][v]}var h=Br(4);if(ba(t,h),pa(h,t),m)for(var y=0;y<3;y++)t[0][y]=-t[0][y],t[1][y]=-t[1][y],t[2][y]=-t[2][y];1!==o[1]&&Nr(t[o[1]],t[1]),0!==o[0]&&Nr(t[o[0]],t[0])}function Ca(e,t,n){var r,a,o,i,s,l,u=[Br(3),Br(3),Br(3)],c=Br(3),d=Br(3);for(r=0;r<3;r++)u[r][0]=e[r][0],u[r][1]=e[r][1],u[r][2]=e[r][2],c[r]=u[r],d[r]=n[r];if(ya(c,3,t,d),t[0]!==t[1]||t[0]!==t[2]){for(ca(n,n),r=0;r<3;r++)if(t[(r+1)%3]===t[(r+2)%3]){for(l=Math.abs(n[r][0]),i=0,a=1;a<3;a++)l<(s=Math.abs(n[r][a]))&&(l=s,i=a);return i!==r&&(s=t[i],t[i]=t[r],t[r]=s,Nr(n[r],n[i])),n[i][i]<0&&(n[i][0]=-n[i][0],n[i][1]=-n[i][1],n[i][2]=-n[i][2]),o=(i+2)%3,n[a=(i+1)%3][0]=0,n[a][1]=0,n[a][2]=0,n[a][a]=1,ta(n[i],n[a],n[o]),ra(n[o]),ta(n[o],n[i],n[a]),void ca(n,n)}for(l=Math.abs(n[0][0]),i=0,r=1;r<3;r++)l<(s=Math.abs(n[r][0]))&&(l=s,i=r);for(0!==i&&(s=t[i],t[i]=t[0],t[0]=s,Nr(n[i],n[0])),Math.abs(n[1][1])i&&(i=u);if(0===i)return Rr("Unable to factor linear system"),0;d[r]=1/i}for(a=0;a=i&&(i=l,c=r)}if(a!==c){for(o=0;o=0)for(o=i;o<=a-1;o++)l-=e[a][o]*n[o];else 0!==l&&(i=a);n[a]=l}for(a=r-1;a>=0;a--){for(l=n[a],o=a+1;o3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=r||Br(n),i=a||Br(n);if(0===Sa(e,o,n))return 0;for(var s=0;sl?l=i:il?l=s:s0?(l-u)/l:0)>0?(n=o===l?1/6*(i-s)/(l-u):i===l?1/3+1/6*(s-o)/(l-u):2/3+1/6*(o-i)/(l-u))<0&&(n+=1):n=0,t[0]=n,t[1]=r,t[2]=c}function Aa(e,t){var n,r,a,o=Mr(e,3),i=o[0],s=o[1],l=o[2];i>1/6&&i<=1/3?(r=1,n=(1/3-i)/(1/6),a=0):i>1/3&&i<=.5?(r=1,a=(i-1/3)/(1/6),n=0):i>.5&&i<=2/3?(a=1,r=(2/3-i)/(1/6),n=0):i>2/3&&i<=5/6?(a=1,n=(i-2/3)/(1/6),r=0):i>5/6&&i<=1?(n=1,a=(1-i)/(1/6),r=0):(n=1,r=i/(1/6),a=0),n=s*n+(1-s),r=s*r+(1-s),a=s*a+(1-s),n*=l,r*=l,a*=l,t[0]=n,t[1]=r,t[2]=a}function Ia(e,t){var n=Mr(e,3),r=(n[0]+16)/116,a=n[1]/500+r,o=r-n[2]/200;r=Math.pow(r,3)>.008856?Math.pow(r,3):(r-16/116)/7.787,a=Math.pow(a,3)>.008856?Math.pow(a,3):(a-16/116)/7.787,o=Math.pow(o,3)>.008856?Math.pow(o,3):(o-16/116)/7.787;t[0]=.9505*a,t[1]=1*r,t[2]=1.089*o}function Ra(e,t){var n=Mr(e,3),r=n[0]/.9505,a=n[1]/1,o=n[2]/1.089;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,t[0]=116*a-16,t[1]=500*(r-a),t[2]=200*(a-o)}function Ea(e,t){var n=Mr(e,3),r=n[0],a=n[1],o=n[2],i=3.2406*r+-1.5372*a+-.4986*o,s=-.9689*r+1.8758*a+.0415*o,l=.0557*r+-.204*a+1.057*o;i>.0031308?i=1.055*Math.pow(i,1/2.4)-.055:i*=12.92,s>.0031308?s=1.055*Math.pow(s,1/2.4)-.055:s*=12.92,l>.0031308?l=1.055*Math.pow(l,1/2.4)-.055:l*=12.92;var u=i;u1&&(i/=u,s/=u,l/=u),i<0&&(i=0),s<0&&(s=0),l<0&&(l=0),t[0]=i,t[1]=s,t[2]=l}function Da(e,t){var n=Mr(e,3),r=n[0],a=n[1],o=n[2];r>.04045?r=Math.pow((r+.055)/1.055,2.4):r/=12.92,a>.04045?a=Math.pow((a+.055)/1.055,2.4):a/=12.92,o>.04045?o=Math.pow((o+.055)/1.055,2.4):o/=12.92,t[0]=.4124*r+.3576*a+.1805*o,t[1]=.2126*r+.7152*a+.0722*o,t[2]=.0193*r+.1192*a+.9505*o}function Va(e,t){var n=[0,0,0];Da(e,n),Ra(n,t)}function La(e,t){var n=[0,0,0];Ia(e,n),Ea(n,t)}function Na(e){e[0]=1,e[1]=-1,e[2]=1,e[3]=-1,e[4]=1,e[5]=-1}function Ba(e){return!(e[1]-e[0]<0)}function ka(e,t,n){n[0]=Math.min(e[0],t[0]),n[1]=Math.max(e[0],t[0]),n[2]=Math.min(e[1],t[1]),n[3]=Math.max(e[1],t[1]),n[4]=Math.min(e[2],t[2]),n[5]=Math.max(e[2],t[2])}function Fa(e,t,n){return en?n:e}function Ga(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return r[0]=Fa(e[0],t[0],n[0]),r[1]=Fa(e[1],t[1],n[1]),r[2]=Fa(e[2],t[2],n[2]),r}var _a=Lr("GetScalarTypeFittingRange"),Ua=Lr("GetAdjustedScalarRange");var ja=function(e){return!Number.isFinite(e)},Wa=Number.isFinite,za=Number.isNaN,Ha=za;function Ka(){return[].concat([Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE])}function Xa(e){var t=Math.floor(255*e);return t>15?t.toString(16):"0".concat(t.toString(16))}function qa(e){return Math.round(255*e)}var Ya={Pi:function(){return Math.PI},radiansFromDegrees:kr,degreesFromRadians:Fr,round:Gr,floor:_r,ceil:Ur,ceilLog2:Hr,min:jr,max:Wr,arrayMin:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=1/0,a=t,o=e.length;a1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=-1/0,a=t,o=e.length;a=0;--a)if(n[a]0&&void 0!==arguments[0]?arguments[0]:0;return e+((arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)-e)*Math.random()},gaussian:Yr,add:Zr,subtract:Qr,multiplyScalar:$r,multiplyScalar2D:Jr,multiplyAccumulate:function(e,t,n,r){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r},multiplyAccumulate2D:function(e,t,n,r){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r},dot:ea,outer:function(e,t,n){for(var r=0;r<3;r++)for(var a=0;a<3;a++)n[r][a]=e[r]*t[a]},cross:ta,norm:na,normalize:ra,perpendiculars:function(e,t,n,r){var a,o,i,s=e[0]*e[0],l=e[1]*e[1],u=e[2]*e[2],c=Math.sqrt(s+l+u);s>l&&s>u?(a=0,o=1,i=2):l>u?(a=1,o=2,i=0):(a=2,o=0,i=1);var d=e[a]/c,f=e[o]/c,p=e[i]/c,g=Math.sqrt(d*d+p*p);if(0!==r){var m=Math.sin(r),v=Math.cos(r);t&&(t[a]=(p*v-d*f*m)/g,t[o]=m*g,t[i]=(-d*v-f*p*m)/g),n&&(n[a]=(-p*m-d*f*v)/g,n[o]=v*g,n[i]=(d*m-f*p*v)/g)}else t&&(t[a]=p/g,t[o]=0,t[i]=-d/g),n&&(n[a]=-d*f/g,n[o]=g,n[i]=-f*p/g)},projectVector:function(e,t,n){var r=ea(t,t);if(0===r)return n[0]=0,n[1]=0,n[2]=0,!1;for(var a=ea(e,t)/r,o=0;o<3;o++)n[o]=t[o];return $r(n,a),!0},projectVector2D:function(e,t,n){var r=aa(t,t);if(0===r)return n[0]=0,n[1]=0,!1;for(var a=aa(e,t)/r,o=0;o<2;o++)n[o]=t[o];return Jr(n,a),!0},distance2BetweenPoints:oa,angleBetweenVectors:ia,gaussianAmplitude:function(e,t,n){var r=Math.abs(e-n);return 1/Math.sqrt(2*Math.PI*t)*Math.exp(-Math.pow(r,2)/(2*t))},gaussianWeight:function(e,t,n){var r=Math.abs(e-n);return Math.exp(-Math.pow(r,2)/(2*t))},dot2D:aa,outer2D:function(e,t,n){for(var r=0;r<2;r++)for(var a=0;a<2;a++)n[r][a]=e[r]*t[a]},norm2D:sa,normalize2D:function(e){var t=sa(e);return 0!==t&&(e[0]/=t,e[1]/=t),t},determinant2x2:la,LUFactor3x3:function(e,t){for(var n,r,a,o=[0,0,0],i=0;i<3;i++)a=Math.abs(e[i][0]),(r=Math.abs(e[i][1]))>a&&(a=r),(r=Math.abs(e[i][2]))>a&&(a=r),o[i]=1/a;a=o[0]*Math.abs(e[0][0]),n=0,(r=o[1]*Math.abs(e[1][0]))>=a&&(a=r,n=1),(r=o[2]*Math.abs(e[2][0]))>=a&&(n=2),0!==n&&(Nr(e[n],e[0]),o[n]=o[0]),t[0]=n,e[1][0]/=e[0][0],e[2][0]/=e[0][0],e[1][1]-=e[1][0]*e[0][1],e[2][1]-=e[2][0]*e[0][1],a=o[1]*Math.abs(e[1][1]),n=1,(r=o[2]*Math.abs(e[2][1]))>=a&&(n=2,Nr(e[2],e[1]),o[2]=o[1]),t[1]=n,e[2][1]/=e[1][1],e[1][2]-=e[1][0]*e[0][2],e[2][2]-=e[2][0]*e[0][2]+e[2][1]*e[1][2],t[2]=2},LUSolve3x3:function(e,t,n){var r=n[t[0]];n[t[0]]=n[0],n[0]=r,r=n[t[1]],n[t[1]]=n[1],n[1]=r-e[1][0]*n[0],r=n[t[2]],n[t[2]]=n[2],n[2]=r-e[2][0]*n[0]-e[2][1]*n[1],n[2]/=e[2][2],n[1]=(n[1]-e[1][2]*n[2])/e[1][1],n[0]=(n[0]-e[0][1]*n[1]-e[0][2]*n[2])/e[0][0]},linearSolve3x3:function(e,t,n){var r=e[0][0],a=e[0][1],o=e[0][2],i=e[1][0],s=e[1][1],l=e[1][2],u=e[2][0],c=e[2][1],d=e[2][2],f=+la(s,c,l,d),p=-la(i,u,l,d),g=+la(i,u,s,c),m=-la(a,c,o,d),v=+la(r,u,o,d),h=-la(r,u,a,c),y=+la(a,s,o,l),b=-la(r,i,o,l),T=+la(r,i,a,s),C=r*f+a*p+o*g,S=f*t[0]+m*t[1]+y*t[2],P=p*t[0]+v*t[1]+b*t[2],w=g*t[0]+h*t[1]+T*t[2];n[0]=S/C,n[1]=P/C,n[2]=w/C},multiply3x3_vect3:function(e,t,n){var r=e[0][0]*t[0]+e[0][1]*t[1]+e[0][2]*t[2],a=e[1][0]*t[0]+e[1][1]*t[1]+e[1][2]*t[2],o=e[2][0]*t[0]+e[2][1]*t[1]+e[2][2]*t[2];n[0]=r,n[1]=a,n[2]=o},multiply3x3_mat3:ua,multiplyMatrix:function(e,t,n,r,a,o,i){r!==a&&Ir("Number of columns of A must match number of rows of B.");for(var s=0;sWr&&(r=Math.abs(e[a][o]));for(var i=0;i6&&void 0!==arguments[6])||arguments[6];if(eVr&&(f=0,d[u]=0);if(f&&1===a)return Rr("Detected homogeneous system (Y=0), calling SolveHomogeneousLeastSquares()"),Oa(e,t,n,o);if(f)g=1;else for(u=0;u1&&void 0!==arguments[1]?arguments[1]:[0,.5,1];switch(e.length){case 3:return t[0]=17*parseInt(e[0],16)/255,t[1]=17*parseInt(e[1],16)/255,t[2]=17*parseInt(e[2],16)/255,t;case 4:return t[0]=17*parseInt(e[1],16)/255,t[1]=17*parseInt(e[2],16)/255,t[2]=17*parseInt(e[3],16)/255,t;case 6:return t[0]=parseInt(e.substr(0,2),16)/255,t[1]=parseInt(e.substr(2,2),16)/255,t[2]=parseInt(e.substr(4,2),16)/255,t;case 7:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t;case 9:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t[3]=parseInt(e.substr(7,2),16)/255,t;default:return t}},rgb2hsv:Ma,hsv2rgb:Aa,lab2xyz:Ia,xyz2lab:Ra,xyz2rgb:Ea,rgb2xyz:Da,rgb2lab:Va,lab2rgb:La,uninitializeBounds:Na,areBoundsInitialized:Ba,computeBoundsFromPoints:ka,clampValue:Fa,clampVector:Ga,clampAndNormalizeValue:function(e,t){var n=0;return t[0]!==t[1]&&(n=((n=et[1]?t[1]:e)-t[0])/(t[1]-t[0])),n},getScalarTypeFittingRange:_a,getAdjustedScalarRange:Ua,extentIsWithinOtherExtent:function(e,t){if(!e||!t)return 0;for(var n=0;n<6;n+=2)if(e[n]t[n+1]||e[n+1]t[n+1])return 0;return 1},boundsIsWithinOtherBounds:function(e,t,n){if(!e||!t)return 0;for(var r=0;r<6;r+=2)if(e[r]+n[r/2]t[r+1]||e[r+1]+n[r/2]t[r+1])return 0;return 1},pointIsWithinBounds:function(e,t,n){if(!e||!t||!n)return 0;for(var r=0;r<3;r++)if(e[r]+n[r]t[2*r+1])return 0;return 1},solve3PointCircle:function(e,t,n,r){for(var a=Br(3),o=Br(3),i=Br(3),s=Br(3),l=Br(3),u=Br(3),c=0;c<3;++c)a[c]=e[c]-t[c],o[c]=t[c]-n[c],i[c]=n[c]-e[c],s[c]=-a[c],l[c]=-o[c],u[c]=-i[c];var d=na(s),f=na(l),p=na(i),g=Br(3);ta(a,o,g);for(var m=na(g),v=d*f*p/(2*m),h=2*m*m,y=f*f*ea(a,u)/h,b=p*p*ea(s,o)/h,T=d*d*ea(i,l)/h,C=0;C<3;++C)r[C]=y*e[C]+b*t[C]+T*n[C];return v},inf:1/0,negInf:-1/0,isInf:ja,isNan:za,isNaN:za,isFinite:Wa,createUninitializedBounds:Ka,getMajorAxisIndex:function(e){for(var t=-1,n=-1,r=0;rt&&(n=r,t=a)}return n},floatToHex2:Xa,floatRGB2HexCode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";return"".concat(t).concat(e.map(Xa).join(""))},float2CssRGBA:function(e){return 3===e.length?"rgb(".concat(e.map(qa).join(", "),")"):"rgba(".concat(qa(e[0]||0),", ").concat(qa(e[1]||0),", ").concat(qa(e[2]||0),", ").concat(e[3]||0,")")}},Za=ur.k;var Qa={context:null,openGLRenderWindow:null,selector:null};function $a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qa,n),pr.extend(e,t,n),ur.b(e,t,["shaderCache"]),ur.i(e,t,["selector"]),function(e,t){t.classHierarchy.push("vtkOpenGLRenderer"),e.buildPass=function(n){if(n){if(!t.renderable)return;t.renderable.isActiveCameraCreated()||t.renderable.resetCamera(),e.updateLights(),e.prepareNodes(),e.addMissingNode(t.renderable.getActiveCamera()),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes()}},e.updateLights=function(){for(var e=0,n=t.renderable.getLightsByReference(),r=0;r0&&e++;return e||(Za("No lights are on, creating one."),t.renderable.createLight()),e},e.opaqueZBufferPass=function(n){if(n){var r=0,a=t.context;t.renderable.getTransparent()||(t.context.clearColor(1,0,0,1),r|=a.COLOR_BUFFER_BIT),t.renderable.getPreserveDepthBuffer()||(a.clearDepth(1),r|=a.DEPTH_BUFFER_BIT,a.depthMask(!0));var o=e.getTiledSizeAndOrigin();a.enable(a.SCISSOR_TEST),a.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),a.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),a.colorMask(!0,!0,!0,!0),a.clear(r),a.enable(a.DEPTH_TEST)}},e.cameraPass=function(t){t&&e.clear()},e.getAspectRatio=function(){var e=t.parent.getSizeByReference(),n=t.renderable.getViewportByReference();return e[0]*(n[2]-n[0])/((n[3]-n[1])*e[1])},e.getTiledSizeAndOrigin=function(){var e=t.renderable.getViewportByReference(),n=[0,0,1,1],r=Fa(e[0]-n[0],0,1),a=Fa(e[1]-n[1],0,1),o=t.parent.normalizedDisplayToDisplay(r,a),i=Math.round(o[0]),s=Math.round(o[1]),l=Fa(e[2]-n[0],0,1),u=Fa(e[3]-n[1],0,1);l>n[2]-n[0]&&(l=n[2]-n[0]),u>n[3]-n[1]&&(u=n[3]-n[1]);var c=t.parent.normalizedDisplayToDisplay(l,u),d=Math.round(c[0])-i,f=Math.round(c[1])-s;return d<0&&(d=0),f<0&&(f=0),{usize:d,vsize:f,lowerLeftU:i,lowerLeftV:s}},e.clear=function(){var n=0,r=t.context;if(!t.renderable.getTransparent()){var a=t.renderable.getBackgroundByReference();t.context.clearColor(a[0],a[1],a[2],a[3]),n|=r.COLOR_BUFFER_BIT}t.renderable.getPreserveDepthBuffer()||(r.clearDepth(1),n|=r.DEPTH_BUFFER_BIT,r.depthMask(!0)),r.colorMask(!0,!0,!0,!0);var o=e.getTiledSizeAndOrigin();r.enable(r.SCISSOR_TEST),r.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),r.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),r.clear(n),r.enable(r.DEPTH_TEST)},e.releaseGraphicsResources=function(){null!==t.selector&&t.selector.releaseGraphicsResources()},e.setOpenGLRenderWindow=function(n){t.openGLRenderWindow!==n&&(e.releaseGraphicsResources(),t.openGLRenderWindow=n,t.context=null,n&&(t.context=t.openGLRenderWindow.getContext()))}}(e,t)}var Ja=ur.d($a,"vtkOpenGLRenderer");yr("vtkRenderer",Ja);var eo={NONE:-1,I:0,J:1,K:2,X:3,Y:4,Z:5},to={VOID:"",CHAR:"Int8Array",SIGNED_CHAR:"Int8Array",UNSIGNED_CHAR:"Uint8Array",SHORT:"Int16Array",UNSIGNED_SHORT:"Uint16Array",INT:"Int32Array",UNSIGNED_INT:"Uint32Array",FLOAT:"Float32Array",DOUBLE:"Float64Array"},no={DefaultDataType:to.FLOAT,DataTypeByteSize:{Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},VtkDataTypes:to};function ro(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ao(e){for(var t=1;ta&&(e=a),t1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=so(),a=e.length,o=0;if(t<0&&n>1){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=e||[];n.length<=t;)n.push(null);return n}function co(e){return Object.prototype.toString.call(e).slice(8,-1)}var fo={computeRange:lo,createRangeHelper:so,getDataType:co,getMaxNorm:function(e){for(var t=e.getNumberOfComponents(),n=0,r=0;rn&&(n=a)}return n}};var po={name:"",numberOfComponents:1,size:0,dataType:no.DefaultDataType,rangeTuple:[0,0]};function go(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,po,n),!t.empty&&!t.values&&!t.size)throw new TypeError("Cannot create vtkDataArray object without: size > 0, values");t.values?Array.isArray(t.values)&&(t.values=ur.f(t.dataType,t.values)):t.values=ur.e(t.dataType,t.size),t.values&&(t.size=t.values.length,t.dataType=co(t.values)),ur.g(e,t),ur.h(e,t,["name","numberOfComponents"]),function(e,t){function n(){t.ranges=null,e.modified()}t.classHierarchy.push("vtkDataArray"),e.getElementComponentSize=function(){return t.values.BYTES_PER_ELEMENT},e.getComponent=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.values[e*t.numberOfComponents+n]},e.setComponent=function(e,r,a){a!==t.values[e*t.numberOfComponents+r]&&(t.values[e*t.numberOfComponents+r]=a,n())},e.getData=function(){return t.values},e.getRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,n=e<0?t.numberOfComponents:e,r=null;return t.ranges||(t.ranges=uo(t.ranges,t.numberOfComponents)),(r=t.ranges[n])?(t.rangeTuple[0]=r.min,t.rangeTuple[1]=r.max,t.rangeTuple):(r=lo(t.values,e,t.numberOfComponents),t.ranges[n]=r,t.rangeTuple[0]=r.min,t.rangeTuple[1]=r.max,t.rangeTuple)},e.setRange=function(e,n){t.ranges||(t.ranges=uo(t.ranges,t.numberOfComponents));var r={min:e.min,max:e.max};return t.ranges[n]=r,t.rangeTuple[0]=r.min,t.rangeTuple[1]=r.max,t.rangeTuple},e.setTuple=function(e,n){for(var r=e*t.numberOfComponents,a=0;a1&&void 0!==arguments[1]?arguments[1]:io,r=t.numberOfComponents||1;n.length!==r&&(n.length=r);var a=e*r;if(1===r)n[0]=t.values[a];else if(2===r)n[0]=t.values[a],n[1]=t.values[a+1];else if(3===r)n[0]=t.values[a],n[1]=t.values[a+1],n[2]=t.values[a+2];else if(4===r)n[0]=t.values[a],n[1]=t.values[a+1],n[2]=t.values[a+2],n[3]=t.values[a+3];else for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:1)*t.numberOfComponents},e.getNumberOfComponents=function(){return t.numberOfComponents},e.getNumberOfValues=function(){return t.values.length},e.getNumberOfTuples=function(){return t.values.length/t.numberOfComponents},e.getDataType=function(){return t.dataType},e.newClone=function(){return mo({empty:!0,name:t.name,dataType:t.dataType,numberOfComponents:t.numberOfComponents})},e.getName=function(){return t.name||(e.modified(),t.name="vtkDataArray".concat(e.getMTime())),t.name},e.setData=function(e,r){t.values=e,t.size=e.length,t.dataType=co(e),r&&(t.numberOfComponents=r),t.size%t.numberOfComponents!=0&&(t.numberOfComponents=1),n()},e.getState=function(){var n=ao(ao({},t),{},{vtkClass:e.getClassName()});n.values=Array.from(n.values),delete n.buffer,Object.keys(n).forEach(function(e){n[e]||delete n[e]});var r={};return Object.keys(n).sort().forEach(function(e){r[e]=n[e]}),r.mtime&&delete r.mtime,r}}(e,t)}var mo=ur.d(go,"vtkDataArray"),vo=ao(ao({newInstance:mo,extend:go},fo),no),ho={ARRAY_BUFFER:0,ELEMENT_ARRAY_BUFFER:1,TEXTURE_BUFFER:2},yo={ObjectType:ho};function bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function To(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Po,n),ur.a.obj(e,t),ur.a.get(e,t,["openGLRenderWindow"]),function(e,t){function n(e){switch(e){case So.ELEMENT_ARRAY_BUFFER:return t.context.ELEMENT_ARRAY_BUFFER;case So.TEXTURE_BUFFER:if("TEXTURE_BUFFER"in t.context)return t.context.TEXTURE_BUFFER;default:case So.ARRAY_BUFFER:return t.context.ARRAY_BUFFER}}t.classHierarchy.push("vtkOpenGLBufferObject");var r=null,a=null,o=!0,i="";e.getType=function(){return r},e.setType=function(e){r=e},e.getHandle=function(){return a},e.isReady=function(){return!1===o},e.generateBuffer=function(e){var o=n(e);return null===a&&(a=t.context.createBuffer(),r=e),n(r)===o},e.upload=function(s,l){return e.generateBuffer(l)?(t.context.bindBuffer(n(r),a),t.context.bufferData(n(r),s,t.context.STATIC_DRAW),o=!1,!0):(i="Trying to upload array buffer to incompatible buffer.",!1)},e.bind=function(){return!!a&&(t.context.bindBuffer(n(r),a),!0)},e.release=function(){return!!a&&(t.context.bindBuffer(n(r),null),!0)},e.releaseGraphicsResources=function(){null!==a&&(t.context.bindBuffer(n(r),null),t.context.deleteBuffer(a),a=null)},e.setOpenGLRenderWindow=function(n){t.openGLRenderWindow!==n&&(e.releaseGraphicsResources(),t.openGLRenderWindow=n,t.context=null,n&&(t.context=t.openGLRenderWindow.getContext()))},e.getError=function(){return i}}(e,t)}var xo=To(To({newInstance:ur.a.newInstance(wo),extend:wo},{}),yo),Oo={FLAT:0,GOURAUD:1,PHONG:2},Mo={POINTS:0,WIREFRAME:1,SURFACE:2},Ao={Shading:Oo,Representation:Mo,Interpolation:Oo},Io=ur.a.vtkErrorMacro;function Ro(e,t){t.classHierarchy.push("vtkOpenGLCellArrayBufferObject"),e.setType(ho.ARRAY_BUFFER),e.createVBO=function(n,r,a,o){if(!n.getData()||!n.getData().length)return t.elementCount=0,0;t.blockSize=3,t.vertexOffset=0,t.normalOffset=0,t.tCoordOffset=0,t.tCoordComponents=0,t.colorComponents=0,t.colorOffset=0,t.customData=[];var i=o.points.getData(),s=null,l=null,u=null,c=o.colors?o.colors.getNumberOfComponents():0,d=o.tcoords?o.tcoords.getNumberOfComponents():0;o.normals&&(t.normalOffset=4*t.blockSize,t.blockSize+=3,s=o.normals.getData()),o.customAttributes&&o.customAttributes.forEach(function(e){e&&(t.customData.push({data:e.getData(),offset:4*t.blockSize,components:e.getNumberOfComponents(),name:e.getName()}),t.blockSize+=e.getNumberOfComponents())}),o.tcoords&&(t.tCoordOffset=4*t.blockSize,t.tCoordComponents=d,t.blockSize+=d,l=o.tcoords.getData()),o.colors?(t.colorComponents=o.colors.getNumberOfComponents(),t.colorOffset=0,u=o.colors.getData(),t.colorBO||(t.colorBO=xo.newInstance()),t.colorBO.setOpenGLRenderWindow(t.openGLRenderWindow)):t.colorBO=null,t.stride=4*t.blockSize;var f,p=0,g=0,m=0,v=0,h=0,y=0,b={anythingToPoints:function(e,t,n){for(var r=0;r2)for(var r=0;r2){for(var r=0;r1?2*(e-1):0},polysToWireframe:function(e,t){return e>2?2*e:0},stripsToWireframe:function(e,t){return e>2?4*e-6:0},polysToSurface:function(e,t){return e>2?3*(e-2):0},stripsToSurface:function(e,t,n){return e>2?3*(e-2):0}},C=null,S=null;a===Mo.POINTS||"verts"===r?(C=b.anythingToPoints,S=T.anythingToPoints):a===Mo.WIREFRAME||"lines"===r?(C=b["".concat(r,"ToWireframe")],S=T["".concat(r,"ToWireframe")]):(C=b["".concat(r,"ToSurface")],S=T["".concat(r,"ToSurface")]);for(var P=n.getData(),w=P.length,x=0,O=0;O0&&(Math.abs(D)/E>1e6||Math.abs(Math.log10(E))>3||0===E&&D>1e6)){for(var k=new Float64Array(3),F=new Float64Array(3),G=0;G<3;++G){var _=o.points.getRange(G),U=_[1]-_[0];k[G]=.5*(_[1]+_[0]),F[G]=U>0?1/U:1}e.setCoordShiftAndScale(k,F)}else!0===t.coordShiftAndScaleEnabled&&e.setCoordShiftAndScale(null,null);f=function(e){if(p=3*e,t.coordShiftAndScaleEnabled?(A[I++]=(i[p++]-t.coordShift[0])*t.coordScale[0],A[I++]=(i[p++]-t.coordShift[1])*t.coordScale[1],A[I++]=(i[p++]-t.coordShift[2])*t.coordScale[2]):(A[I++]=i[p++],A[I++]=i[p++],A[I++]=i[p++]),null!==s&&(g=o.haveCellNormals?3*(y+o.cellOffset):3*e,A[I++]=s[g++],A[I++]=s[g++],A[I++]=s[g++]),t.customData.forEach(function(t){h=e*t.components;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Eo,n),xo.extend(e,t,n),ur.a.setGet(e,t,["colorBO","elementCount","stride","colorBOStride","vertexOffset","normalOffset","tCoordOffset","tCoordComponents","colorOffset","colorComponents","customData"]),ur.a.get(e,t,["coordShift","coordScale","coordShiftAndScaleEnabled","inverseShiftAndScaleMatrix"]),Ro(e,t)}var Vo={newInstance:ur.a.newInstance(Do),extend:Do},Lo=ur.a.vtkErrorMacro;var No={shaderType:"Unknown",source:"",error:"",handle:0,dirty:!1,context:null};function Bo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,No,n),ur.a.obj(e,t),ur.a.setGet(e,t,["shaderType","source","error","handle","context"]),function(e,t){t.classHierarchy.push("vtkShader"),e.compile=function(){var e=t.context.VERTEX_SHADER;if(!t.source||!t.source.length||"Unknown"===t.shaderType)return!1;switch(0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0),t.shaderType){case"Fragment":e=t.context.FRAGMENT_SHADER;break;case"Vertex":default:e=t.context.VERTEX_SHADER}if(t.handle=t.context.createShader(e),t.context.shaderSource(t.handle,t.source),t.context.compileShader(t.handle),!t.context.getShaderParameter(t.handle,t.context.COMPILE_STATUS)){var n=t.context.getShaderInfoLog(t.handle);return Lo("Error compiling shader '".concat(t.source,"': ").concat(n)),t.context.deleteShader(t.handle),t.handle=0,!1}return!0},e.cleanup=function(){"Unknown"!==t.shaderType&&0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0,t.dirty=!0)}}(e,t)}var ko={newInstance:ur.a.newInstance(Bo,"vtkShader"),extend:Bo},Fo=ur.a.vtkErrorMacro;var Go={vertexShaderHandle:0,fragmentShaderHandle:0,geometryShaderHandle:0,vertexShader:null,fragmentShader:null,geometryShader:null,linked:!1,bound:!1,compiled:!1,error:"",handle:0,numberOfOutputs:0,attributesLocs:null,uniformLocs:null,md5Hash:0,context:null,lastCameraMTime:null};function _o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Go,n),t.attributesLocs={},t.uniformLocs={},t.vertexShader=ko.newInstance(),t.vertexShader.setShaderType("Vertex"),t.fragmentShader=ko.newInstance(),t.fragmentShader.setShaderType("Fragment"),t.geometryShader=ko.newInstance(),t.geometryShader.setShaderType("Geometry"),ur.a.obj(e,t),ur.a.get(e,t,["lastCameraMTime"]),ur.a.setGet(e,t,["error","handle","compiled","bound","md5Hash","vertexShader","fragmentShader","geometryShader","linked"]),function(e,t){t.classHierarchy.push("vtkShaderProgram"),e.compileShader=function(){return t.vertexShader.compile()?t.fragmentShader.compile()?e.attachShader(t.vertexShader)&&e.attachShader(t.fragmentShader)?e.link()?(e.setCompiled(!0),1):(Fo("Links failed: ".concat(t.error)),0):(Fo(t.error),0):(Fo(t.fragmentShader.getSource().split("\n").map(function(e,t){return"".concat(t,": ").concat(e)}).join("\n")),Fo(t.fragmentShader.getError()),0):(Fo(t.vertexShader.getSource().split("\n").map(function(e,t){return"".concat(t,": ").concat(e)}).join("\n")),Fo(t.vertexShader.getError()),0)},e.cleanup=function(){"Unknown"!==t.shaderType&&0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0)},e.bind=function(){return!(!t.linked&&!e.link()||(t.context.useProgram(t.handle),e.setBound(!0),0))},e.isBound=function(){return!!t.bound},e.release=function(){t.context.useProgram(null),e.setBound(!1)},e.setContext=function(e){t.vertexShader.setContext(e),t.fragmentShader.setContext(e),t.geometryShader.setContext(e)},e.link=function(){if(t.inked)return!0;if(0===t.handle)return t.error="Program has not been initialized, and/or does not have shaders.",!1;if(t.uniformLocs={},t.context.linkProgram(t.handle),!t.context.getProgramParameter(t.handle,t.context.LINK_STATUS)){var n=t.context.getProgramInfoLog(t.handle);return Fo("Error linking shader ".concat(n)),t.handle=0,!1}return e.setLinked(!0),t.attributeLocs={},!0},e.setUniformMatrix=function(n,r){var a=e.findUniform(n);if(-1===a)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;var o=new Float32Array(r);return t.context.uniformMatrix4fv(a,!1,o),!0},e.setUniformMatrix3x3=function(n,r){var a=e.findUniform(n);if(-1===a)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;var o=new Float32Array(r);return t.context.uniformMatrix3fv(a,!1,o),!0},e.setUniformf=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1f(a,r),!0)},e.setUniformfv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1fv(a,r),!0)},e.setUniformi=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1i(a,r),!0)},e.setUniformiv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform1iv(a,r),!0)},e.setUniform2f=function(n,r,a){var o=e.findUniform(n);if(-1===o)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2f(o,r,a),!0},e.setUniform2fv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform2fv(a,r),!0)},e.setUniform2i=function(n,r,a){var o=e.findUniform(n);if(-1===o)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(void 0===a)throw new RangeError("Invalid number of values for array");return t.context.uniform2i(o,r,a),!0},e.setUniform2iv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform2iv(a,r),!0)},e.setUniform3f=function(n,r,a,o){var i=e.findUniform(n);if(-1===i)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(void 0===o)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(i,r,a,o),!0},e.setUniform3fArray=function(n,r){var a=e.findUniform(n);if(-1===a)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;if(!Array.isArray(r)||3!==r.length)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(a,r[0],r[1],r[2]),!0},e.setUniform3fv=function(n,r){var a=e.findUniform(n);return-1===a?(t.error="Could not set uniform ".concat(n," . No such uniform."),!1):(t.context.uniform3fv(a,r),!0)},e.setUniform3i=function(n){var r=e.findUniform(n);if(-1===r)return t.error="Could not set uniform ".concat(n," . No such uniform."),!1;for(var a=arguments.length,o=new Array(a>1?a-1:0),i=1;i1?a-1:0),i=1;i1?a-1:0),i=1;i3&&void 0!==arguments[3])||arguments[3],a=Array.isArray(n)?n.join("\n"):n,o=!1;-1!==e.search(t)&&(o=!0);var i="";r&&(i="g");var s=new RegExp(t,i);return{replace:o,result:e.replace(s,a)}}};var jo={forceEmulation:!1,handleVAO:0,handleProgram:0,supported:!0,buffers:null,context:null,openGLRenderWindow:null};function Wo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,jo,n),t.buffers=[],ur.a.obj(e,t),ur.a.get(e,t,["supported"]),ur.a.setGet(e,t,["forceEmulation"]),function(e,t){t.classHierarchy.push("vtkOpenGLVertexArrayObject"),e.exposedMethod=function(){},e.initialize=function(){t.instancingExtension=null,t.openGLRenderWindow.getWebgl2()||(t.instancingExtension=t.context.getExtension("ANGLE_instanced_arrays")),!t.forceEmulation&&t.openGLRenderWindow&&t.openGLRenderWindow.getWebgl2()?(t.extension=null,t.supported=!0,t.handleVAO=t.context.createVertexArray()):(t.extension=t.context.getExtension("OES_vertex_array_object"),!t.forceEmulation&&t.extension?(t.supported=!0,t.handleVAO=t.extension.createVertexArrayOES()):t.supported=!1)},e.isReady=function(){return 0!==t.handleVAO||!1===t.supported},e.bind=function(){if(e.isReady()||e.initialize(),e.isReady()&&t.supported)t.extension?t.extension.bindVertexArrayOES(t.handleVAO):t.context.bindVertexArray(t.handleVAO);else if(e.isReady())for(var n=t.context,r=0;r0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,1):n.vertexAttribDivisor(i.index+l,1))}},e.release=function(){if(e.isReady()&&t.supported)t.extension?t.extension.bindVertexArrayOES(null):t.context.bindVertexArray(null);else if(e.isReady())for(var n=t.context,r=0;r0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(i.index+l,0):n.vertexAttribDivisor(i.index+l,0)),n.disableVertexAttribArray(i.index+l)}},e.shaderProgramChanged=function(){e.release(),t.handleVAO&&(t.extension?t.extension.deleteVertexArrayOES(t.handleVAO):t.context.deleteVertexArray(t.handleVAO)),t.handleVAO=0,t.handleProgram=0},e.releaseGraphicsResources=function(){e.shaderProgramChanged(),t.handleVAO&&(t.extension?t.extension.deleteVertexArrayOES(t.handleVAO):t.context.deleteVertexArray(t.handleVAO)),t.handleVAO=0,t.supported=!0,t.handleProgram=0},e.addAttributeArray=function(t,n,r,a,o,i,s,l){return e.addAttributeArrayWithDivisor(t,n,r,a,o,i,s,l,0,!1)},e.addAttributeArrayWithDivisor=function(n,r,a,o,i,s,l,u,c,d){if(!n)return!1;if(!n.isBound()||0===r.getHandle()||r.getType()!==ho.ARRAY_BUFFER)return!1;if(0===t.handleProgram&&(t.handleProgram=n.getHandle()),e.isReady()||e.initialize(),!e.isReady()||t.handleProgram!==n.getHandle())return!1;var f=t.context,p={};if(p.name=a,p.index=f.getAttribLocation(t.handleProgram,a),p.offset=o,p.stride=i,p.type=s,p.size=l,p.normalize=u,p.isMatrix=d,p.divisor=c,-1===p.Index)return!1;if(r.bind(),f.enableVertexAttribArray(p.index),f.vertexAttribPointer(p.index,p.size,p.type,p.normalize,p.stride,p.offset),c>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(p.index,1):f.vertexAttribDivisor(p.index,1)),p.buffer=r.getHandle(),!t.supported){for(var g=!1,m=0;m0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(p+g,1):f.vertexAttribDivisor(p+g,1));return!0},e.removeAttributeArray=function(n){if(!e.isReady()||0===t.handleProgram)return!1;if(!t.supported)for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ho,n),ur.a.obj(e,t),t.shaderSourceTime={},ur.a.obj(t.shaderSourceTime),t.attributeUpdateTime={},ur.a.obj(t.attributeUpdateTime),ur.a.setGet(e,t,["program","shaderSourceTime","VAO","attributeUpdateTime","CABO","primitiveType"]),t.program=Uo.newInstance(),t.VAO=zo.newInstance(),t.CABO=Vo.newInstance(),function(e,t){t.classHierarchy.push("vtkOpenGLHelper"),e.setOpenGLRenderWindow=function(e){t.program.setContext(e.getContext()),t.VAO.setOpenGLRenderWindow(e),t.CABO.setOpenGLRenderWindow(e)},e.releaseGraphicsResources=function(e){t.VAO.releaseGraphicsResources(),t.CABO.releaseGraphicsResources(),t.CABO.setElementCount(0)}}(e,t)}var Xo={newInstance:ur.a.newInstance(Ko),extend:Ko},qo={CLAMP_TO_EDGE:0,REPEAT:1,MIRRORED_REPEAT:2},Yo={NEAREST:0,LINEAR:1,NEAREST_MIPMAP_NEAREST:2,NEAREST_MIPMAP_LINEAR:3,LINEAR_MIPMAP_NEAREST:4,LINEAR_MIPMAP_LINEAR:5},Zo={Wrap:qo,Filter:Yo};function Qo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jo=Zo.Wrap,ei=Zo.Filter,ti=vo.VtkDataTypes,ni=ur.k,ri=ur.l,ai=ur.m;var oi={openGLRenderWindow:null,context:null,handle:0,sendParametersTime:null,textureBuildTime:null,numberOfDimensions:0,target:0,format:0,openGLDataType:0,components:0,width:0,height:0,depth:0,autoParameters:!0,wrapS:Jo.CLAMP_TO_EDGE,wrapT:Jo.CLAMP_TO_EDGE,wrapR:Jo.CLAMP_TO_EDGE,minificationFilter:ei.NEAREST,magnificationFilter:ei.NEAREST,minLOD:-1e3,maxLOD:1e3,baseLevel:0,maxLevel:1e3,generateMipmap:!1};function ii(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oi,n),pr.extend(e,t,n),t.sendParametersTime={},ur.g(t.sendParametersTime,{mtime:0}),t.textureBuildTime={},ur.g(t.textureBuildTime,{mtime:0}),ur.h(e,t,["format","openGLDataType"]),ur.i(e,t,["keyMatrixTime","minificationFilter","magnificationFilter","wrapS","wrapT","wrapR","generateMipmap"]),ur.b(e,t,["width","height","volumeInfo","components","handle","target"]),function(e,t){var n=this;function r(e,n){var r=[];if(e!==ti.FLOAT&&t.openGLDataType===t.context.FLOAT)for(var a=t.width*t.height*t.components,o=0;o=a&&(h=a-1);var y=m-v,b=1-y;v=v*r*o,h=h*r*o;for(var T=0;T=r&&(w=r-1);var x=S-P;P*=o,w*=o;for(var O=0;Oa[l]&&(a[l]=n[i]),i++;for(var u=[],c=[],d=0;d0&&void 0!==arguments[0]?arguments[0]:null;if(n?t.openGLRenderWindow=n:(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent()),t.context=t.openGLRenderWindow.getContext(),t.renderable.getInterpolate()?(t.generateMipmap?e.setMinificationFilter(ei.LINEAR_MIPMAP_LINEAR):e.setMinificationFilter(ei.LINEAR),e.setMagnificationFilter(ei.LINEAR)):(e.setMinificationFilter(ei.NEAREST),e.setMagnificationFilter(ei.NEAREST)),t.renderable.getRepeat()&&(e.setWrapR(Jo.REPEAT),e.setWrapS(Jo.REPEAT),e.setWrapT(Jo.REPEAT)),t.renderable.getInputData()&&t.renderable.setImage(null),!t.handle||t.renderable.getMTime()>t.textureBuildTime.getMTime()){null!==t.renderable.getImage()&&(t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(ei.LINEAR_MIPMAP_LINEAR)),t.renderable.getImage()&&t.renderable.getImageLoaded()&&(e.create2DFromImage(t.renderable.getImage()),e.activate(),e.sendParameters(),t.textureBuildTime.modified()));var r=t.renderable.getInputData(0);if(r&&r.getPointData().getScalars()){for(var a=r.getExtent(),o=r.getPointData().getScalars(),i=[],s=0;st.sendParametersTime.getMTime()&&e.sendParameters()},e.isBound=function(){var e=!1;if(t.context&&t.handle){var n=0;switch(t.target){case t.context.TEXTURE_2D:n=t.context.TEXTURE_BINDING_2D;break;default:ai("impossible case")}e=t.context.getIntegerv(n)===t.handle}return e},e.sendParameters=function(){t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_S,e.getOpenGLWrapMode(t.wrapS)),t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_T,e.getOpenGLWrapMode(t.wrapT)),t.openGLRenderWindow.getWebgl2()&&t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_R,e.getOpenGLWrapMode(t.wrapR)),t.context.texParameteri(t.target,t.context.TEXTURE_MIN_FILTER,e.getOpenGLFilterMode(t.minificationFilter)),t.context.texParameteri(t.target,t.context.TEXTURE_MAG_FILTER,e.getOpenGLFilterMode(t.magnificationFilter)),t.openGLRenderWindow.getWebgl2()&&(t.context.texParameteri(t.target,t.context.TEXTURE_BASE_LEVEL,t.baseLevel),t.context.texParameteri(t.target,t.context.TEXTURE_MAX_LEVEL,t.maxLevel)),t.sendParametersTime.modified()},e.getInternalFormat=function(n,r){return t.internalFormat||(t.internalFormat=e.getDefaultInternalFormat(n,r)),t.internalFormat||ni("Unable to find suitable internal format for T=".concat(n," NC= ").concat(r)),t.internalFormat},e.getDefaultInternalFormat=function(e,r){var a=0;return(a=t.openGLRenderWindow.getDefaultTextureInternalFormat(e,r,!1))?a:((a=n.openGLRenderWindow.getDefaultTextureInternalFormat(e,r,!0))||(ni("Unsupported internal texture type!"),ni("Unable to find suitable internal format for T=".concat(e," NC= ").concat(r))),a)},e.setInternalFormat=function(n){n!==t.internalFormat&&(t.internalFormat=n,e.modified())},e.getFormat=function(n,r){return t.format=e.getDefaultFormat(n,r),t.format},e.getDefaultFormat=function(e,n){if(t.openGLRenderWindow.getWebgl2())switch(n){case 1:return t.context.RED;case 2:return t.context.RG;case 3:return t.context.RGB;case 4:return t.context.RGBA;default:return t.context.RGB}else switch(n){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:return t.context.RGB;case 4:return t.context.RGBA;default:return t.context.RGB}},e.resetFormatAndType=function(){t.format=0,t.internalFormat=0,t.openGLDataType=0},e.getDefaultDataType=function(e){if(t.openGLRenderWindow.getWebgl2())switch(e){case ti.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case ti.FLOAT:case ti.VOID:default:return t.context.FLOAT}switch(e){case ti.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case ti.FLOAT:case ti.VOID:default:return t.context.getExtension("OES_texture_float")&&t.context.getExtension("OES_texture_float_linear")?t.context.FLOAT:t.context.UNSIGNED_BYTE}},e.getOpenGLDataType=function(n){return t.openGLDataType=e.getDefaultDataType(n),t.openGLDataType},e.getShiftAndScale=function(){var e=0,n=1;switch(t.openGLDataType){case t.context.BYTE:e=(n=127.5)-128;break;case t.context.UNSIGNED_BYTE:n=255,e=0;break;case t.context.SHORT:e=(n=32767.5)-32768;break;case t.context.UNSIGNED_SHORT:n=65536,e=0;break;case t.context.INT:e=(n=2147483647.5)-2147483648;break;case t.context.UNSIGNED_INT:n=4294967295,e=0;break;case t.context.FLOAT:}return{shift:e,scale:n}},e.getOpenGLFilterMode=function(e){switch(e){case ei.NEAREST:return t.context.NEAREST;case ei.LINEAR:return t.context.LINEAR;case ei.NEAREST_MIPMAP_NEAREST:return t.context.NEAREST_MIPMAP_NEAREST;case ei.NEAREST_MIPMAP_LINEAR:return t.context.NEAREST_MIPMAP_LINEAR;case ei.LINEAR_MIPMAP_NEAREST:return t.context.LINEAR_MIPMAP_NEAREST;case ei.LINEAR_MIPMAP_LINEAR:return t.context.LINEAR_MIPMAP_LINEAR;default:return t.context.NEAREST}},e.getOpenGLWrapMode=function(e){switch(e){case Jo.CLAMP_TO_EDGE:return t.context.CLAMP_TO_EDGE;case Jo.REPEAT:return t.context.REPEAT;case Jo.MIRRORED_REPEAT:return t.context.MIRRORED_REPEAT;default:return t.context.CLAMP_TO_EDGE}},e.create2DFromRaw=function(n,o,i,s,l){if(e.getOpenGLDataType(s),e.getInternalFormat(s,i),e.getFormat(s,i),!t.internalFormat||!t.format||!t.openGLDataType)return ri("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=i,t.width=n,t.height=o,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();var u=a(r(s,[l]));return t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,u[0]),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0},e.createCubeFromRaw=function(n,o,i,s,l){if(e.getOpenGLDataType(s),e.getInternalFormat(s,i),e.getFormat(s,i),!t.internalFormat||!t.format||!t.openGLDataType)return ri("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_CUBE_MAP,t.components=i,t.width=n,t.height=o,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),t.maxLevel=l.length/6-1,e.createTexture(),e.bind();for(var u=a(r(s,l)),c=[],d=t.width,f=t.height,p=0;p=1&&T>=1;){var C=null;y<=t.maxLevel&&(C=c[6*y+h]),t.context.texImage2D(t.context.TEXTURE_CUBE_MAP_POSITIVE_X+h,y,t.internalFormat,b,T,0,t.format,t.openGLDataType,C),y++,b/=2,T/=2}return e.deactivate(),!0},e.createDepthFromRaw=function(n,r,a,o){return e.getOpenGLDataType(a),t.format=t.context.DEPTH_COMPONENT,t.openGLRenderWindow.getWebgl2()?a===ti.FLOAT?t.internalFormat=t.context.DEPTH_COMPONENT32F:t.internalFormat=t.context.DEPTH_COMPONENT16:t.internalFormat=t.context.DEPTH_COMPONENT,t.internalFormat&&t.format&&t.openGLDataType?(t.target=t.context.TEXTURE_2D,t.components=1,t.width=n,t.height=r,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,o),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0):(ri("Failed to determine texture parameters."),!1)},e.create2DFromImage=function(n){if(e.getOpenGLDataType(ti.UNSIGNED_CHAR),e.getInternalFormat(ti.UNSIGNED_CHAR,4),e.getFormat(ti.UNSIGNED_CHAR,4),!t.internalFormat||!t.format||!t.openGLDataType)return ri("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=4,t.width=n.width,t.height=n.height,t.depth=1,t.numberOfDimensions=2,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1);var r=!qr(n.width)||!qr(n.height),a=document.createElement("canvas");a.width=r?Xr(n.width):n.width,a.height=r?Xr(n.height):n.height;var o=a.getContext("2d");o.translate(0,a.height),o.scale(1,-1),o.drawImage(n,0,0,n.width,n.height,0,0,a.width,a.height),navigator.userAgent.indexOf("Chrome/69")>=0&&o.getImageData(0,0,1,1);var i=a;return t.context.texImage2D(t.target,0,t.internalFormat,t.format,t.openGLDataType,i),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0},e.create3DFromRaw=function(n,r,a,o,i,s){return e.getOpenGLDataType(i),e.getInternalFormat(i,o),e.getFormat(i,o),t.internalFormat&&t.format&&t.openGLDataType?(t.target=t.context.TEXTURE_3D,t.components=o,t.width=n,t.height=r,t.depth=a,t.numberOfDimensions=3,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.texImage3D(t.target,0,t.internalFormat,t.width,t.height,t.depth,0,t.format,t.openGLDataType,s),t.generateMipmap&&t.context.generateMipmap(t.target),e.deactivate(),!0):(ri("Failed to determine texture parameters."),!1)},e.create3DFilterableFromRaw=function(n,r,a,i,s,l){for(var u=n*r*a,c=[],d=[],f=0;f4096&&(w===ti.FLOAT||i>=3)&&(O=4096);var M=1,A=1;u>O*O&&(A=M=Math.ceil(Math.sqrt(u/(O*O))));var I=Math.sqrt(u)/M;I=Xr(I);var R,E=Math.floor(I*M/n),D=Math.ceil(a/E),V=Xr(r*D/A);t.width=I,t.height=V,t.openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.volumeInfo.xreps=E,t.volumeInfo.yreps=D,t.volumeInfo.xstride=M,t.volumeInfo.ystride=A,t.volumeInfo.offset=S.offset,t.volumeInfo.scale=S.scale;var L=I*V*i;R=w===ti.FLOAT?new Float32Array(L):new Uint8Array(L);for(var N=0,B=Math.floor(n/M),k=Math.floor(r/A),F=0;F2&&void 0!==arguments[2]&&arguments[2],e.replaceShaderCoincidentOffset=function(n,r,a){var o=e.getCoincidentParameters(r,a);if(o&&(0!==o.factor||0!==o.offset)){var i=n.Fragment;i=Uo.substitute(i,"//VTK::Coincident::Dec",["uniform float cfactor;","uniform float coffset;"]).result,t.context.getExtension("EXT_frag_depth")&&(0!==o.factor?(i=Uo.substitute(i,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,i=Uo.substitute(i,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):i=Uo.substitute(i,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + 0.000016*coffset;").result),t.openGLRenderWindow.getWebgl2()&&(0!==o.factor?(i=Uo.substitute(i,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,i=Uo.substitute(i,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):i=Uo.substitute(i,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + 0.000016*coffset;").result),n.Fragment=i}}}},mi=ur.l,vi=eo;function hi(e,t,n){if(t.apply(e)){var r=e.getIndependentComponents();return"".concat(e.getMTime(),"-").concat(r,"-").concat(n)}return"0"}var yi={VBOBuildTime:0,VBOBuildString:null,openGLTexture:null,tris:null,imagemat:null,colorTexture:null,pwfTexture:null,lastHaveSeenDepthRequest:!1,haveSeenDepthRequest:!1,lastTextureComponents:0};function bi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yi,n),pr.extend(e,t,n),gi.implementReplaceShaderCoincidentOffset(e,t,n),t.tris=Xo.newInstance(),t.openGLTexture=li.newInstance(),t.colorTexture=li.newInstance(),t.pwfTexture=li.newInstance(),t.imagemat=o.identity(new Float64Array(16)),ur.i(e,t,[]),t.VBOBuildTime={},ur.g(t.VBOBuildTime),function(e,t){t.classHierarchy.push("vtkOpenGLImageMapper"),e.buildPass=function(n){if(n){t.openGLImageSlice=e.getFirstAncestorOfType("vtkOpenGLImageSlice"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext(),t.tris.setOpenGLRenderWindow(t.openGLRenderWindow),t.openGLTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.colorTexture.setOpenGLRenderWindow(t.openGLRenderWindow),t.pwfTexture.setOpenGLRenderWindow(t.openGLRenderWindow);var r=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(r.getActiveCamera()),t.renderable.getSliceAtFocalPoint()&&t.renderable.setSliceFromCamera(r.getActiveCamera())}},e.translucentPass=function(t){t&&e.render()},e.opaqueZBufferPass=function(n){n&&(t.haveSeenDepthRequest=!0,t.renderDepth=!0,e.render(),t.renderDepth=!1)},e.opaquePass=function(t){t&&e.render()},e.getCoincidentParameters=function(e,n){return t.renderable.getResolveCoincidentTopology()?t.renderable.getCoincidentTopologyPolygonOffsetParameters():null},e.render=function(){var n=t.openGLImageSlice.getRenderable(),r=t.openGLRenderer.getRenderable();e.renderPiece(r,n)},e.buildShaders=function(t,n,r){e.getShaderTemplate(t,n,r),e.replaceShaderValues(t,n,r)},e.getShaderTemplate=function(e,t,n){e.Vertex=di.a,e.Fragment=pi.a,e.Geometry=""},e.replaceShaderValues=function(n,r,a){var o=n.Vertex,i=n.Fragment;o=Uo.substitute(o,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,o=Uo.substitute(o,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result,o=Uo.substitute(o,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result,o=Uo.substitute(o,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result;var s=t.openGLTexture.getComponents(),l=a.getProperty().getIndependentComponents(),u=["varying vec2 tcoordVCVSOutput;","uniform float cshift0;","uniform float cscale0;","uniform float pwfshift0;","uniform float pwfscale0;","uniform sampler2D texture1;","uniform sampler2D colorTexture1;","uniform sampler2D pwfTexture1;","uniform float opacity;"];if(l){for(var c=1;cn.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(n.getProgram().isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexMC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||mi("Error setting vertexMC in shader VAO.")),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),t.context.FLOAT,n.getCABO().getTCoordComponents(),t.context.FALSE)||mi("Error setting tcoordMC in shader VAO.")),n.getAttributeUpdateTime().modified());var o=t.openGLTexture.getTextureUnit();n.getProgram().setUniformi("texture1",o);var i=t.openGLTexture.getComponents(),s=a.getProperty().getIndependentComponents();if(s)for(var l=0;l1?1:0;var U=o.getData(),j=null;if(E===vi.I){j=new U.constructor(B[2]*B[1]*l);for(var W=0,z=0;z2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ci,n),pr.extend(e,t,n),t.keyMatrixTime={},ur.g(t.keyMatrixTime,{mtime:0}),t.keyMatrices={mcwc:o.identity(new Float64Array(16))},ur.i(e,t,["context"]),function(e,t){t.classHierarchy.push("vtkOpenGLImageSlice"),e.buildPass=function(n){if(t.renderable&&t.renderable.getVisibility()&&n){if(!t.renderable)return;t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaqueZBufferPass=function(t){e.traverseOpaquePass(t)},e.traverseOpaquePass=function(n){t.renderable&&t.renderable.getVisibility()&&t.renderable.getIsOpaque()&&(!t.openGLRenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children.forEach(function(e){e.traverse(n)}),e.apply(n,!1))},e.traverseTranslucentPass=function(n){!t.renderable||!t.renderable.getVisibility()||t.renderable.getIsOpaque()||t.openGLRenderer.getSelector()&&!t.renderable.getPickable()||(e.apply(n,!0),t.children.forEach(function(e){e.traverse(n)}),e.apply(n,!1))},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?n.incrementOpaqueActorCount():n.incrementTranslucentActorCount()}},e.opaqueZBufferPass=function(t,n){return e.opaquePass(t,n)},e.opaquePass=function(n,r){n&&(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!0))},e.translucentPass=function(n,r){n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!1)):t.context.depthMask(!0)},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(o.copy(t.keyMatrices.mcwc,t.renderable.getMatrix()),o.transpose(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.keyMatrixTime.modified()),t.keyMatrices}}(e,t)}var Pi=ur.d(Si,"vtkOpenGLImageSlice");yr("vtkImageSlice",Pi);var wi={};function xi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,wi,n),pr.extend(e,t,n),t.keyMatrixTime={},ur.g(t.keyMatrixTime,{mtime:0}),t.normalMatrix=new Float64Array(9),t.MCWCMatrix=new Float64Array(16),ur.i(e,t,["context"]),function(e,t){t.classHierarchy.push("vtkOpenGLVolume"),e.buildPass=function(n){t.renderable&&t.renderable.getVisibility()&&n&&(t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;n.incrementVolumeCount()}},e.traverseVolumePass=function(n){t.renderable&&t.renderable.getVisibility()&&(!t.openGLRenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children[0].traverse(n),e.apply(n,!1))},e.volumePass=function(n){t.renderable&&t.renderable.getVisibility()&&(n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!1)):t.context.depthMask(!0))},e.getKeyMatrices=function(){return t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),o.copy(t.MCWCMatrix,t.renderable.getMatrix()),o.transpose(t.MCWCMatrix,t.MCWCMatrix),t.renderable.getIsIdentity()?a.identity(t.normalMatrix):(a.fromMat4(t.normalMatrix,t.MCWCMatrix),a.invert(t.normalMatrix,t.normalMatrix)),t.keyMatrixTime.modified()),{mcwc:t.MCWCMatrix,normalMatrix:t.normalMatrix}}}(e,t)}var Oi=ur.d(xi,"vtkOpenGLVolume");yr("vtkVolume",Oi);var Mi={openGLRenderWindow:null,glFramebuffer:null,colorTexture:null,depthTexture:null,previousDrawBinding:0,previousReadBinding:0,previousDrawBuffer:0,previousReadBuffer:0,previousActiveFramebuffer:null};function Ai(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mi,n),ur.g(e,t),ur.i(e,t,["colorTexture"]),function(e,t){t.classHierarchy.push("vtkFramebuffer"),e.getBothMode=function(){return t.context.FRAMEBUFFER},e.saveCurrentBindingsAndBuffers=function(t){var n=void 0!==t?t:e.getBothMode();e.saveCurrentBindings(n),e.saveCurrentBuffers(n)},e.saveCurrentBindings=function(e){var n=t.context;t.previousDrawBinding=n.getParameter(t.context.FRAMEBUFFER_BINDING),t.previousActiveFramebuffer=t.openGLRenderWindow.getActiveFramebuffer()},e.saveCurrentBuffers=function(e){},e.restorePreviousBindingsAndBuffers=function(t){var n=void 0!==t?t:e.getBothMode();e.restorePreviousBindings(n),e.restorePreviousBuffers(n)},e.restorePreviousBindings=function(e){var n=t.context;n.bindFramebuffer(n.FRAMEBUFFER,t.previousDrawBinding),t.openGLRenderWindow.setActiveFramebuffer(t.previousActiveFramebuffer)},e.restorePreviousBuffers=function(e){},e.bind=function(){t.context.bindFramebuffer(t.context.FRAMEBUFFER,t.glFramebuffer),t.colorTexture&&t.colorTexture.bind(),t.openGLRenderWindow.setActiveFramebuffer(e)},e.create=function(e,n){t.glFramebuffer=t.context.createFramebuffer(),t.glFramebuffer.width=e,t.glFramebuffer.height=n},e.setColorBuffer=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=t.context,a=r.COLOR_ATTACHMENT0;if(n>0){if(!t.openGLRenderWindow.getWebgl2())return void ur.l("Using multiple framebuffer attachments requires WebGL 2");a+=n}t.colorTexture=e,r.framebufferTexture2D(r.FRAMEBUFFER,a,r.TEXTURE_2D,e.getHandle(),0)},e.removeColorBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=t.context,r=n.COLOR_ATTACHMENT0;if(e>0){if(!t.openGLRenderWindow.getWebgl2())return void ur.l("Using multiple framebuffer attachments requires WebGL 2");r+=e}n.framebufferTexture2D(n.FRAMEBUFFER,r,n.TEXTURE_2D,null,0)},e.setDepthBuffer=function(e){if(t.openGLRenderWindow.getWebgl2()){var n=t.context;n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,e.getHandle(),0)}else ur.l("Attaching depth buffer textures to fbo requires WebGL 2")},e.removeDepthBuffer=function(){if(t.openGLRenderWindow.getWebgl2()){var e=t.context;e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,null,0)}else ur.l("Attaching depth buffer textures to framebuffers requires WebGL 2")},e.getGLFramebuffer=function(){return t.glFramebuffer},e.setOpenGLRenderWindow=function(n){t.openGLRenderWindow!==n&&(e.releaseGraphicsResources(),t.openGLRenderWindow=n,t.context=null,n&&(t.context=t.openGLRenderWindow.getContext()))},e.releaseGraphicsResources=function(){t.glFramebuffer&&t.context.deleteFramebuffer(t.glFramebuffer),t.colorTexture&&t.colorTexture.releaseGraphicsResources()},e.getSize=function(){var e=[0,0];return null!==t.glFramebuffer&&(e[0]=t.glFramebuffer.width,e[1]=t.glFramebuffer.height),e},e.populateFramebuffer=function(){e.bind();var n=t.context,r=li.newInstance();r.setOpenGLRenderWindow(t.openGLRenderWindow),r.setMinificationFilter(Yo.LINEAR),r.setMagnificationFilter(Yo.LINEAR),r.create2DFromRaw(t.glFramebuffer.width,t.glFramebuffer.height,4,to.UNSIGNED_CHAR,null),e.setColorBuffer(r),t.depthTexture=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,t.depthTexture),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t.glFramebuffer.width,t.glFramebuffer.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t.depthTexture)}}(e,t)}var Ii={newInstance:ur.d(Ai,"vtkFramebuffer"),extend:Ai},Ri={NEAREST:0,LINEAR:1,FAST_LINEAR:2},Ei={FRACTIONAL:0,PROPORTIONAL:1},Di={InterpolationType:Ri,OpacityMode:Ei},Vi={COMPOSITE_BLEND:0,MAXIMUM_INTENSITY_BLEND:1,MINIMUM_INTENSITY_BLEND:2,AVERAGE_INTENSITY_BLEND:3},Li={BlendMode:Vi},Ni=n(9),Bi=n.n(Ni),ki=n(10),Fi=n.n(ki);function Gi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ui=ur.m,ji=ur.l;function Wi(e,t){if(e.length!==t.length)return!1;for(var n=0;n0&&(o=Uo.substitute(o,"//VTK::vtkProportionalComponents",u.join("\n")).result)}var d=t.currentInput.getExtent(),f=t.currentInput.getSpacing(),p=new Float64Array(3);i.set(p,(d[1]-d[0])*f[0],(d[3]-d[2])*f[1],(d[5]-d[4])*f[2]);var g=i.length(p)/t.renderable.getSampleDistance();o=Uo.substitute(o,"//VTK::MaximumSamplesValue","".concat(Math.ceil(g))).result,o=Uo.substitute(o,"//VTK::LightComplexity","#define vtkLightComplexity ".concat(t.lastLightComplexity)).result,t.gopacity=a.getProperty().getUseGradientOpacity(0);for(var m=1;l&&!t.gopacity&&m0&&(a=Uo.substitute(a,"//VTK::Light::Dec",["uniform vec3 lightColor".concat(o,";"),"uniform vec3 lightDirectionVC".concat(o,"; // normalized"),"uniform vec3 lightHalfAngleVC".concat(o,"; // normalized"),"//VTK::Light::Dec"],!1).result,a=Uo.substitute(a,"//VTK::Light::Impl",[" float df = abs(dot(normal.rgb, -lightDirectionVC".concat(o,"));")," diffuse += ((df".concat("",") * lightColor").concat(o,");")," float sf = pow( abs(dot(lightHalfAngleVC".concat(o,",normal.rgb)), vSpecularPower);")," specular += ((sf".concat("",") * lightColor").concat(o,");")," //VTK::Light::Impl"],!1).result,o++)})}e.Fragment=a},e.replaceShaderClippingPlane=function(e,n,r){var a=e.Fragment;if(t.renderable.getClippingPlanes().length>0){var o=t.renderable.getClippingPlanes().length;a=Uo.substitute(a,"//VTK::ClipPlane::Dec",["uniform vec3 vClipPlaneNormals[6];","uniform float vClipPlaneDistances[6];","//VTK::ClipPlane::Dec"],!1).result,a=Uo.substitute(a,"//VTK::ClipPlane::Impl",["for(int i = 0; i < ".concat(o,"; i++) {")," float rayDirRatio = dot(rayDir, vClipPlaneNormals[i]);"," float equationResult = dot(vertexVCVSOutput, vClipPlaneNormals[i]) + vClipPlaneDistances[i];"," if (rayDirRatio == 0.0)"," {"," if (equationResult < 0.0) dists.x = dists.y;"," continue;"," }"," float result = -1.0 * equationResult / rayDirRatio;"," if (rayDirRatio < 0.0) dists.y = min(dists.y, result);"," else dists.x = max(dists.x, result);","}","//VTK::ClipPlane::Impl"],!1).result}e.Fragment=a},e.getNeedToRebuildShaders=function(n,r,a){var o=0;a.getProperty().getShade()&&t.renderable.getBlendMode()===Vi.COMPOSITE_BLEND&&(o=0,t.numberOfLights=0,r.getLights().forEach(function(e){e.getSwitch()>0&&(t.numberOfLights++,0===o&&(o=1)),1===o&&(t.numberOfLights>1||1!==e.getIntensity()||!e.lightTypeIsHeadLight())&&(o=2),o<3&&e.getPositional()&&(o=3)}));var s=!1;t.lastLightComplexity!==o&&(t.lastLightComplexity=o,s=!0);var l=t.scalarTexture.getComponents(),u=a.getProperty().getIndependentComponents(),c=!1,d=[];if(u){for(var f=0;f0&&(c=!0)}var p=t.currentInput.getExtent(),g=t.currentInput.getSpacing(),m=new Float64Array(3);i.set(m,(p[1]-p[0])*g[0],(p[3]-p[2])*g[1],(p[5]-p[4])*g[2]);var v=i.length(m)/t.renderable.getSampleDistance(),h={interpolationType:a.getProperty().getInterpolationType(),useLabelOutline:a.getProperty().getUseLabelOutline(),numComp:l,usesProportionalComponents:c,iComps:u,maxSamples:v,useGradientOpacity:a.getProperty().getUseGradientOpacity(0),blendMode:t.renderable.getBlendMode(),averageIPScalarMode:t.renderable.getAverageIPScalarRange(),proportionalComponents:d};return t.previousState&&t.previousState.interpolationType===h.interpolationType&&t.previousState.useLabelOutline===h.useLabelOutline&&t.previousState.numComp===h.numComp&&t.previousState.usesProportionalComponents===h.usesProportionalComponents&&t.previousState.iComps===h.iComps&&t.previousState.maxSamples===h.maxSamples&&t.previousState.useGradientOpacity===h.useGradientOpacity&&t.previousState.blendMode===h.blendMode&&Wi(t.previousState.averageIPScalarMode,h.averageIPScalarMode)&&Wi(t.previousState.proportionalComponents,h.proportionalComponents)?!!(0===n.getProgram()||s||t.lastHaveSeenDepthRequest!==t.haveSeenDepthRequest||!!t.lastZBufferTexture!=!!t.zBufferTexture||n.getShaderSourceTime().getMTime()n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())&&(o.isAttributeUsed("vertexDC")&&(n.getVAO().addAttributeArray(o,n.getCABO(),"vertexDC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||ji("Error setting vertexDC in shader VAO.")),n.getAttributeUpdateTime().modified()),o.setUniformi("texture1",t.scalarTexture.getTextureUnit()),o.setUniformf("sampleDistance",t.renderable.getSampleDistance()),null!==t.zBufferTexture){o.setUniformi("zBufferTexture",t.zBufferTexture.getTextureUnit());var i=e.getRenderTargetSize();o.setUniformf("vpWidth",i[0]),o.setUniformf("vpHeight",i[1])}},e.setCameraShaderParameters=function(n,r,s){var l=t.openGLCamera.getKeyMatrices(r),u=t.openGLVolume.getKeyMatrices();o.multiply(t.modelToView,l.wcvc,u.mcwc);var c=n.getProgram(),d=t.openGLCamera.getRenderable(),f=d.getClippingRange();c.setUniformf("camThick",f[1]-f[0]),c.setUniformf("camNear",f[0]),c.setUniformf("camFar",f[1]);for(var p=t.currentInput.getBounds(),g=t.currentInput.getDimensions(),m=new Float64Array(3),v=new Float64Array(3),h=1,y=-1,b=1,T=-1,C=0;C<8;++C){if(i.set(m,p[C%2],p[2+Math.floor(C/2)%2],p[4+Math.floor(C/4)]),i.transformMat4(m,m,t.modelToView),!d.getParallelProjection()){i.normalize(v,m);var S=-f[0]/m[2];i.scale(m,v,S)}i.transformMat4(m,m,l.vcpc),h=Math.min(m[0],h),y=Math.max(m[0],y),b=Math.min(m[1],b),T=Math.max(m[1],T)}c.setUniformf("dcxmin",h),c.setUniformf("dcxmax",y),c.setUniformf("dcymin",b),c.setUniformf("dcymax",T),c.isUniformUsed("cameraParallel")&&c.setUniformi("cameraParallel",d.getParallelProjection());var P=t.currentInput.getExtent(),w=t.currentInput.getSpacing(),x=new Float64Array(3);i.set(x,(P[1]-P[0]+1)*w[0],(P[3]-P[2]+1)*w[1],(P[5]-P[4]+1)*w[2]),c.setUniform3f("vSpacing",w[0],w[1],w[2]),i.set(m,P[0],P[2],P[4]),t.currentInput.indexToWorldVec3(m,m),i.transformMat4(m,m,t.modelToView),c.setUniform3f("vOriginVC",m[0],m[1],m[2]);var O=t.currentInput.getIndexToWorld();o.multiply(t.idxToView,t.modelToView,O),a.multiply(t.idxNormalMatrix,l.normalMatrix,u.normalMatrix),a.multiply(t.idxNormalMatrix,t.idxNormalMatrix,t.currentInput.getDirection());var M=i.length(x)/t.renderable.getSampleDistance();M>t.renderable.getMaximumSamplesPerRay()&&Ui("The number of steps required ".concat(Math.ceil(M)," is larger than the\n specified maximum number of steps ").concat(t.renderable.getMaximumSamplesPerRay(),".\n Please either change the\n volumeMapper sampleDistance or its maximum number of samples."));var A=new Float64Array(3);if(i.set(A,1,1,1),i.divide(A,A,x),c.setUniform3f("vVCToIJK",A[0],A[1],A[2]),c.setUniform3i("volumeDimensions",g[0],g[1],g[2]),!t.openGLRenderWindow.getWebgl2()){var I=t.scalarTexture.getVolumeInfo();c.setUniformf("texWidth",t.scalarTexture.getWidth()),c.setUniformf("texHeight",t.scalarTexture.getHeight()),c.setUniformi("xreps",I.xreps),c.setUniformi("xstride",I.xstride),c.setUniformi("ystride",I.ystride)}for(var R=new Float64Array(3),E=new Float64Array(3),D=0;D<6;++D){switch(D){default:case 0:i.set(R,1,0,0),i.set(E,P[1],P[3],P[5]);break;case 1:i.set(R,-1,0,0),i.set(E,P[0],P[2],P[4]);break;case 2:i.set(R,0,1,0),i.set(E,P[1],P[3],P[5]);break;case 3:i.set(R,0,-1,0),i.set(E,P[0],P[2],P[4]);break;case 4:i.set(R,0,0,1),i.set(E,P[1],P[3],P[5]);break;case 5:i.set(R,0,0,-1),i.set(E,P[0],P[2],P[4])}i.transformMat3(R,R,t.idxNormalMatrix),i.transformMat4(E,E,t.idxToView);var V=-1*i.dot(E,R);if(c.setUniform3f("vPlaneNormal".concat(D),R[0],R[1],R[2]),c.setUniformf("vPlaneDistance".concat(D),V),s.getProperty().getUseLabelOutline()){var L=t.currentInput.getWorldToIndex();c.setUniformMatrix("vWCtoIDX",L),o.invert(t.projectionToWorld,l.wcpc),c.setUniformMatrix("PCWCMatrix",t.projectionToWorld);var N=e.getRenderTargetSize();c.setUniformf("vpWidth",N[0]),c.setUniformf("vpHeight",N[1])}}switch(o.invert(t.projectionToView,l.vcpc),c.setUniformMatrix("PCVCMatrix",t.projectionToView),t.lastLightComplexity){default:case 0:break;case 1:case 2:case 3:var B=0,k=[];r.getLights().forEach(function(e){if(e.getSwitch()>0){var t=e.getColor(),n=e.getIntensity();k[0]=t[0]*n,k[1]=t[1]*n,k[2]=t[2]*n,c.setUniform3fArray("lightColor".concat(B),k);var r=e.getDirection();i.set(R,r[0],r[1],r[2]),i.transformMat3(R,R,l.normalMatrix),c.setUniform3f("lightDirectionVC".concat(B),R[0],R[1],R[2]);var a=[-.5*R[0],-.5*R[1],-.5*(R[2]-1)];c.setUniform3fArray("lightHalfAngleVC".concat(B),a),B++}})}},e.setPropertyShaderParameters=function(e,n,r){var a=e.getProgram();a.setUniformi("ctexture",t.colorTexture.getTextureUnit()),a.setUniformi("otexture",t.opacityTexture.getTextureUnit()),a.setUniformi("jtexture",t.jitterTexture.getTextureUnit());var o=t.scalarTexture.getVolumeInfo(),i=r.getProperty(),s=t.scalarTexture.getComponents(),l=r.getProperty().getIndependentComponents();if(l&&s>=2)for(var u=0;u0&&(a.setUniformf("vAmbient",i.getAmbient()),a.setUniformf("vDiffuse",i.getDiffuse()),a.setUniformf("vSpecular",i.getSpecular()),a.setUniformf("vSpecularPower",i.getSpecularPower()))},e.getClippingPlaneShaderParameters=function(e,n,r){if(t.renderable.getClippingPlanes().length>0){for(var a=t.openGLCamera.getKeyMatrices(n),o=[],s=[],l=t.renderable.getClippingPlanes(),u=l.length,c=0;c1.43){var e=t.framebuffer.getSize();return[t.fvp[0]*e[0],t.fvp[1]*e[1]]}return t.openGLRenderWindow.getFramebufferSize()},e.renderPieceStart=function(n,r){if(t.renderable.getAutoAdjustSampleDistances()){var a=n.getVTKWindow().getInteractor(),o=a.getLastFrameTime();if(t.avgFrameTime=.97*t.avgFrameTime+.03*o,t.avgWindowArea=.97*t.avgWindowArea+.03/(t.lastXYF*t.lastXYF),n.getVTKWindow().getInteractor().isAnimating()){var i=Math.sqrt(t.avgFrameTime*a.getDesiredUpdateRate()/t.avgWindowArea);i>10&&(i=10),t.targetXYF=i}else t.targetXYF=Math.sqrt(t.avgFrameTime*a.getStillUpdateRate()/t.avgWindowArea);t.targetXYF<1.53&&t.targetXYF>1.33&&(t.targetXYF=t.lastXYF),Math.abs(1-t.targetXYF/t.lastXYF)<.1&&(t.targetXYF=t.lastXYF),t.lastXYF=t.targetXYF}else t.lastXYF=t.renderable.getImageSampleDistance();t.lastXYF<=1.43&&(t.lastXYF=1);var s=t.lastXYF,l=t.openGLRenderWindow.getFramebufferSize();if(s>1.43){if(t.framebuffer.saveCurrentBindingsAndBuffers(),null===t.framebuffer.getGLFramebuffer())t.framebuffer.create(Math.floor(.7*l[0]),Math.floor(.7*l[1])),t.framebuffer.populateFramebuffer();else{var u=t.framebuffer.getSize();u[0]===Math.floor(.7*l[0])&&u[1]===Math.floor(.7*l[1])||(t.framebuffer.create(Math.floor(.7*l[0]),Math.floor(.7*l[1])),t.framebuffer.populateFramebuffer())}t.framebuffer.bind();var c=t.context;c.clearColor(0,0,0,0),c.colorMask(!0,!0,!0,!0),c.clear(c.COLOR_BUFFER_BIT),c.viewport(0,0,l[0]/s,l[1]/s),t.fvp=[Math.floor(l[0]/s)/Math.floor(.7*l[0]),Math.floor(l[1]/s)/Math.floor(.7*l[1])]}t.context.disable(t.context.DEPTH_TEST),e.updateBufferObjects(n,r),r.getProperty().getInterpolationType()===Ri.NEAREST?(t.scalarTexture.setMinificationFilter(Yo.NEAREST),t.scalarTexture.setMagnificationFilter(Yo.NEAREST)):(t.scalarTexture.setMinificationFilter(Yo.LINEAR),t.scalarTexture.setMagnificationFilter(Yo.LINEAR)),t.lastBoundBO=null,null!==t.zBufferTexture&&t.zBufferTexture.activate()},e.renderPieceDraw=function(n,r){var a=t.context;t.scalarTexture.activate(),t.opacityTexture.activate(),t.colorTexture.activate(),t.jitterTexture.activate(),e.updateShaders(t.tris,n,r),a.drawArrays(a.TRIANGLES,0,t.tris.getCABO().getElementCount()),t.tris.getVAO().release(),t.scalarTexture.deactivate(),t.colorTexture.deactivate(),t.opacityTexture.deactivate(),t.jitterTexture.deactivate()},e.renderPieceFinish=function(e,n){if(null!==t.zBufferTexture&&t.zBufferTexture.deactivate(),t.lastXYF>1.43){if(t.framebuffer.restorePreviousBindingsAndBuffers(),null===t.copyShader){t.copyShader=t.openGLRenderWindow.getShaderCache().readyShaderProgramArray(["//VTK::System::Dec","attribute vec4 vertexDC;","uniform vec2 tfactor;","varying vec2 tcoord;","void main() { tcoord = vec2(vertexDC.x*0.5 + 0.5, vertexDC.y*0.5 + 0.5) * tfactor; gl_Position = vertexDC; }"].join("\n"),["//VTK::System::Dec","//VTK::Output::Dec","uniform sampler2D texture1;","varying vec2 tcoord;","void main() { gl_FragData[0] = texture2D(texture1,tcoord); }"].join("\n"),"");var r=t.copyShader;t.copyVAO=zo.newInstance(),t.copyVAO.setOpenGLRenderWindow(t.openGLRenderWindow),t.tris.getCABO().bind(),t.copyVAO.addAttributeArray(r,t.tris.getCABO(),"vertexDC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||ji("Error setting vertexDC in copy shader VAO.")}else t.openGLRenderWindow.getShaderCache().readyShaderProgram(t.copyShader);var a=t.openGLRenderWindow.getFramebufferSize();t.context.viewport(0,0,a[0],a[1]);var o=t.framebuffer.getColorTexture();o.activate(),t.copyShader.setUniformi("texture",o.getTextureUnit()),t.copyShader.setUniform2f("tfactor",t.fvp[0],t.fvp[1]);var i=t.context;i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA),t.context.drawArrays(t.context.TRIANGLES,0,t.tris.getCABO().getElementCount()),o.deactivate(),i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA)}},e.renderPiece=function(n,r){e.invokeEvent({type:"StartEvent"}),t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent({type:"EndEvent"}),t.currentInput?(e.renderPieceStart(n,r),e.renderPieceDraw(n,r),e.renderPieceFinish(n,r)):ji("No input!")},e.computeBounds=function(n,r){e.getInput()?t.bounds=e.getInput().getBounds():Na(t.Bounds)},e.updateBufferObjects=function(t,n){e.getNeedToRebuildBufferObjects(t,n)&&e.buildBufferObjects(t,n)},e.getNeedToRebuildBufferObjects=function(n,r){return t.VBOBuildTime.getMTime()1?1:-1,A[3*I+2]=-1;var R=new Uint16Array(8);R[0]=3,R[1]=0,R[2]=1,R[3]=3,R[4]=3,R[5]=0,R[6]=3,R[7]=2;var E=vo.newInstance({numberOfComponents:3,values:A});E.setName("points");var D=vo.newInstance({numberOfComponents:1,values:R});t.tris.getCABO().createVBO(D,"polys",Mo.SURFACE,{points:E,cellOffset:0})}t.VBOBuildTime.modified()}}}}var Hi={context:null,VBOBuildTime:null,scalarTexture:null,scalarTextureString:null,opacityTexture:null,opacityTextureString:null,colorTexture:null,colorTextureString:null,jitterTexture:null,tris:null,framebuffer:null,copyShader:null,copyVAO:null,lastXYF:1,targetXYF:1,zBufferTexture:null,lastZBufferTexture:null,lastLightComplexity:0,fullViewportTime:1,idxToView:null,idxNormalMatrix:null,modelToView:null,projectionToView:null,avgWindowArea:0,avgFrameTime:0};function Ki(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hi,n),pr.extend(e,t,n),t.VBOBuildTime={},ur.g(t.VBOBuildTime,{mtime:0}),t.tris=Xo.newInstance(),t.scalarTexture=li.newInstance(),t.opacityTexture=li.newInstance(),t.colorTexture=li.newInstance(),t.jitterTexture=li.newInstance(),t.jitterTexture.setWrapS(qo.REPEAT),t.jitterTexture.setWrapT(qo.REPEAT),t.framebuffer=Ii.newInstance(),t.idxToView=o.identity(new Float64Array(16)),t.idxNormalMatrix=a.identity(new Float64Array(9)),t.modelToView=o.identity(new Float64Array(16)),t.projectionToView=o.identity(new Float64Array(16)),t.projectionToWorld=o.identity(new Float64Array(16)),ur.i(e,t,["context"]),zi(e,t)}var Xi=ur.d(Ki,"vtkOpenGLVolumeMapper");yr("vtkVolumeMapper",Xi);var qi=ur.k;var Yi={};function Zi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yi,n),pr.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkOpenGLPixelSpaceCallbackMapper"),e.opaquePass=function(n,r){t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent();var a=t.openGLRenderer.getAspectRatio(),o=t.openGLRenderer?t.openGLRenderer.getRenderable().getActiveCamera():null,i=t.openGLRenderer.getTiledSizeAndOrigin(),s=null;if(t.renderable.getUseZValues()){var l=r.getZBufferTexture(),u=Math.floor(l.getWidth()),c=Math.floor(l.getHeight()),d=t.openGLRenderWindow.getContext();l.bind();var f=r.getFramebuffer();f?f.saveCurrentBindingsAndBuffers():qi("No framebuffer to save/restore");var p=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,p),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,l.getHandle(),0),d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE&&(s=new Uint8Array(u*c*4),d.viewport(0,0,u,c),d.readPixels(0,0,u,c,d.RGBA,d.UNSIGNED_BYTE,s)),f&&f.restorePreviousBindingsAndBuffers(),d.deleteFramebuffer(p)}t.renderable.invokeCallback(t.renderable.getInputData(),o,a,i,s)},e.queryPass=function(e,n){e&&t.renderable.getUseZValues()&&n.requestDepth()}}(e,t)}var Qi=ur.d(Zi,"vtkOpenGLPixelSpaceCallbackMapper");yr("vtkPixelSpaceCallbackMapper",Qi);var $i=Object.create(null);function Ji(e,t){$i[e]=t}var es={};function ts(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,es,n),t.overrides=$i,vr.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkWebGPUViewNodeFactory")}(0,t)}ur.a.newInstance(ts,"vtkWebGPUViewNodeFactory");var ns={keyMatrixTime:null,keyMatrices:null};function rs(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ns,n),pr.extend(e,t,n),t.keyMatrixTime={},ur.a.obj(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(16),vcpc:new Float64Array(16),pcsc:new Float64Array(16),wcvc:new Float64Array(16),scpc:new Float64Array(16),scvc:new Float64Array(16)},ur.a.setGet(e,t,["keyMatrixTime"]),function(e,t){t.classHierarchy.push("vtkWebGPUCamera"),e.getKeyMatrices=function(n){var r=n.getRenderable(),a=n.getParent();if(Math.max(a.getMTime(),e.getMTime(),r.getMTime(),t.renderable.getMTime(),n.getStabilizedTime().getMTime())>t.keyMatrixTime.getMTime()){var i=t.renderable.getViewMatrix();o.copy(t.keyMatrices.normalMatrix,i),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,o.invert(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),o.transpose(t.keyMatrices.wcvc,i);var s=n.getStabilizedCenterByReference();o.translate(t.keyMatrices.scvc,t.keyMatrices.wcvc,s);var l=n.getAspectRatio(),u=t.renderable.getProjectionMatrix(l,-1,1);o.transpose(t.keyMatrices.vcpc,u),t.keyMatrices.vcpc[2]=.5*u[8]+.5*u[12],t.keyMatrices.vcpc[6]=.5*u[9]+.5*u[13],t.keyMatrices.vcpc[10]=.5*u[10]+.5*u[14],t.keyMatrices.vcpc[14]=.5*u[11]+.5*u[15],o.multiply(t.keyMatrices.scpc,t.keyMatrices.vcpc,t.keyMatrices.scvc),o.invert(t.keyMatrices.pcsc,t.keyMatrices.scpc),t.keyMatrixTime.modified()}return t.keyMatrices}}(e,t)}var as=ur.a.newInstance(rs);Ji("vtkCamera",as);var os={device:null,handle:null,name:null};function is(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,os,n),ur.a.obj(e,t),t.bindables=[],t.bindGroupTime={},ur.a.obj(t.bindGroupTime,{mtime:0}),ur.a.get(e,t,["bindGroupTime","handle","sizeInBytes","usage"]),ur.a.setGet(e,t,["name","device","arrayInformation","sourceTime"]),function(e,t){t.classHierarchy.push("vtkWebGPUBindGroup"),e.addBindable=function(n){for(var r=0;rr?o:r}if(r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ls,n),ur.a.obj(e,t),ur.a.get(e,t,["lastCameraMTime"]),ur.a.setGet(e,t,["device","handle"]),function(e,t){t.classHierarchy.push("vtkWebGPUShaderModule"),e.initialize=function(e,n){t.device=e,t.handle=t.device.getHandle().createShaderModule({code:n.getCode()})}}(e,t)}var cs={newInstance:ur.a.newInstance(us,"vtkWebGPUShaderModule"),extend:us};var ds={shaderModules:null,device:null,window:null};function fs(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ds,n),t._shaderModules=new Map,ur.a.obj(e,t),ur.a.setGet(e,t,["device","window"]),function(e,t){t.classHierarchy.push("vtkWebGPUShaderCache"),e.getShaderModule=function(e){for(var n=e.getType(),r=e.getHash(),a=t._shaderModules.keys(),o=0;o3&&void 0!==arguments[3])||arguments[3],a=Array.isArray(n)?n.join("\n"):n,o=!1;-1!==e.search(t)&&(o=!0);var i="";r&&(i="g");var s=new RegExp(t,i);return{replace:o,result:e.replace(s,a)}}};var gs={handle:null,layouts:null,renderEncoder:null,shaderDescriptions:null,vertexState:null,topology:null};function ms(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gs,n),ur.g(e,t),t.layouts=[],t.shaderDescriptions=[],ur.b(e,t,["handle"]),ur.i(e,t,["device","renderEncoder","topology","vertexState"]),function(e,t){t.classHierarchy.push("vtkWebGPUPipeline"),e.getShaderDescriptions=function(){return t.shaderDescriptions},e.initialize=function(e){var n=t.renderEncoder.getPipelineSettings();n.primitive.topology=t.topology,n.vertex=t.vertexState;for(var r=[],a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hs,n),t.outputNames=[],t.outputTypes=[],t.builtinOutputNames=[],t.builtinOutputTypes=[],t.builtinInputNames=[],t.builtinInputTypes=[],ur.a.obj(e,t),ur.a.setGet(e,t,["type","hash","code"]),ur.a.getArray(e,t,["outputTypes","outputNames"]),function(e,t){t.classHierarchy.push("vtkWebGPUShaderDescription"),e.hasOutput=function(e){return t.outputNames.includes(e)},e.addOutput=function(e,n){t.outputTypes.push(e),t.outputNames.push(n)},e.addBuiltinOutput=function(e,n){t.builtinOutputTypes.push(e),t.builtinOutputNames.push(n)},e.addBuiltinInput=function(e,n){t.builtinInputTypes.push(e),t.builtinInputNames.push(n)},e.replaceShaderCode=function(e,n){var r=[],a=[];if(n&&r.push(n.getShaderCode()),e||t.builtinInputNames.length){var o=[];if(o.push("struct ".concat(t.type,"Input\n{")),e)for(var i=e.getOutputNamesByReference(),s=e.getOutputTypesByReference(),l=0;l1&&(o.push("};"),a=o,r[r.length-1]+=",",r.push("input: ".concat(t.type,"Input")))}if(r.length&&(t.code=ps.substitute(t.code,"//VTK::IOStructs::Input",r).result),t.outputNames.length+t.builtinOutputNames.length){for(var c=["struct ".concat(t.type,"Output\n{")],d=0;d ".concat(t.type,"Output")]).result}t.code=ps.substitute(t.code,"//VTK::IOStructs::Dec",a).result}}(e,t)}var bs={newInstance:ur.a.newInstance(ys,"vtkWebGPUShaderDescription"),extend:ys};var Ts={getByteStrideFromBufferFormat:function(e){if(!e||e.length<5)return 0;var t=1;"x"===e[e.length-2]&&(t=e[e.length-1]);var n=1===t?e.length-1:e.length-3,r=Number(e[n]);return Number.isNaN(r)?(Object(ur.l)("unknown format ".concat(e)),0):t*(5-r/2)},getNativeTypeFromBufferFormat:function(e){if(!e||e.length<5)return 0;var t;if("f"===e[0])t="Float";else if("s"===e[0])t="Int";else{if("u"!==e[0])return void Object(ur.l)("unknown format ".concat(e));t="Uint"}var n=e.split("x")[0],r=Number(n[n.length-1]);if(!Number.isNaN(r))return t+=8*(5-r/2),t+="Array";Object(ur.l)("unknown format ".concat(e))},getShaderTypeFromBufferFormat:function(e){var t;if("f"===e[0]||"n"===e[1])t="f32";else if("s"===e[0]&&"i"===e[1])t="i32";else{if("u"!==e[0]||"i"!==e[1])return void Object(ur.l)("unknown format ".concat(e));t="u32"}var n=1;return"x"===e[e.length-2]&&(n=Number(e[e.length-1])),4===n?"vec4<".concat(t,">"):3===n?"vec3<".concat(t,">"):2===n?"vec2<".concat(t,">"):t},getByteStrideFromShaderFormat:function(e){if(!e)return 0;var t=1;return"vec"===e.substring(0,3)?t=e[3]:"mat"===e.substring(0,3)&&(t=e[3]*e[5]),4*t},getNativeTypeFromShaderFormat:function(e){if(e)return e.includes("f32")?"Float32Array":e.includes("i32")?"Int32Array":e.includes("u32")?"Uint32Array":void Object(ur.l)("unknown format ".concat(e))}};function Cs(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ss,n),ur.g(e,t),t.bindingDescriptions=[],t.attributeDescriptions=[],t.inputs=[],ur.i(e,t,["created","device","handle"]),function(e,t){t.classHierarchy.push("vtkWebGPUVertexInput"),e.addBuffer=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertex",a=n;Array.isArray(a)||(a=[a]);for(var o=0;ot.names[0]?1:0})},e.removeBufferIfPresent=function(e){for(var n=0;n0&&(e+=",\n"),e="".concat(e," [[location(").concat(n,")]] ").concat(t.inputs[r].names[a]," : ").concat(i),n++}return e},e.getVertexInputInformation=function(){var e={};if(t.inputs.length){for(var n=[],r=0,a=0;a = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",Os="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n // var computedColor:vec4 = vec4(1.0,0.5,0.5,1.0);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";var Ms={bindGroup:null,device:null,fragmentShaderTemplate:null,numberOfInstances:1,numberOfVertices:0,pipelineHash:null,shaderReplacements:null,SSBO:null,textureViews:null,topology:"triangle-list",UBO:null,vertexShaderTemplate:null,WebGPURenderer:null};function As(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ms,n),ur.a.obj(e,t),t.textureViews=[],t.vertexInput=ws.newInstance(),t.bindGroup=ss.newInstance(),t.bindGroup.setName("mapperBG"),t.fragmentShaderTemplate=t.fragmentShaderTemplate||Os,t.vertexShaderTemplate=t.vertexShaderTemplate||xs,t.shaderReplacements=new Map,ur.a.get(e,t,["vertexInput"]),ur.a.setGet(e,t,["device","fragmentShaderTemplate","interpolate","numberOfInstances","numberOfVertices","pipelineHash","shaderReplacements","SSBO","textureViews","topology","UBO","vertexShaderTemplate","WebGPURenderer"]),function(e,t){t.classHierarchy.push("vtkWebGPUMapperHelper"),e.generateShaderDescriptions=function(n,r,a){var o=bs.newInstance({type:"vertex",hash:n,code:t.vertexShaderTemplate}),i=bs.newInstance({type:"fragment",hash:n,code:t.fragmentShaderTemplate}),s=r.getShaderDescriptions();s.push(o),s.push(i);for(var l=t.vertexShaderTemplate+t.fragmentShaderTemplate,u=new RegExp("//VTK::[^:]*::","g"),c=l.match(u).filter(function(e,t,n){return n.indexOf(e)===t}).map(function(e){return"replaceShader".concat(e.substring(7,e.length-2))}),d=0;d","[[builtin(position)]] Position");var a=r.getCode();a=ps.substitute(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*vertexBC;"]).result,r.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderTCoord=function(e,t,n){t.getShaderDescription("vertex").addOutput("vec2","tcoordVS")},t.shaderReplacements.set("replaceShaderTCoord",e.replaceShaderTCoord),e.addTextureView=function(e){t.textureViews.includes(e)||t.textureViews.push(e)},e.renderForPipeline=function(e){var n=e.getBoundPipeline();e.activateBindGroup(t.bindGroup),n.bindVertexInput(e,t.vertexInput),e.draw(t.numberOfVertices,t.numberOfInstances,0,0)},e.registerToDraw=function(){t.pipeline&&t.WebGPURenderer.registerPipelineCallback(t.pipeline,e.renderForPipeline)},e.render=function(n,r){e.build(n,r),n.setPipeline(t.pipeline),t.WebGPURenderer&&t.WebGPURenderer.bindUBO(n),e.renderForPipeline(n)},e.build=function(n,r){t.renderEncoder=n,t.pipeline=r.getPipeline(t.pipelineHash),t.UBO&&t.bindGroup.addBindable(t.UBO),t.SSBO&&t.bindGroup.addBindable(t.SSBO);for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Rs,n),Is.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkWebGPUFullScreenQuad"),e.replaceShaderPosition=function(e,t,n){var r=t.getShaderDescription("vertex");r.addBuiltinOutput("vec4","[[builtin(position)]] Position");var a=r.getCode();a=ps.substitute(a,"//VTK::Position::Impl",["output.tcoordVS = vec2(vertexBC.x * 0.5 + 0.5, 1.0 - vertexBC.y * 0.5 - 0.5);","output.Position = vec4(vertexBC, 1.0);"]).result,r.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition);var n=e.build;e.build=function(e,r){var a=r.getBufferManager().getFullScreenQuadBuffer();t.vertexInput.addBuffer(a,["vertexBC"]),t.numberOfVertices=6,n(e,r)}}(e,t)}var Ds={newInstance:ur.a.newInstance(Es,"vtkWebGPUFullScreenQuad"),extend:Es},Vs={BufferUsage:{Verts:0,Lines:1,Triangles:2,Strips:3,LinesFromStrips:4,LinesFromTriangles:5,Points:6,UniformArray:7,PointArray:8,NormalsFromPoints:9,Texture:10,RawVertex:11,Storage:12},PrimitiveTypes:{Start:0,Points:0,Lines:1,Triangles:2,TriangleStrips:3,TriangleEdges:4,TriangleStripEdges:5,End:6}};function Ls(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ns(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Bs=["getMappedRange","mapAsync","unmap"];function ks(e,t){t.classHierarchy.push("vtkWebGPUBuffer"),e.create=function(e,n){t.handle=t.device.getHandle().createBuffer({size:e,usage:n}),t.sizeInBytes=e,t.usage=n},e.write=function(e){!function(e,t,n,r){var a=r.byteLength,o=e.createBuffer({size:a,usage:GPUBufferUsage.COPY_SRC,mappedAtCreation:!0}),i=o.getMappedRange(0,a);new Uint8Array(i).set(new Uint8Array(r)),o.unmap();var s=e.createCommandEncoder();s.copyBufferToBuffer(o,0,t,n,a);var l=s.finish();e.queue.submit([l]),o.destroy()}(t.device.getHandle(),t.handle,0,e.buffer)},e.createAndWrite=function(e,n){t.handle=t.device.getHandle().createBuffer({size:e.byteLength,usage:n,mappedAtCreation:!0}),t.sizeInBytes=e.byteLength,t.usage=n,new Uint8Array(t.handle.getMappedRange()).set(new Uint8Array(e.buffer)),t.handle.unmap()};for(var n=function(n){e[Bs[n]]=function(){var e;return(e=t.handle)[Bs[n]].apply(e,arguments)}},r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fs,n),ur.a.obj(e,t),ur.a.get(e,t,["handle","sizeInBytes","usage"]),ur.a.setGet(e,t,["strideInBytes","device","arrayInformation","sourceTime"]),ks(e,t)}var _s=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ks,n),ur.a.obj(e,t),ur.a.setGet(e,t,["lighting","interpolation","ambient","diffuse","specular","specularPower","opacity","edgeVisibility","lineWidth","pointSize","backfaceCulling","frontfaceCulling","representation"]),ur.a.setGetArray(e,t,["ambientColor","specularColor","diffuseColor","edgeColor"],3),function(e,t){t.classHierarchy.push("vtkProperty"),e.setColor=function(n,r,a){Array.isArray(n)?t.color[0]===n[0]&&t.color[1]===n[1]&&t.color[2]===n[2]||(t.color[0]=n[0],t.color[1]=n[1],t.color[2]=n[2],e.modified()):t.color[0]===n&&t.color[1]===r&&t.color[2]===a||(t.color[0]=n,t.color[1]=r,t.color[2]=a,e.modified()),e.setDiffuseColor(t.color),e.setAmbientColor(t.color),e.setSpecularColor(t.color)},e.computeCompositeColor=Hs("ComputeCompositeColor"),e.getColor=function(){var e=0;t.ambient+t.diffuse+t.specular>0&&(e=1/(t.ambient+t.diffuse+t.specular));for(var n=0;n<3;n++)t.color[n]=e*(t.ambient*t.ambientColor[n]+t.diffuse*t.diffuseColor[n]+t.specular*t.specularColor[n]);return[].concat(t.color)},e.addShaderVariable=Hs("AddShaderVariable"),e.setInterpolationToFlat=function(){return e.setInterpolation(zs.FLAT)},e.setInterpolationToGouraud=function(){return e.setInterpolation(zs.GOURAUD)},e.setInterpolationToPhong=function(){return e.setInterpolation(zs.PHONG)},e.getInterpolationAsString=function(){return ur.a.enumToString(zs,t.interpolation)},e.setRepresentationToWireframe=function(){return e.setRepresentation(Ws.WIREFRAME)},e.setRepresentationToSurface=function(){return e.setRepresentation(Ws.SURFACE)},e.setRepresentationToPoints=function(){return e.setRepresentation(Ws.POINTS)},e.getRepresentationAsString=function(){return ur.a.enumToString(Ws,t.representation)}}(e,t)}var qs=function(e){for(var t=1;t1?2*(e-1):0},polysToWireframe:function(e,t){return e>2?2*e:0},stripsToWireframe:function(e,t){return e>2?4*e-6:0},polysToSurface:function(e,t){return e>2?3*(e-2):0},stripsToSurface:function(e,t,n){return numPoints>2?3*(e-2):0}};function al(e){switch(e){case Js.Points:return"points";case Js.Lines:return"lines";case Js.Triangles:return"polys";case Js.TriangleStrips:return"strips";default:return""}}function ol(e,t,n){var r=null;r=t===el.POINTS||"points"===n?rl.anythingToPoints:t===el.WIREFRAME||"lines"===n?rl["".concat(n,"ToWireframe")]:rl["".concat(n,"ToSurface")];for(var a=e.getData(),o=a.length,i=0,s=0;s2)for(var a=0;a2){for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ll,n),ur.g(e,t),t.buffers=new WeakMap,ur.i(e,t,["device"]),sl(e,t)}var cl=Zs(Zs({newInstance:ur.d(ul),extend:ul},{}),Vs);function dl(e){return function(e){if(Array.isArray(e))return fl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return fl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ml,n),ur.a.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"uniform"}},t.sendTime={},ur.a.obj(t.sendTime,{mtime:0}),t.bindGroupTime={},ur.a.obj(t.bindGroupTime,{mtime:0}),t.sendDirty=!0,t.sortDirty=!0,ur.a.get(e,t,["binding","bindGroupTime"]),ur.a.setGet(e,t,["bindGroupLayoutEntry","device","name","sizeInBytes"]),function(e,t){t.classHierarchy.push("vtkWebGPUUniformBuffer"),e.addEntry=function(e,n){t._bufferEntryNames.has(e)?gl("entry named ".concat(e," already exists")):(t.sortDirty=!0,t._bufferEntryNames.set(e,t.bufferEntries.length),t.bufferEntries.push({name:e,type:n,sizeInBytes:Ts.getByteStrideFromShaderFormat(n),offset:-1,nativeType:Ts.getNativeTypeFromShaderFormat(n),packed:!1}))},e.sortBufferEntries=function(){if(t.sortDirty){for(var e=0,n=[],r=0;r4&&(C.packed=!0,C.offset=e,n.push(C),e+=C.sizeInBytes)}for(var S=0;S ").concat(t.name,": ").concat(t.name,"Struct;")),a.join("\n")}}(e,t)}var hl={newInstance:ur.a.newInstance(vl,"vtkWebGPUUniformBuffer"),extend:vl},yl=ur.k,bl="\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n var computedColor: vec4 = mapperUBO.BackgroundColor;\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";var Tl={bindGroup:null,selector:null,renderEncoder:null,recenterThreshold:20,suppressClear:!1,stabilizedCenter:[0,0,0]};function Cl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tl,n),pr.extend(e,t,n),t.UBO=hl.newInstance(),t.UBO.setName("rendererUBO"),t.UBO.addEntry("WCVCMatrix","mat4x4"),t.UBO.addEntry("SCPCMatrix","mat4x4"),t.UBO.addEntry("PCSCMatrix","mat4x4"),t.UBO.addEntry("SCVCMatrix","mat4x4"),t.UBO.addEntry("VCPCMatrix","mat4x4"),t.UBO.addEntry("WCVCNormals","mat4x4"),t.UBO.addEntry("cameraParallel","u32"),t.bindGroup=ss.newInstance(),t.bindGroup.setName("rendererBG"),t.bindGroup.addBindable(t.UBO),t.tmpMat4=o.identity(new Float64Array(16)),t.stabilizedTime={},ur.g(t.stabilizedTime,{mtime:0}),ur.b(e,t,["bindGroup","stabilizedTime"]),ur.c(e,t,["stabilizedCenter"]),ur.i(e,t,["renderEncoder","selector","suppressClear","UBO"]),function(e,t){t.classHierarchy.push("vtkWebGPURenderer"),e.buildPass=function(n){if(n){if(!t.renderable)return;t.renderable.isActiveCameraCreated()||t.renderable.resetCamera(),e.updateLights(),e.prepareNodes(),e.addMissingNode(t.renderable.getActiveCamera()),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes(),e.updateStabilizedMatrix()}},e.updateStabilizedMatrix=function(){var e=t.renderable.getActiveCamera(),n=e.getClippingRange(),r=e.getPositionByReference(),a=e.getDirectionOfProjectionByReference(),o=[],s=[];i.scale(s,a,.5*(n[0]+n[1])),i.add(o,r,s),i.sub(s,o,t.stabilizedCenter),i.len(s)/(n[1]-n[0])>t.recenterThreshold&&(t.stabilizedCenter=o,t.stabilizedTime.modified())},e.updateLights=function(){for(var e=0,n=t.renderable.getLightsByReference(),r=0;r0&&e++;return e||(yl("No lights are on, creating one."),t.renderable.createLight()),e},e.registerPipelineCallback=function(e,n){for(var r=0;ra||e.getMTime()>a||n.getMTime()>a||t.renderable.getMTime()>a){var o=r.getKeyMatrices(e);t.UBO.setArray("WCVCMatrix",o.wcvc),t.UBO.setArray("SCPCMatrix",o.scpc),t.UBO.setArray("PCSCMatrix",o.pcsc),t.UBO.setArray("SCVCMatrix",o.scvc),t.UBO.setArray("VCPCMatrix",o.vcpc),t.UBO.setArray("WCVCNormals",o.normalMatrix),t.UBO.setValue("cameraParallel",n.getParallelProjection());var i=t.parent.getDevice();t.UBO.sendIfNeeded(i)}},e.scissorAndViewport=function(t){var n=e.getYInvertedTiledSizeAndOrigin();t.getHandle().setViewport(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize,0,1),t.getHandle().setScissorRect(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize)},e.bindUBO=function(e){e.activateBindGroup(t.bindGroup)},e.opaquePass=function(n){if(n)t.pipelineCallbacks=[],t.renderEncoder.begin(t.parent.getCommandEncoder()),e.updateUBO();else{e.scissorAndViewport(t.renderEncoder),e.clear();for(var r=0;r"),t.clearFSQ.setUBO(n)}var r=t.renderable.getBackgroundByReference();t.clearFSQ.getUBO().setArray("BackgroundColor",r),t.clearFSQ.getUBO().sendIfNeeded(e),t.clearFSQ.render(t.renderEncoder,e)}},e.translucentPass=function(n){if(n)t.pipelineCallbacks=[],t.renderEncoder.begin(t.parent.getCommandEncoder());else{e.scissorAndViewport(t.renderEncoder);for(var r=0;rn[2]-n[0]&&(l=n[2]-n[0]),u>n[3]-n[1]&&(u=n[3]-n[1]);var c=t.parent.normalizedDisplayToDisplay(l,u),d=Math.round(c[0])-i,f=Math.round(c[1])-s;return d<0&&(d=0),f<0&&(f=0),{usize:d,vsize:f,lowerLeftU:i,lowerLeftV:s}},e.getPropFromID=function(e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Pl,n),pr.extend(e,t,n),t.keyMatricesTime={},ur.a.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={bcwc:new Float64Array(16),bcsc:new Float64Array(16)},ur.a.get(e,t,["propID","keyMatricesTime"]),function(e,t){t.classHierarchy.push("vtkWebGPUVolume"),e.buildPass=function(n){t.renderable&&t.renderable.getVisibility()&&n&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.queryPass=function(n,r){if(n){if(!t.renderable||!t.renderable.getVisibility())return;var a=t.renderable.getMapper().getBounds();if(!a||6!==a.length||a[0]>a[1])return;r.addVolume(e)}},e.getBoundingCubePoints=function(e,n){for(var r=t.renderable.getMapper().getBounds(),a=t.renderable.getMatrix(),o=0,i=4;i<6;i++)for(var s=r[i],l=2;l<4;l++)for(var u=r[l],c=0;c<2;c++){var d=r[c],f=n+3*o;e[f++]=a[0]*d+a[1]*u+a[2]*s+a[3],e[f++]=a[4]*d+a[5]*u+a[6]*s+a[7],e[f++]=a[8]*d+a[9]*u+a[10]*s+a[11],o++}},e.traverseVolumePass=function(n){t.renderable&&t.renderable.getVisibility()&&(!t.WebGPURenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children[0].traverse(n),e.apply(n,!1))},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime().getMTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var n=t.renderable.getMatrix(),r=e.getStabilizedCenterByReference();o.transpose(t.keyMatrices.bcwc,n),o.translate(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-r[0],-r[1],-r[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}(e,t)}var xl=ur.a.newInstance(wl,"vtkWebGPUVolume");Ji("vtkVolume",xl);var Ol={};function Ml(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ol,n),pr.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkWebGPUPixelSpaceCallbackMapper"),e.opaquePass=function(n,r){t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent();var a=t.WebGPURenderer.getAspectRatio(),o=t.WebGPURenderer?t.WebGPURenderer.getRenderable().getActiveCamera():null,i=t.WebGPURenderer.getTiledSizeAndOrigin();t.renderable.getUseZValues(),t.renderable.invokeCallback(t.renderable.getInputData(),o,a,i,null)}}(e,t)}var Al=ur.a.newInstance(Ml,"vtkWebGPUPixelSpaceCallbackMapper");Ji("vtkPixelSpaceCallbackMapper",Al);var Il={context:null,keyMatrixTime:null,keyMatrices:null,activeTextures:null};function Rl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Il,n),pr.extend(e,t,n),t.keyMatrixTime={},ur.g(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:a.identity(new Float64Array(9)),mcwc:o.identity(new Float64Array(16))},ur.i(e,t,["context"]),ur.b(e,t,["activeTextures"]),function(e,t){t.classHierarchy.push("vtkOpenGLActor"),e.buildPass=function(n){if(n){t.openGLRenderWindow=e.getFirstAncestorOfType("vtkOpenGLRenderWindow"),t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t.openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNodes(t.renderable.getTextures()),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes(),t.ogltextures=null,t.activeTextures=null;for(var r=0;rt.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),o.copy(t.keyMatrices.mcwc,t.renderable.getMatrix()),o.transpose(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.renderable.getIsIdentity()?a.identity(t.keyMatrices.normalMatrix):(a.fromMat4(t.keyMatrices.normalMatrix,t.keyMatrices.mcwc),a.invert(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),a.transpose(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),t.keyMatrixTime.modified()),t.keyMatrices}}(e,t)}var El=ur.d(Rl);yr("vtkActor",El);var Dl={context:null,activeTextures:[]};function Vl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Dl,n),pr.extend(e,t,n),ur.i(e,t,["context"]),ur.b(e,t,["activeTextures"]),function(e,t){t.classHierarchy.push("vtkOpenGLActor2D"),e.buildPass=function(n){if(n){if(!t.renderable)return;t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),e.prepareNodes(),e.addMissingNodes(t.renderable.getTextures()),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes()}},e.traverseOpaquePass=function(n){t.renderable&&t.renderable.getVisibility()&&t.renderable.getIsOpaque()&&(!t.openGLRenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children.forEach(function(e){e.isA("vtkOpenGLTexture")||e.traverse(n)}),e.apply(n,!1))},e.traverseTranslucentPass=function(n){!t.renderable||!t.renderable.getVisibility()||t.renderable.getIsOpaque()||t.openGLRenderer.getSelector()&&!t.renderable.getPickable()||(e.apply(n,!0),t.children.forEach(function(e){e.isA("vtkOpenGLTexture")||e.traverse(n)}),e.apply(n,!1))},e.activateTextures=function(){t.activeTextures=[],t.children.forEach(function(e){e.isA("vtkOpenGLTexture")&&(e.render(),e.getHandle()&&t.activeTextures.push(e))})},e.opaquePass=function(n,r){n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!0),e.activateTextures()):t.activeTextures.forEach(function(e){e.deactivate()})},e.translucentPass=function(n,r){n?(t.context=e.getFirstAncestorOfType("vtkOpenGLRenderWindow").getContext(),t.context.depthMask(!1),e.activateTextures()):(t.activeTextures.forEach(function(e){e.deactivate()}),t.context.depthMask(!0))}}(e,t)}var Ll=ur.d(Vl);yr("vtkActor2D",Ll);var Nl={clippingPlanes:[]};var Bl={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Nl,n),ur.a.obj(e,t),ur.a.algo(e,t,1,0),t.clippingPlanes||(t.clippingPlanes=[]),function(e,t){e.update=function(){e.getInputData()},e.addClippingPlane=function(e){"vtkPlane"===e.getClassName()&&t.clippingPlanes.push(e)},e.getNumberOfClippingPlanes=function(){return t.clippingPlanes.length},e.removeAllClippingPlanes=function(){t.clippingPlanes.length=0},e.removeClippingPlane=function(e){e<0||e>=6||t.clippingPlanes.splice(e,1)},e.getClippingPlanes=function(){return t.clippingPlanes},e.setClippingPlanes=function(t){if(t)if(Array.isArray(t))for(var n=t.length,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kl,n),Bl.extend(e,t,n),t.bounds||Na(t.bounds),t.center||(t.center=[0,0,0]),function(e,t){e.getBounds=function(){return 0},e.getBounds=function(n){e.getBounds();for(var r=0;r<6;r++)n[r]=t.bounds[r]},e.getCenter=function(){e.getBounds();for(var n=0;n<3;n++)t.center[n]=(t.bounds[2*n+1]+t.bounds[2*n])/2;return t.center.slice()},e.getLength=function(){var n=0,r=0;e.getBounds();for(var a=0;a<3;a++)r+=(n=t.bounds[2*a+1]-t.bounds[2*a])*n;return Math.sqrt(r)},e.getClippingPlaneInDataCoords=function(e,n,r){var a=t.clippingPlanes,o=e;if(a){var i=a.length;if(n>=0&&n=0&&a.t<=1,a)}function Yl(e,t,n,r){var a={intersection:!1,l0:[],l1:[],error:null},o=[];ta(t,r,o);var i,s=o.map(function(e){return Math.abs(e)});if(s[0]+s[1]+s[2]s[1]&&s[0]>s[2]?"x":s[1]>s[2]?"y":"z";var u=[],c=-ea(t,e),d=-ea(r,n);switch(i){case"x":u[0]=0,u[1]=(d*t[2]-c*r[2])/o[0],u[2]=(c*r[1]-d*t[1])/o[0];break;case"y":u[0]=(c*r[2]-d*t[2])/o[1],u[1]=0,u[2]=(d*t[0]-c*r[0])/o[1];break;case"z":u[0]=(d*t[1]-c*r[1])/o[2],u[1]=(c*r[0]-d*t[0])/o[2],u[2]=0}return a.l0=u,Zr(u,o,a.l1),a.intersection=!0,a}var Zl={evaluate:function(e,t,n){return e[0]*(n[0]-t[0])+e[1]*(n[1]-t[1])+e[2]*(n[2]-t[2])},distanceToPlane:zl,projectPoint:Hl,projectVector:Kl,generalizedProjectPoint:Xl,intersectWithLine:ql,intersectWithPlane:Yl,DISJOINT:Wl,COINCIDE:jl};var Ql={normal:[0,0,1],origin:[0,0,0]};function $l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ql,n),ur.a.obj(e,t),ur.a.setGetArray(e,t,["normal","origin"],3),function(e,t){t.classHierarchy.push("vtkPlane"),e.distanceToPlane=function(e){return zl(e,t.origin,t.normal)},e.projectPoint=function(e,n){Hl(e,t.origin,t.normal,n)},e.projectVector=function(e,n){return Kl(e,t.normal,n)},e.push=function(e){if(0!==e)for(var n=0;n<3;n++)t.origin[n]+=e*t.normal[n]},e.generalizedProjectPoint=function(e,n){Xl(e,t.origin,t.normal,n)},e.evaluateFunction=function(e,n,r){return Array.isArray(e)?t.normal[0]*(e[0]-t.origin[0])+t.normal[1]*(e[1]-t.origin[1])+t.normal[2]*(e[2]-t.origin[2]):t.normal[0]*(e-t.origin[0])+t.normal[1]*(n-t.origin[1])+t.normal[2]*(r-t.origin[2])},e.evaluateGradient=function(e){return[t.normal[0],t.normal[1],t.normal[2]]},e.intersectWithLine=function(e,n){return ql(e,n,t.origin,t.normal)},e.intersectWithPlane=function(e,n){return Yl(e,n,t.origin,t.normal)}}(e,t)}var Jl=function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n(arguments.length<=1?void 0:arguments[1])?r:arguments.length<=1?void 0:arguments[1],e[2]=a<(arguments.length<=2?void 0:arguments[2])?a:arguments.length<=2?void 0:arguments[2],e[3]=o>(arguments.length<=2?void 0:arguments[2])?o:arguments.length<=2?void 0:arguments[2],e[4]=i<(arguments.length<=3?void 0:arguments[3])?i:arguments.length<=3?void 0:arguments[3],e[5]=s>(arguments.length<=3?void 0:arguments[3])?s:arguments.length<=3?void 0:arguments[3]}function pu(e,t,n,r,a,o,i){var s=au(e,6),l=s[0],u=s[1],c=s[2],d=s[3],f=s[4],p=s[5];void 0===i?(e[0]=Math.min(t[0],l),e[1]=Math.max(t[1],u),e[2]=Math.min(t[2],c),e[3]=Math.max(t[3],d),e[4]=Math.min(t[4],f),e[5]=Math.max(t[5],p)):(e[0]=Math.min(t,l),e[1]=Math.max(n,u),e[2]=Math.min(r,c),e[3]=Math.max(a,d),e[4]=Math.min(o,f),e[5]=Math.max(i,p))}function gu(e,t,n,r){var a=au(e,6),o=a[0],i=a[1],s=a[2],l=a[3],u=a[4],c=a[5];return e[0]=t,e[1]=t>i?t:i,e[2]=n,e[3]=n>l?n:l,e[4]=r,e[5]=r>c?r:c,o!==t||s!==n||u!==r}function mu(e,t,n,r){var a=au(e,6),o=a[0],i=a[1],s=a[2],l=a[3],u=a[4],c=a[5];return e[0]=t=0?(e[0]*=t,e[1]*=t):(e[0]=t*e[1],e[1]=t*e[0]),n>=0?(e[2]*=n,e[3]*=n):(e[2]=n*e[3],e[3]=n*e[2]),r>=0?(e[4]*=r,e[5]*=r):(e[4]=r*e[5],e[5]=r*e[4]),!0)}function yu(e){return[.5*(e[0]+e[1]),.5*(e[2]+e[3]),.5*(e[4]+e[5])]}function bu(e,t){return e[2*t+1]-e[2*t]}function Tu(e){return[bu(e,0),bu(e,1),bu(e,2)]}function Cu(e){return e.slice(0,2)}function Su(e){return e.slice(2,4)}function Pu(e){return e.slice(4,6)}function wu(e){var t=Tu(e);return t[0]>t[1]?t[0]>t[2]?t[0]:t[2]:t[1]>t[2]?t[1]:t[2]}function xu(e){if(uu(e)){var t=Tu(e);return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}return null}function Ou(e){return[e[0],e[2],e[4]]}function Mu(e){return[e[1],e[3],e[5]]}function Au(e,t){return e<=0&&t>=0||e>=0&&t<=0}function Iu(e,t){for(var n=0,r=0;r<2;r++)for(var a=2;a<4;a++)for(var o=4;o<6;o++)t[n]=[e[r],e[a],e[o]],n++}function Ru(e,t,n){t[0]=e[0],t[1]=e[2],t[2]=e[4],n[0]=e[1],n[1]=e[3],n[2]=e[5]}function Eu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=yu(e);return t[0]=e[1]-n[0],t[1]=e[3]-n[1],t[2]=e[5]-n[2],t}function Du(e,t,n,r){for(var a=[].concat(su),o=e.getData(),i=0;ie[2*c+1]?(i[c]=0,u[c]=e[2*c+1],o=!1):i[c]=2;if(o)return r[0]=t[0],r[1]=t[1],r[2]=t[2],a[0]=0,1;for(var d=0;d<3;d++)2!==i[d]&&0!==n[d]?l[d]=(u[d]-t[d])/n[d]:l[d]=-1;for(var f=0;f<3;f++)l[s]1||l[s]<0)return 0;a[0]=l[s];for(var p=0;p<3;p++)if(s!==p){if(r[p]=t[p]+l[s]*n[p],r[p]e[2*p+1])return 0}else r[p]=u[p];return 1}function Lu(e,t,n){for(var r=[],a=0,o=1,i=1,s=4;s<=5;++s){r[2]=e[s];for(var l=2;l<=3;++l){r[1]=e[l];for(var u=0;u<=1;++u)if(r[0]=e[u],a=Jl.evaluate(n,t,r),i&&(o=a>=0?1:-1,i=0),0===a||o>0&&a<0||o<0&&a>0)return 1}}return 0}function Nu(e,t){if(!uu(e)||!uu(t))return!1;for(var n,r=[0,0,0,0,0,0],a=0;a<3;a++)if(n=!1,t[2*a]>=e[2*a]&&t[2*a]<=e[2*a+1]?(n=!0,r[2*a]=t[2*a]):e[2*a]>=t[2*a]&&e[2*a]<=t[2*a+1]&&(n=!0,r[2*a]=e[2*a]),t[2*a+1]>=e[2*a]&&t[2*a+1]<=e[2*a+1]?(n=!0,r[2*a+1]=t[2*a+1]):e[2*a+1]>=t[2*a]&&e[2*a+1]<=t[2*a+1]&&(n=!0,r[2*a+1]=e[2*a+1]),!n)return!1;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],!0}function Bu(e,t){if(!uu(e)||!uu(t))return!1;for(var n=0;n<3;n++)if(!(t[2*n]>=e[2*n]&&t[2*n]<=e[2*n+1]||e[2*n]>=t[2*n]&&e[2*n]<=t[2*n+1]||t[2*n+1]>=e[2*n]&&t[2*n+1]<=e[2*n+1]||e[2*n+1]>=t[2*n]&&e[2*n+1]<=t[2*n+1]))return!1;return!0}function ku(e,t,n,r){return!(te[1])&&(!(ne[3])&&!(re[5]))}function Fu(e,t,n){for(var r=[[0,1,2,3,4,5,6,7],[0,1,4,5,2,3,6,7],[0,2,4,6,1,3,5,7]],a=[0,0,0,0,0,0,0,0],o=0,i=0;i<2;i++)for(var s=2;s<4;s++)for(var l=4;l<6;l++){var u=[e[i],e[s],e[l]];a[o++]=Jl.evaluate(n,t,u)}for(var c=2;c--&&!(Au(a[r[c][0]],a[r[c][4]])&&Au(a[r[c][1]],a[r[c][5]])&&Au(a[r[c][2]],a[r[c][6]])&&Au(a[r[c][3]],a[r[c][7]])););if(c<0)return!1;for(var d=Math.sign(n[c]),f=Math.abs((e[2*c+1]-e[2*c])*n[c]),p=d>0?1:0,g=0;g<4;g++)if(0!==f){var m=Math.abs(a[r[c][g]])/f;d>0&&mp&&(p=m)}var v=(1-p)*e[2*c]+p*e[2*c+1];return d>0?e[2*c]=v:e[2*c+1]=v,!0}var Gu=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bounds=t,this.bounds||(this.bounds=new Float64Array(6),cu(this.bounds,su))}return function(e,t,n){t&&nu(e.prototype,t),n&&nu(e,n)}(e,[{key:"getBounds",value:function(){return this.bounds}},{key:"equals",value:function(e){return lu(this.bounds,e)}},{key:"isValid",value:function(){return uu(this.bounds)}},{key:"setBounds",value:function(e){return cu(this.bounds,e)}},{key:"reset",value:function(){return du(this.bounds)}},{key:"addPoint",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ju,n),ur.a.obj(e,t),function(e,t){t.classHierarchy.push("vtkFieldData");var n=e.getState;t.arrays&&(t.arrays=t.arrays.map(function(e){return{data:Object(Uu.a)(e.data)}})),e.initialize=function(){e.initializeFields(),e.copyAllOn(),e.clearFieldFlags()},e.initializeFields=function(){t.arrays=[],t.copyFieldFlags={},e.modified()},e.copyStructure=function(n){e.initializeFields(),t.copyFieldFlags=n.getCopyFieldFlags().map(function(e){return e}),t.arrays=n.arrays().map(function(e){return{array:e}})},e.getNumberOfArrays=function(){return t.arrays.length},e.getNumberOfActiveArrays=function(){return t.arrays.length},e.addArray=function(e){return t.arrays=[].concat(t.arrays,{data:e}),t.arrays.length-1},e.removeAllArrays=function(){t.arrays=[]},e.removeArray=function(e){t.arrays=t.arrays.filter(function(t){return e!==t.data.getName()})},e.removeArrayByIndex=function(e){t.arrays=t.arrays.filter(function(t,n){return n!==e})},e.getArrays=function(){return t.arrays.map(function(e){return e.data})},e.getArray=function(t){return"number"==typeof t?e.getArrayByIndex(t):e.getArrayByName(t)},e.getArrayByName=function(e){return t.arrays.reduce(function(t,n,r){return n.data.getName()===e?n.data:t},null)},e.getArrayWithIndex=function(e){return t.arrays.reduce(function(t,n,r){return n.data&&n.data.getName()===e?{array:n.data,index:r}:t},{array:null,index:-1})},e.getArrayByIndex=function(e){return e>=0&&e=0},e.getArrayName=function(e){var n=t.arrays[e];return n?n.data.getName():""},e.getCopyFieldFlags=function(){return t.copyFieldFlags},e.getFlag=function(e){return t.copyFieldFlags[e]},e.passData=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;n.getArrays().forEach(function(n){var o=e.getFlag(n.getName());if(!1!==o&&(!t.doCopyAllOff||!0===o)&&n){var i=e.getArrayByName(n.getName());if(i){if(n.getNumberOfComponents()===i.getNumberOfComponents())if(r>-1&&r-1?a:r;i.setTuple(s,n.getTuple(r))}else for(var l=0;ln.getNumberOfTuples())e.addArray(n);else{var u=n.getNumberOfComponents(),c=n.getNumberOfValues(),d=a>-1?a:r;ce?t.data.getMTime():e},t.mtime)},e.getNumberOfComponents=function(){return t.arrays.reduce(function(e,t){return e+t.data.getNumberOfComponents()},0)},e.getNumberOfTuples=function(){return t.arrays.length>0?t.arrays[0].getNumberOfTuples():0},e.getState=function(){var e=n();return e.arrays=t.arrays.map(function(e){return{data:e.data.getState()}}),e}}(e,t)}var zu={newInstance:ur.a.newInstance(Wu,"vtkFieldData"),extend:Wu},Hu={AttributeCopyOperations:{COPYTUPLE:0,INTERPOLATE:1,PASSDATA:2,ALLCOPY:3},AttributeLimitTypes:{MAX:0,EXACT:1,NOLIMIT:2},AttributeTypes:{SCALARS:0,VECTORS:1,NORMALS:2,TCOORDS:3,TENSORS:4,GLOBALIDS:5,PEDIGREEIDS:6,EDGEFLAG:7,NUM_ATTRIBUTES:8},CellGhostTypes:{DUPLICATECELL:1,HIGHCONNECTIVITYCELL:2,LOWCONNECTIVITYCELL:4,REFINEDCELL:8,EXTERIORCELL:16,HIDDENCELL:32},DesiredOutputPrecision:{DEFAULT:0,SINGLE:1,DOUBLE:2},PointGhostTypes:{DUPLICATEPOINT:1,HIDDENPOINT:2},ghostArrayName:"vtkGhostType"};function Ku(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qu=Hu.AttributeTypes,Yu=Hu.AttributeCopyOperations,Zu=ur.a.vtkWarningMacro;var Qu={activeScalars:-1,activeVectors:-1,activeTensors:-1,activeNormals:-1,activeTCoords:-1,activeGlobalIds:-1,activePedigreeIds:-1};function $u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qu,n),zu.extend(e,t,n),ur.a.setGet(e,t,["activeScalars","activeNormals","activeTCoords","activeVectors","activeTensors","activeGlobalIds","activePedigreeIds"]),t.arrays||(t.arrays={}),function(e,t){var n=["Scalars","Vectors","Normals","TCoords","Tensors","GlobalIds","PedigreeIds"];function r(e){var t=n.find(function(t){return qu[t.toUpperCase()]===e||"number"!=typeof e&&t.toLowerCase()===e.toLowerCase()});return void 0===t&&(t=null),t}t.classHierarchy.push("vtkDataSetAttributes"),e.checkNumberOfComponents=function(e){return!0},e.setAttribute=function(n,a){var o=r(a);if(n&&"PEDIGREEIDS"===o.toUpperCase()&&!n.isA("vtkDataArray"))return Zu("Cannot set attribute ".concat(o,". The attribute must be a vtkDataArray.")),-1;if(n&&!e.checkNumberOfComponents(n,o))return Zu("Cannot set attribute ".concat(o,". Incorrect number of components.")),-1;var i=t["active".concat(o)];if(i>=0&&i=0&&n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,oc,n),ur.a.obj(e,t),ur.a.setGet(e,t,ac),function(e,t){t.classHierarchy.push("vtkDataSet"),ac.forEach(function(e){t[e]?t[e]=Object(Uu.a)(t[e]):t[e]=Ju.newInstance()});var n=e.shallowCopy;e.shallowCopy=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n(e,r),ac.forEach(function(n){t[n]=Ju.newInstance(),t[n].shallowCopy(e.getReferenceByName(n))})}}(e,t)}var sc=function(e){for(var t=1;te[1]||e[2]>e[3]||e[4]>e[5]?fc.EMPTY:3===t?fc.XYZ_GRID:2===t?e[0]===e[1]?fc.YZ_PLANE:e[2]===e[3]?fc.XZ_PLANE:fc.XY_PLANE:1===t?e[0]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hc,n),sc.extend(e,t,n),t.direction?Array.isArray(t.direction)&&(t.direction=new Float64Array(t.direction.slice(0,9))):t.direction=a.identity(new Float64Array(9)),t.indexToWorld=new Float64Array(16),t.worldToIndex=new Float64Array(16),ur.a.get(e,t,["direction","indexToWorld","worldToIndex"]),ur.a.setGetArray(e,t,["origin","spacing"],3),ur.a.getArray(e,t,["extent"],6),function(e,t){t.classHierarchy.push("vtkImageData"),e.setExtent=function(){if(t.deleted)return vc("instance deleted - cannot call any method"),!1;for(var n=arguments.length,r=new Array(n),a=0;a1&&(n*=t[r]-1)}return n},e.getNumberOfPoints=function(){var t=e.getDimensions();return t[0]*t[1]*t[2]},e.getPoint=function(n){var r=e.getDimensions();if(0===r[0]||0===r[1]||0===r[2])return vc("Requesting a point from an empty image."),null;var a=new Float64Array(3);switch(t.dataDescription){case lc.EMPTY:return null;case lc.SINGLE_POINT:break;case lc.X_LINE:a[0]=n;break;case lc.Y_LINE:a[1]=n;break;case lc.Z_LINE:a[2]=n;break;case lc.XY_PLANE:a[0]=n%r[0],a[1]=n/r[0];break;case lc.YZ_PLANE:a[1]=n%r[1],a[2]=n/r[1];break;case lc.XZ_PLANE:a[0]=n%r[0],a[2]=n/r[0];break;case lc.XYZ_GRID:a[0]=n%r[0],a[1]=n/r[0]%r[1],a[2]=n/(r[0]*r[1]);break;default:vc("Invalid dataDescription")}var o=[0,0,0];return e.indexToWorld(a,o),o},e.getBounds=function(){return e.extentToBounds(t.extent)},e.extentToBounds=function(t){var n=[t[0],t[2],t[4],t[1],t[2],t[4],t[0],t[3],t[4],t[1],t[3],t[4],t[0],t[2],t[5],t[1],t[2],t[5],t[0],t[3],t[5],t[1],t[3],t[5]],r=new Float64Array([n[0],n[1],n[2]]),a=new Float64Array(3);e.indexToWorld(r,a);for(var o=[a[0],a[0],a[1],a[1],a[2],a[2]],s=3;s<24;s+=3)i.set(r,n[s],n[s+1],n[s+2]),e.indexToWorld(r,a),a[0]o[1]&&(o[1]=a[0]),a[1]>o[3]&&(o[3]=a[1]),a[2]>o[5]&&(o[5]=a[2]);return o},e.computeTransforms=function(){o.fromTranslation(t.indexToWorld,t.origin),t.indexToWorld[0]=t.direction[0],t.indexToWorld[1]=t.direction[1],t.indexToWorld[2]=t.direction[2],t.indexToWorld[4]=t.direction[3],t.indexToWorld[5]=t.direction[4],t.indexToWorld[6]=t.direction[5],t.indexToWorld[8]=t.direction[6],t.indexToWorld[9]=t.direction[7],t.indexToWorld[10]=t.direction[8],o.scale(t.indexToWorld,t.indexToWorld,t.spacing),o.invert(t.worldToIndex,t.indexToWorld)},e.setDirection=function(){if(t.deleted)return vc("instance deleted - cannot call any method"),!1;for(var n=arguments.length,r=new Array(n),a=0;a1&&void 0!==arguments[1]?arguments[1]:[];return i.transformMat4(n,e,t.indexToWorld),n},e.indexToWorldVec3=e.indexToWorld,e.worldToIndex=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return i.transformMat4(n,e,t.worldToIndex),n},e.worldToIndexVec3=e.worldToIndex,e.indexToWorldBounds=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[0,0,0],a=[0,0,0];_u.computeCornerPoints(e,r,a);var o=[0,0,0],s=[0,0,0];return i.transformMat4(o,r,t.indexToWorld),i.transformMat4(s,a,t.indexToWorld),ka(o,s,n),n},e.worldToIndexBounds=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[0,0,0],a=[0,0,0];_u.computeCornerPoints(e,r,a);var o=[0,0,0],s=[0,0,0];return i.transformMat4(o,r,t.worldToIndex),i.transformMat4(s,a,t.worldToIndex),ka(o,s,n),n},e.onModified(e.computeTransforms),e.computeTransforms(),e.getCenter=function(){for(var t=e.getBounds(),n=[],r=0;r<3;r++)n[r]=(t[2*r+1]+t[2*r])/2;return n},e.computeHistogram=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=[0,0,0,0,0,0];e.worldToIndexBounds(t,r);var a=[0,0,0],o=[0,0,0];_u.computeCornerPoints(r,a,o),ha(a,a),ha(o,o);var i=e.getDimensions();Ga(a,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],a),Ga(o,[0,0,0],[i[0]-1,i[1]-1,i[2]-1],o);for(var s=i[0],l=i[0]*i[1],u=e.getPointData().getScalars().getData(),c=-1/0,d=1/0,f=0,p=0,g=0,m=a[2];m<=o[2];m++)for(var v=a[1];v<=o[1];v++)for(var h=a[0]+v*s+m*l,y=a[0];y<=o[0];y++){if(!n||n([y,v,m],r)){var b=u[h];b>c&&(c=b),b0?p/g:0,C=f-T*T;return{minimum:d,maximum:c,average:T,variance:C,sigma:Math.sqrt(C)}},e.computeIncrements=function(e){for(var t=[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=0;r<3;++r)t[r]=n,n*=e[2*r+1]-e[2*r]+1;return t},e.computeOffsetIndex=function(t){var n=gc(t,3),r=n[0],a=n[1],o=n[2],i=e.getExtent(),s=e.getPointData().getScalars().getNumberOfComponents(),l=e.computeIncrements(i,s);return Math.floor((Math.round(r)-i[0])*l[0]+(Math.round(a)-i[2])*l[1]+(Math.round(o)-i[4])*l[2])},e.getOffsetIndexFromWorld=function(t){for(var n=e.getExtent(),r=e.worldToIndex(t),a=0;a<3;++a)if(r[a]n[2*a+1])return vc("GetScalarPointer: Pixel ".concat(r," is not in memory. Current extent = ").concat(n)),NaN;return e.computeOffsetIndex(r)},e.getScalarValueFromWorld=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.getPointData().getScalars().getNumberOfComponents();if(n<0||n>=r)return vc("GetScalarPointer: Scalar Component ".concat(n," is not within bounds. Current Scalar numberOfComponents: ").concat(r)),NaN;var a=e.getOffsetIndexFromWorld(t);return Number.isNaN(a)?a:e.getPointData().getScalars().getComponent(a,n)}}(e,t)}var bc={newInstance:ur.a.newInstance(yc,"vtkImageData"),extend:yc},Tc={LUMINANCE:1,LUMINANCE_ALPHA:2,RGB:3,RGBA:4},Cc={VectorMode:{MAGNITUDE:0,COMPONENT:1,RGBCOLORS:2},ScalarMappingTarget:Tc},Sc={DEFAULT:0,USE_POINT_DATA:1,USE_CELL_DATA:2,USE_POINT_FIELD_DATA:3,USE_CELL_FIELD_DATA:4,USE_FIELD_DATA:5},Pc={ColorMode:{DEFAULT:0,MAP_SCALARS:1,DIRECT_SCALARS:2},GetArray:{BY_ID:0,BY_NAME:1},ScalarMode:Sc};function wc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Oc=Cc.ScalarMappingTarget,Mc=Cc.VectorMode,Ac=vo.VtkDataTypes,Ic=Pc.ColorMode,Rc=ur.a.vtkErrorMacro;function Ec(e){return e}function Dc(e){return Math.floor(255*e+.5)}var Vc={alpha:1,vectorComponent:0,vectorSize:-1,vectorMode:Mc.COMPONENT,mappingRange:null,annotationArray:null,annotatedValueMap:null,indexedLookup:!1};function Lc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Vc,n),ur.a.obj(e,t),t.mappingRange=[0,255],t.annotationArray=[],t.annotatedValueMap=[],ur.a.setGet(e,t,["vectorSize","vectorComponent","vectorMode","alpha","indexedLookup"]),ur.a.setArray(e,t,["mappingRange"],2),ur.a.getArray(e,t,["mappingRange"]),function(e,t){t.classHierarchy.push("vtkScalarsToColors"),e.setVectorModeToMagnitude=function(){return e.setVectorMode(Mc.MAGNITUDE)},e.setVectorModeToComponent=function(){return e.setVectorMode(Mc.COMPONENT)},e.setVectorModeToRGBColors=function(){return e.setVectorMode(Mc.RGBCOLORS)},e.build=function(){},e.isOpaque=function(){return!0},e.setAnnotations=function(n,r){if(!(n&&!r||!n&&r))if(n&&r&&n.length!==r.length)Rc("Values and annotations do not have the same number of tuples so ignoring");else{if(t.annotationArray=[],r&&n)for(var a=r.length,o=0;o=0?t.annotationArray[a].annotation!==r&&(t.annotationArray[a].annotation=r,o=!0):(t.annotationArray.push({value:n,annotation:r}),a=t.annotationArray.length-1,o=!0),o&&(e.updateAnnotatedValueMap(),e.modified()),a},e.getNumberOfAnnotatedValues=function(){return t.annotationArray.length},e.getAnnotatedValue=function(e){return e<0||e>=t.annotationArray.length?null:t.annotationArray[e].value},e.getAnnotation=function(e){return void 0===t.annotationArray[e]?null:t.annotationArray[e].annotation},e.getAnnotatedValueIndex=function(n){return t.annotationArray.length?e.checkForAnnotatedValue(n):-1},e.removeAnnotation=function(n){var r=e.checkForAnnotatedValue(n),a=r>=0;return a&&(t.annotationArray.splice(r,1),e.updateAnnotatedValueMap(),e.modified()),a},e.resetAnnotations=function(){t.annotationArray=[],t.annotatedValueMap=[],e.modified()},e.getAnnotationColor=function(n,r){if(t.indexedLookup){var a=e.getAnnotatedValueIndex(n);e.getIndexedColor(a,r)}else e.getColor(parseFloat(n),r),r[3]=1},e.checkForAnnotatedValue=function(t){return e.getAnnotatedValueIndexInternal(t)},e.getAnnotatedValueIndexInternal=function(e){if(void 0!==t.annotatedValueMap[e]){var n=t.annotationArray.length;return t.annotatedValueMap[e]%n}return-1},e.getIndexedColor=function(e,t){t[0]=0,t[1]=0,t[2]=0,t[3]=0},e.updateAnnotatedValueMap=function(){t.annotatedValueMap=[];for(var e=t.annotationArray.length,n=0;n1?e.mapVectorsThroughTable(t,o,Oc.RGBA,-1,-1):(l<0&&(l=0),l>=a&&(l=a-1),e.mapScalarsThroughTable(t,o,Oc.RGBA,l))}return o},e.mapVectorsToMagnitude=function(e,t,n){for(var r=e.getNumberOfTuples(),a=e.getNumberOfComponents(),o=t.getData(),i=e.getData(),s=0;s=u&&(l=u-1)):(-1===s&&(s=e.getVectorSize()),s<=0?(l=0,s=u):(l<0&&(l=0),l>=u&&(l=u-1),l+s>u&&(s=u-l)),i!==Mc.MAGNITUDE||1!==u&&1!==s||(i=Mc.COMPONENT));var c=0;switch(l>0&&(c=l),i){case Mc.COMPONENT:e.mapScalarsThroughTable(t,n,r,c);break;default:case Mc.MAGNITUDE:var d=vo.newInstance({numberOfComponents:1,values:new Float32Array(t.getNumberOfTuples())});e.mapVectorsToMagnitude(t,d,s),e.mapScalarsThroughTable(d,n,r,0);break;case Mc.RGBCOLORS:}},e.luminanceToRGBA=function(e,t,n,r){for(var a=r(n),o=t.getData(),i=e.getData(),s=o.length,l=0,u=0;u=1&&n.getDataType()===Ac.UNSIGNED_CHAR)return n;var i=vo.newInstance({numberOfComponents:4,empty:!0,size:4*a,dataType:Ac.UNSIGNED_CHAR});if(a<=0)return i;o=(o=o>0?o:0)<1?o:1;var s=Ec;switch(n.getDataType()!==Ac.FLOAT&&n.getDataType()!==Ac.DOUBLE||(s=Dc),r){case 1:e.luminanceToRGBA(i,n,o,s);break;case 2:e.luminanceAlphaToRGBA(i,n,s);break;case 3:e.rGBToRGBA(i,n,o,s);break;case 4:e.rGBAToRGBA(i,n,o,s);break;default:return Rc("Cannot convert colors"),null}return i},e.usingLogScale=function(){return!1},e.getNumberOfAvailableColors=function(){return 16777216},e.setRange=function(t,n){return e.setMappingRange(t,n)},e.getRange=function(t,n){return e.getMappingRange()}}(e,t)}var Nc=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_c,n),Nc.extend(e,t,n),t.table||(t.table=[]),t.buildTime={},ur.a.obj(t.buildTime),t.opaqueFlagBuildTime={},ur.a.obj(t.opaqueFlagBuildTime,{mtime:0}),t.insertTime={},ur.a.obj(t.insertTime,{mtime:0}),ur.a.get(e,t,["buildTime"]),ur.a.setGet(e,t,["numberOfColors","useAboveRangeColor","useBelowRangeColor"]),ur.a.setArray(e,t,["alphaRange","hueRange","saturationRange","valueRange"],2),ur.a.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),ur.a.getArray(e,t,["hueRange","saturationRange","valueRange","alphaRange","nanColor","belowRangeColor","aboveRangeColor"]),function(e,t){t.classHierarchy.push("vtkLookupTable"),e.isOpaque=function(){if(t.opaqueFlagBuildTime.getMTime()t.range[1]?t.maxIndex+Fc+1.5:(n=(e+t.shift)*t.scale)e[0]&&(t.scale=(t.maxIndex+1)/(e[1]-e[0]))},e.mapScalarsThroughTable=function(n,r,a,o){var i=e.linearLookup;t.indexedLookup&&(i=e.indexedLookupFunction);var s=e.getMappingRange(),l={maxIndex:e.getNumberOfColors()-1,range:s,shift:0,scale:0};e.lookupShiftAndScale(s,l);var u=e.getAlpha(),c=n.getNumberOfTuples(),d=n.getNumberOfComponents(),f=r.getData(),p=n.getData();if(u>=1){if(a===Tc.RGBA)for(var g=0;gt.buildTime.getMTime()&&t.insertTime.getMTime()<=t.buildTime.getMTime())&&e.forceBuild()},t.table.length>0&&t.insertTime.modified()}(e,t)}var jc={newInstance:ur.a.newInstance(Uc,"vtkLookupTable"),extend:Uc},Wc=1,zc=0,Hc=["VTK_RESOLVE_OFF","VTK_RESOLVE_POLYGON_OFFSET"];function Kc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;zc=e}var Xc={getResolveCoincidentTopologyAsString:function(){return Hc[zc]},getResolveCoincidentTopologyPolygonOffsetFaces:function(){return Wc},getResolveCoincidentTopology:function(){return zc},setResolveCoincidentTopology:Kc,setResolveCoincidentTopologyPolygonOffsetFaces:function(e){Wc=e},setResolveCoincidentTopologyToDefault:function(){Kc(0)},setResolveCoincidentTopologyToOff:function(){Kc(0)},setResolveCoincidentTopologyToPolygonOffset:function(){Kc(1)}};function qc(e,t,n){n.forEach(function(n){e["get".concat(n.method)]=function(){return t[n.key]},e["set".concat(n.method)]=function(e,r){t[n.key]={factor:e,offset:r}}})}var Yc=["Polygon","Line","Point"],Zc={};qc(Zc,{Polygon:{factor:2,offset:0},Line:{factor:1,offset:-1},Point:{factor:0,offset:-2}},Yc.map(function(e){return{key:e,method:"ResolveCoincidentTopology".concat(e,"OffsetParameters")}}));var Qc={implementCoincidentTopologyMethods:function(e,t){void 0===t.resolveCoincidentTopology&&(t.resolveCoincidentTopology=!1),ur.a.setGet(e,t,["resolveCoincidentTopology"]),t.topologyOffset={Polygon:{factor:0,offset:0},Line:{factor:0,offset:0},Point:{factor:0,offset:0}},Object.keys(Xc).forEach(function(t){e[t]=Xc[t]}),Object.keys(Zc).forEach(function(t){e[t]=Zc[t]}),qc(e,t.topologyOffset,Yc.map(function(e){return{key:e,method:"RelativeCoincidentTopology".concat(e,"OffsetParameters")}})),e.getCoincidentTopologyPolygonOffsetParameters=function(){var t=Zc.getResolveCoincidentTopologyPolygonOffsetParameters(),n=e.getRelativeCoincidentTopologyPolygonOffsetParameters();return{factor:t.factor+n.factor,offset:t.offset+n.offset}},e.getCoincidentTopologyLineOffsetParameters=function(){var t=Zc.getResolveCoincidentTopologyLineOffsetParameters(),n=e.getRelativeCoincidentTopologyLineOffsetParameters();return{factor:t.factor+n.factor,offset:t.offset+n.offset}},e.getCoincidentTopologyPointOffsetParameter=function(){var t=Zc.getResolveCoincidentTopologyPointOffsetParameters(),n=e.getRelativeCoincidentTopologyPointOffsetParameters();return{factor:t.factor+n.factor,offset:t.offset+n.offset}}},staticOffsetAPI:Zc,otherStaticMethods:Xc,CATEGORIES:Yc};function $c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jc(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ud,n),Fl.extend(e,t,n),ur.a.get(e,t,["colorCoordinates","colorMapColors","colorTextureMap"]),ur.a.setGet(e,t,["colorByArrayName","arrayAccessMode","colorMode","fieldDataTupleId","interpolateScalarsBeforeMapping","lookupTable","renderTime","scalarMode","scalarVisibility","static","useLookupTableScalarRange","viewSpecificProperties","customShaderAttributes"]),ur.a.setGetArray(e,t,["scalarRange"],2),t.viewSpecificProperties||(t.viewSpecificProperties={}),Qc.implementCoincidentTopologyMethods(e,t),function(e,t){t.classHierarchy.push("vtkMapper"),e.getBounds=function(){var n=e.getInputData();return n?(t.static||e.update(),t.bounds=n.getBounds()):t.bounds=Ka(),t.bounds},e.setForceCompileOnly=function(e){t.forceCompileOnly=e},e.createDefaultLookupTable=function(){t.lookupTable=jc.newInstance()},e.getColorModeAsString=function(){return ur.a.enumToString(rd,t.colorMode)},e.setColorModeToDefault=function(){return e.setColorMode(0)},e.setColorModeToMapScalars=function(){return e.setColorMode(1)},e.setColorModeToDirectScalars=function(){return e.setColorMode(2)},e.getScalarModeAsString=function(){return ur.a.enumToString(ad,t.scalarMode)},e.setScalarModeToDefault=function(){return e.setScalarMode(0)},e.setScalarModeToUsePointData=function(){return e.setScalarMode(1)},e.setScalarModeToUseCellData=function(){return e.setScalarMode(2)},e.setScalarModeToUsePointFieldData=function(){return e.setScalarMode(3)},e.setScalarModeToUseCellFieldData=function(){return e.setScalarMode(4)},e.setScalarModeToUseFieldData=function(){return e.setScalarMode(5)},e.getAbstractScalars=function(e,n,r,a,o){if(!e||!t.scalarVisibility)return{scalars:null,cellFLag:!1};var i=null,s=!1;if(n===ad.DEFAULT)(i=e.getPointData().getScalars())||(i=e.getCellData().getScalars(),s=!0);else if(n===ad.USE_POINT_DATA)i=e.getPointData().getScalars();else if(n===ad.USE_CELL_DATA)i=e.getCellData().getScalars(),s=!0;else if(n===ad.USE_POINT_FIELD_DATA){var l=e.getPointData();i=r===od.BY_ID?l.getArrayByIndex(a):l.getArrayByName(o)}else if(n===ad.USE_CELL_FIELD_DATA){var u=e.getCellData();s=!0,i=r===od.BY_ID?u.getArrayByIndex(a):u.getArrayByName(o)}else if(n===ad.USE_FIELD_DATA){var c=e.getFieldData();i=r===od.BY_ID?c.getArrayByIndex(a):c.getArrayByName(o)}return{scalars:i,cellFlag:s}},e.mapScalars=function(n,r){var a=e.getAbstractScalars(n,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;if(!a)return t.colorCoordinates=null,t.colorTextureMap=null,void(t.colorMapColors=null);var o="".concat(e.getMTime()).concat(a.getMTime()).concat(r);if(t.colorBuildString!==o){if(t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]),e.canUseTextureMapForColoring(n))e.mapScalarsToTexture(a,r);else{t.colorCoordinates=null,t.colorTextureMap=null;var i=e.getLookupTable();i&&(i.build(),t.colorMapColors=i.mapScalars(a,t.colorMode,-1))}t.colorBuildString="".concat(e.getMTime()).concat(a.getMTime()).concat(r)}},e.scalarToTextureCoordinate=function(e,t,n){var r=.5,a=1;return Ha(e)||(a=.49,(r=(e-t)*n)>1e3?r=1e3:r<-1e3&&(r=-1e3)),{texCoordS:r,texCoordT:a}},e.createColorTextureCoordinates=function(t,n,r,a,o,i,s,l,u){var c=(i[1]-i[0])/l,d=[];d[0]=i[0]-c,d[1]=i[1]+c;var f=1/(d[1]-d[0]),p=n.getData(),g=t.getData(),m=0,v=0;if(o<0||o>=a)for(var h=0;ht.colorTextureMap.getMTime()||t.lookupTable.getMTime()>t.colorTextureMap.getMTime()||t.lookupTable.getAlpha()!==r){t.lookupTable.setAlpha(r),t.colorTextureMap=null,t.lookupTable.build();var s=t.lookupTable.getNumberOfAvailableColors();s>4094&&(s=4094),s+=2;for(var l=(a[1]-a[0])/(s-1-2),u=new Float64Array(2*s),c=0;ct.colorCoordinates.getMTime()||e.getInputData(0).getMTime()>t.colorCoordinates.getMTime()||t.lookupTable.getMTime()>t.colorCoordinates.getMTime()){t.colorCoordinates=null;var p=n.getNumberOfComponents(),g=n.getNumberOfTuples();t.colorCoordinates=vo.newInstance({numberOfComponents:2,values:new Float32Array(2*g)});var m=t.lookupTable.getVectorComponent();t.lookupTable.getVectorMode()===id.MAGNITUDE&&n.getNumberOfComponents()>1&&(m=-1),e.createColorTextureCoordinates(n,t.colorCoordinates,g,p,m,a,t.lookupTable.getRange(),t.colorTextureMap.getPointData().getScalars().getNumberOfTuples()/2-2,o)}},e.getIsOpaque=function(){var t=e.getLookupTable();return!t||(t.build(),t.isOpaque())},e.canUseTextureMapForColoring=function(n){if(!t.interpolateScalarsBeforeMapping)return!1;if(t.lookupTable&&t.lookupTable.getIndexedLookup())return!1;var r=e.getAbstractScalars(n,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName),a=r.scalars;return!(!a||r.cellFlag||t.colorMode===rd.DEFAULT&&a.getDataType()===sd.UNSIGNED_CHAR||t.colorMode===rd.DIRECT_SCALARS)},e.clearColorArrays=function(){t.colorMapColors=null,t.colorCoordinates=null,t.colorTextureMap=null},e.getLookupTable=function(){return t.lookupTable||e.createDefaultLookupTable(),t.lookupTable},e.getMTime=function(){var e=t.mtime;if(null!==t.lookupTable){var n=t.lookupTable.getMTime();e=n>e?n:e}return e},e.getPrimitiveCount=function(){var t=e.getInputData();return{points:t.getPoints().getNumberOfValues()/3,verts:t.getVerts().getNumberOfValues()-t.getVerts().getNumberOfCells(),lines:t.getLines().getNumberOfValues()-2*t.getLines().getNumberOfCells(),triangles:t.getPolys().getNumberOfValues()-3*t.getLines().getNumberOfCells()}},e.acquireInvertibleLookupTable=ld("AcquireInvertibleLookupTable"),e.valueToColor=ld("ValueToColor"),e.colorToValue=ld("ColorToValue"),e.useInvertibleColorFor=ld("UseInvertibleColorFor"),e.clearInvertibleColor=ld("ClearInvertibleColor")}(e,t)}var dd=Jc(Jc(Jc({newInstance:ur.a.newInstance(cd,"vtkMapper"),extend:cd},td),nd),Pc);function fd(e){return function(e){if(Array.isArray(e))return pd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return pd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pd(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Pd,n),pr.extend(e,t,n),gi.implementReplaceShaderCoincidentOffset(e,t,n),t.primitives=[],t.primTypes=gd,t.tmpMat3=a.identity(new Float64Array(9)),t.tmpMat4=o.identity(new Float64Array(16));for(var r=gd.Start;r= cos(radians(lightConeAngle".concat(d,")))")," {"," attenuation = attenuation * pow(coneDot, lightExponent".concat(d,");")," }"," else"," {"," attenuation = 0.0;"," }"," }"," }"," df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));"," diffuseL += ((df".concat("",") * lightColor").concat(d,");")," if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)"," {"," float sf = attenuation*pow( max(0.0, dot(lightHalfAngleVC".concat(d,",normalVCVSOutput)), specularPower);")," specularL += ((sf".concat("",") * lightColor").concat(d,");")," }"]);s=s.concat([" diffuseL = diffuseL * diffuseColor;"," specularL = specularL * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"]),a=Uo.substitute(a,"//VTK::Light::Impl",s,!1).result;break;default:Td("bad light complexity")}e.Fragment=a},e.replaceShaderNormal=function(n,r,a){if(t.lastBoundBO.getReferenceByName("lastLightComplexity")>0){var o=n.Vertex,i=n.Geometry,s=n.Fragment;t.lastBoundBO.getCABO().getNormalOffset()?(o=Uo.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=Uo.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * normalMC;"]).result,i=Uo.substitute(i,"//VTK::Normal::Dec",["in vec3 normalVCVSOutput[];","out vec3 normalVCGSOutput;"]).result,i=Uo.substitute(i,"//VTK::Normal::Impl",["normalVCGSOutput = normalVCVSOutput[i];"]).result,s=Uo.substitute(s,"//VTK::Normal::Dec",["varying vec3 normalVCVSOutput;"]).result,s=Uo.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalVCVSOutput);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):t.haveCellNormals?(s=Uo.substitute(s,"//VTK::Normal::Dec",["uniform mat3 normalMatrix;","uniform samplerBuffer textureN;"]).result,s=Uo.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalMatrix *"," texelFetchBuffer(textureN, gl_PrimitiveID + PrimitiveIDOffset).xyz);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):e.getOpenGLMode(a.getProperty().getRepresentation(),t.lastBoundBO.getPrimitiveType())===t.context.LINES?(s=Uo.substitute(s,"//VTK::UniformFlow::Impl",[" vec3 fdx = vec3(dFdx(vertexVC.x),dFdx(vertexVC.y),dFdx(vertexVC.z));"," vec3 fdy = vec3(dFdy(vertexVC.x),dFdy(vertexVC.y),dFdy(vertexVC.z));"," //VTK::UniformFlow::Impl"]).result,s=Uo.substitute(s,"//VTK::Normal::Impl",["vec3 normalVCVSOutput;"," fdx = normalize(fdx);"," fdy = normalize(fdy);"," if (abs(fdx.x) > 0.0)"," { normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }"," else { normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}"]).result):(s=Uo.substitute(s,"//VTK::Normal::Dec",["uniform int cameraParallel;"]).result,s=Uo.substitute(s,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,s=Uo.substitute(s,"//VTK::Normal::Impl",[" fdx = normalize(fdx);"," fdy = normalize(fdy);"," vec3 normalVCVSOutput = normalize(cross(fdx,fdy));"," if (cameraParallel == 1 && normalVCVSOutput.z < 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"," if (cameraParallel == 0 && dot(normalVCVSOutput,vertexVC.xyz) > 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"]).result),n.Vertex=o,n.Geometry=i,n.Fragment=s}},e.replaceShaderPositionVC=function(e,n,r){var a=e.Vertex,o=e.Geometry,i=e.Fragment;r.getProperty().getRepresentation()!==md.POINTS&&t.lastBoundBO.getPrimitiveType()!==gd.Points||(a=Uo.substitute(a,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," gl_PointSize = ".concat(r.getProperty().getPointSize(),".0;")],!1).result),t.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(a=Uo.substitute(a,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,a=Uo.substitute(a,"//VTK::PositionVC::Impl",["vertexVCVSOutput = MCVCMatrix * vertexMC;"," gl_Position = MCPCMatrix * vertexMC;"]).result,a=Uo.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result,o=Uo.substitute(o,"//VTK::PositionVC::Dec",["in vec4 vertexVCVSOutput[];","out vec4 vertexVCGSOutput;"]).result,o=Uo.substitute(o,"//VTK::PositionVC::Impl",["vertexVCGSOutput = vertexVCVSOutput[i];"]).result,i=Uo.substitute(i,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,i=Uo.substitute(i,"//VTK::PositionVC::Impl",["vec4 vertexVC = vertexVCVSOutput;"]).result):(a=Uo.substitute(a,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,a=Uo.substitute(a,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result),e.Vertex=a,e.Geometry=o,e.Fragment=i},e.replaceShaderTCoord=function(e,n,r){if(t.lastBoundBO.getCABO().getTCoordOffset()){var a=e.Vertex,o=e.Geometry,i=e.Fragment;if(t.drawingEdges)return;a=Uo.substitute(a,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result;var s=t.openGLActor.getActiveTextures(),l=2,u=2;if(s&&s.length>0&&(l=s[0].getComponents(),s[0].getTarget()===t.context.TEXTURE_CUBE_MAP&&(u=3)),t.renderable.getColorTextureMap()&&(l=t.renderable.getColorTextureMap().getPointData().getScalars().getNumberOfComponents(),u=2),2===u){if(a=Uo.substitute(a,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result,o=Uo.substitute(o,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput[];","out vec2 tcoordVCGSOutput;"]).result,o=Uo.substitute(o,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=Uo.substitute(i,"//VTK::TCoord::Dec",["varying vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,s&&s.length>=1)switch(l){case 1:i=Uo.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,1.0);"]).result;break;case 2:i=Uo.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);"]).result;break;default:i=Uo.substitute(i,"//VTK::TCoord::Impl","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*texture2D(texture1, tcoordVCVSOutput.st);").result}}else switch(a=Uo.substitute(a,"//VTK::TCoord::Dec","attribute vec3 tcoordMC; varying vec3 tcoordVCVSOutput;").result,o=Uo.substitute(o,"//VTK::TCoord::Dec",["in vec3 tcoordVCVSOutput[];","out vec3 tcoordVCGSOutput;"]).result,o=Uo.substitute(o,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,i=Uo.substitute(i,"//VTK::TCoord::Dec",["varying vec3 tcoordVCVSOutput;","uniform samplerCube texture1;"]).result,l){case 1:i=Uo.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,1.0);"]).result;break;case 2:i=Uo.substitute(i,"//VTK::TCoord::Impl",["vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*"," vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);"]).result;break;default:i=Uo.substitute(i,"//VTK::TCoord::Impl","gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*textureCube(texture1, tcoordVCVSOutput);").result}e.Vertex=a,e.Geometry=o,e.Fragment=i}},e.replaceShaderClip=function(e,n,r){var a=e.Vertex,o=e.Fragment;if(t.renderable.getNumberOfClippingPlanes()){var i=t.renderable.getNumberOfClippingPlanes();i>6&&(ur.l("OpenGL has a limit of 6 clipping planes"),i=6),a=Uo.substitute(a,"//VTK::Clip::Dec",["uniform int numClipPlanes;","uniform vec4 clipPlanes[6];","varying float clipDistancesVSOutput[6];"]).result,a=Uo.substitute(a,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,o=Uo.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;","varying float clipDistancesVSOutput[6];"]).result,o=Uo.substitute(o,"//VTK::Clip::Impl",["for (int planeNum = 0; planeNum < 6; planeNum++)"," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}e.Vertex=a,e.Fragment=o},e.getCoincidentParameters=function(e,n){var r=null,a=n.getProperty();if(t.renderable.getResolveCoincidentTopology()||a.getEdgeVisibility()&&a.getRepresentation()===md.SURFACE){var o=t.lastBoundBO.getPrimitiveType();o===gd.Points||a.getRepresentation()===md.POINTS?r=t.renderable.getCoincidentTopologyPointOffsetParameter():o===gd.Lines||a.getRepresentation()===md.WIREFRAME?r=t.renderable.getCoincidentTopologyLineOffsetParameters():o!==gd.Tris&&o!==gd.TriStrips||(r=t.renderable.getCoincidentTopologyPolygonOffsetParameters()),o!==gd.TrisEdges&&o!==gd.TriStripsEdges||((r=t.renderable.getCoincidentTopologyPolygonOffsetParameters()).factor/=2,r.offset/=2)}return r},e.replaceShaderPicking=function(e,t,n){var r=e.Fragment;r=Uo.substitute(r,"//VTK::Picking::Dec",["uniform vec3 mapperIndex;","uniform int picking;"]).result,r=Uo.substitute(r,"//VTK::Picking::Impl"," gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];").result,e.Fragment=r},e.replaceShaderValues=function(n,r,a){if(e.replaceShaderColor(n,r,a),e.replaceShaderNormal(n,r,a),e.replaceShaderLight(n,r,a),e.replaceShaderTCoord(n,r,a),e.replaceShaderPicking(n,r,a),e.replaceShaderClip(n,r,a),e.replaceShaderCoincidentOffset(n,r,a),e.replaceShaderPositionVC(n,r,a),t.haveSeenDepthRequest){var o=n.Fragment;o=Uo.substitute(o,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,o=Uo.substitute(o,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float iz = floor(gl_FragCoord.z*65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result,n.Fragment=o}},e.getNeedToRebuildShaders=function(n,r,a){var o=0,i=0,s=n.getPrimitiveType(),l=t.currentInput,u=!1,c=l.getPointData().getNormals(),d=l.getCellData().getNormals(),f=a.getProperty().getInterpolation()===vd.FLAT,p=a.getProperty().getRepresentation(),g=e.getOpenGLMode(p,s);if(g===t.context.TRIANGLES?u=!0:d&&!c?u=!0:!f&&c?u=!0:f||g!==t.context.LINES||(u=!0),a.getProperty().getLighting()&&u){o=0;for(var m=r.getLightsByReference(),v=0;v0&&(i++,0===o&&(o=1)),1===o&&(i>1||1!==h.getIntensity()||!h.lightTypeIsHeadLight())&&(o=2),o<3&&h.getPositional()&&(o=3)}}var y=!1,b=t.lastBoundBO.getReferenceByName("lastLightComplexity"),T=t.lastBoundBO.getReferenceByName("lastLightCount");return b===o&&T===i||(t.lastBoundBO.set({lastLightComplexity:o},!0),t.lastBoundBO.set({lastLightCount:i},!0),y=!0),!!(t.lastHaveSeenDepthRequest!==t.haveSeenDepthRequest||0===n.getProgram()||n.getShaderSourceTime().getMTime()n.getAttributeUpdateTime().getMTime()||n.getShaderSourceTime().getMTime()>n.getAttributeUpdateTime().getMTime())){var o=t.lastBoundBO.getReferenceByName("lastLightComplexity");n.getProgram().isAttributeUsed("vertexMC")&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"vertexMC",n.getCABO().getVertexOffset(),n.getCABO().getStride(),t.context.FLOAT,3,!1)||Td("Error setting vertexMC in shader VAO.")),n.getProgram().isAttributeUsed("normalMC")&&n.getCABO().getNormalOffset()&&o>0?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"normalMC",n.getCABO().getNormalOffset(),n.getCABO().getStride(),t.context.FLOAT,3,!1)||Td("Error setting normalMC in shader VAO."):n.getVAO().removeAttributeArray("normalMC"),t.renderable.getCustomShaderAttributes().forEach(function(e,r){n.getProgram().isAttributeUsed("".concat(e,"MC"))&&(n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"".concat(e,"MC"),n.getCABO().getCustomData()[r].offset,n.getCABO().getStride(),t.context.FLOAT,n.getCABO().getCustomData()[r].components,!1)||Td("Error setting ".concat(e,"MC in shader VAO.")))}),n.getProgram().isAttributeUsed("tcoordMC")&&n.getCABO().getTCoordOffset()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO(),"tcoordMC",n.getCABO().getTCoordOffset(),n.getCABO().getStride(),t.context.FLOAT,n.getCABO().getTCoordComponents(),!1)||Td("Error setting tcoordMC in shader VAO."):n.getVAO().removeAttributeArray("tcoordMC"),n.getProgram().isAttributeUsed("scalarColor")&&n.getCABO().getColorComponents()?n.getVAO().addAttributeArray(n.getProgram(),n.getCABO().getColorBO(),"scalarColor",n.getCABO().getColorOffset(),n.getCABO().getColorBOStride(),t.context.UNSIGNED_BYTE,4,!0)||Td("Error setting scalarColor in shader VAO."):n.getVAO().removeAttributeArray("scalarColor"),n.getAttributeUpdateTime().modified()}if(t.renderable.getNumberOfClippingPlanes()){var i=t.renderable.getNumberOfClippingPlanes();i>6&&(ur.l("OpenGL has a limit of 6 clipping planes"),i=6);for(var s=[],l=0;l0){var f=d.getColorByReference(),p=d.getIntensity();t.lightColor[0]=f[0]*p,t.lightColor[1]=f[1]*p,t.lightColor[2]=f[2]*p;var g=d.getDirection(),m=n.getActiveCamera().getViewMatrix(),v=fd(g);d.lightTypeIsSceneLight()&&(v[0]=m[0]*g[0]+m[1]*g[1]+m[2]*g[2],v[1]=m[4]*g[0]+m[5]*g[1]+m[6]*g[2],v[2]=m[8]*g[0]+m[9]*g[1]+m[10]*g[2],ra(v)),t.lightDirection[0]=v[0],t.lightDirection[1]=v[1],t.lightDirection[2]=v[2],t.lightHalfAngle[0]=-t.lightDirection[0],t.lightHalfAngle[1]=-t.lightDirection[1],t.lightHalfAngle[2]=1-t.lightDirection[2],ra(t.lightDirection),s.setUniform3fArray("lightColor".concat(l),t.lightColor),s.setUniform3fArray("lightDirectionVC".concat(l),t.lightDirection),s.setUniform3fArray("lightHalfAngleVC".concat(l),t.lightHalfAngle),l++}}if(!(a<3)){var h=n.getActiveCamera().getViewMatrix();o.transpose(h,h),l=0;for(var y=0;y0){var T=b.getTransformedPosition(),C=new Float64Array(3);i.transformMat4(C,T,h),s.setUniform3fArray("lightAttenuation".concat(l),b.getAttenuationValuesByReference()),s.setUniformi("lightPositional".concat(l),b.getPositional()),s.setUniformf("lightExponent".concat(l),b.getExponent()),s.setUniformf("lightConeAngle".concat(l),b.getConeAngle()),s.setUniform3fArray("lightPositionVC".concat(l),[C[0],C[1],C[2]]),l++}}}}},e.setCameraShaderParameters=function(e,r,i){var s=e.getProgram(),l=t.openGLCamera.getKeyMatrices(r),u=r.getActiveCamera(),c=t.openGLCamera.getKeyMatrixTime().getMTime(),d=s.getLastCameraMTime(),f=e.getCABO().getCoordShiftAndScaleEnabled()?e.getCABO().getInverseShiftAndScaleMatrix():null,p=i.getIsIdentity(),g=p?{mcwc:null,normalMatrix:null}:t.openGLActor.getKeyMatrices();s.setUniformMatrix("MCPCMatrix",n([l.wcpc,g.mcwc,f],o,t.tmpMat4)),s.isUniformUsed("MCVCMatrix")&&s.setUniformMatrix("MCVCMatrix",n([l.wcvc,g.mcwc,f],o,t.tmpMat4)),s.isUniformUsed("normalMatrix")&&s.setUniformMatrix3x3("normalMatrix",n([l.normalMatrix,g.normalMatrix],a,t.tmpMat3)),d!==c&&(s.isUniformUsed("cameraParallel")&&s.setUniformi("cameraParallel",u.getParallelProjection()),s.setLastCameraMTime(c)),p||s.setLastCameraMTime(0)},e.setPropertyShaderParameters=function(e,n,r){var a=e.getProgram(),o=r.getProperty(),i=o.getOpacity(),s=t.drawingEdges?o.getEdgeColorByReference():o.getAmbientColorByReference(),l=t.drawingEdges?o.getEdgeColorByReference():o.getDiffuseColorByReference(),u=t.drawingEdges?1:o.getAmbient(),c=t.drawingEdges?0:o.getDiffuse(),d=t.drawingEdges?0:o.getSpecular(),f=o.getSpecularPower();a.setUniformf("opacityUniform",i),a.setUniform3fArray("ambientColorUniform",s),a.setUniform3fArray("diffuseColorUniform",l),a.setUniformf("ambient",u),a.setUniformf("diffuse",c);var p=t.lastBoundBO.getReferenceByName("lastLightComplexity");if(!(p<1)){var g=o.getSpecularColorByReference();if(a.setUniform3fArray("specularColorUniform",g),a.setUniformf("specularPowerUniform",f),a.isUniformUsed("ambientIntensityBF")){if(i=(o=r.getBackfaceProperty()).getOpacity(),s=o.getAmbientColor(),u=o.getAmbient(),l=o.getDiffuseColor(),c=o.getDiffuse(),g=o.getSpecularColor(),d=o.getSpecular(),a.setUniformf("ambientIntensityBF",u),a.setUniformf("diffuseIntensityBF",c),a.setUniformf("opacityUniformBF",i),a.setUniform3fArray("ambientColorUniformBF",s),a.setUniform3fArray("diffuseColorUniformBF",l),p<1)return;a.setUniformf("specularIntensityBF",d),a.setUniform3fArray("specularColorUniformBF",g),a.setUniformf("specularPowerUniformBF",f)}}},e.renderPieceStart=function(n,r){t.primitiveIDOffset=0,t.openGLRenderer.getSelector()&&(t.openGLRenderer.getSelector().getCurrentPass(),t.openGLRenderer.getSelector().renderProp(r)),e.updateBufferObjects(n,r),t.renderable.getColorTextureMap()&&t.internalColorTexture.activate(),t.lastBoundBO=null},e.renderPieceDraw=function(n,r){var a=r.getProperty().getRepresentation(),o=t.context,i=r.getProperty().getEdgeVisibility()&&a===md.SURFACE;o.lineWidth(r.getProperty().getLineWidth());for(var s=gd.Start;s2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ad,n),pr.extend(e,t,n),t.openGLTexture=li.newInstance(),t.tris=Xo.newInstance(),t.keyMatrixTime={},ur.g(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:a.identity(new Float64Array(9)),mcwc:o.identity(new Float64Array(16))},ur.i(e,t,["context"]),ur.b(e,t,["activeTextures"]),function(e,t){t.classHierarchy.push("vtkOpenGLSkybox"),e.buildPass=function(n){if(n){t.openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.openGLRenderWindow=t.openGLRenderer.getParent(),t.context=t.openGLRenderWindow.getContext(),t.tris.setOpenGLRenderWindow(t.openGLRenderWindow),t.openGLTexture.setOpenGLRenderWindow(t.openGLRenderWindow);var r=t.openGLRenderer.getRenderable();t.openGLCamera=t.openGLRenderer.getViewNodeFor(r.getActiveCamera())}},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;n.incrementOpaqueActorCount()}},e.opaquePass=function(n,r){if(n&&!t.openGLRenderer.getSelector()){e.updateBufferObjects(),t.openGLRenderWindow.enableDepthMask(),t.openGLRenderWindow.getShaderCache().readyShaderProgram(t.tris.getProgram()),t.openGLTexture.render(t.openGLRenderWindow);var a=t.openGLTexture.getTextureUnit();t.tris.getProgram().setUniformi("sbtexture",a);var i=t.openGLRenderer.getRenderable(),s=t.openGLCamera.getKeyMatrices(i),l=new Float64Array(16);if(o.invert(l,s.wcpc),t.tris.getProgram().setUniformMatrix("IMCPCMatrix",l),"box"===t.lastFormat){var u=i.getActiveCamera().getPosition();t.tris.getProgram().setUniform3f("camPos",u[0],u[1],u[2])}t.tris.getVAO().bind(),t.context.drawArrays(t.context.TRIANGLES,0,t.tris.getCABO().getElementCount()),t.tris.getVAO().release(),t.openGLTexture.deactivate()}},e.updateBufferObjects=function(){if(!t.tris.getCABO().getElementCount()){for(var e=new Float32Array(12),n=0;n<4;n++)e[3*n]=n%2*2-1,e[3*n+1]=n>1?1:-1,e[3*n+2]=1;var r=vo.newInstance({numberOfComponents:3,values:e});r.setName("points");var a=new Uint16Array(8);a[0]=3,a[1]=0,a[2]=1,a[3]=3,a[4]=3,a[5]=0,a[6]=3,a[7]=2;var o=vo.newInstance({numberOfComponents:1,values:a});t.tris.getCABO().createVBO(o,"polys",Mo.SURFACE,{points:r,cellOffset:0})}t.renderable.getFormat()!==t.lastFormat&&(t.lastFormat=t.renderable.getFormat(),"box"===t.lastFormat&&t.tris.setProgram(t.openGLRenderWindow.getShaderCache().readyShaderProgramArray("//VTK::System::Dec\n attribute vec3 vertexMC;\n uniform mat4 IMCPCMatrix;\n varying vec3 TexCoords;\n void main () {\n gl_Position = vec4(vertexMC.xyz, 1.0);\n vec4 wpos = IMCPCMatrix * gl_Position;\n TexCoords = wpos.xyz/wpos.w;\n }","//VTK::System::Dec\n //VTK::Output::Dec\n varying vec3 TexCoords;\n uniform samplerCube sbtexture;\n uniform vec3 camPos;\n void main () {\n // skybox looks from inside out\n // which means we have to adjust\n // our tcoords. Otherwise text would\n // be flipped\n vec3 tc = normalize(TexCoords - camPos);\n if (abs(tc.z) < max(abs(tc.x),abs(tc.y)))\n {\n tc = vec3(1.0, 1.0, -1.0) * tc;\n }\n else\n {\n tc = vec3(-1.0, 1.0, 1.0) * tc;\n }\n gl_FragData[0] = textureCube(sbtexture, tc);\n }","")),"background"===t.lastFormat&&t.tris.setProgram(t.openGLRenderWindow.getShaderCache().readyShaderProgramArray("//VTK::System::Dec\n attribute vec3 vertexMC;\n uniform mat4 IMCPCMatrix;\n varying vec2 TexCoords;\n void main () {\n gl_Position = vec4(vertexMC.xyz, 1.0);\n vec4 wpos = IMCPCMatrix * gl_Position;\n TexCoords = vec2(vertexMC.x, vertexMC.y)*0.5 + 0.5;\n }","//VTK::System::Dec\n //VTK::Output::Dec\n varying vec2 TexCoords;\n uniform sampler2D sbtexture;\n void main () {\n gl_FragData[0] = texture2D(sbtexture, TexCoords);\n }","")),t.tris.getShaderSourceTime().modified(),t.tris.getVAO().bind(),t.tris.getVAO().addAttributeArray(t.tris.getProgram(),t.tris.getCABO(),"vertexMC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||Md("Error setting vertexMC in shader VAO."));var i=t.renderable.getTextures();i.length||Md("vtkSkybox requires a texture map"),t.openGLTexture.getRenderable()!==i[0]&&(t.openGLTexture.releaseGraphicsResources(t.openGLRenderWindow),t.openGLTexture.setRenderable(i[0]))}}(e,t)}var Rd=ur.d(Id);yr("vtkSkybox",Rd);var Ed={keyMatricesTime:null,keyMatrices:null,propID:void 0,bufferShift:void 0};function Dd(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ed,n),pr.extend(e,t,n),t.keyMatricesTime={},ur.a.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={normalMatrix:new Float64Array(16),bcwc:new Float64Array(16),bcsc:new Float64Array(16)},ur.a.get(e,t,["propID","keyMatricesTime"]),t.bufferShift=[0,0,0,0],function(e,t){t.classHierarchy.push("vtkWebGPUActor"),e.buildPass=function(n){n&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.traverseOpaquePass=function(n){t.renderable&&t.renderable.getVisibility()&&t.renderable.getIsOpaque()&&(!t.WebGPURenderer.getSelector()||t.renderable.getPickable())&&(e.apply(n,!0),t.children[0]&&t.children[0].traverse(n),e.apply(n,!1))},e.traverseTranslucentPass=function(n){!t.renderable||!t.renderable.getVisibility()||t.renderable.getIsOpaque()||t.WebGPURenderer.getSelector()&&!t.renderable.getPickable()||(e.apply(n,!0),t.children[0]&&t.children[0].traverse(n),e.apply(n,!1))},e.queryPass=function(e,n){if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?n.incrementOpaqueActorCount():n.incrementTranslucentActorCount()}},e.getBufferShift=function(n){return e.getKeyMatrices(n),t.bufferShift},e.getKeyMatrices=function(e){if(Math.max(t.renderable.getMTime(),e.getStabilizedTime().getMTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();var n=t.renderable.getMatrix(),r=e.getStabilizedCenterByReference();t.bufferShift[0]=n[3]-r[0],t.bufferShift[1]=n[7]-r[1],t.bufferShift[2]=n[11]-r[2],o.transpose(t.keyMatrices.bcwc,n),t.renderable.getIsIdentity()?o.identity(t.keyMatrices.normalMatrix):(o.copy(t.keyMatrices.normalMatrix,t.keyMatrices.bcwc),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,o.invert(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),o.transpose(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),o.translate(t.keyMatrices.bcwc,t.keyMatrices.bcwc,[-t.bufferShift[0],-t.bufferShift[1],-t.bufferShift[2]]),o.translate(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-r[0],-r[1],-r[2]]),t.keyMatricesTime.modified()}return t.keyMatrices}}(e,t)}var Vd=ur.a.newInstance(Dd);Ji("vtkActor",Vd);var Ld={repeat:!1,interpolate:!1,edgeClamp:!1,image:null,imageLoaded:!1};function Nd(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ld,n),ur.a.obj(e,t),ur.a.algo(e,t,6,0),ur.a.get(e,t,["imageLoaded"]),ur.a.setGet(e,t,["repeat","edgeClamp","interpolate","image"]),function(e,t){t.classHierarchy.push("vtkTexture"),e.imageLoaded=function(){t.image.removeEventListener("load",e.imageLoaded),t.imageLoaded=!0,e.modified()},e.setImage=function(n){t.image!==n&&(null!==n&&(e.setInputData(null),e.setInputConnection(null)),t.image=n,t.imageLoaded=!1,n.complete?e.imageLoaded():n.addEventListener("load",e.imageLoaded),e.modified())}}(e,t)}var Bd={newInstance:ur.a.newInstance(Nd,"vtkTexture"),extend:Nd},kd=cl.BufferUsage,Fd=cl.PrimitiveTypes,Gd=qs.Representation,_d=dd.ScalarMode,Ud={type:"StartEvent"},jd={type:"EndEvent"},Wd="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(vertex)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n var vertex: vec4 = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",zd="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n var ambientColor: vec4 = mapperUBO.AmbientColor;\n var diffuseColor: vec4 = mapperUBO.DiffuseColor;\n var opacity: f32 = mapperUBO.Opacity;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n var computedColor: vec4 = vec4(ambientColor.rgb * mapperUBO.AmbientIntensity\n + diffuse * mapperUBO.DiffuseIntensity\n + specular * mapperUBO.SpecularIntensity,\n opacity);\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n if (computedColor.a == 0.0) { discard; };\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";var Hd={colorTexture:null,renderEncoder:null,textures:null,textureViews:null,primitives:null,tmpMat4:null,fragmentShaderTemplate:null,vertexShaderTemplate:null};function Kd(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hd,n),pr.extend(e,t,n),t.tmpMat3=a.identity(new Float64Array(9)),t.tmpMat4=o.identity(new Float64Array(16)),t.fragmentShaderTemplate=t.fragmentShaderTemplate||zd,t.vertexShaderTemplate=t.vertexShaderTemplate||Wd,t.UBO=hl.newInstance(),t.UBO.setName("mapperUBO"),t.UBO.addEntry("BCWCMatrix","mat4x4"),t.UBO.addEntry("BCSCMatrix","mat4x4"),t.UBO.addEntry("MCWCNormals","mat4x4"),t.UBO.addEntry("AmbientColor","vec4"),t.UBO.addEntry("DiffuseColor","vec4"),t.UBO.addEntry("AmbientIntensity","f32"),t.UBO.addEntry("DiffuseIntensity","f32"),t.UBO.addEntry("SpecularColor","vec4"),t.UBO.addEntry("SpecularIntensity","f32"),t.UBO.addEntry("Opacity","f32"),t.UBO.addEntry("SpecularPower","f32"),t.UBO.addEntry("PropID","u32"),ur.b(e,t,["fragmentShaderTemplate","vertexShaderTemplate","UBO"]),ur.i(e,t,["renderEncoder"]),t.textures=[],t.textureViews=[],t.primitives=[],function(e,t){t.classHierarchy.push("vtkWebGPUPolyDataMapper"),e.buildPass=function(n){n&&(t.WebGPUActor=e.getFirstAncestorOfType("vtkWebGPUActor"),t.WebGPURenderer=t.WebGPUActor.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.device=t.WebGPURenderWindow.getDevice())},e.translucentPass=function(t){t&&e.render()},e.opaquePass=function(t){t&&e.render()},e.updateUBO=function(){var n=t.WebGPUActor.getRenderable().getProperty(),r=t.UBO.getSendTime();if(e.getMTime()>r||n.getMTime()>r||t.renderable.getMTime()>r){var a=t.WebGPUActor.getKeyMatrices(t.WebGPURenderer);t.UBO.setArray("BCWCMatrix",a.bcwc),t.UBO.setArray("BCSCMatrix",a.bcsc),t.UBO.setArray("MCWCNormals",a.normalMatrix);var o=n.getAmbientColorByReference();t.UBO.setValue("AmbientIntensity",n.getAmbient()),t.UBO.setArray("AmbientColor",[o[0],o[1],o[2],1]),t.UBO.setValue("DiffuseIntensity",n.getDiffuse()),o=n.getDiffuseColorByReference(),t.UBO.setArray("DiffuseColor",[o[0],o[1],o[2],1]),t.UBO.setValue("SpecularIntensity",n.getSpecular()),t.UBO.setValue("SpecularPower",n.getSpecularPower()),o=n.getSpecularColorByReference(),t.UBO.setArray("SpecularColor",[o[0],o[1],o[2],1]),t.UBO.setValue("Opacity",n.getOpacity()),t.UBO.setValue("PropID",t.WebGPUActor.getPropID());var i=t.WebGPURenderWindow.getDevice();t.UBO.sendIfNeeded(i)}},e.render=function(){e.invokeEvent(Ud),t.renderable.getStatic()||t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent(jd),t.renderEncoder=t.WebGPURenderer.getRenderEncoder(),e.buildPrimitives(),e.updateUBO()},e.replaceShaderPosition=function(e,t,n){var r=t.getShaderDescription("vertex");r.addBuiltinOutput("vec4","[[builtin(position)]] Position");var a=r.getCode();a=ps.substitute(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix*vertexBC;"]).result,r.setCode(a)},e.replaceShaderNormal=function(e,t,n){if(n.hasAttribute("normalMC")){var r=t.getShaderDescription("vertex");r.addOutput("vec3","normalVC");var a=r.getCode();a=ps.substitute(a,"//VTK::Normal::Impl",[" output.normalVC = normalize((rendererUBO.WCVCNormals * mapperUBO.MCWCNormals * normalMC).xyz);"]).result,r.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=ps.substitute(a,"//VTK::Normal::Impl",[" var normal: vec3 = input.normalVC;"," if (!input.frontFacing) { normal = -normal; }"]).result,o.setCode(a)}},e.replaceShaderLight=function(e,t,n){var r=t.getShaderDescription("fragment"),a=r.getCode();a.includes("var normal")?(a=ps.substitute(a,"//VTK::Light::Impl",[" var df: f32 = max(0.0, normal.z);"," var sf: f32 = pow(df, mapperUBO.SpecularPower);"," var diffuse: vec3 = df * diffuseColor.rgb;"," var specular: vec3 = sf * mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;"]).result,r.setCode(a)):(a=ps.substitute(a,"//VTK::Light::Impl",[" var diffuse: vec3 = diffuseColor.rgb;"," var specular: vec3 = mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;"]).result,r.setCode(a))},e.replaceShaderColor=function(e,t,n){if(n.hasAttribute("colorVI")){var r=t.getShaderDescription("vertex");r.addOutput("vec4","color");var a=r.getCode();a=ps.substitute(a,"//VTK::Color::Impl",[" output.color = colorVI;"]).result,r.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=ps.substitute(a,"//VTK::Color::Impl",["ambientColor = input.color;","diffuseColor = input.color;","opacity = mapperUBO.Opacity * input.color.a;"]).result,o.setCode(a)}},e.replaceShaderTCoord=function(e,n,r){if(r.hasAttribute("tcoord")){var a=n.getShaderDescription("vertex");a.addOutput("vec2","tcoordVS");var o=a.getCode();o=ps.substitute(o,"//VTK::TCoord::Impl",[" output.tcoordVS = tcoord;"]).result,a.setCode(o);var i=n.getShaderDescription("fragment");o=i.getCode(),t.textures.length&&(o=ps.substitute(o,"//VTK::TCoord::Impl",["var tcolor: vec4 = textureSample(Texture0, Texture0Sampler, input.tcoordVS);","computedColor = computedColor*tcolor;"]).result),i.setCode(o)}},e.replaceShaderSelect=function(e,t,n){if(e.includes("sel")){var r=t.getShaderDescription("fragment"),a=r.getCode();a=ps.substitute(a,"//VTK::Select::Impl",[" var compositeID: u32 = 0u;"]).result,r.setCode(a)}},e.getUsage=function(e,t){return e===Gd.POINTS||0===t?kd.Verts:1===t?kd.Lines:e===Gd.WIREFRAME?2===t?kd.LinesFromTriangles:kd.LinesFromStrips:2===t?kd.Triangles:kd.Strips},e.getHashFromUsage=function(e){return"pt".concat(e)},e.getTopologyFromUsage=function(e){switch(e){case kd.Triangles:return"triangle-list";case kd.Verts:return"point-list";default:case kd.Lines:return"line-list"}},e.buildVertexInput=function(n,r,a){var o=t.WebGPUActor.getRenderable().getProperty().getRepresentation(),i=t.WebGPURenderWindow.getDevice(),s=t.primitives[a].getVertexInput(),l=r.getMTime()+o,u=n.getPoints();if(u){var c=t.WebGPUActor.getBufferShift(t.WebGPURenderer),d={hash:l+u.getMTime(),dataArray:u,source:u,cells:r,primitiveType:a,representation:o,time:Math.max(u.getMTime(),r.getMTime(),t.WebGPUActor.getKeyMatricesTime().getMTime()),shift:c,usage:kd.PointArray,format:"float32x4",packExtra:!0},f=i.getBufferManager().getBuffer(d);s.addBuffer(f,["vertexBC"])}else s.removeBufferIfPresent("vertexBC");var p=e.getUsage(o,a);if(p===kd.Triangles||p===kd.Strips){var g=n.getPointData().getNormals(),m={cells:r,representation:o,primitiveType:a,format:"snorm8x4",packExtra:!0,shift:0,scale:127};if(g){m.hash=l+g.getMTime(),m.dataArray=g,m.source=g,m.time=Math.max(g.getMTime(),r.getMTime()),m.usage=kd.PointArray;var v=i.getBufferManager().getBuffer(m);s.addBuffer(v,["normalMC"])}else if(a===Fd.Triangles){m.hash=l+u.getMTime(),m.dataArray=u,m.source=u,m.time=Math.max(u.getMTime(),r.getMTime()),m.usage=kd.NormalsFromPoints;var h=i.getBufferManager().getBuffer(m);s.addBuffer(h,["normalMC"])}else s.removeBufferIfPresent("normalMC")}else s.removeBufferIfPresent("normalMC");var y=!1;if(t.renderable.getScalarVisibility()){var b=t.renderable.getColorMapColors();if(b){var T=t.renderable.getScalarMode(),C=!1;T!==_d.USE_CELL_DATA&&T!==_d.USE_CELL_FIELD_DATA&&T!==_d.USE_FIELD_DATA&&n.getPointData().getScalars()||T===_d.USE_POINT_FIELD_DATA||!b||(C=!0);var S={hash:l+u.getMTime(),dataArray:b,source:b,cells:r,primitiveType:a,representation:o,time:Math.max(b.getMTime(),r.getMTime()),usage:kd.PointArray,format:"unorm8x4",cellData:C,cellOffset:0},P=i.getBufferManager().getBuffer(S);s.addBuffer(P,["colorVI"]),y=!0}}y||s.removeBufferIfPresent("colorVI");var w=null;if(w=t.renderable.getInterpolateScalarsBeforeMapping()&&t.renderable.getColorCoordinates()?t.renderable.getColorCoordinates():n.getPointData().getTCoords()){var x={hash:l+w.getMTime(),dataArray:w,source:w,cells:r,primitiveType:a,representation:o,time:Math.max(w.getMTime(),r.getMTime()),usage:kd.PointArray,format:"float32x2"},O=i.getBufferManager().getBuffer(x);s.addBuffer(O,["tcoord"])}else s.removeBufferIfPresent("tcoord")},e.updateTextures=function(){var e=[],n=[],r=t.renderable.getColorTextureMap();r&&(t.colorTexture||(t.colorTexture=Bd.newInstance()),t.colorTexture.setInputData(r),n.push(t.colorTexture));for(var a=t.WebGPUActor.getRenderable().getTextures(),o=0;o=0;m--)e[m]||(t.textures.splice(m,1),t.textureViews.splice(m,1))},e.computePipelineHash=function(n,r){var a="pd";return n.hasAttribute("normalMC")&&(a+="n"),n.hasAttribute("colorVI")&&(a+="c"),n.hasAttribute("tcoord")&&(a+="t"),t.textures.length&&(a+="tx".concat(t.textures.length)),t.SSBO&&(a+="ssbo"),a+=e.getHashFromUsage(r),a+=t.renderEncoder.getPipelineHash()},e.buildPrimitives=function(){var n=t.currentInput,r=[n.getVerts(),n.getLines(),n.getPolys(),n.getStrips()],a=t.WebGPURenderWindow.getDevice();t.renderable.mapScalars(n,1),e.updateTextures();for(var o=Fd.Points;o<=Fd.Triangles;o++)if(r[o].getNumberOfValues()>0){var i=t.WebGPUActor.getRenderable().getProperty().getRepresentation(),s=e.getUsage(i,o),l=t.primitives[o];e.buildVertexInput(t.currentInput,r[o],o),l.setPipelineHash(e.computePipelineHash(l.getVertexInput(),s)),l.setTextureViews(t.textureViews),l.setWebGPURenderer(t.WebGPURenderer),l.setNumberOfInstances(1);var u=l.getVertexInput().getBuffer("vertexBC");l.setNumberOfVertices(u.getSizeInBytes()/u.getStrideInBytes()),l.setTopology(e.getTopologyFromUsage(s)),l.build(t.renderEncoder,a),l.registerToDraw()}},e.setShaderReplacement=function(e,n){for(var r=Fd.Start;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yd,n),ur.a.obj(e,t),t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,sampler:{}},t.bindGroupTime={},ur.a.obj(t.bindGroupTime,{mtime:0}),ur.a.get(e,t,["bindGroupTime","handle"]),ur.a.setGet(e,t,["bindGroupLayoutEntry","device","name"]),function(e,t){t.classHierarchy.push("vtkWebGPUSampler"),e.create=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.device=e,t.handle=t.device.getHandle().createSampler({magFilter:n.magFilter?n.magFilter:"nearest",minFilter:n.minFilter?n.minFilter:"nearest"}),t.bindGroupTime.modified()},e.getShaderCode=function(e,n){return"[[binding(".concat(e,"), group(").concat(n,")]] var ").concat(t.name,": sampler;")},e.getBindGroupEntry=function(){return{resource:t.handle}}}(e,t)}var Qd={newInstance:ur.a.newInstance(Zd),extend:Zd};var $d={texture:null,handle:null,name:null,sampler:null};function Jd(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,$d,n),ur.a.obj(e,t),t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,texture:{}},t.bindGroupTime={},ur.a.obj(t.bindGroupTime,{mtime:0}),ur.a.get(e,t,["bindGroupTime","name","texture"]),ur.a.setGet(e,t,["bindGroupLayoutEntry","sampler"]),function(e,t){t.classHierarchy.push("vtkWebGPUTextureView"),e.create=function(e,n){t.texture=e,t.options=n,t.textureHandle=e.getHandle(),t.handle=t.textureHandle.createView(t.options)},e.getBindGroupEntry=function(){return{resource:e.getHandle()}},e.getShaderCode=function(e,n){return"[[binding(".concat(e,"), group(").concat(n,")]] var ").concat(t.name,": texture_2d;")},e.addSampler=function(n,r){var a=Qd.newInstance();a.create(n,r),e.setSampler(a),t.sampler.setName("".concat(t.name,"Sampler"))},e.setName=function(n){t.sampler&&t.sampler.setName("".concat(n,"Sampler")),t.name!==n&&(t.name=n,e.modified())},e.getHandle=function(){return t.texture.getHandle()!==t.textureHandle&&(t.textureHandle=t.texture.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupTime.modified()),t.handle}}(e,t)}var ef={newInstance:ur.a.newInstance(Jd),extend:Jd},tf=cl.BufferUsage;var nf={device:null,handle:null,buffer:null,ready:!1};function rf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,nf,n),ur.a.obj(e,t),ur.a.get(e,t,["handle","ready","width","height","depth","format","usage"]),ur.a.setGet(e,t,["device"]),function(e,t){t.classHierarchy.push("vtkWebGPUTexture"),e.create=function(e,n){t.device=e,t.width=n.width,t.height=n.height,t.depth=n.depth?n.depth:1;var r=1===t.depth?"2d":"3d";t.format=n.format?n.format:"rgbaunorm",t.usage=n.usage?n.usage:GPUTextureUsage.SAMPLED|GPUTextureUsage.COPY_DST,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage,dimension:r})},e.assignFromHandle=function(e,n,r){t.device=e,t.handle=n,t.width=r.width,t.height=r.height,t.depth=r.depth?r.depth:1,t.format=r.format?r.format:"rgbaunorm",t.usage=r.usage?r.usage:GPUTextureUsage.SAMPLED|GPUTextureUsage.COPY_DST},e.writeImageData=function(e){var n=4*t.width;if(e.dataArray){var r={dataArray:e.dataArray,time:e.dataArray.getMTime(),usage:tf.Texture,format:"unorm8x4"};if(t.width%64){for(var a=e.dataArray.getData(),o=64*Math.floor((t.width+63)/64),i=new Uint8Array(o*t.height*4),s=0;s2&&void 0!==arguments[2]?arguments[2]:1;e===t.width&&n===t.height&&r===t.depth||(t.width=e,t.height=n,t.depth=r,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage}))},e.createView=function(t){var n=ef.newInstance();return n.create(e,t),n}}(e,t)}ur.a.newInstance(rf);var af={PassTypes:{MIN_KNOWN_PASS:0,ACTOR_PASS:0,COMPOSITE_INDEX_PASS:1,ID_LOW24:2,MAX_KNOWN_PASS:2}};function of(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function sf(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){of(o,r,a,i,s,"next",e)}function s(e){of(o,r,a,i,s,"throw",e)}i(void 0)})}}var lf={fieldAssociation:sc.FieldAssociations.FIELD_ASSOCIATION_CELLS,captureZValues:!1};function uf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,lf,n),ur.a.obj(e,t),ur.a.setGet(e,t,["fieldAssociation","captureZValues"]),function(e,t){t.classHierarchy.push("vtkHardwareSelector"),e.getSourceDataAsync=function(){var e=sf(regeneratorRuntime.mark(function e(t,n,r,a,o){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},e)}));return function(t,n,r,a,o){return e.apply(this,arguments)}}(),e.selectAsync=function(){var t=sf(regeneratorRuntime.mark(function t(n,r,a,o,i){var s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getSourceDataAsync(n,r,a,o,i);case 2:if(!(s=t.sent)){t.next=5;break}return t.abrupt("return",s.generateSelection(r,a,o,i));case 5:return t.abrupt("return",[]);case 6:case"end":return t.stop()}},t)}));return function(e,n,r,a,o){return t.apply(this,arguments)}}()}(e,t)}var cf={newInstance:ur.a.newInstance(uf,"vtkHardwareSelector"),extend:uf},df={SelectionContent:{GLOBALIDS:0,PEDIGREEIDS:1,VALUES:2,INDICES:3,FRUSTUM:4,LOCATIONS:5,THRESHOLDS:6,BLOCKS:7,QUERY:8},SelectionField:{CELL:0,POINT:1,FIELD:2,VERTEX:3,EDGE:4,ROW:5}};function ff(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gf={contentType:-1,fieldType:-1,properties:null,selectionList:[]};function mf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gf,n),ur.a.obj(e,t),t.properties={},ur.a.setGet(e,t,["contentType","fieldType","properties","selectionList"]),function(e,t){t.classHierarchy.push("vtkSelectionNode"),e.getBounds=function(){return t.points.getBounds()}}(e,t)}var vf=function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.area[2]||t[1]e.area[3])return null;var o=[t[0]-e.area[0],t[1]-e.area[1]],i=If(o[0],o[1],e.pixBuffer[Sf.ACTOR_PASS],e.area);if(i<=0)return null;var s={valid:!0};s.propID=i-Mf,s.prop=e.props[s.propID];var l=If(o[0],o[1],e.pixBuffer[Sf.COMPOSITE_INDEX_PASS],e.area);if((l<0||l>16777215)&&(l=0),s.compositeID=l-Mf,e.captureZValues){var u=4*(o[1]*(e.area[2]-e.area[0]+1)+o[0]);s.zValue=(256*e.zBuffer[u]+e.zBuffer[u+1])/65535,s.displayPosition=t}return s}var c=[t[0],t[1]],d=[0,0],f=Rf(e,t,0,r);if(f&&f.valid)return f;for(var p=1;pp?c[1]-p:0;g<=c[1]+p;++g){if(d[1]=g,c[0]>=p&&(d[0]=c[0]-p,(f=Rf(e,d,0,r))&&f.valid))return f;if(d[0]=c[0]+p,(f=Rf(e,d,0,r))&&f.valid)return f}for(var m=c[0]>=p?c[0]-(p-1):0;m<=c[0]+(p-1);++m){if(d[0]=m,c[1]>=p&&(d[1]=c[1]-p,(f=Rf(e,d,0,r))&&f.valid))return f;if(d[1]=c[1]+p,(f=Rf(e,d,0,r))&&f.valid)return f}}return r[0]=t[0],r[1]=t[1],null}function Ef(e,t,n,r,a){var o=[],i=0;return t.forEach(function(t,s){var l=vf.newInstance();switch(l.setContentType(Pf.INDICES),e){case xf.FIELD_ASSOCIATION_CELLS:l.setFieldType(wf.CELL);break;case xf.FIELD_ASSOCIATION_POINTS:l.setFieldType(wf.POINT);break;default:Of("Unknown field association")}l.getProperties().propID=t.info.propID,l.getProperties().prop=t.info.prop,l.getProperties().compositeID=t.info.compositeID,l.getProperties().pixelCount=t.pixelCount,n&&(l.getProperties().displayPosition=[t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue],l.getProperties().worldPosition=a.displayToWorld(t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue,r)),l.setSelectionList(t.attributeIDs),o[i]=l,i++}),o}function Df(e,t,n,r,a){for(var o=Math.floor(t),i=Math.floor(n),s=Math.floor(r),l=Math.floor(a),u=new Map,c=[0,0],d=i;d<=l;d++)for(var f=o;f<=s;f++){var p=Rf(e,[f,d],0,c);if(p&&p.valid){var g=Af(p);if(u.has(g)){var m=u.get(g);m.pixelCount++,e.captureZValues&&p.zValue0&&(--a in t.hitProps||(t.hitProps[a]=!0))}},e.renderProp=function(n){t.currentPass===Sf.ACTOR_PASS&&(e.setPropColorValueFromInt(t.props.length+Mf),t.props.push(n))},e.renderCompositeIndex=function(n){t.currentPass===Sf.COMPOSITE_INDEX_PASS&&e.setPropColorValueFromInt(n+Mf)},e.renderAttributeId=function(e){e<0||(t.maxAttributeId=e>t.maxAttributeId?e:t.maxAttributeId)},e.passTypeToString=function(e){return ur.a.enumToString(Sf,e)},e.isPropHit=function(e){return Boolean(t.hitProps[e])},e.setPropColorValueFromInt=function(e){t.propColorValue[0]=e%256/255,t.propColorValue[1]=Math.floor(e/256)%256/255,t.propColorValue[2]=Math.floor(e/65536)%256/255},e.getPixelInformation=function(n,r,a){var o=r<0?0:r;if(0===o){if(a[0]=n[0],a[1]=n[1],n[0]t.area[2]||n[1]t.area[3])return null;var i=[n[0]-t.area[0],n[1]-t.area[1]],s=If(i[0],i[1],t.pixBuffer[Sf.ACTOR_PASS],t.area);if(s<=0)return null;var l={valid:!0};l.propID=s-Mf,l.prop=t.props[l.propID];var u=If(i[0],i[1],t.pixBuffer[Sf.COMPOSITE_INDEX_PASS],t.area);if((u<0||u>16777215)&&(u=0),l.compositeID=u-Mf,t.captureZValues){var c=4*(i[1]*(t.area[2]-t.area[0]+1)+i[0]);l.zValue=(256*t.zBuffer[c]+t.zBuffer[c+1])/65535,l.displayPosition=n}return l}var d=[n[0],n[1]],f=[0,0],p=e.getPixelInformation(n,0,a);if(p&&p.valid)return p;for(var g=1;gg?d[1]-g:0;m<=d[1]+g;++m){if(f[1]=m,d[0]>=g&&(f[0]=d[0]-g,(p=e.getPixelInformation(f,0,a))&&p.valid))return p;if(f[0]=d[0]+g,(p=e.getPixelInformation(f,0,a))&&p.valid)return p}for(var v=d[0]>=g?d[0]-(g-1):0;v<=d[0]+(g-1);++v){if(f[0]=v,d[1]>=g&&(f[1]=d[1]-g,(p=e.getPixelInformation(f,0,a))&&p.valid))return p;if(f[1]=d[1]+g,(p=e.getPixelInformation(f,0,a))&&p.valid)return p}}return a[0]=n[0],a[1]=n[1],null},e.generateSelection=function(n,r,a,o){for(var i=Math.floor(n),s=Math.floor(r),l=Math.floor(a),u=Math.floor(o),c=new Map,d=[0,0],f=s;f<=u;f++)for(var p=i;p<=l;p++){var g=[p,f],m=e.getPixelInformation(g,0,d);if(m&&m.valid){var v=Af(m);if(c.has(v)){var h=c.get(v);h.pixelCount++,t.captureZValues&&m.zValue2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Lf,n),cf.extend(e,t,n),t.propColorValue=[0,0,0],t.props=[],t.area||(t.area=[0,0,0,0]),ur.a.setGetArray(e,t,["area"],4),ur.a.setGet(e,t,["renderer","currentPass","openGLRenderWindow"]),ur.a.setGetArray(e,t,["propColorValue"],3),ur.a.event(e,t,"event"),Vf(e,t)}var Bf=function(e){for(var t=1;t0){var o=e.Vertex;t.lastBoundBO.getCABO().getNormalOffset()&&(o=Uo.substitute(o,"//VTK::Normal::Dec",["attribute vec3 normalMC;","attribute mat3 gNormal;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,o=Uo.substitute(o,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * gNormal * normalMC;"]).result),e.Vertex=o}n.replaceShaderNormal(e,r,a)},e.replaceShaderColor=function(e,r,a){if(t.hardwareSupport&&t.renderable.getColorArray()){var o=e.Vertex,i=e.Geometry,s=e.Fragment,l=t.lastBoundBO.getReferenceByName("lastLightComplexity"),u=["uniform float ambient;","uniform float diffuse;","uniform float specular;","uniform float opacityUniform; // the fragment opacity"];l&&(u=u.concat(["uniform vec3 specularColorUniform;","uniform float specularPowerUniform;"]));var c=["vec3 ambientColor;"," vec3 diffuseColor;"," float opacity;"];l&&(c=c.concat([" vec3 specularColor;"," float specularPower;"])),c=c.concat([" opacity = opacityUniform;"]),l&&(c=c.concat([" specularColor = specularColorUniform;"," specularPower = specularPowerUniform;"])),t.drawingEdges||(u=u.concat(["varying vec4 vertexColorVSOutput;"]),o=Uo.substitute(o,"//VTK::Color::Dec",["attribute vec4 gColor;","varying vec4 vertexColorVSOutput;"]).result,o=Uo.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = gColor;"]).result,i=Uo.substitute(i,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,i=Uo.substitute(i,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result,c=c.concat([" diffuseColor = vertexColorVSOutput.rgb;"," ambientColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])),s=Uo.substitute(s,"//VTK::Color::Impl",c).result,s=Uo.substitute(s,"//VTK::Color::Dec",u).result,e.Vertex=o,e.Geometry=i,e.Fragment=s}n.replaceShaderColor(e,r,a)},e.replaceShaderPositionVC=function(e,r,a){if(t.hardwareSupport){var o=e.Vertex;t.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(o=Uo.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;","vertexVCVSOutput = MCVCMatrix * gVertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result,o=Uo.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result):(o=Uo.substitute(o,"//VTK::Camera::Dec",["attribute mat4 gMatrix;","uniform mat4 MCPCMatrix;"]).result,o=Uo.substitute(o,"//VTK::PositionVC::Impl",["vec4 gVertexMC = gMatrix * vertexMC;"," gl_Position = MCPCMatrix * gVertexMC;"]).result),e.Vertex=o}n.replaceShaderPositionVC(e,r,a)},e.replaceShaderPicking=function(e,r,a){if(t.hardwareSupport){var o=e.Fragment,i=e.Vertex;i=Uo.substitute(i,"//VTK::Picking::Dec",["attribute vec3 mapperIndexVS;","varying vec3 mapperIndexVSOutput;"]).result,i=Uo.substitute(i,"//VTK::Picking::Impl"," mapperIndexVSOutput = mapperIndexVS;").result,e.Vertex=i,o=Uo.substitute(o,"//VTK::Picking::Dec",["varying vec3 mapperIndexVSOutput;","uniform vec3 mapperIndex;","uniform int picking;"]).result,o=Uo.substitute(o,"//VTK::Picking::Impl",[" vec4 pickColor = picking == 2 ? vec4(mapperIndexVSOutput,1.0) : vec4(mapperIndex,1.0);"," gl_FragData[0] = picking != 0 ? pickColor : gl_FragData[0];"]).result,e.Fragment=o}else n.replaceShaderPicking(e,r,a)},e.updateGlyphShaderParameters=function(n,r,a,o,i,s,l,u){var c=a.getProgram();if(n){var d=t.normalMatrix,f=s,p=9*l,g=t.tmpMat3,m=d[0],v=d[1],h=d[2],y=d[3],b=d[4],T=d[5],C=d[6],S=d[7],P=d[8],w=f[p],x=f[p+1],O=f[p+2],M=f[p+3],A=f[p+4],I=f[p+5],R=f[p+6],E=f[p+7],D=f[p+8];g[0]=w*m+x*y+O*C,g[1]=w*v+x*b+O*S,g[2]=w*h+x*T+O*P,g[3]=M*m+A*y+I*C,g[4]=M*v+A*b+I*S,g[5]=M*h+A*T+I*P,g[6]=R*m+E*y+D*C,g[7]=R*v+E*b+D*S,g[8]=R*h+E*T+D*P,c.setUniformMatrix3x3("normalMatrix",t.tmpMat3)}if(e.multiply4x4WithOffset(t.tmpMat4,t.mcpcMatrix,i,16*l),c.setUniformMatrix("MCPCMatrix",t.tmpMat4),r&&(e.multiply4x4WithOffset(t.tmpMat4,t.mcvcMatrix,i,16*l),c.setUniformMatrix("MCVCMatrix",t.tmpMat4)),o){var V=o.getData();t.tmpColor[0]=V[4*l]/255,t.tmpColor[1]=V[4*l+1]/255,t.tmpColor[2]=V[4*l+2]/255,c.setUniform3fArray("ambientColorUniform",t.tmpColor),c.setUniform3fArray("diffuseColorUniform",t.tmpColor)}u&&c.setUniform3fArray("mapperIndex",u.getPropColorValue())},e.renderPieceDraw=function(n,r){var i=r.getProperty().getRepresentation(),s=t.context,l=r.getProperty().getEdgeVisibility()&&i===_f.SURFACE,u=t.openGLCamera.getKeyMatrices(n),c=t.openGLActor.getKeyMatrices();a.multiply(t.normalMatrix,u.normalMatrix,c.normalMatrix),o.multiply(t.mcpcMatrix,u.wcpc,c.mcwc),o.multiply(t.mcvcMatrix,u.wcvc,c.mcwc);var d=t.renderable.getMatrixArray(),f=t.renderable.getNormalArray(),p=t.renderable.getColorArray(),g=d.length/16,m=!1;t.openGLRenderer.getSelector()&&t.openGLRenderer.getSelector().getCurrentPass()===jf.COMPOSITE_INDEX_PASS&&(m=!0);for(var v=t.primTypes.Start;ve.getAttributeUpdateTime().getMTime()||e.getShaderSourceTime().getMTime()>e.getAttributeUpdateTime().getMTime()))return e.getProgram().isAttributeUsed("gMatrix")?e.getVAO().addAttributeMatrixWithDivisor(e.getProgram(),t.matrixBuffer,"gMatrix",0,64,t.context.FLOAT,4,!1,1)||Gf("Error setting gMatrix in shader VAO."):e.getVAO().removeAttributeArray("gMatrix"),e.getProgram().isAttributeUsed("gNormal")?e.getVAO().addAttributeMatrixWithDivisor(e.getProgram(),t.normalBuffer,"gNormal",0,36,t.context.FLOAT,3,!1,1)||Gf("Error setting gNormal in shader VAO."):e.getVAO().removeAttributeArray("gNormal"),e.getProgram().isAttributeUsed("gColor")?e.getVAO().addAttributeArrayWithDivisor(e.getProgram(),t.colorBuffer,"gColor",0,4,t.context.UNSIGNED_BYTE,4,!0,1,!1)||Gf("Error setting gColor in shader VAO."):e.getVAO().removeAttributeArray("gColor"),e.getProgram().isAttributeUsed("mapperIndexVS")?e.getVAO().addAttributeArrayWithDivisor(e.getProgram(),t.pickBuffer,"mapperIndexVS",0,4,t.context.UNSIGNED_BYTE,4,!0,1,!1)||Gf("Error setting mapperIndexVS in shader VAO."):e.getVAO().removeAttributeArray("mapperIndexVS"),n.setMapperShaderParameters(e,r,a),void e.getAttributeUpdateTime().modified();n.setMapperShaderParameters(e,r,a)},e.getNeedToRebuildBufferObjects=function(e,r){return t.renderable.buildArrays(),t.VBOBuildTime.getMTime()t.glyphBOBuildTime.getMTime()){t.matrixBuffer.upload(a,Uf.ARRAY_BUFFER),t.normalBuffer.upload(o,Uf.ARRAY_BUFFER),i?t.colorBuffer.upload(i.getData(),Uf.ARRAY_BUFFER):t.colorBuffer.releaseGraphicsResources();for(var s=a.length/16,l=new Uint8Array(4*s),u=0;u2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Kf,n),Od.extend(e,t,n),t.tmpMat3=a.identity(new Float64Array(9)),t.normalMatrix=a.identity(new Float64Array(9)),t.mcpcMatrix=o.identity(new Float64Array(16)),t.mcvcMatrix=o.identity(new Float64Array(16)),t.tmpColor=[],t.glyphBOBuildTime={},ur.g(t.glyphBOBuildTime,{mtime:0}),Hf(e,t)}var qf=ur.d(Xf,"vtkOpenGLGlyph3DMapper");yr("vtkGlyph3DMapper",qf);var Yf=cl.BufferUsage,Zf=ur.a.vtkErrorMacro;var Qf={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,name:null,numberOfInstances:1};function $f(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qf,n),ur.a.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t._sendTime={},ur.a.obj(t._sendTime,{mtime:0}),t.bindGroupTime={},ur.a.obj(t.bindGroupTime,{mtime:0}),t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"read-only-storage"}},ur.a.get(e,t,["bindGroupTime"]),ur.a.setGet(e,t,["device","bindGroupLayoutEntry","name","numberOfInstances","sizeInBytes"]),function(e,t){t.classHierarchy.push("vtkWebGPUStorageBuffer"),e.addEntry=function(e,n){if(t._bufferEntryNames.has(e))Zf("entry named ".concat(e," already exists"));else{t._bufferEntryNames.set(e,t.bufferEntries.length);var r=Ts.getByteStrideFromShaderFormat(n);t.bufferEntries.push({name:e,type:n,sizeInBytes:r,offset:t.sizeInBytes,nativeType:Ts.getNativeTypeFromShaderFormat(n)}),t.sizeInBytes+=r}},e.send=function(e){if(!t._buffer){var n={nativeArray:t.Float32Array,time:0,usage:Yf.Storage};return t._buffer=e.getBufferManager().getBuffer(n),t.bindGroupTime.modified(),void t._sendTime.modified()}e.getHandle().queue.writeBuffer(t._buffer.getHandle(),0,t.arrayBuffer,0,t.sizeInBytes*t.numberOfInstances),t._sendTime.modified()},e.createView=function(e){e in t==0&&(t.arrayBuffer||(t.arrayBuffer=new ArrayBuffer(t.sizeInBytes*t.numberOfInstances)),t[e]=ur.a.newTypedArray(e,t.arrayBuffer))},e.setValue=function(n,r,a){var o=t._bufferEntryNames.get(n);if(void 0!==o){var i=t.bufferEntries[o];e.createView(i.nativeType);var s=t[i.nativeType];s[(i.offset+r*t.sizeInBytes)/s.BYTES_PER_ELEMENT]=a}else Zf("entry named ".concat(n," not found in UBO"))},e.setArray=function(n,r,a){var o=t._bufferEntryNames.get(n);if(void 0!==o){var i=t.bufferEntries[o];e.createView(i.nativeType);for(var s=t[i.nativeType],l=(i.offset+r*t.sizeInBytes)/s.BYTES_PER_ELEMENT,u=0;u;\n};\n[[binding(").concat(e,"), group(").concat(n,")]] var ").concat(t.name,": [[access(read)]] ").concat(t.name,"Struct;\n")),r.join("\n")},e.getBindGroupEntry=function(){return{resource:{buffer:t._buffer.getHandle()}}},e.clearData=function(){t.numberOfInstances=0,t.sizeInBytes=0,t.bufferEntries=[],t._bufferEntryNames=new Map,t._buffer=null,delete t.arrayBuffer,delete t.Float32Array}}(e,t)}var Jf={newInstance:ur.a.newInstance($f,"vtkWebGPUStorageBuffer"),extend:$f};function ep(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var np=cl.PrimitiveTypes;function rp(e,t){t.classHierarchy.push("vtkWebGPUGlyph3DMapper");var n=function(e){for(var t=1;t","[[builtin(position)]] Position");var a=r.getCode();a=ps.substitute(a,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix"," *glyphSSBO.values[input.instanceIndex].matrix"," *vertexBC;"]).result,r.setCode(a)},e.replaceShaderNormal=function(e,t,r){if(r.hasAttribute("normalMC")){var a=t.getShaderDescription("vertex"),o=a.getCode();o=ps.substitute(o,"//VTK::Normal::Impl",[" output.normalVC = normalize((rendererUBO.WCVCNormals"," * mapperUBO.MCWCNormals"," * glyphSSBO.values[input.instanceIndex].normal*normalMC).xyz);"]).result,a.setCode(o)}n.replaceShaderNormal(e,t,r)},e.replaceShaderColor=function(e,r,a){if(t.carray){var o=r.getShaderDescription("vertex");o.addOutput("vec4","color");var i=o.getCode();i=ps.substitute(i,"//VTK::Color::Impl",[" output.color = glyphSSBO.values[input.instanceIndex].color;"]).result,o.setCode(i);var s=r.getShaderDescription("fragment");i=s.getCode(),i=ps.substitute(i,"//VTK::Color::Impl",["ambientColor = input.color;","diffuseColor = input.color;","opacity = mapperUBO.Opacity * input.color.a;"]).result,s.setCode(i)}else n.replaceShaderColor(e,r,a)},e.replaceShaderSelect=function(e,t,n){if(e.includes("sel")){var r=t.getShaderDescription("vertex");r.addOutput("u32","compositeID");var a=r.getCode();a=ps.substitute(a,"//VTK::Select::Impl",[" output.compositeID = input.instanceIndex;"]).result,r.setCode(a);var o=t.getShaderDescription("fragment");a=o.getCode(),a=ps.substitute(a,"//VTK::Select::Impl",["var compositeID: u32 = input.compositeID;"]).result,o.setCode(a)}},e.buildPrimitives=function(){t.currentInput=t.renderable.getInputData(1),t.renderable.buildArrays();var e=t.renderable.getMatrixArray(),r=t.renderable.getNormalArray();t.carray=t.renderable.getColorArray();var a=e.length/16;if(t.renderable.getBuildTime().getMTime()>t.glyphBOBuildTime.getMTime()){var o=t.WebGPURenderWindow.getDevice();t.SSBO.clearData(),t.SSBO.setNumberOfInstances(a),t.SSBO.addEntry("matrix","mat4x4"),t.SSBO.addEntry("normal","mat4x4"),t.carray&&t.SSBO.addEntry("color","vec4"),t.SSBO.setAllInstancesFromArray("matrix",e),t.SSBO.setAllInstancesFromArray3x3To4x4("normal",r),t.carray&&t.SSBO.setAllInstancesFromArrayColorToFloat("color",t.carray.getData()),t.SSBO.send(o),t.glyphBOBuildTime.modified()}n.buildPrimitives();for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ap,n),qd.extend(e,t,n),t.glyphBOBuildTime={},ur.g(t.glyphBOBuildTime,{mtime:0}),t.SSBO=Jf.newInstance(),t.SSBO.setName("glyphSSBO"),rp(e,t);for(var r=np.Start;r1&&void 0!==arguments[1]?arguments[1]:{};return lp[e]&&lp[e](t)}var dp={defaultViewAPI:sp,renderers:[],views:[],interactor:null,neverRendered:!0,numberOfLayers:1};function fp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dp,n),ur.a.obj(e,t),ur.a.setGet(e,t,["interactor","numberOfLayers","views","defaultViewAPI"]),ur.a.get(e,t,["neverRendered"]),ur.a.getArray(e,t,["renderers"]),ur.a.event(e,t,"completion"),function(e,t){t.classHierarchy.push("vtkRenderWindow"),e.addRenderer=function(n){e.hasRenderer(n)||(n.setRenderWindow(e),t.renderers.push(n),e.modified())},e.removeRenderer=function(n){t.renderers=t.renderers.filter(function(e){return e!==n}),e.modified()},e.hasRenderer=function(e){return-1!==t.renderers.indexOf(e)},e.newAPISpecificView=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return cp(e||t.defaultViewAPI,n)},e.addView=function(n){e.hasView(n)||(n.setRenderable(e),t.views.push(n),e.modified())},e.removeView=function(n){t.views=t.views.filter(function(e){return e!==n}),e.modified()},e.hasView=function(e){return-1!==t.views.indexOf(e)},e.render=function(){t.interactor?t.interactor.render():t.views.forEach(function(e){return e.traverseAllPasses()})},e.getStatistics=function(){var e={propCount:0,invisiblePropCount:0};return t.renderers.forEach(function(t){t.getViewProps().forEach(function(t){if(t.getVisibility()){e.propCount+=1;var n=t.getMapper&&t.getMapper();if(n&&n.getPrimitiveCount){var r=n.getPrimitiveCount();Object.keys(r).forEach(function(t){e[t]||(e[t]=0),e[t]+=r[t]})}}else e.invisiblePropCount+=1})}),e.str=Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t])}).join("\n"),e},e.captureImages=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ur.a.setImmediate(e.render),t.views.map(function(e){return e.captureNextImage?e.captureNextImage(n,r):void 0}).filter(function(e){return!!e})}}(e,t)}var pp={newInstance:ur.a.newInstance(fp,"vtkRenderWindow"),extend:fp,registerViewConstructor:up,listViewAPIs:function(){return Object.keys(lp)},newAPISpecificView:cp};var gp={delegates:[],currentOperation:null,preDelegateOperations:[],postDelegateOperations:[],currentParent:null};function mp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gp,n),ur.a.obj(e,t),ur.a.get(e,t,["currentOperation"]),ur.a.setGet(e,t,["delegates","currentParent","preDelegateOperations","postDelegateOperations"]),function(e,t){t.classHierarchy.push("vtkRenderPass"),e.getOperation=function(){return t.currentOperation},e.setCurrentOperation=function(e){t.currentOperation=e,t.currentTraverseOperation="traverse".concat(ur.a.capitalize(t.currentOperation))},e.getTraverseOperation=function(){return t.currentTraverseOperation},e.traverse=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t.deleted||(t.currentParent=r,t.preDelegateOperations.forEach(function(t){e.setCurrentOperation(t),n.traverse(e)}),t.delegates.forEach(function(t){t.traverse(n,e)}),t.postDelegateOperations.forEach(function(t){e.setCurrentOperation(t),n.traverse(e)}))}}(e,t)}var vp={newInstance:ur.a.newInstance(mp,"vtkRenderPass"),extend:mp};var hp={opaqueActorCount:0,translucentActorCount:0,volumeCount:0,framebuffer:null,depthRequested:!1};function yp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hp,n),vp.extend(e,t,n),ur.a.get(e,t,["framebuffer"]),function(e,t){t.classHierarchy.push("vtkForwardPass"),e.traverse=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t.deleted){t.currentParent=r,e.setCurrentOperation("buildPass"),n.traverse(e);for(var a=n.getRenderable().getNumberOfLayers(),o=n.getChildren(),i=0;i0&&t.volumeCount>0||t.depthRequested){var c=n.getFramebufferSize();null===t.framebuffer&&(t.framebuffer=Ii.newInstance()),t.framebuffer.setOpenGLRenderWindow(n),t.framebuffer.saveCurrentBindingsAndBuffers();var d=t.framebuffer.getSize();null!==d&&d[0]===c[0]&&d[1]===c[1]||(t.framebuffer.create(c[0],c[1]),t.framebuffer.populateFramebuffer()),t.framebuffer.bind(),e.setCurrentOperation("opaqueZBufferPass"),l.traverse(e),t.framebuffer.restorePreviousBindingsAndBuffers(),t.depthRequested=!1}e.setCurrentOperation("cameraPass"),l.traverse(e),t.opaqueActorCount>0&&(e.setCurrentOperation("opaquePass"),l.traverse(e)),t.translucentActorCount>0&&(e.setCurrentOperation("translucentPass"),l.traverse(e)),t.volumeCount>0&&(e.setCurrentOperation("volumePass"),l.traverse(e))}}}},e.getZBufferTexture=function(){return t.framebuffer?t.framebuffer.getColorTexture():null},e.requestDepth=function(){t.depthRequested=!0},e.incrementOpaqueActorCount=function(){return t.opaqueActorCount++},e.incrementTranslucentActorCount=function(){return t.translucentActorCount++},e.incrementVolumeCount=function(){return t.volumeCount++}}(e,t)}var bp={newInstance:ur.a.newInstance(yp,"vtkForwardPass"),extend:yp},Tp=n(11),Cp=n.n(Tp),Sp=["lastShaderBound","context","openGLRenderWindow"];var Pp={lastShaderBound:null,shaderPrograms:null,context:null,openGLRenderWindow:null};function wp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Pp,n),t.shaderPrograms={},ur.a.obj(e,t),ur.a.setGet(e,t,Sp),function(e,t){t.classHierarchy.push("vtkShaderCache"),e.replaceShaderValues=function(e,n,r){var a=n;r.length>0&&(a=Uo.substitute(a,"VSOut","GSOut").result);var o=t.openGLRenderWindow.getWebgl2(),i="\n",s="#version 100\n";o?s="#version 300 es\n#define attribute in\n#define textureCube texture\n#define texture2D texture\n#define textureCubeLod textureLod\n#define texture2DLod textureLod\n":(t.context.getExtension("OES_standard_derivatives"),t.context.getExtension("EXT_frag_depth")&&(i="#extension GL_EXT_frag_depth : enable\n"),t.context.getExtension("EXT_shader_texture_lod")&&(i+="#extension GL_EXT_shader_texture_lod : enable\n#define textureCubeLod textureCubeLodEXT\n#define texture2DLod texture2DLodEXT")),a=Uo.substitute(a,"//VTK::System::Dec",["".concat(s,"\n"),o?"":"#extension GL_OES_standard_derivatives : enable\n",i,"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;var l=Uo.substitute(e,"//VTK::System::Dec",["".concat(s,"\n"),"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;return o&&(l=Uo.substitute(l,"varying","out").result,a=Uo.substitute(a,"varying","in").result,a=Uo.substitute(a,"gl_FragData\\[0\\]","fragOutput0").result,a=Uo.substitute(a,"//VTK::Output::Dec","layout(location = 0) out vec4 fragOutput0;").result),{VSSource:l,FSSource:a,GSSource:Uo.substitute(r,"//VTK::System::Dec",s).result}},e.readyShaderProgramArray=function(t,n,r){var a=e.replaceShaderValues(t,n,r),o=e.getShaderProgram(a.VSSource,a.FSSource,a.GSSource);return e.readyShaderProgram(o)},e.readyShaderProgram=function(t){return t&&(t.getCompiled()||t.compileShader())&&e.bindShader(t)?t:null},e.getShaderProgram=function(e,n,r){var a="".concat(e).concat(n).concat(r),o=Cp()(a);if(-1===Object.keys(t.shaderPrograms).indexOf(o)){var i=Uo.newInstance();return i.setContext(t.context),i.getVertexShader().setSource(e),i.getFragmentShader().setSource(n),r&&i.getGeometryShader().setSource(r),i.setMd5Hash(o),t.shaderPrograms[o]=i,i}return t.shaderPrograms[o]},e.releaseGraphicsResources=function(n){e.releaseCurrentShader(),Object.keys(t.shaderPrograms).map(function(e){return t.shaderPrograms[e]}).forEach(function(e){return e.releaseGraphicsResources(n)})},e.releaseGraphicsResources=function(){t.astShaderBound&&(t.lastShaderBound.release(),t.lastShaderBound=null)},e.bindShader=function(e){return t.lastShaderBound===e?1:(t.lastShaderBound&&t.lastShaderBound.release(),e.bind(),t.lastShaderBound=e,1)}}(e,t)}var xp={newInstance:ur.a.newInstance(wp,"vtkShaderCache"),extend:wp};var Op={size:void 0,selector:void 0};function Mp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Op,n),t.size||(t.size=[300,300]),ur.a.getArray(e,t,["size"],2),ur.a.get(e,t,["selector"]),pr.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkRenderWindowViewNode"),e.getViewNodeFactory=function(){return null},e.getAspectRatio=function(){return t.size[0]/t.size[1]},e.getAspectRatioForRenderer=function(e){var n=e.getViewportByReference();return t.size[0]*(n[2]-n[0])/((n[3]-n[1])*t.size[1])},e.isInViewport=function(t,n,r){var a=r.getViewportByReference(),o=e.getFramebufferSize();return a[0]*o[0]<=t&&a[2]*o[0]>=t&&a[1]*o[1]<=n&&a[3]*o[1]>=n},e.getViewportSize=function(t){var n=t.getViewportByReference(),r=e.getFramebufferSize();return[(n[2]-n[0])*r[0],(n[3]-n[1])*r[1]]},e.getViewportCenter=function(t){var n=e.getViewportSize(t);return[.5*n[0],.5*n[1]]},e.displayToNormalizedDisplay=function(t,n,r){var a=e.getFramebufferSize();return[t/a[0],n/a[1],r]},e.normalizedDisplayToDisplay=function(t,n,r){var a=e.getFramebufferSize();return[t*a[0],n*a[1],r]},e.worldToView=function(e,t,n,r){return r.worldToView(e,t,n)},e.viewToWorld=function(e,t,n,r){return r.viewToWorld(e,t,n)},e.worldToDisplay=function(t,n,r,a){var o=a.worldToView(t,n,r),i=e.getViewportSize(a),s=a.viewToProjection(o[0],o[1],o[2],i[0]/i[1]),l=a.projectionToNormalizedDisplay(s[0],s[1],s[2]);return e.normalizedDisplayToDisplay(l[0],l[1],l[2])},e.displayToWorld=function(t,n,r,a){var o=e.displayToNormalizedDisplay(t,n,r),i=a.normalizedDisplayToProjection(o[0],o[1],o[2]),s=e.getViewportSize(a),l=a.projectionToView(i[0],i[1],i[2],s[0]/s[1]);return a.viewToWorld(l[0],l[1],l[2])},e.normalizedDisplayToViewport=function(t,n,r,a){var o=a.getViewportByReference();o=e.normalizedDisplayToDisplay(o[0],o[1],0);var i=e.normalizedDisplayToDisplay(t,n,r);return[i[0]-o[0]-.5,i[1]-o[1]-.5,r]},e.viewportToNormalizedViewport=function(t,n,r,a){var o=e.getViewportSize(a);return o&&0!==o[0]&&0!==o[1]?[t/(o[0]-1),n/(o[1]-1),r]:[t,n,r]},e.normalizedViewportToViewport=function(t,n,r){var a=e.getFramebufferSize();return[t*(a[0]-1),n*(a[1]-1),r]},e.displayToLocalDisplay=function(t,n,r){return[t,e.getFramebufferSize()[1]-n-1,r]},e.viewportToNormalizedDisplay=function(t,n,r,a){var o=a.getViewportByReference(),i=t+(o=e.normalizedDisplayToDisplay(o[0],o[1],0))[0]+.5,s=n+o[1]+.5;return e.displayToNormalizedDisplay(i,s,r)},e.getPixelData=function(e,t,n,r){ur.a.vtkErrorMacro("not implemented")}}(e,t)}var Ap={newInstance:ur.a.newInstance(Mp,"vtkRenderWindowViewNode"),extend:Mp},Ip=ur.a.vtkErrorMacro;var Rp={context:null,numberOfTextureUnits:0,textureUnits:0};function Ep(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Rp,n),ur.a.obj(e,t),t.textureUnits=[],ur.a.get(e,t,["numberOfTextureUnits"]),ur.a.setGet(e,t,["context"]),function(e,t){t.classHierarchy.push("vtkOpenGLTextureUnitManager"),e.deleteTable=function(){for(var e=0;ee.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{preserveDrawingBuffer:!1,depth:!0,alpha:!0},r=null,a="undefined"!=typeof WebGL2RenderingContext;return t.webgl2=!1,t.defaultToWebgl2&&a&&(r=t.canvas.getContext("webgl2",n))&&(t.webgl2=!0,kp("using webgl2")),r||(kp("using webgl1"),r=t.canvas.getContext("webgl",n)||t.canvas.getContext("experimental-webgl",n)),navigator.getVRDisplays&&navigator.getVRDisplays().then(function(n){n.length>0&&(t.vrDisplay=n[0],t.vrDisplay.depthNear=.01,t.vrDisplay.depthFar=100,e.invokeHaveVRDisplay())}),t.canvas.addEventListener("webglcontextlost",function(e){e.preventDefault()},!1),t.canvas.addEventListener("webglcontextrestored",e.restoreContext,!1),r},e.startVR=function(){t.oldCanvasSize=t.size.slice(),t.vrDisplay.capabilities.canPresent?t.vrDisplay.requestPresent([{source:t.canvas}]).then(function(){if(t.el&&t.vrDisplay.capabilities.hasExternalDisplay&&t.hideCanvasInVR&&(t.el.style.display="none"),t.queryVRSize){var n=t.vrDisplay.getEyeParameters("left"),r=t.vrDisplay.getEyeParameters("right"),a=Math.floor(n.renderWidth+r.renderWidth),o=Math.floor(Math.max(n.renderHeight,r.renderHeight));e.setSize(a,o)}else e.setSize(t.vrResolution);t.renderable.getRenderers()[0].resetCamera(),t.vrFrameData=new VRFrameData,t.renderable.getInteractor().switchToVRAnimation(),t.vrSceneFrame=t.vrDisplay.requestAnimationFrame(e.vrRender),Gp&&(t.vrSceneFrame=t.vrDisplay.requestAnimationFrame(e.vrRender))}).catch(function(){console.error("failed to requestPresent")}):Fp("vrDisplay is not connected")},e.stopVR=function(){t.renderable.getInteractor().returnFromVRAnimation(),t.vrDisplay.exitPresent(),t.vrDisplay.cancelAnimationFrame(t.vrSceneFrame),e.setSize.apply(e,Lp(t.oldCanvasSize)),t.el&&t.vrDisplay.capabilities.hasExternalDisplay&&(t.el.style.display="block");var n=t.renderable.getRenderers()[0];n.getActiveCamera().setProjectionMatrix(null),n.setViewport(0,0,1,1),e.traverseAllPasses()},e.vrRender=function(){if(t.vrDisplay.isPresenting){t.renderable.getInteractor().updateGamepads(t.vrDisplay.displayId),t.vrSceneFrame=t.vrDisplay.requestAnimationFrame(e.vrRender),t.vrDisplay.getFrameData(t.vrFrameData);var n=t.renderable.getRenderers()[0];n.setViewport(0,0,.5,1),n.getActiveCamera().computeViewParametersFromPhysicalMatrix(t.vrFrameData.leftViewMatrix),n.getActiveCamera().setProjectionMatrix(t.vrFrameData.leftProjectionMatrix),e.traverseAllPasses(),n.setViewport(.5,0,1,1),n.getActiveCamera().computeViewParametersFromPhysicalMatrix(t.vrFrameData.rightViewMatrix),n.getActiveCamera().setProjectionMatrix(t.vrFrameData.rightProjectionMatrix),e.traverseAllPasses(),t.vrDisplay.submitFrame()}},e.restoreContext=function(){var t=vp.newInstance();t.setCurrentOperation("Release"),t.traverse(e,null)},e.activateTexture=function(n){var r=t._textureResourceIds.get(n);if(void 0===r){var a=e.getTextureUnitManager().allocate();a<0?Fp("Hardware does not support the number of textures defined."):(t._textureResourceIds.set(n,a),t.context.activeTexture(t.context.TEXTURE0+a))}else t.context.activeTexture(t.context.TEXTURE0+r)},e.deactivateTexture=function(n){var r=t._textureResourceIds.get(n);void 0!==r&&(e.getTextureUnitManager().free(r),t._textureResourceIds.delete(n))},e.getTextureUnitForTexture=function(e){var n=t._textureResourceIds.get(e);return void 0!==n?n:-1},e.getDefaultTextureInternalFormat=function(e,n,r){if(t.webgl2)switch(e){case to.UNSIGNED_CHAR:switch(n){case 1:return t.context.R8;case 2:return t.context.RG8;case 3:return t.context.RGB8;case 4:default:return t.context.RGBA8}default:case to.FLOAT:switch(n){case 1:return t.context.R16F;case 2:return t.context.RG16F;case 3:return t.context.RGB16F;case 4:default:return t.context.RGBA16F}}switch(n){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:return t.context.RGB;case 4:default:return t.context.RGBA}},e.setBackgroundImage=function(e){t.bgImage.src=e.src},e.setUseBackgroundImage=function(e){t.useBackgroundImage=e,t.useBackgroundImage&&!t.el.contains(t.bgImage)?t.el.appendChild(t.bgImage):!t.useBackgroundImage&&t.el.contains(t.bgImage)&&t.el.removeChild(t.bgImage)},e.captureNextImage=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.resetCamera,o=void 0!==a&&a,i=r.size,s=void 0===i?null:i,l=r.scale,u=void 0===l?1:l;if(t.deleted)return null;t.imageFormat=n;var c=t.notifyStartCaptureImage;return t.notifyStartCaptureImage=!0,t._screenshot={size:s||1!==u?s||t.size.map(function(e){return e*u}):null},new Promise(function(n,r){var a=e.onImageReady(function(r){if(null===t._screenshot.size)t.notifyStartCaptureImage=c,a.unsubscribe(),t._screenshot.placeHolder&&(t.size=t._screenshot.originalSize,e.modified(),t._screenshot.cameras&&t._screenshot.cameras.forEach(function(e){return(0,e.restoreParamsFn)(e.arg)}),e.traverseAllPasses(),t.el.removeChild(t._screenshot.placeHolder),t._screenshot.placeHolder.remove(),t._screenshot=null),n(r);else{var i=document.createElement("img");i.style=_p,i.src=r,t._screenshot.placeHolder=t.el.appendChild(i),t.canvas.style.display="none",t._screenshot.originalSize=t.size,t.size=t._screenshot.size,t._screenshot.size=null,e.modified(),o&&(t._screenshot.cameras=t.renderable.getRenderers().map(function(e){var t=e.getActiveCamera(),n=t.get("focalPoint","position","parallelScale");return{resetCameraFn:e.resetCamera,restoreParamsFn:t.set,arg:JSON.parse(JSON.stringify(n))}}),t._screenshot.cameras.forEach(function(e){return(0,e.resetCameraFn)()})),e.traverseAllPasses()}})})},e.getGLInformations=function(){for(var n=e.get3DContext(),r=n.getExtension("OES_texture_float"),a=n.getExtension("OES_texture_half_float"),o=n.getExtension("WEBGL_debug_renderer_info"),i=n.getExtension("WEBGL_draw_buffers"),s=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),l=[["Max Vertex Attributes","MAX_VERTEX_ATTRIBS",n.getParameter(n.MAX_VERTEX_ATTRIBS)],["Max Varying Vectors","MAX_VARYING_VECTORS",n.getParameter(n.MAX_VARYING_VECTORS)],["Max Vertex Uniform Vectors","MAX_VERTEX_UNIFORM_VECTORS",n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS)],["Max Fragment Uniform Vectors","MAX_FRAGMENT_UNIFORM_VECTORS",n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS)],["Max Fragment Texture Image Units","MAX_TEXTURE_IMAGE_UNITS",n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)],["Max Vertex Texture Image Units","MAX_VERTEX_TEXTURE_IMAGE_UNITS",n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS)],["Max Combined Texture Image Units","MAX_COMBINED_TEXTURE_IMAGE_UNITS",n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS)],["Max 2D Texture Size","MAX_TEXTURE_SIZE",n.getParameter(n.MAX_TEXTURE_SIZE)],["Max Cube Texture Size","MAX_CUBE_MAP_TEXTURE_SIZE",n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE)],["Max Texture Anisotropy","MAX_TEXTURE_MAX_ANISOTROPY_EXT",s&&n.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT)],["Point Size Range","ALIASED_POINT_SIZE_RANGE",n.getParameter(n.ALIASED_POINT_SIZE_RANGE).join(" - ")],["Line Width Range","ALIASED_LINE_WIDTH_RANGE",n.getParameter(n.ALIASED_LINE_WIDTH_RANGE).join(" - ")],["Max Viewport Dimensions","MAX_VIEWPORT_DIMS",n.getParameter(n.MAX_VIEWPORT_DIMS).join(" - ")],["Max Renderbuffer Size","MAX_RENDERBUFFER_SIZE",n.getParameter(n.MAX_RENDERBUFFER_SIZE)],["Framebuffer Red Bits","RED_BITS",n.getParameter(n.RED_BITS)],["Framebuffer Green Bits","GREEN_BITS",n.getParameter(n.GREEN_BITS)],["Framebuffer Blue Bits","BLUE_BITS",n.getParameter(n.BLUE_BITS)],["Framebuffer Alpha Bits","ALPHA_BITS",n.getParameter(n.ALPHA_BITS)],["Framebuffer Depth Bits","DEPTH_BITS",n.getParameter(n.DEPTH_BITS)],["Framebuffer Stencil Bits","STENCIL_BITS",n.getParameter(n.STENCIL_BITS)],["Framebuffer Subpixel Bits","SUBPIXEL_BITS",n.getParameter(n.SUBPIXEL_BITS)],["MSAA Samples","SAMPLES",n.getParameter(n.SAMPLES)],["MSAA Sample Buffers","SAMPLE_BUFFERS",n.getParameter(n.SAMPLE_BUFFERS)],["Supported Formats for UByte Render Targets ","UNSIGNED_BYTE RENDER TARGET FORMATS",[r&&Up(n,n.RGBA,n.UNSIGNED_BYTE)?"RGBA":"",r&&Up(n,n.RGB,n.UNSIGNED_BYTE)?"RGB":"",r&&Up(n,n.LUMINANCE,n.UNSIGNED_BYTE)?"LUMINANCE":"",r&&Up(n,n.ALPHA,n.UNSIGNED_BYTE)?"ALPHA":"",r&&Up(n,n.LUMINANCE_ALPHA,n.UNSIGNED_BYTE)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Half Float Render Targets","HALF FLOAT RENDER TARGET FORMATS",[a&&Up(n,n.RGBA,a.HALF_FLOAT_OES)?"RGBA":"",a&&Up(n,n.RGB,a.HALF_FLOAT_OES)?"RGB":"",a&&Up(n,n.LUMINANCE,a.HALF_FLOAT_OES)?"LUMINANCE":"",a&&Up(n,n.ALPHA,a.HALF_FLOAT_OES)?"ALPHA":"",a&&Up(n,n.LUMINANCE_ALPHA,a.HALF_FLOAT_OES)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Full Float Render Targets","FLOAT RENDER TARGET FORMATS",[r&&Up(n,n.RGBA,n.FLOAT)?"RGBA":"",r&&Up(n,n.RGB,n.FLOAT)?"RGB":"",r&&Up(n,n.LUMINANCE,n.FLOAT)?"LUMINANCE":"",r&&Up(n,n.ALPHA,n.FLOAT)?"ALPHA":"",r&&Up(n,n.LUMINANCE_ALPHA,n.FLOAT)?"LUMINANCE_ALPHA":""].join(" ")],["Max Multiple Render Targets Buffers","MAX_DRAW_BUFFERS_WEBGL",i?n.getParameter(i.MAX_DRAW_BUFFERS_WEBGL):0],["High Float Precision in Vertex Shader","HIGH_FLOAT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Vertex Shader","MEDIUM_FLOAT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Vertex Shader","LOW_FLOAT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).rangeMax,")"].join("")],["High Float Precision in Fragment Shader","HIGH_FLOAT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).rangeMax,")"].join("")],["Medium Float Precision in Fragment Shader","MEDIUM_FLOAT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).rangeMax,")"].join("")],["Low Float Precision in Fragment Shader","LOW_FLOAT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).rangeMax,")"].join("")],["High Int Precision in Vertex Shader","HIGH_INT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Vertex Shader","MEDIUM_INT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Vertex Shader","LOW_INT VERTEX_SHADER",[n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).precision," (-2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).rangeMax,")"].join("")],["High Int Precision in Fragment Shader","HIGH_INT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).rangeMax,")"].join("")],["Medium Int Precision in Fragment Shader","MEDIUM_INT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).rangeMax,")"].join("")],["Low Int Precision in Fragment Shader","LOW_INT FRAGMENT_SHADER",[n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).precision," (-2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).rangeMin," - 2",n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).rangeMax,")"].join("")],["Supported Extensions","EXTENSIONS",n.getSupportedExtensions().join("
\t\t\t\t\t ")],["WebGL Renderer","RENDERER",n.getParameter(n.RENDERER)],["WebGL Vendor","VENDOR",n.getParameter(n.VENDOR)],["WebGL Version","VERSION",n.getParameter(n.VERSION)],["Shading Language Version","SHADING_LANGUAGE_VERSION",n.getParameter(n.SHADING_LANGUAGE_VERSION)],["Unmasked Renderer","UNMASKED_RENDERER",o&&n.getParameter(o.UNMASKED_RENDERER_WEBGL)],["Unmasked Vendor","UNMASKED_VENDOR",o&&n.getParameter(o.UNMASKED_VENDOR_WEBGL)],["WebGL Version","WEBGL_VERSION",t.webgl2?2:1]],u={};l.length;){var c=Vp(l.pop(),3),d=c[0],f=c[1],p=c[2];f&&(u[f]={label:d,value:p})}return u},e.traverseAllPasses=function(){if(t.renderPasses)for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:t.imageFormat,r=document.createElement("canvas"),a=r.getContext("2d");r.width=t.canvas.width,r.height=t.canvas.height,a.drawImage(t.canvas,0,0);var o=t.canvas.getBoundingClientRect();t.renderable.getRenderers().forEach(function(e){e.getViewProps().forEach(function(e){if(e.getContainer)for(var t=e.getContainer().getElementsByTagName("canvas"),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Kp,n),Ap.extend(e,t,n),t.canvas=document.createElement("canvas"),t.canvas.style.width="100%",jp++,Wp.forEach(function(e){return e(jp)}),t.selector||(t.selector=Bf.newInstance(),t.selector.setOpenGLRenderWindow(e)),t.bgImage=new Image,t.bgImage.style.position="absolute",t.bgImage.style.left="0",t.bgImage.style.top="0",t.bgImage.style.width="100%",t.bgImage.style.height="100%",t.bgImage.style.zIndex="-1",t._textureResourceIds=new Map,t.myFactory=Cr.newInstance(),t.myFactory.registerOverride("vtkRenderWindow",qp),t.shaderCache=xp.newInstance(),t.shaderCache.setOpenGLRenderWindow(e),t.renderPasses[0]=bp.newInstance(),ur.a.event(e,t,"imageReady"),ur.a.event(e,t,"haveVRDisplay"),ur.a.get(e,t,["shaderCache","textureUnitManager","webgl2","vrDisplay","useBackgroundImage"]),ur.a.setGet(e,t,["initialized","context","canvas","renderPasses","notifyStartCaptureImage","defaultToWebgl2","cursor","queryVRSize","hideCanvasInVR","useOffScreen","activeFramebuffer"]),ur.a.setGetArray(e,t,["size","vrResolution"],2),Hp(e,t)}var qp=ur.a.newInstance(Xp,"vtkOpenGLRenderWindow");up("WebGL",qp);var Yp={newInstance:qp,extend:Xp,pushMonitorGLContextCount:function(e){Wp.push(e)},popMonitorGLContextCount:function(e){return Wp.pop()}};function Zp(e){return function(e){if(Array.isArray(e))return Qp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Qp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qp(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jp,n),ur.a.obj(e,t),ur.a.get(e,t,["distance"]),ur.a.setGet(e,t,["parallelProjection","useHorizontalViewAngle","viewAngle","parallelScale","useOffAxisProjection","freezeFocalPoint","physicalScale"]),ur.a.getArray(e,t,["directionOfProjection","viewPlaneNormal","position","focalPoint"]),ur.a.setGetArray(e,t,["clippingRange","windowCenter"],2),ur.a.setGetArray(e,t,["viewUp","screenBottomLeft","screenBottomRight","screenTopRight","physicalTranslation","physicalViewUp","physicalViewNorth"],3),function(e,t){t.classHierarchy.push("vtkCamera");var n=new Float64Array(3),r=new Float64Array([0,0,-1]),a=new Float64Array([0,1,0]),u=o.identity(new Float64Array(16)),c=new Float64Array(3),d=new Float64Array(3),f=new Float64Array(3),p=o.identity(new Float64Array(16)),g=o.identity(new Float64Array(16)),m=new Float64Array(3),v=new Float64Array(3);function h(){t.viewPlaneNormal[0]=-t.directionOfProjection[0],t.viewPlaneNormal[1]=-t.directionOfProjection[1],t.viewPlaneNormal[2]=-t.directionOfProjection[2]}e.orthogonalizeViewUp=function(){var n=e.getViewMatrix();t.viewUp[0]=n[4],t.viewUp[1]=n[5],t.viewUp[2]=n[6],e.modified()},e.setPosition=function(n,r,a){n===t.position[0]&&r===t.position[1]&&a===t.position[2]||(t.position[0]=n,t.position[1]=r,t.position[2]=a,e.computeDistance(),e.modified())},e.setFocalPoint=function(n,r,a){n===t.focalPoint[0]&&r===t.focalPoint[1]&&a===t.focalPoint[2]||(t.focalPoint[0]=n,t.focalPoint[1]=r,t.focalPoint[2]=a,e.computeDistance(),e.modified())},e.setDistance=function(n){if(t.distance!==n){t.distance=n,t.distance<1e-20&&(t.distance=1e-20,$p("Distance is set to minimum."));var r=t.directionOfProjection;t.focalPoint[0]=t.position[0]+r[0]*t.distance,t.focalPoint[1]=t.position[1]+r[1]*t.distance,t.focalPoint[2]=t.position[2]+r[2]*t.distance,e.modified()}},e.computeDistance=function(){var e=t.focalPoint[0]-t.position[0],n=t.focalPoint[1]-t.position[1],r=t.focalPoint[2]-t.position[2];if(t.distance=Math.sqrt(e*e+n*n+r*r),t.distance<1e-20){t.distance=1e-20,$p("Distance is set to minimum.");var a=t.directionOfProjection;t.focalPoint[0]=t.position[0]+a[0]*t.distance,t.focalPoint[1]=t.position[1]+a[1]*t.distance,t.focalPoint[2]=t.position[2]+a[2]*t.distance}t.directionOfProjection[0]=e/t.distance,t.directionOfProjection[1]=n/t.distance,t.directionOfProjection[2]=r/t.distance,h()},e.dolly=function(n){if(!(n<=0)){var r=t.distance/n;e.setPosition(t.focalPoint[0]-r*t.directionOfProjection[0],t.focalPoint[1]-r*t.directionOfProjection[1],t.focalPoint[2]-r*t.directionOfProjection[2])}},e.roll=function(n){var r=t.position,a=t.focalPoint,i=t.viewUp,l=new Float64Array([i[0],i[1],i[2],0]);o.identity(p);var u=new Float64Array([a[0]-r[0],a[1]-r[1],a[2]-r[2]]);o.rotate(p,p,kr(n),u),s.transformMat4(l,l,p),t.viewUp[0]=l[0],t.viewUp[1]=l[1],t.viewUp[2]=l[2],e.modified()},e.azimuth=function(n){var r=t.focalPoint;o.identity(g),o.translate(g,g,r),o.rotate(g,g,kr(n),t.viewUp),o.translate(g,g,[-r[0],-r[1],-r[2]]),i.transformMat4(m,t.position,g),e.setPosition(m[0],m[1],m[2])},e.yaw=function(n){var r=t.position;o.identity(g),o.translate(g,g,r),o.rotate(g,g,kr(n),t.viewUp),o.translate(g,g,[-r[0],-r[1],-r[2]]),i.transformMat4(v,t.focalPoint,g),e.setFocalPoint(v[0],v[1],v[2])},e.elevation=function(n){var r=t.focalPoint,a=e.getViewMatrix(),s=[-a[0],-a[1],-a[2]];o.identity(g),o.translate(g,g,r),o.rotate(g,g,kr(n),s),o.translate(g,g,[-r[0],-r[1],-r[2]]),i.transformMat4(m,t.position,g),e.setPosition(m[0],m[1],m[2])},e.pitch=function(n){var r=t.position,a=e.getViewMatrix(),s=[a[0],a[1],a[2]];o.identity(g),o.translate(g,g,r),o.rotate(g,g,kr(n),s),o.translate(g,g,[-r[0],-r[1],-r[2]]),i.transformMat4(v,t.focalPoint,g),e.setFocalPoint.apply(e,Zp(v))},e.zoom=function(n){n<=0||(t.parallelProjection?t.parallelScale/=n:t.viewAngle/=n,e.modified())},e.translate=function(n,r,a){var o=[n,r,a];Zr(t.position,o,t.position),Zr(t.focalPoint,o,t.focalPoint),e.computeDistance(),e.modified()},e.applyTransform=function(n){var r=[].concat(Zp(t.viewUp),[1]),a=[],o=[],i=[];r[0]+=t.position[0],r[1]+=t.position[1],r[2]+=t.position[2],s.transformMat4(a,[].concat(Zp(t.position),[1]),n),s.transformMat4(o,[].concat(Zp(t.focalPoint),[1]),n),s.transformMat4(i,r,n),i[0]-=a[0],i[1]-=a[1],i[2]-=a[2],e.setPosition.apply(e,Zp(a.slice(0,3))),e.setFocalPoint.apply(e,Zp(o.slice(0,3))),e.setViewUp.apply(e,Zp(i.slice(0,3)))},e.getThickness=function(){return t.clippingRange[1]-t.clippingRange[0]},e.setThickness=function(n){var r=n;r<1e-20&&(r=1e-20,$p("Thickness is set to minimum.")),e.setClippingRange(t.clippingRange[0],t.clippingRange[0]+r)},e.setThicknessFromFocalPoint=function(n){var r=n;r<1e-20&&(r=1e-20,$p("Thickness is set to minimum.")),e.setClippingRange(t.distance-r/2,t.distance+r/2)},e.setRoll=function(e){},e.getRoll=function(){},e.setObliqueAngles=function(e,t){},e.getOrientation=function(){},e.getOrientationWXYZ=function(){},e.getFrustumPlanes=function(e){},e.getCameraLightTransformMatrix=function(){},e.deepCopy=function(e){},e.physicalOrientationToWorldDirection=function(e){var t=l.fromValues(e[0],e[1],e[2],e[3]),n=l.create(),r=l.fromValues(0,0,1,0);return l.conjugate(n,t),l.multiply(r,t,r),l.multiply(r,r,n),[r[0],r[1],r[2]]},e.getPhysicalToWorldMatrix=function(t){e.getWorldToPhysicalMatrix(t),o.invert(t,t)},e.getWorldToPhysicalMatrix=function(e){o.identity(e);var n=[3];ta(t.physicalViewNorth,t.physicalViewUp,n),e[0]=n[0],e[1]=n[1],e[2]=n[2],e[4]=t.physicalViewUp[0],e[5]=t.physicalViewUp[1],e[6]=t.physicalViewUp[2],e[8]=-t.physicalViewNorth[0],e[9]=-t.physicalViewNorth[1],e[10]=-t.physicalViewNorth[2],o.transpose(e,e),i.set(c,1/t.physicalScale,1/t.physicalScale,1/t.physicalScale),o.scale(e,e,c),o.translate(e,e,t.physicalTranslation)},e.computeViewParametersFromViewMatrix=function(s){o.invert(u,s),i.transformMat4(c,n,u),e.computeDistance();var l=t.distance;e.setPosition(c[0],c[1],c[2]),i.transformMat4(d,r,u),i.subtract(d,d,c),i.normalize(d,d),e.setDirectionOfProjection(d[0],d[1],d[2]),i.transformMat4(f,a,u),i.subtract(f,f,c),i.normalize(f,f),e.setViewUp(f[0],f[1],f[2]),e.setDistance(l)},e.computeViewParametersFromPhysicalMatrix=function(t){e.getWorldToPhysicalMatrix(u),o.multiply(u,t,u),e.computeViewParametersFromViewMatrix(u)},e.setViewMatrix=function(n){t.viewMatrix=n,t.viewMatrix&&(o.copy(u,t.viewMatrix),e.computeViewParametersFromViewMatrix(u),o.transpose(t.viewMatrix,t.viewMatrix))},e.getViewMatrix=function(){if(t.viewMatrix)return t.viewMatrix;o.lookAt(u,t.position,t.focalPoint,t.viewUp),o.transpose(u,u);var e=new Float64Array(16);return o.copy(e,u),e},e.setProjectionMatrix=function(e){t.projectionMatrix=e},e.getProjectionMatrix=function(e,n,r){var a=new Float64Array(16);if(o.identity(a),t.projectionMatrix){var s=1/t.physicalScale;return i.set(c,s,s,s),o.copy(a,t.projectionMatrix),o.scale(a,a,c),o.transpose(a,a),a}o.identity(u);var l=t.clippingRange[1]-t.clippingRange[0],d=[t.clippingRange[0]+(n+1)*l/2,t.clippingRange[0]+(r+1)*l/2];if(t.parallelProjection){var f=t.parallelScale*e,p=t.parallelScale,g=(t.windowCenter[0]-1)*f,m=(t.windowCenter[0]+1)*f,v=(t.windowCenter[1]-1)*p,h=(t.windowCenter[1]+1)*p;o.ortho(u,g,m,v,h,d[0],d[1]),o.transpose(u,u)}else{if(t.useOffAxisProjection)throw new Error("Off-Axis projection is not supported at this time");var y,b,T=Math.tan(kr(t.viewAngle)/2);!0===t.useHorizontalViewAngle?(y=t.clippingRange[0]*T,b=t.clippingRange[0]*T/e):(y=t.clippingRange[0]*T*e,b=t.clippingRange[0]*T);var C=(t.windowCenter[0]-1)*y,S=(t.windowCenter[0]+1)*y,P=(t.windowCenter[1]-1)*b,w=(t.windowCenter[1]+1)*b,x=d[0],O=d[1];u[0]=2*x/(S-C),u[5]=2*x/(w-P),u[2]=(C+S)/(S-C),u[6]=(P+w)/(w-P),u[10]=-(x+O)/(O-x),u[14]=-1,u[11]=-2*x*O/(O-x),u[15]=0}return o.copy(a,u),a},e.getCompositeProjectionMatrix=function(t,n,r){var a=e.getViewMatrix(),i=e.getProjectionMatrix(t,n,r);return o.multiply(i,a,i),i},e.setDirectionOfProjection=function(e,n,r){if(t.directionOfProjection[0]!==e||t.directionOfProjection[1]!==n||t.directionOfProjection[2]!==r){t.directionOfProjection[0]=e,t.directionOfProjection[1]=n,t.directionOfProjection[2]=r;var a=t.directionOfProjection;t.focalPoint[0]=t.position[0]+a[0]*t.distance,t.focalPoint[1]=t.position[1]+a[1]*t.distance,t.focalPoint[2]=t.position[2]+a[2]*t.distance,h()}},e.setDeviceAngles=function(n,r,a,s){var l=[3];ta(t.physicalViewNorth,t.physicalViewUp,l);var u=o.identity(new Float64Array(16));o.rotate(u,u,kr(n),t.physicalViewUp),o.rotate(u,u,kr(r),l),o.rotate(u,u,kr(a),t.physicalViewNorth),o.rotate(u,u,kr(-s),t.physicalViewUp);var c=new Float64Array([-t.physicalViewUp[0],-t.physicalViewUp[1],-t.physicalViewUp[2]]),d=new Float64Array(t.physicalViewNorth);i.transformMat4(c,c,u),i.transformMat4(d,d,u),e.setDirectionOfProjection(c[0],c[1],c[2]),e.setViewUp(d[0],d[1],d[2]),e.modified()},e.setOrientationWXYZ=function(t,n,r,a){var s=o.identity(new Float64Array(16));if(0!==t&&(0!==n||0!==r||0!==a)){var u=kr(t),c=l.create();l.setAxisAngle(c,[n,r,a],u),o.fromQuat(s,c)}var d=new Float64Array(3);i.transformMat4(d,[0,0,-1],s);var f=new Float64Array(3);i.transformMat4(f,[0,1,0],s),e.setDirectionOfProjection.apply(e,Zp(d)),e.setViewUp.apply(e,Zp(f)),e.modified()},e.computeClippingRange=function(e){var n,r;n=t.viewPlaneNormal,r=t.position;for(var a=-n[0],o=-n[1],i=-n[2],s=-(a*r[0]+o*r[1]+i*r[2]),l=[a*e[0]+o*e[2]+i*e[4]+s,1e-18],u=0;u<2;u++)for(var c=0;c<2;c++)for(var d=0;d<2;d++){var f=a*e[d]+o*e[2+c]+i*e[4+u]+s;l[0]=fl[1]?f:l[1]}return l}}(e,t)}var tg={newInstance:ur.a.newInstance(eg,"vtkCamera"),extend:eg};var ng={switch:!0,intensity:1,color:[1,1,1],position:[0,0,1],focalPoint:[0,0,0],positional:!1,exponent:1,coneAngle:30,attenuationValues:[1,0,0],transformMatrix:null,lightType:"SceneLight",shadowAttenuation:1,direction:[0,0,0],directionMTime:0};function rg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ng,n),ur.a.obj(e,t),ur.a.setGet(e,t,["intensity","switch","positional","exponent","coneAngle","transformMatrix","lightType","shadowAttenuation"]),ur.a.setGetArray(e,t,["color","position","focalPoint","attenuationValues"],3),function(e,t){t.classHierarchy.push("vtkLight"),e.getTransformedPosition=function(){return t.transformMatrix?[]:[].concat(t.position)},e.getTransformedFocalPoint=function(){return t.transformMatrix?[]:[].concat(t.focalPoint)},e.getDirection=function(){return t.directionMTime1&&void 0!==arguments[1]?arguments[1]:[];t.push(e);var r=e.getNestedProps();if(r&&r.length)for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sg,n),ur.a.obj(e,t),ur.a.event(e,t,"event"),ur.a.setGetArray(e,t,["viewport"],4),ur.a.setGetArray(e,t,["background","background2"],3),ig(e,t)}var ug={newInstance:ur.a.newInstance(lg,"vtkViewport"),extend:lg},cg=ur.k,dg=ur.l,fg=ur.m;function pg(e){return function(){return dg("vtkRenderer::".concat(e," - NOT IMPLEMENTED"))}}var gg={pickedProp:null,activeCamera:null,allBounds:[],ambient:[1,1,1],allocatedRenderTime:100,timeFactor:1,createdLight:null,automaticLightCreation:!0,twoSidedLighting:!0,lastRenderTimeInSeconds:-1,renderWindow:null,lights:[],actors:[],volumes:[],lightFollowCamera:!0,numberOfPropsRendered:0,propArray:null,pathArray:null,layer:0,preserveColorBuffer:!1,preserveDepthBuffer:!1,computeVisiblePropBounds:Ka(),interactive:!0,nearClippingPlaneTolerance:0,clippingRangeExpansion:.05,erase:!0,draw:!0,useShadows:!1,useDepthPeeling:!1,occlusionRatio:0,maximumNumberOfPeels:4,selector:null,delegate:null,texturedBackground:!1,backgroundTexture:null,pass:0};function mg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gg,n),ug.extend(e,t,n),ur.b(e,t,["renderWindow","allocatedRenderTime","timeFactor","lastRenderTimeInSeconds","numberOfPropsRendered","lastRenderingUsedDepthPeeling","selector"]),ur.i(e,t,["twoSidedLighting","lightFollowCamera","automaticLightCreation","erase","draw","nearClippingPlaneTolerance","clippingRangeExpansion","backingStore","interactive","layer","preserveColorBuffer","preserveDepthBuffer","useDepthPeeling","occlusionRatio","maximumNumberOfPeels","delegate","backgroundTexture","texturedBackground","useShadows","pass"]),ur.c(e,t,["actors","volumes","lights"]),ur.j(e,t,["background"],4,1),function(e,t){for(t.classHierarchy.push("vtkRenderer"),t.background||(t.background=[0,0,0,1]);t.background.length<3;)t.background.push(0);3===t.background.length&&t.background.push(1);var n={type:"ComputeVisiblePropBoundsEvent",renderer:e},r={type:"ResetCameraClippingRangeEvent",renderer:e},a={type:"ResetCameraEvent",renderer:e};e.updateCamera=function(){return t.activeCamera||(cg("No cameras are on, creating one."),e.getActiveCameraAndResetIfCreated()),t.activeCamera.render(e),!0},e.updateLightsGeometryToFollowCamera=function(){var n=e.getActiveCameraAndResetIfCreated();t.lights.forEach(function(e){e.lightTypeIsSceneLight()||e.lightTypeIsCameraLight()||(e.lightTypeIsHeadLight()?(e.setPositionFrom(n.getPositionByReference()),e.setFocalPointFrom(n.getFocalPointByReference()),e.modified(n.getMTime())):dg("light has unknown light type",e.get()))})},e.updateLightGeometry=function(){return!t.lightFollowCamera||e.updateLightsGeometryToFollowCamera()},e.allocateTime=pg("allocateTime"),e.updateGeometry=pg("updateGeometry"),e.getVTKWindow=function(){return t.renderWindow},e.setLayer=function(n){cg(e.getClassName(),e,"setting Layer to ",n),t.layer!==n&&(t.layer=n,e.modified()),e.setPreserveColorBuffer(!!n)},e.setActiveCamera=function(n){return t.activeCamera!==n&&(t.activeCamera=n,e.modified(),e.invokeEvent({type:"ActiveCameraEvent",camera:n}),!0)},e.makeCamera=function(){var t=tg.newInstance();return e.invokeEvent({type:"CreateCameraEvent",camera:t}),t},e.getActiveCamera=function(){return t.activeCamera||(t.activeCamera=e.makeCamera()),t.activeCamera},e.getActiveCameraAndResetIfCreated=function(){return t.activeCamera||(e.getActiveCamera(),e.resetCamera()),t.activeCamera},e.getActors=function(){return t.actors=[],t.props.forEach(function(e){t.actors=t.actors.concat(e.getActors())}),t.actors},e.addActor=e.addViewProp,e.removeActor=function(n){t.actors=t.actors.filter(function(e){return e!==n}),e.removeViewProp(n),e.modified()},e.removeAllActors=function(){e.getActors().forEach(function(t){e.removeViewProp(t)}),t.actors=[],e.modified()},e.getVolumes=function(){return t.volumes=[],t.props.forEach(function(e){t.volumes=t.volumes.concat(e.getVolumes())}),t.volumes},e.addVolume=e.addViewProp,e.removeVolume=function(n){t.volumes=t.volumes.filter(function(e){return e!==n}),e.removeViewProp(n),e.modified()},e.removeAllVolumes=function(){e.getVolumes().forEach(function(t){e.removeViewProp(t)}),t.volumes=[],e.modified()},e.addLight=function(n){t.lights=[].concat(t.lights,n),e.modified()},e.removeLight=function(n){t.lights=t.lights.filter(function(e){return e!==n}),e.modified()},e.removeAllLights=function(){t.lights=[],e.modified()},e.setLightCollection=function(n){t.lights=n,e.modified()},e.makeLight=ag.newInstance,e.createLight=function(){t.automaticLightCreation&&(t.createdLight&&(e.removeLight(t.createdLight),t.createdLight.delete(),t.createdLight=null),t.createdLight=e.makeLight(),e.addLight(t.createdLight),t.createdLight.setLightTypeToHeadLight(),t.createdLight.setPosition(e.getActiveCamera().getPosition()),t.createdLight.setFocalPoint(e.getActiveCamera().getFocalPoint()))},e.normalizedDisplayToWorld=function(t,n,r,a){var o=e.normalizedDisplayToProjection(t,n,r);return o=e.projectionToView(o[0],o[1],o[2],a),e.viewToWorld(o[0],o[1],o[2])},e.worldToNormalizedDisplay=function(t,n,r,a){var o=e.worldToView(t,n,r);return o=e.viewToProjection(o[0],o[1],o[2],a),e.projectionToNormalizedDisplay(o[0],o[1],o[2])},e.viewToWorld=function(e,n,r){if(null===t.activeCamera)return dg("ViewToWorld: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();o.invert(a,a),o.transpose(a,a);var s=new Float64Array([e,n,r]);return i.transformMat4(s,s,a),s},e.projectionToView=function(e,n,r,a){if(null===t.activeCamera)return dg("ProjectionToView: no active camera, cannot compute projection to view, returning 0,0,0"),[0,0,0];var s=t.activeCamera.getProjectionMatrix(a,-1,1);o.invert(s,s),o.transpose(s,s);var l=new Float64Array([e,n,r]);return i.transformMat4(l,l,s),l},e.worldToView=function(e,n,r){if(null===t.activeCamera)return dg("WorldToView: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];var a=t.activeCamera.getViewMatrix();o.transpose(a,a);var s=new Float64Array([e,n,r]);return i.transformMat4(s,s,a),s},e.viewToProjection=function(e,n,r,a){if(null===t.activeCamera)return dg("ViewToProjection: no active camera, cannot compute view to projection, returning 0,0,0"),[0,0,0];var s=t.activeCamera.getProjectionMatrix(a,-1,1);o.transpose(s,s);var l=new Float64Array([e,n,r]);return i.transformMat4(l,l,s),l},e.computeVisiblePropBounds=function(){t.allBounds[0]=_u.INIT_BOUNDS[0],t.allBounds[1]=_u.INIT_BOUNDS[1],t.allBounds[2]=_u.INIT_BOUNDS[2],t.allBounds[3]=_u.INIT_BOUNDS[3],t.allBounds[4]=_u.INIT_BOUNDS[4],t.allBounds[5]=_u.INIT_BOUNDS[5];var r=!0;e.invokeEvent(n);for(var a=0;at.allBounds[1]&&(t.allBounds[1]=i[1]),i[2]t.allBounds[3]&&(t.allBounds[3]=i[3]),i[4]t.allBounds[5]&&(t.allBounds[5]=i[5]))}}return r&&(Na(t.allBounds),cg("Can't compute bounds, no 3D props are visible")),t.allBounds},e.resetCamera=function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||e.computeVisiblePropBounds(),r=[0,0,0];if(!Ba(n))return cg("Cannot reset camera!"),!1;var o=null;if(!e.getActiveCamera())return dg("Trying to reset non-existent camera"),!1;o=t.activeCamera.getViewPlaneNormal(),t.activeCamera.setViewAngle(30),r[0]=(n[0]+n[1])/2,r[1]=(n[2]+n[3])/2,r[2]=(n[4]+n[5])/2;var i=n[1]-n[0],s=n[3]-n[2],l=n[5]-n[4],u=(i*=i)+(s*=s)+(l*=l);u=0===u?1:u,u=.5*Math.sqrt(u);var c=kr(t.activeCamera.getViewAngle()),d=u,f=u/Math.sin(.5*c),p=t.activeCamera.getViewUp();return Math.abs(ea(p,o))>.999&&(fg("Resetting view-up since view plane normal is parallel"),t.activeCamera.setViewUp(-p[2],p[0],p[1])),t.activeCamera.setFocalPoint(r[0],r[1],r[2]),t.activeCamera.setPosition(r[0]+f*o[0],r[1]+f*o[1],r[2]+f*o[2]),e.resetCameraClippingRange(n),t.activeCamera.setParallelScale(d),t.activeCamera.setPhysicalScale(u),t.activeCamera.setPhysicalTranslation(-r[0],-r[1],-r[2]),e.invokeEvent(a),!0},e.resetCameraClippingRange=function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||e.computeVisiblePropBounds();if(!Ba(n))return cg("Cannot reset camera clipping range!"),!1;if(e.getActiveCameraAndResetIfCreated(),!t.activeCamera)return dg("Trying to reset clipping range of non-existent camera"),!1;var a=t.activeCamera.computeClippingRange(n),o=0;if(t.activeCamera.getParallelProjection())o=.1*t.activeCamera.getParallelScale();else{var i=kr(t.activeCamera.getViewAngle());o=.2*Math.tan(i/2)*a[1]}return a[1]-a[0]=a[1]?.01*a[1]:a[0],t.nearClippingPlaneTolerance||(t.nearClippingPlaneTolerance=.01),a[0]e&&(e=n);var r=t.createdLight?t.createdLight.getMTime():0;return r>e&&(e=r),e},e.getTransparent=function(){return!!t.preserveColorBuffer},e.isActiveCameraCreated=function(){return!!t.activeCamera}}(e,t)}var vg={newInstance:ur.d(mg,"vtkRenderer"),extend:mg},hg={Unknown:0,LeftController:1,RightController:2},yg={Unknown:0,Trigger:1,TrackPad:2,Grip:3,ApplicationMenu:4},bg={Device:hg,Input:yg};function Tg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Cg(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Dg,n),ur.a.obj(e,t),ur.a.event(e,t,"RenderEvent"),Rg.forEach(function(n){return ur.a.event(e,t,n)}),ur.a.get(e,t,["initialized","container","interactorStyle","lastFrameTime","view"]),ur.a.setGet(e,t,["lightFollowCamera","enabled","enableRender","recognizeGestures","desiredUpdateRate","stillUpdateRate","picker"]),function(e,t){t.classHierarchy.push("vtkRenderWindowInteractor");var n=new Set,r=0;function a(n,r){t.currentRenderer=e.findPokedRenderer(n,r)}function o(e){var n=t.container.getBoundingClientRect(),r=t.view.getCanvas(),o=r.width/n.width,i=r.height/n.height,s={x:o*(e.clientX-n.left),y:i*(n.height-e.clientY+n.top),z:0};return a(s.x,s.y),s}function i(e){for(var t={},n=0;n1&&void 0!==arguments[1]&&arguments[1],o=document,i=n?"addEventListener":"removeEventListener",s=n?"removeEventListener":"addEventListener";!a&&!n&&r>0&&--r,r&&!a||(r=0,t.container&&t.container[s]("mousemove",e.handleMouseMove),o[i]("mouseup",e.handleMouseUp),o[i]("mousemove",e.handleMouseMove),o[i]("touchend",e.handleTouchEnd,!1),o[i]("touchcancel",e.handleTouchEnd,!1),o[i]("touchmove",e.handleTouchMove,!1)),!a&&n&&++r}function c(){t.view&&t.enabled&&t.enableRender&&(t.inRender=!0,t.view.traverseAllPasses(),t.inRender=!1),e.invokeRenderEvent()}e.start=function(){(t.initialized||(e.initialize(),t.initialized))&&e.startEventLoop()},e.setRenderWindow=function(e){Og("you want to call setView(view) instead of setRenderWindow on a vtk.js interactor")},e.setInteractorStyle=function(n){t.interactorStyle!==n&&(null!=t.interactorStyle&&t.interactorStyle.setInteractor(null),t.interactorStyle=n,null!=t.interactorStyle&&t.interactorStyle.getInteractor()!==e&&t.interactorStyle.setInteractor(e))},e.initialize=function(){t.initialized=!0,e.enable(),e.render()},e.enable=function(){return e.setEnabled(!0)},e.disable=function(){return e.setEnabled(!1)},e.startEventLoop=function(){return xg("empty event loop")},e.getCurrentRenderer=function(){return t.currentRenderer?t.currentRenderer:(a(0,0),t.currentRenderer)},e.bindEvents=function(n){t.container=n,n.addEventListener("contextmenu",Eg),n.addEventListener("wheel",e.handleWheel),n.addEventListener("DOMMouseScroll",e.handleWheel),n.addEventListener("mouseenter",e.handleMouseEnter),n.addEventListener("mouseleave",e.handleMouseLeave),n.addEventListener("mousemove",e.handleMouseMove),n.addEventListener("mousedown",e.handleMouseDown),document.addEventListener("keypress",e.handleKeyPress),document.addEventListener("keydown",e.handleKeyDown),document.addEventListener("keyup",e.handleKeyUp),document.addEventListener("pointerlockchange",e.handlePointerLockChange),n.addEventListener("touchstart",e.handleTouchStart,!1)},e.unbindEvents=function(){u(!1,!0),t.container.removeEventListener("contextmenu",Eg),t.container.removeEventListener("wheel",e.handleWheel),t.container.removeEventListener("DOMMouseScroll",e.handleWheel),t.container.removeEventListener("mouseenter",e.handleMouseEnter),t.container.removeEventListener("mouseleave",e.handleMouseLeave),t.container.removeEventListener("mousemove",e.handleMouseMove),t.container.removeEventListener("mousedown",e.handleMouseDown),document.removeEventListener("keypress",e.handleKeyPress),document.removeEventListener("keydown",e.handleKeyDown),document.removeEventListener("keyup",e.handleKeyUp),document.removeEventListener("pointerlockchange",e.handlePointerLockChange),t.container.removeEventListener("touchstart",e.handleTouchStart),t.container=null},e.handleKeyPress=function(t){var n=l(t);e.keyPressEvent(n)},e.handleKeyDown=function(t){var n=l(t);e.keyDownEvent(n)},e.handleKeyUp=function(t){var n=l(t);e.keyUpEvent(n)},e.handleMouseDown=function(t){if(!(t.button>2)){u(!0),t.stopPropagation(),t.preventDefault();var n=Cg(Cg({},s(t)),{},{position:o(t)});switch(t.button){case 0:e.leftButtonPressEvent(n);break;case 1:e.middleButtonPressEvent(n);break;case 2:e.rightButtonPressEvent(n);break;default:Og("Unknown mouse button pressed: ".concat(t.button))}}},e.requestPointerLock=function(){e.getView().getCanvas().requestPointerLock()},e.exitPointerLock=function(){return document.exitPointerLock()},e.isPointerLocked=function(){return!!document.pointerLockElement},e.handlePointerLockChange=function(){e.isPointerLocked()?e.startPointerLockEvent():e.endPointerLockEvent()},e.requestAnimation=function(r){void 0!==r?n.has(r)?xg("requester is already registered for animating"):(n.add(r),1===n.size&&(t.lastFrameTime=.1,t.lastFrameStart=Date.now(),t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())):Og("undefined requester, can not start animating")},e.isAnimating=function(){return t.vrAnimation||null!==t.animationRequest},e.cancelAnimation=function(r){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n.has(r))n.delete(r),t.animationRequest&&0===n.size&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null,e.endAnimationEvent(),e.render());else if(!a){var o=r&&r.getClassName?r.getClassName():r;xg("".concat(o," did not request an animation"))}},e.switchToVRAnimation=function(){t.animationRequest&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null),t.vrAnimation=!0},e.returnFromVRAnimation=function(){t.vrAnimation=!1,0!==n.size&&(t.FrameTime=-1,t.animationRequest=requestAnimationFrame(e.handleAnimation))},e.updateGamepads=function(n){for(var r=navigator.getGamepads(),a=0;a1){var r=i(n.touches);if(2===n.touches.length){var a={position:o(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(a)}e.recognizeGesture("TouchStart",r)}else{var s={position:o(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(s)}},e.handleTouchMove=function(n){if(n.stopPropagation(),n.preventDefault(),t.recognizeGestures&&n.touches.length>1){var r=i(n.touches);e.recognizeGesture("TouchMove",r)}else{var a={position:o(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.mouseMoveEvent(a)}},e.handleTouchEnd=function(n){if(n.stopPropagation(),n.preventDefault(),t.recognizeGestures)if(0===n.touches.length)if(1===n.changedTouches.length){var r={position:o(n.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(r),u(!1)}else{var a=i(n.changedTouches);e.recognizeGesture("TouchEnd",a),u(!1)}else if(1===n.touches.length){var s=i(n.changedTouches);e.recognizeGesture("TouchEnd",s);var l={position:o(n.touches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonPressEvent(l)}else{var c=i(n.touches);e.recognizeGesture("TouchMove",c)}else{var d={position:o(n.changedTouches[0]),shiftKey:!1,altKey:!1,controlKey:!1};e.leftButtonReleaseEvent(d),u(!1)}},e.setView=function(n){t.view!==n&&(t.view=n,t.view.getRenderable().setInteractor(e),e.modified())},e.getFirstRenderer=function(){return t.view.getRenderable().getRenderersByReference()[0]},e.findPokedRenderer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!t.view)return null;var r=t.view.getRenderable().getRenderers();r.sort(function(e,t){return e.getLayer()-t.getLayer()});for(var a=null,o=null,i=null,s=r.length;s--;){var l=r[s];if(t.view.isInViewport(e,n,l)&&l.getInteractive()){i=l;break}null===a&&l.getInteractive()&&(a=l),null===o&&t.view.isInViewport(e,n,l)&&(o=l)}return null===i&&(i=a),null===i&&(i=o),null==i&&(i=r[0]),i},e.render=function(){null!==t.animationRequest||t.inRender||c()},Rg.forEach(function(n){var r=n.charAt(0).toLowerCase()+n.slice(1);e["".concat(r,"Event")]=function(r){if(t.enabled)if(e.getCurrentRenderer()){var a=Cg({type:n,pokedRenderer:t.currentRenderer,firstRenderer:e.getFirstRenderer()},r);e["invoke".concat(n)](a)}else Ag("\n Can not forward events without a current renderer on the interactor.\n ")}}),e.recognizeGesture=function(n,r){if(!(Object.keys(r).length>2)){if(t.startingEventPositions||(t.startingEventPositions={}),"TouchStart"===n)return Object.keys(r).forEach(function(e){t.startingEventPositions[e]=r[e]}),void(t.currentGesture="Start");if("TouchEnd"===n)return"Pinch"===t.currentGesture&&(e.render(),e.endPinchEvent()),"Rotate"===t.currentGesture&&(e.render(),e.endRotateEvent()),"Pan"===t.currentGesture&&(e.render(),e.endPanEvent()),t.currentGesture="Start",void(t.startingEventPositions={});var a=0,o=[],i=[];Object.keys(r).forEach(function(e){o[a]=r[e],i[a]=t.startingEventPositions[e],a++});var s=Math.sqrt((i[0].x-i[1].x)*(i[0].x-i[1].x)+(i[0].y-i[1].y)*(i[0].y-i[1].y)),l=Math.sqrt((o[0].x-o[1].x)*(o[0].x-o[1].x)+(o[0].y-o[1].y)*(o[0].y-o[1].y)),u=Fr(Math.atan2(i[1].y-i[0].y,i[1].x-i[0].x)),c=Fr(Math.atan2(o[1].y-o[0].y,o[1].x-o[0].x)),d=c-u;c=c+180>=360?c-180:c+180,u=u+180>=360?u-180:u+180,Math.abs(c-u)p&&g>m&&g>v){t.currentGesture="Pinch";var h={scale:1,touches:r};e.startPinchEvent(h)}else if(m>p&&m>v){t.currentGesture="Rotate";var y={rotation:0,touches:r};e.startRotateEvent(y)}else if(v>p){t.currentGesture="Pan";var b={translation:[0,0],touches:r};e.startPanEvent(b)}}else{if("Rotate"===t.currentGesture){var T={rotation:d,touches:r};e.rotateEvent(T)}if("Pinch"===t.currentGesture){var C={scale:l/s,touches:r};e.pinchEvent(C)}if("Pan"===t.currentGesture){var S={translation:f,touches:r};e.panEvent(S)}}}},e.handleVisibilityChange=function(){t.lastFrameStart=Date.now()};var d=e.delete;e.delete=function(){for(;n.size;)e.cancelAnimation(n.values().next().value);void 0!==document.hidden&&document.removeEventListener("visibilitychange",e.handleVisibilityChange),d()},void 0!==document.hidden&&document.addEventListener("visibilitychange",e.handleVisibilityChange,!1)}(e,t)}var Lg=Cg({newInstance:ur.a.newInstance(Vg,"vtkRenderWindowInteractor"),extend:Vg,handledEvents:Rg},bg);function Ng(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bg(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ug,n),ur.a.obj(e,t),ur.a.event(e,t,"InteractionEvent"),ur.a.event(e,t,"StartInteractionEvent"),ur.a.event(e,t,"EndInteractionEvent"),ur.a.get(e,t,["interactor","enabled"]),ur.a.setGet(e,t,["priority","processEvents"]),function(e,t){t.classHierarchy.push("vtkInteractorObserver");var n=Bg({},e);function r(){for(;t.subscribedEvents.length;)t.subscribedEvents.pop().unsubscribe()}function a(){Lg.handledEvents.forEach(function(n){e["handle".concat(n)]&&t.subscribedEvents.push(t.interactor["on".concat(n)](function(r){return t.processEvents?e["handle".concat(n)](r):Gg},t.priority))})}e.setInteractor=function(n){n!==t.interactor&&(r(),t.interactor=n,n&&t.enabled&&a(),e.modified())},e.setEnabled=function(n){n!==t.enabled&&(r(),n&&(t.interactor?a():Fg("\n The interactor must be set before subscribing to events\n ")),t.enabled=n,e.modified())},e.computeDisplayToWorld=function(e,n,r,a){return e?t.interactor.getView().displayToWorld(n,r,a,e):null},e.computeWorldToDisplay=function(e,n,r,a){return e?t.interactor.getView().worldToDisplay(n,r,a,e):null},e.setPriority=function(e){n.setPriority(e)&&t.interactor&&(r(),a())}}(e,t)}var Wg=Bg({newInstance:ur.a.newInstance(jg,"vtkInteractorObserver"),extend:jg},_g),zg={States:{IS_START:0,IS_NONE:0,IS_ROTATE:1,IS_PAN:2,IS_SPIN:3,IS_DOLLY:4,IS_CAMERA_POSE:11,IS_WINDOW_LEVEL:1024,IS_SLICE:1025}};function Hg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Xg=zg.States,qg={Rotate:Xg.IS_ROTATE,Pan:Xg.IS_PAN,Spin:Xg.IS_SPIN,Dolly:Xg.IS_DOLLY,CameraPose:Xg.IS_CAMERA_POSE,WindowLevel:Xg.IS_WINDOW_LEVEL,Slice:Xg.IS_SLICE};var Yg={state:Xg.IS_NONE,handleObservers:1,autoAdjustCameraClippingRange:1};function Zg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yg,n),Wg.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkInteractorStyle"),Object.keys(qg).forEach(function(n){ur.a.event(e,t,"Start".concat(n,"Event")),e["start".concat(n)]=function(){t.state===Xg.IS_NONE&&(t.state=qg[n],t.interactor.requestAnimation(e),e.invokeStartInteractionEvent({type:"StartInteractionEvent"}),e["invokeStart".concat(n,"Event")]({type:"Start".concat(n,"Event")}))},ur.a.event(e,t,"End".concat(n,"Event")),e["end".concat(n)]=function(){t.state===qg[n]&&(t.state=Xg.IS_NONE,t.interactor.cancelAnimation(e),e.invokeEndInteractionEvent({type:"EndInteractionEvent"}),e["invokeEnd".concat(n,"Event")]({type:"End".concat(n,"Event")}),t.interactor.render())}}),e.handleKeyPress=function(e){var n=t.interactor;switch(e.key){case"r":case"R":e.pokedRenderer.resetCamera(),n.render();break;case"w":case"W":e.pokedRenderer.getActors().forEach(function(e){var t=e.getProperty();t.setRepresentationToWireframe&&t.setRepresentationToWireframe()}),n.render();break;case"s":case"S":e.pokedRenderer.getActors().forEach(function(e){var t=e.getProperty();t.setRepresentationToSurface&&t.setRepresentationToSurface()}),n.render();break;case"v":case"V":e.pokedRenderer.getActors().forEach(function(e){var t=e.getProperty();t.setRepresentationToPoints&&t.setRepresentationToPoints()}),n.render()}}}(e,t)}var Qg=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jg,n),Qg.extend(e,t,n),ur.a.setGet(e,t,["motionFactor"]),function(e,t){t.classHierarchy.push("vtkInteractorStyleTrackballCamera"),e.handleMouseMove=function(n){var r=n.position,a=n.pokedRenderer;switch(t.state){case $g.IS_ROTATE:e.handleMouseRotate(a,r),e.invokeInteractionEvent({type:"InteractionEvent"});break;case $g.IS_PAN:e.handleMousePan(a,r),e.invokeInteractionEvent({type:"InteractionEvent"});break;case $g.IS_DOLLY:e.handleMouseDolly(a,r),e.invokeInteractionEvent({type:"InteractionEvent"});break;case $g.IS_SPIN:e.handleMouseSpin(a,r),e.invokeInteractionEvent({type:"InteractionEvent"})}t.previousPosition=r},e.handleButton3D=function(n){n&&n.pressed&&n.device===hg.RightController&&n.input===yg.TrackPad?e.startCameraPose():n&&!n.pressed&&n.device===hg.RightController&&n.input===yg.TrackPad&&t.state===$g.IS_CAMERA_POSE&&e.endCameraPose()},e.handleMove3D=function(n){switch(t.state){case $g.IS_CAMERA_POSE:e.updateCameraPose(n)}},e.updateCameraPose=function(e){var t=e.pokedRenderer.getActiveCamera(),n=t.getPhysicalTranslation(),r=.05*e.gamepad.axes[1]/t.getPhysicalScale(),a=t.physicalOrientationToWorldDirection(e.orientation);t.setPhysicalTranslation(n[0]+a[0]*r,n[1]+a[1]*r,n[2]+a[2]*r)},e.handleLeftButtonPress=function(n){var r=n.position;t.previousPosition=r,n.shiftKey?n.controlKey||n.altKey?e.startDolly():e.startPan():n.controlKey||n.altKey?e.startSpin():e.startRotate()},e.handleLeftButtonRelease=function(){switch(t.state){case $g.IS_DOLLY:e.endDolly();break;case $g.IS_PAN:e.endPan();break;case $g.IS_SPIN:e.endSpin();break;case $g.IS_ROTATE:e.endRotate()}},e.handleStartMouseWheel=function(t){e.startDolly(),e.handleMouseWheel(t)},e.handleEndMouseWheel=function(){e.endDolly()},e.handleStartPinch=function(n){t.previousScale=n.scale,e.startDolly()},e.handleEndPinch=function(){e.endDolly()},e.handleStartRotate=function(n){t.previousRotation=n.rotation,e.startRotate()},e.handleEndRotate=function(){e.endRotate()},e.handleStartPan=function(n){t.previousTranslation=n.translation,e.startPan()},e.handleEndPan=function(){e.endPan()},e.handlePinch=function(n){e.dollyByFactor(n.pokedRenderer,n.scale/t.previousScale),t.previousScale=n.scale},e.handlePan=function(n){var r=n.pokedRenderer.getActiveCamera(),a=r.getFocalPoint(),o=(a=e.computeWorldToDisplay(n.pokedRenderer,a[0],a[1],a[2]))[2],i=n.translation,s=t.previousTranslation,l=e.computeDisplayToWorld(n.pokedRenderer,a[0]+i[0]-s[0],a[1]+i[1]-s[1],o),u=e.computeDisplayToWorld(n.pokedRenderer,a[0],a[1],o),c=[];c[0]=u[0]-l[0],c[1]=u[1]-l[1],c[2]=u[2]-l[2],a=r.getFocalPoint();var d=r.getPosition();r.setFocalPoint(c[0]+a[0],c[1]+a[1],c[2]+a[2]),r.setPosition(c[0]+d[0],c[1]+d[1],c[2]+d[2]),t.interactor.getLightFollowCamera()&&n.pokedRenderer.updateLightsGeometryToFollowCamera(),r.orthogonalizeViewUp(),t.previousTranslation=n.translation},e.handleRotate=function(e){var n=e.pokedRenderer.getActiveCamera();n.roll(e.rotation-t.previousRotation),n.orthogonalizeViewUp(),t.previousRotation=e.rotation},e.handleMouseRotate=function(e,n){var r=t.interactor,a=n.x-t.previousPosition.x,o=n.y-t.previousPosition.y,i=r.getView().getViewportSize(e),s=-.1,l=-.1;i[0]&&i[1]&&(s=-20/i[1],l=-20/i[0]);var u=a*l*t.motionFactor,c=o*s*t.motionFactor,d=e.getActiveCamera();Number.isNaN(u)||Number.isNaN(c)||(d.azimuth(u),d.elevation(c),d.orthogonalizeViewUp()),t.autoAdjustCameraClippingRange&&e.resetCameraClippingRange(),r.getLightFollowCamera()&&e.updateLightsGeometryToFollowCamera()},e.handleMouseSpin=function(e,n){var r=t.interactor,a=e.getActiveCamera(),o=r.getView().getViewportCenter(e),i=Fr(Math.atan2(t.previousPosition.y-o[1],t.previousPosition.x-o[0])),s=Fr(Math.atan2(n.y-o[1],n.x-o[0]))-i;Number.isNaN(s)||(a.roll(s),a.orthogonalizeViewUp())},e.handleMousePan=function(n,r){var a=n.getActiveCamera(),o=a.getFocalPoint(),i=(o=e.computeWorldToDisplay(n,o[0],o[1],o[2]))[2],s=e.computeDisplayToWorld(n,r.x,r.y,i),l=e.computeDisplayToWorld(n,t.previousPosition.x,t.previousPosition.y,i),u=[];u[0]=l[0]-s[0],u[1]=l[1]-s[1],u[2]=l[2]-s[2],o=a.getFocalPoint();var c=a.getPosition();a.setFocalPoint(u[0]+o[0],u[1]+o[1],u[2]+o[2]),a.setPosition(u[0]+c[0],u[1]+c[1],u[2]+c[2]),t.interactor.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera()},e.handleMouseDolly=function(n,r){var a=r.y-t.previousPosition.y,o=t.interactor.getView().getViewportCenter(n),i=t.motionFactor*a/o[1];e.dollyByFactor(n,Math.pow(1.1,i))},e.handleMouseWheel=function(t){var n=1-t.spinY/10;e.dollyByFactor(t.pokedRenderer,n)},e.dollyByFactor=function(e,n){if(!Number.isNaN(n)){var r=e.getActiveCamera();r.getParallelProjection()?r.setParallelScale(r.getParallelScale()/n):(r.dolly(n),t.autoAdjustCameraClippingRange&&e.resetCameraClippingRange()),t.interactor.getLightFollowCamera()&&e.updateLightsGeometryToFollowCamera()}}}(e,t)}var tm={newInstance:ur.a.newInstance(em,"vtkInteractorStyleTrackballCamera"),extend:em},nm=ur.a.vtkErrorMacro,rm=[1,-1,1,-1,1,-1];var am={empty:!0,numberOfComponents:3,dataType:to.FLOAT,bounds:[1,-1,1,-1,1,-1]};function om(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,am,n),vo.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkPoints"),e.getNumberOfPoints=e.getNumberOfTuples,e.setNumberOfPoints=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;e.getNumberOfPoints()!==n&&(t.size=n*r,t.values=ur.a.newTypedArray(t.dataType,t.size),e.setNumberOfComponents(r),e.modified())},e.setPoint=function(e){for(var n=e*t.numberOfComponents,r=0;r2&&void 0!==arguments[2]?arguments[2]:{};vo.extend(e,t,function(e){return lm({empty:!0,numberOfComponents:1,dataType:to.UNSIGNED_INT},e)}(n)),function(e,t){t.classHierarchy.push("vtkCellArray"),e.getNumberOfCells=function(e){return void 0===t.numberOfCells||e?(t.cellSizes=cm(t.values),t.numberOfCells=t.cellSizes.length,t.numberOfCells):t.numberOfCells},e.getCellSizes=function(e){return void 0===t.cellSizes||e?(t.cellSizes=cm(t.values),t.cellSizes):t.cellSizes};var n=e.setData;e.setData=function(e){n(e,1),t.numberOfCells=void 0,t.cellSizes=void 0},e.getCell=function(e){var n=e,r=t.values[n++];return t.values.subarray(n,n+r)}}(e,t)}var pm=lm({newInstance:ur.a.newInstance(fm,"vtkCellArray"),extend:fm},dm);var gm={bounds:[-1,-1,-1,-1,-1,-1],pointsIds:[]};function mm(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gm,n),ur.a.obj(e,t),t.points||(t.points=im.newInstance()),ur.a.get(e,t,["points","pointsIds"]),function(e,t){t.classHierarchy.push("vtkCell"),e.initialize=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(n){t.pointsIds=n;var r=t.points.getData();r.length!==3*t.pointsIds.length&&(r=ur.a.newTypedArray(e.getDataType(),3*t.pointsIds.length));var a=e.getData();t.pointsIds.forEach(function(e,t){var n=3*e,o=3*t;r[o]=a[n],r[++o]=a[++n],r[++o]=a[++n]}),t.points.setData(r)}else{t.points=e,t.pointsIds=new Array(e.getNumberOfPoints());for(var o=e.getNumberOfPoints()-1;o>=0;--o)t.pointsIds[o]=o}},e.getBounds=function(){var e=t.points.getNumberOfPoints(),n=[];if(e){t.points.getPoint(0,n),t.bounds[0]=n[0],t.bounds[1]=n[0],t.bounds[2]=n[1],t.bounds[3]=n[1],t.bounds[4]=n[2],t.bounds[5]=n[2];for(var r=1;rt.bounds[1]?n[0]:t.bounds[1],t.bounds[2]=n[1]t.bounds[3]?n[1]:t.bounds[3],t.bounds[4]=n[2]t.bounds[5]?n[2]:t.bounds[5]}else Na(t.bounds);return t.bounds},e.getLength2=function(){e.getBounds();for(var n=0,r=0,a=0;a<3;a++)n+=(r=t.bounds[2*a+1]-t.bounds[2*a])*r;return n},e.getParametricDistance=function(e){for(var t,n=0,r=0;r<3;r++)(t=e[r]<0?-e[r]:e[r]>1?e[r]-1:0)>n&&(n=t);return n},e.getNumberOfPoints=function(){return t.points.getNumberOfPoints()},e.deepCopy=function(e){e.initialize(t.points,t.pointsIds)},e.getCellDimension=function(){},e.intersectWithLine=function(e,t,n,r,a,o,i){},e.evaluatePosition=function(e,t,n,r,a,o){}}(e,t)}var vm={newInstance:ur.a.newInstance(mm,"vtkCell"),extend:mm};function hm(e){return function(e){if(Array.isArray(e))return ym(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ym(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ym(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ym(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bm,n),ur.a.obj(e,t),function(e,t){t.classHierarchy.push("vtkCellLinks"),e.buildLinks=function(n){var r=n.getPoints().getNumberOfPoints(),a=n.getNumberOfCells(),o=new Uint32Array(r);if(n.isA("vtkPolyData")){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:1e3;t.array=Array(e).fill().map(function(){return{ncells:0,cells:null}}),t.extend=n,t.maxId=-1},e.initialize=function(){t.array=null},e.getLink=function(e){return t.array[e]},e.getNcells=function(e){return t.array[e].ncells},e.getCells=function(e){return t.array[e].cells},e.insertNextPoint=function(e){t.array.push({ncells:e,cells:Array(e)}),++t.maxId},e.insertNextCellReference=function(e,n){t.array[e].cells[t.array[e].ncells++]=n},e.deletePoint=function(e){t.array[e].ncells=0,t.array[e].cells=null},e.removeCellReference=function(e,n){t.array[n].cells=t.array[n].cells.filter(function(t){return t!==e}),t.array[n].ncells=t.array[n].cells.length},e.addCellReference=function(e,n){t.array[n].cells[t.array[n].ncells++]=e},e.resizeCellList=function(e,n){t.array[e].cells.length=n},e.squeeze=function(){!function(e,t){var n=t;for(t>=e.array.length&&(n+=e.array.length);n>e.array.length;)e.array.push({ncells:0,cells:null});e.array.length=n}(t,t.maxId+1)},e.reset=function(){t.maxId=-1},e.deepCopy=function(e){t.array=hm(e.array),t.extend=e.extend,t.maxId=e.maxId},e.incrementLinkCount=function(e){++t.array[e].ncells},e.allocateLinks=function(e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mm,n),ur.a.obj(e,t),ur.a.get(e,t,["size","maxId","extend"]),ur.a.getArray(e,t,["typeArray","locationArray"]),function(e,t){t.classHierarchy.push("vtkCellTypes"),e.allocate=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:512,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;t.size=e>0?e:1,t.extend=n>0?n:1,t.maxId=-1,t.typeArray=new Uint8Array(e),t.locationArray=new Uint32Array(e)},e.insertCell=function(e,n,r){t.typeArray[e]=n,t.locationArray[e]=r,e>t.maxId&&(t.maxId=e)},e.insertNextCell=function(n,r){return e.insertCell(++t.maxId,n,r),t.maxId},e.setCellTypes=function(e,n,r){t.size=e,t.typeArray=n,t.locationArray=r,t.maxId=e-1},e.getCellLocation=function(e){return t.locationArray[e]},e.deleteCell=function(e){t.typeArray[e]=Sm.VTK_EMPTY_CELL},e.getNumberOfTypes=function(){return t.maxId+1},e.isType=function(t){for(var n=e.getNumberOfTypes(),r=0;r3&&void 0!==arguments[3]?arguments[3]:null,o={t:Number.MIN_VALUE,distance:0},i=[];i[0]=n[0]-t[0],i[1]=n[1]-t[1],i[2]=n[2]-t[2];var s=i[0]*(e[0]-t[0])+i[1]*(e[1]-t[1])+i[2]*(e[2]-t[2]),l=ea(i,i),u=1e-5*s;return 0!==l&&(o.t=s/l),u<0&&(u=-u),-u1?r=n:(r=i,i[0]=t[0]+o.t*i[0],i[1]=t[1]+o.t*i[1],i[2]=t[2]+o.t*i[2]),a&&(a[0]=r[0],a[1]=r[1],a[2]=r[2]),o.distance=oa(r,e),o}function Bm(e,t,n,r,a,o){var i=[],s=[],l=[];a[0]=0,o[0]=0,i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],s[0]=r[0]-n[0],s[1]=r[1]-n[1],s[2]=r[2]-n[2],l[0]=n[0]-e[0],l[1]=n[1]-e[1],l[2]=n[2]-e[2];var u=[];u[0]=[ea(i,i),-ea(i,s)],u[1]=[u[0][1],ea(s,s)];var c=[];if(c[0]=ea(i,l),c[1]=-ea(s,l),0===wa(u,c,2)){for(var d,f=Number.MAX_VALUE,p=[e,t,n,r],g=[n,n,e,e],m=[r,r,t,t],v=[o[0],o[0],a[0],a[0]],h=[a[0],a[0],o[0],o[0]],y=0;y<4;y++)(d=Nm(p[y],g[y],m[y])).distance=0&&a[0]<=1&&o[0]>=0&&o[0]<=1?Lm.YES_INTERSECTION:Lm.NO_INTERSECTION}var km={distanceToLine:Nm,intersection:Bm};var Fm={};function Gm(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fm,n),vm.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkLine"),e.getCellDimension=function(){return 1},e.intersectWithLine=function(e,n,r,a,o){var i={intersect:0,t:Number.MAX_VALUE,subId:0,betweenPoints:null};o[1]=0,o[2]=0;var s=[],l=[],u=[];t.points.getPoint(0,l),t.points.getPoint(1,u);var c=[],d=[],f=Bm(e,n,l,u,c,d);if(i.t=c[0],i.betweenPoints=function(e){return e>=0&&e<=1}(i.t),o[0]=d[0],f===Lm.YES_INTERSECTION){for(var p=0;p<3;p++)a[p]=l[p]+o[0]*(u[p]-l[p]),s[p]=e[p]+i.t*(n[p]-e[p]);if(oa(a,s)<=r*r)return i.intersect=1,i}else{var g;if(i.t<0)return(g=Nm(e,l,u,a)).distance<=r*r?(i.t=0,i.intersect=1,i.betweenPoints=!0,i):i;if(i.t>1)return(g=Nm(n,l,u,a)).distance<=r*r?(i.t=1,i.intersect=1,i.betweenPoints=!0,i):i;if(o[0]<0)return o[0]=0,g=Nm(l,e,n,a),i.t=g.t,g.distance<=r*r?(i.intersect=1,i):i;if(o[0]>1)return o[0]=1,g=Nm(u,e,n,a),i.t=g.t,g.distance<=r*r?(i.intersect=1,i):i}return i},e.evaluatePosition=function(e,t,n,r,a,o){}}(e,t)}var _m=Dm(Dm({newInstance:ur.a.newInstance(Gm,"vtkLine"),extend:Gm},km),Rm);var Um={};function jm(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Um,n),sc.extend(e,t,n),ur.a.setGet(e,t,["points"]),function(e,t){t.classHierarchy.push("vtkPointSet"),t.points?t.points=Object(Uu.a)(t.points):t.points=im.newInstance(),e.getNumberOfPoints=function(){return t.points.getNumberOfPoints()},e.getBounds=function(){return t.points.getBounds()},e.computeBounds=function(){e.getBounds()};var n=e.shallowCopy;e.shallowCopy=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n(e,r),t.points=im.newInstance(),t.points.shallowCopy(e.getPoints())}}(e,t)}var Wm={newInstance:ur.a.newInstance(jm,"vtkPointSet"),extend:jm};function zm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Km(e,t,n,r){var a=n[0]-t[0],o=n[1]-t[1],i=n[2]-t[2],s=e[0]-t[0],l=e[1]-t[1],u=e[2]-t[2];r[0]=o*u-i*l,r[1]=i*s-a*u,r[2]=a*l-o*s}function Xm(e,t,n,r){Km(e,t,n,r);var a=Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);0!==a&&(r[0]/=a,r[1]/=a,r[2]/=a)}var qm={computeNormalDirection:Km,computeNormal:Xm};var Ym={};function Zm(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ym,n),vm.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkTriangle"),e.getCellDimension=function(){return 2},e.intersectWithLine=function(n,r,a,o,i){var s={subId:0,t:Number.MAX_VALUE,intersect:0,betweenPoints:!1};i[2]=0;var l=a*a,u=[],c=[],d=[];t.points.getPoint(0,u),t.points.getPoint(1,c),t.points.getPoint(2,d);var f=[];if(Xm(u,c,d,f),0!==f[0]||0!==f[1]||0!==f[2]){var p=Jl.intersectWithLine(n,r,u,f);if(s.betweenPoints=p.betweenPoints,s.t=p.t,o[0]=p.x[0],o[1]=p.x[1],o[2]=p.x[2],!p.intersection)return i[0]=0,i[1]=0,s.intersect=0,s;var g=e.evaluatePosition(o,[],i,[]);if(g.evaluation>=0)return g.dist2<=l?(s.intersect=1,s):(s.intersect=g.evaluation,s)}var m=oa(u,c),v=oa(c,d),h=oa(d,u);t.line||(t.line=_m.newInstance()),m>v&&m>h?(t.line.getPoints().setPoint(0,u),t.line.getPoints().setPoint(1,c)):v>h&&v>m?(t.line.getPoints().setPoint(0,c),t.line.getPoints().setPoint(1,d)):(t.line.getPoints().setPoint(0,d),t.line.getPoints().setPoint(1,u));var y=t.line.intersectWithLine(n,r,a,o,i);if(s.betweenPoints=y.betweenPoints,s.t=y.t,y.intersect){for(var b=[],T=[],C=[],S=0;S<3;S++)b[S]=u[S]-d[S],T[S]=c[S]-d[S],C[S]=o[S]-d[S];return i[0]=ea(C,b)/h,i[1]=ea(C,T)/v,s.intersect=1,s}return i[0]=0,i[1]=0,s.intersect=0,s},e.evaluatePosition=function(e,n,r,a){var o,i,s,l,u,c,d,f={subId:0,dist2:0,evaluation:-1},p=[],g=[],m=[],v=[],h=[],y=[],b=[],T=0,C=[],S=[],P=[],w=[],x=[];f.subId=0,r[2]=0,t.points.getPoint(1,p),t.points.getPoint(2,g),t.points.getPoint(0,m),Km(p,g,m,v),Jl.generalizedProjectPoint(e,p,v,x);var O=0;for(o=0;o<3;o++)(s=v[o]<0?-v[o]:v[o])>O&&(O=s,T=o);for(i=0,o=0;o<3;o++)o!==T&&(C[i++]=o);for(o=0;o<2;o++)h[o]=x[C[o]]-m[C[o]],y[o]=p[C[o]]-m[C[o]],b[o]=g[C[o]]-m[C[o]];if(0===(l=la(y,b)))return r[0]=0,r[1]=0,f.evaluation=-1,f;if(r[0]=la(h,b)/l,r[1]=la(y,h)/l,a[0]=1-(r[0]+r[1]),a[1]=r[0],a[2]=r[1],a[0]>=0&&a[0]<=1&&a[1]>=0&&a[1]<=1&&a[2]>=0&&a[2]<=1)n&&(f.dist2=oa(x,e),n[0]=x[0],n[1]=x[1],n[2]=x[2]),f.evaluation=1;else{var M;if(n)if(a[1]<0&&a[2]<0)for(u=oa(e,m),c=_m.distanceToLine(e,p,m,M,P),d=_m.distanceToLine(e,m,g,M,w),u1?r[a]-1:0)>n&&(n=t);return n}}(e,t)}var Qm,$m=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rv,n),Wm.extend(e,t,n),ur.a.get(e,t,["cells","links"]),ur.a.setGet(e,t,["verts","lines","polys","strips"]),function(e,t){t.classHierarchy.push("vtkPolyData"),Jm.forEach(function(n){e["getNumberOf".concat(function(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,function(e){return e.toUpperCase()}).replace(/\s+/g,"")}(n))]=function(){return t[n].getNumberOfCells()},t[n]?t[n]=Object(Uu.a)(t[n]):t[n]=pm.newInstance()}),e.getNumberOfCells=function(){return Jm.reduce(function(e,n){return e+t[n].getNumberOfCells()},0)};var n=e.shallowCopy;e.shallowCopy=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n(e,r),Jm.forEach(function(n){t[n]=pm.newInstance(),t[n].shallowCopy(e.getReferenceByName(n))})},e.buildCells=function(){var n=e.getNumberOfVerts(),r=e.getNumberOfLines(),a=e.getNumberOfPolys(),o=e.getNumberOfStrips(),i=n+r+a+o,s=new Uint8Array(i),l=s,u=new Uint32Array(i),c=u;if(n){var d=0;t.verts.getCellSizes().forEach(function(e,t){c[t]=d,l[t]=e>1?Sm.VTK_POLY_VERTEX:Sm.VTK_VERTEX,d+=e+1}),c=c.subarray(n),l=l.subarray(n)}if(r){var f=0;t.lines.getCellSizes().forEach(function(e,t){c[t]=f,l[t]=e>2?Sm.VTK_POLY_LINE:Sm.VTK_LINE,1===e&&tv("Building VTK_LINE ",t," with only one point, but VTK_LINE needs at least two points. Check the input."),f+=e+1}),c=c.subarray(r),l=l.subarray(r)}if(a){var p=0;t.polys.getCellSizes().forEach(function(e,t){switch(c[t]=p,e){case 3:l[t]=Sm.VTK_TRIANGLE;break;case 4:l[t]=Sm.VTK_QUAD;break;default:l[t]=Sm.VTK_POLYGON}e<3&&tv("Building VTK_TRIANGLE ",t," with less than three points, but VTK_TRIANGLE needs at least three points. Check the input."),p+=e+1}),c+=c.subarray(a),l+=l.subarray(a)}if(o){var g=0;l.fill(Sm.VTK_TRIANGLE_STRIP,0,o),t.strips.getCellSizes().forEach(function(e,t){c[t]=g,g+=e+1})}t.cells=Im.newInstance(),t.cells.setCellTypes(i,s,u)},e.buildLinks=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;void 0===t.cells&&e.buildCells(),t.links=Cm.newInstance(),n>0?t.links.allocate(n):t.links.allocate(e.getPoints().getNumberOfPoints()),t.links.buildLinks(e)},e.getCellPoints=function(e){var n=t.cells.getCellType(e),r=null;switch(n){case Sm.VTK_VERTEX:case Sm.VTK_POLY_VERTEX:r=t.verts;break;case Sm.VTK_LINE:case Sm.VTK_POLY_LINE:r=t.lines;break;case Sm.VTK_TRIANGLE:case Sm.VTK_QUAD:case Sm.VTK_POLYGON:r=t.polys;break;case Sm.VTK_TRIANGLE_STRIP:r=t.strips;break;default:return r=null,{type:0,cellPointIds:null}}var a=t.cells.getCellLocation(e);return{cellType:n,cellPointIds:r.getCell(a)}},e.getPointCells=function(e){return t.links.getCells(e)},e.getCellEdgeNeighbors=function(e,n,r){var a=t.links.getLink(n),o=t.links.getLink(r);return a.cells.filter(function(t){return t!==e&&-1!==o.cells.indexOf(t)})},e.getCell=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.getCellPoints(t),a=n||nv[r.cellType].newInstance();return a.initialize(e.getPoints(),r.cellPointIds),a}}(e,t)}var ov={newInstance:ur.a.newInstance(av,"vtkPolyData"),extend:av};function iv(e){return function(){return ur.a.vtkErrorMacro("vtkProp::".concat(e," - NOT IMPLEMENTED"))}}var sv={visibility:!0,pickable:!0,dragable:!0,useBounds:!0,allocatedRenderTime:10,estimatedRenderTime:0,savedEstimatedRenderTime:0,renderTimeMultiplier:1,paths:null,textures:[]};function lv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sv,n),ur.a.obj(e,t),ur.a.get(e,t,["estimatedRenderTime","allocatedRenderTime"]),ur.a.setGet(e,t,["visibility","pickable","dragable","useBounds","renderTimeMultiplier"]),function(e,t){t.classHierarchy.push("vtkProp"),e.getMTime=function(){for(var e=t.mtime,n=0;ne&&(e=r)}return e},e.getNestedProps=function(){return null},e.getActors=function(){return[]},e.getActors2D=function(){return[]},e.getVolumes=function(){return[]},e.pick=iv("pick"),e.hasKey=iv("hasKey"),e.getRedrawMTime=function(){return t.mtime},e.setEstimatedRenderTime=function(e){t.estimatedRenderTime=e,t.savedEstimatedRenderTime=e},e.restoreEstimatedRenderTime=function(){t.estimatedRenderTime=t.savedEstimatedRenderTime},e.addEstimatedRenderTime=function(e){t.estimatedRenderTime+=e},e.setAllocatedRenderTime=function(e){t.allocatedRenderTime=e,t.savedEstimatedRenderTime=t.estimatedRenderTime,t.estimatedRenderTime=0},e.getSupportsSelection=function(){return!1},e.getTextures=function(){return t.textures},e.hasTexture=function(e){return-1!==t.textures.indexOf(e)},e.addTexture=function(n){n&&!e.hasTexture(n)&&(t.textures=t.textures.concat(n),e.modified())},e.removeTexture=function(n){var r=t.textures.filter(function(e){return e!==n});t.textures.length!==r.length&&(t.textures=r,e.modified())},e.removeAllTextures=function(){t.textures=[],e.modified()}}(e,t)}var uv={newInstance:ur.a.newInstance(lv,"vtkProp"),extend:lv};var cv={origin:[0,0,0],position:[0,0,0],orientation:[0,0,0],rotation:null,scale:[1,1,1],bounds:[1,-1,1,-1,1,-1],userMatrix:null,userMatrixMTime:null,cachedProp3D:null,isIdentity:!0,matrixMTime:null};function dv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,cv,n),uv.extend(e,t,n),t.matrixMTime={},ur.a.obj(t.matrixMTime),ur.a.get(e,t,["bounds","isIdentity"]),ur.a.getArray(e,t,["orientation"]),ur.a.setGetArray(e,t,["origin","position","scale"],3),t.matrix=o.identity(new Float64Array(16)),t.rotation=o.identity(new Float64Array(16)),t.userMatrix=o.identity(new Float64Array(16)),t.transform=null,function(e,t){t.classHierarchy.push("vtkProp3D"),e.addPosition=function(n){t.position=t.position.map(function(e,t){return e+n[t]}),e.modified()},e.getOrientationWXYZ=function(){var e=l.create();o.getRotation(e,t.rotation);var n=new Float64Array(3);return[Fr(l.getAxisAngle(n,e)),n[0],n[1],n[2]]},e.rotateX=function(n){0!==n&&(o.rotateX(t.rotation,t.rotation,kr(n)),e.modified())},e.rotateY=function(n){0!==n&&(o.rotateY(t.rotation,t.rotation,kr(n)),e.modified())},e.rotateZ=function(n){0!==n&&(o.rotateZ(t.rotation,t.rotation,kr(n)),e.modified())},e.rotateWXYZ=function(n,r,a,i){if(0!==n&&(0!==r||0!==a||0!==i)){var s=kr(n),u=l.create();l.setAxisAngle(u,[r,a,i],s);var c=new Float64Array(16);o.fromQuat(c,u),o.multiply(t.rotation,t.rotation,c),e.modified()}},e.setOrientation=function(n,r,a){return(n!==t.orientation[0]||r!==t.orientation[1]||a!==t.orientation[2])&&(t.orientation=[n,r,a],o.identity(t.rotation),e.rotateZ(a),e.rotateX(n),e.rotateY(r),e.modified(),!0)},e.setUserMatrix=function(n){o.copy(t.userMatrix,n),e.modified()},e.getMatrix=function(){return e.computeMatrix(),t.matrix},e.computeMatrix=function(){if(e.getMTime()>t.matrixMTime.getMTime()){o.identity(t.matrix),t.userMatrix&&o.multiply(t.matrix,t.matrix,t.userMatrix),o.translate(t.matrix,t.matrix,t.origin),o.translate(t.matrix,t.matrix,t.position),o.multiply(t.matrix,t.matrix,t.rotation),o.scale(t.matrix,t.matrix,t.scale),o.translate(t.matrix,t.matrix,[-t.origin[0],-t.origin[1],-t.origin[2]]),o.transpose(t.matrix,t.matrix),t.isIdentity=!0;for(var n=0;n<4;++n)for(var r=0;r<4;++r)(n===r?1:0)!==t.matrix[n+4*r]&&(t.isIdentity=!1);t.matrixMTime.modified()}},e.getCenter=function(){return _u.getCenter(t.bounds)},e.getLength=function(){return _u.getLength(t.bounds)},e.getXRange=function(){return _u.getXRange(t.bounds)},e.getYRange=function(){return _u.getYRange(t.bounds)},e.getZRange=function(){return _u.getZRange(t.bounds)},e.getUserMatrix=function(){return t.userMatrix},e.onModified(function(){e.computeMatrix()})}(e,t)}var fv={newInstance:ur.a.newInstance(dv,"vtkProp3D"),extend:dv};function pv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var mv=ur.a.vtkDebugMacro;function vv(e,t){t.classHierarchy.push("vtkActor");var n=function(e){for(var t=1;t=1;return n=(n=n&&(!t.texture||!t.texture.isTranslucent()))&&(!t.mapper||t.mapper.getIsOpaque())},e.hasTranslucentPolygonalGeometry=function(){return null!==t.mapper&&(null===t.property&&e.setProperty(e.makeProperty()),!e.getIsOpaque())},e.makeProperty=qs.newInstance,e.getProperty=function(){return null===t.property&&(t.property=e.makeProperty()),t.property},e.getBounds=function(){if(null===t.mapper)return t.bounds;var n=t.mapper.getBounds();if(!n||6!==n.length)return n;if(n[0]>n[1])return t.mapperBounds=n.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),n;if(!t.mapperBounds||n[0]!==t.mapperBounds[0]||n[1]!==t.mapperBounds[1]||n[2]!==t.mapperBounds[2]||n[3]!==t.mapperBounds[3]||n[4]!==t.mapperBounds[4]||n[5]!==t.mapperBounds[5]||e.getMTime()>t.boundsMTime.getMTime()){mv("Recomputing bounds..."),t.mapperBounds=n.concat();var r=[];_u.getCorners(n,r),e.computeMatrix();var a=new Float64Array(16);o.transpose(a,t.matrix),r.forEach(function(e){return i.transformMat4(e,e,a)}),t.bounds[0]=t.bounds[2]=t.bounds[4]=Number.MAX_VALUE,t.bounds[1]=t.bounds[3]=t.bounds[5]=-Number.MAX_VALUE,t.bounds=t.bounds.map(function(e,t){return t%2==0?r.reduce(function(e,n){return e>n[t/2]?n[t/2]:e},e):r.reduce(function(e,n){return ee?r:e}if(null!==t.backfaceProperty){var a=t.backfaceProperty.getMTime();e=a>e?a:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var n=t.mapper.getMTime();e=n>e?n:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(n=t.mapper.getInput().getMTime())>e?n:e)}return e},e.getSupportsSelection=function(){return!!t.mapper&&t.mapper.getSupportsSelection()}}var hv={mapper:null,property:null,backfaceProperty:null,forceOpaque:!1,forceTranslucent:!1,bounds:[1,-1,1,-1,1,-1]};function yv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hv,n),fv.extend(e,t,n),t.boundsMTime={},ur.a.obj(t.boundsMTime),ur.a.set(e,t,["property"]),ur.a.setGet(e,t,["backfaceProperty","forceOpaque","forceTranslucent","mapper"]),vv(e,t)}var bv={newInstance:ur.a.newInstance(yv,"vtkActor"),extend:yv};function Tv(e){return function(e){if(Array.isArray(e))return Cv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Cv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cv(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Sv,n),ur.a.obj(e,t),ur.a.get(e,t,["renderWindow","renderer","openGLRenderWindow","interactor","container"]),ur.a.event(e,t,"resize"),function(e,t){var n=e.invokeResize;delete e.invokeResize,t.renderWindow=pp.newInstance(),t.renderer=vg.newInstance(),t.renderWindow.addRenderer(t.renderer),t.openGLRenderWindow=Yp.newInstance(),t.renderWindow.addView(t.openGLRenderWindow),t.interactor=Lg.newInstance(),t.interactor.setInteractorStyle(tm.newInstance()),t.interactor.setView(t.openGLRenderWindow),t.interactor.initialize(),e.setBackground=t.renderer.setBackground,e.setBackground.apply(e,Tv(t.background)),e.resize=function(){if(t.container){var e=t.container.getBoundingClientRect(),r=window.devicePixelRatio||1;t.openGLRenderWindow.setSize(Math.floor(e.width*r),Math.floor(e.height*r)),n(),t.renderWindow.render()}},e.setContainer=function(e){t.container&&t.interactor.unbindEvents(t.container),t.container=e,t.openGLRenderWindow.setContainer(t.container),t.container&&t.interactor.bindEvents(t.container)},e.delete=ur.a.chain(e.setContainer,t.openGLRenderWindow.delete,e.delete),t.listenWindowResize&&window.addEventListener("resize",e.resize),e.resize()}(e,t)}var wv={newInstance:ur.a.newInstance(Pv),extend:Pv},xv={ColorSpace:{RGB:0,HSV:1,LAB:2,DIVERGING:3},Scale:{LINEAR:0,LOG10:1}};function Ov(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Av=xv.ColorSpace,Iv=xv.Scale,Rv=Nc.ScalarMappingTarget,Ev=ur.a.vtkDebugMacro,Dv=ur.a.vtkErrorMacro,Vv=ur.a.vtkWarningMacro;function Lv(e,t){var n=e[0],r=e[1],a=e[2],o=Math.sqrt(n*n+r*r+a*a),i=o>.001?Math.acos(n/o):0,s=i>.001?Math.atan2(a,r):0;t[0]=o,t[1]=i,t[2]=s}function Nv(e,t){if(e[0]>=t-.1)return e[2];var n=e[1]*Math.sqrt(t*t-e[0]*e[0])/(e[0]*Math.sin(e[1]));return e[2]>-.3*Math.PI?e[2]+n:e[2]-n}function Bv(e,t,n,r){var a=[],o=[];Va(t,a),Va(n,o);var i=[],s=[];Lv(a,i),Lv(o,s);var l=e;if(i[1]>.05&&s[1]>.05&&function(e,t){var n=e-t;for(n<0&&(n=-n);n>=2*Math.PI;)n-=2*Math.PI;return n>Math.PI&&(n=2*Math.PI-n),n}(i[2],s[2])>.33*Math.PI){var u=Math.max(i[0],s[0]);u=Math.max(88,u),e<.5?(s[0]=u,s[1]=0,s[2]=0,l*=2):(i[0]=u,i[1]=0,i[2]=0,l=2*l-1)}i[1]<.05&&s[1]>.05?i[2]=Nv(s,i[0]):s[1]<.05&&i[1]>.05&&(s[2]=Nv(i,s[0]));var c=[];c[0]=(1-l)*i[0]+l*s[0],c[1]=(1-l)*i[1]+l*s[1],c[2]=(1-l)*i[2]+l*s[2];var d=[];!function(e,t){var n=e[0],r=e[1],a=e[2];t[0]=n*Math.cos(r),t[1]=n*Math.sin(r)*Math.cos(a),t[2]=n*Math.sin(r)*Math.sin(a)}(c,d),La(d,r)}var kv={clamping:!0,colorSpace:Av.RGB,hSVWrap:!0,scale:Iv.LINEAR,nanColor:null,belowRangeColor:null,aboveRangeColor:null,useAboveRangeColor:!1,useBelowRangeColor:!1,allowDuplicateScalars:!1,table:null,tableSize:0,buildTime:null,nodes:null,discretize:!1,numberOfValues:256};function Fv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kv,n),Nc.extend(e,t,n),t.table=[],t.nodes=[],t.nanColor=[.5,0,0,1],t.belowRangeColor=[0,0,0,1],t.aboveRangeColor=[1,1,1,1],t.buildTime={},ur.a.obj(t.buildTime),ur.a.get(e,t,["buildTime","mappingRange"]),ur.a.setGet(e,t,["useAboveRangeColor","useBelowRangeColor","colorSpace","discretize","numberOfValues"]),ur.a.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),ur.a.getArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"]),function(e,t){t.classHierarchy.push("vtkColorTransferFunction"),e.getSize=function(){return t.nodes.length},e.addRGBPoint=function(t,n,r,a){return e.addRGBPointLong(t,n,r,a,.5,0)},e.addRGBPointLong=function(n,r,a,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(i<0||i>1)return Dv("Midpoint outside range [0.0, 1.0]"),-1;if(s<0||s>1)return Dv("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(n);var l={x:n,r:r,g:a,b:o,midpoint:i,sharpness:s};t.nodes.push(l),e.sortAndUpdateRange();for(var u=0;u4&&void 0!==arguments[4]?arguments[4]:.5,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=[];return Aa([n,r,a],s),e.addRGBPoint(t,s[0],s[1],s[2],o,i)},e.setNodes=function(n){t.nodes!==n&&(t.nodes=n,e.sortAndUpdateRange())},e.sortAndUpdateRange=function(){t.nodes.sort(function(e,t){return e.x-t.x}),e.updateRange()||e.modified()},e.updateRange=function(){var n=[2];n[0]=t.mappingRange[0],n[1]=t.mappingRange[1];var r=t.nodes.length;return r?(t.mappingRange[0]=t.nodes[0].x,t.mappingRange[1]=t.nodes[r-1].x):(t.mappingRange[0]=0,t.mappingRange[1]=0),(n[0]!==t.mappingRange[0]||n[1]!==t.mappingRange[1])&&(e.modified(),!0)},e.removePoint=function(n){for(var r=0;r=t.nodes.length)return-1;var o=!1;return t.nodes.splice(r,1),0!==r&&r!==t.nodes.length||(o=e.updateRange()),o||e.modified(),a},e.movePoint=function(n,r){if(n!==r){e.removePoint(r);for(var a=0;a=n&&t.nodes[c].x<=i?t.nodes.splice(c,1):c++;e.addRGBPointLong(n,r,a,o,.5,0),e.addRGBPointLong(i,s,l,u,.5,0),e.modified()},e.addHSVSegment=function(t,n,r,a,o,i,s,l){var u=[i,s,l],c=[],d=[];Aa([n,r,a],c),Aa(u,d),e.addRGBSegment(t,c[0],c[1],c[2],o,d[0],d[1],d[2])},e.mapValue=function(t){var n=[];return e.getColor(t,n),[Math.floor(255*n[0]+.5),Math.floor(255*n[1]+.5),Math.floor(255*n[2]+.5),255]},e.getColor=function(n,r){if(t.indexedLookup){var a=e.getSize(),o=e.getAnnotatedValueIndexInternal(n);if(o<0||0===a)e.getNanColor(r);else{var i=[];e.getNodeValue(o%a,i),r[0]=i.r,r[1]=i.g,r[2]=i.b}}else e.getTable(n,n,1,r)},e.getRedValue=function(t){var n=[];return e.getColor(t,n),n[0]},e.getGreenValue=function(t){var n=[];return e.getColor(t,n),n[1]},e.getBlueValue=function(t){var n=[];return e.getColor(t,n),n[2]},e.getTable=function(n,r,a,o){if(Ha(n)||Ha(r))for(var i=0;i0);var C=0,S=0,P=0;T&&(C=Math.log10(n),S=Math.log10(r));for(var w=0;w1?T?(P=C+w/(a-1)*(S-C),f=Math.pow(10,P)):f=n+w/(a-1)*(r-n):T?(P=.5*(C+S),f=Math.pow(10,P)):f=.5*(n+r),t.discretize){var O=t.mappingRange;if(f>=O[0]&&f<=O[1]){var M=t.numberOfValues,A=O[1]-O[0];if(M<=1)f=O[0]+A/2;else{var I=(f-O[0])/A,R=_r(M*I);f=O[0]+R/(M-1)*A}}}for(;st.nodes[s].x;)++s.99999&&(h=.99999));if(f>t.mappingRange[1])o[x]=0,o[x+1]=0,o[x+2]=0,t.clamping&&(e.getUseAboveRangeColor()?(o[x]=t.aboveRangeColor[0],o[x+1]=t.aboveRangeColor[1],o[x+2]=t.aboveRangeColor[2]):(o[x]=u,o[x+1]=c,o[x+2]=d));else if(f0&&(o[x]=t.nodes[0].r,o[x+1]=t.nodes[0].g,o[x+2]=t.nodes[0].b));else if(0===s&&(Math.abs(f-n)<1e-6||t.discretize))l>0?(o[x]=t.nodes[0].r,o[x+1]=t.nodes[0].g,o[x+2]=t.nodes[0].b):(o[x]=0,o[x+1]=0,o[x+2]=0);else{var E=0;if(E=(E=T?(P-p)/(g-p):(f-p)/(g-p)).99){if(E<.5){o[x]=m[0],o[x+1]=m[1],o[x+2]=m[2];continue}o[x]=v[0],o[x+1]=v[1],o[x+2]=v[2];continue}if(y<.01){if(t.colorSpace===Av.RGB)o[x]=(1-E)*m[0]+E*v[0],o[x+1]=(1-E)*m[1]+E*v[1],o[x+2]=(1-E)*m[2]+E*v[2];else if(t.colorSpace===Av.HSV){var D=[],V=[];Ma(m,D),Ma(v,V),t.hSVWrap&&(D[0]-V[0]>.5||V[0]-D[0]>.5)&&(D[0]>V[0]?D[0]-=1:V[0]-=1);var L=[];L[0]=(1-E)*D[0]+E*V[0],L[0]<0&&(L[0]+=1),L[1]=(1-E)*D[1]+E*V[1],L[2]=(1-E)*D[2]+E*V[2],Aa(L,b),o[x]=b[0],o[x+1]=b[1],o[x+2]=b[2]}else if(t.colorSpace===Av.LAB){var N=[],B=[];Va(m,N),Va(v,B);var k=[];k[0]=(1-E)*N[0]+E*B[0],k[1]=(1-E)*N[1]+E*B[1],k[2]=(1-E)*N[2]+E*B[2],La(k,b),o[x]=b[0],o[x+1]=b[1],o[x+2]=b[2]}else t.colorSpace===Av.DIVERGING?(Bv(E,m,v,b),o[x]=b[0],o[x+1]=b[1],o[x+2]=b[2]):Dv("ColorSpace set to invalid value.",t.colorSpace);continue}E<.5?E=.5*Math.pow(2*E,1+10*y):E>.5&&(E=1-.5*Math.pow(2*(1-E),1+10*y));var F=E*E,G=F*E,_=2*G-3*F+1,U=-2*G+3*F,j=G-2*F+E,W=G-F,z=void 0;if(t.colorSpace===Av.RGB)for(var H=0;H<3;H++)z=(1-y)*(v[H]-m[H]),o[x+H]=_*m[H]+U*v[H]+j*z+W*z;else if(t.colorSpace===Av.HSV){var K=[],X=[];Ma(m,K),Ma(v,X),t.hSVWrap&&(K[0]-X[0]>.5||X[0]-K[0]>.5)&&(K[0]>X[0]?K[0]-=1:X[0]-=1);for(var q=[],Y=0;Y<3;Y++)z=(1-y)*(X[Y]-K[Y]),q[Y]=_*K[Y]+U*X[Y]+j*z+W*z,0===Y&&q[Y]<0&&(q[Y]+=1);Aa(q,b),o[x]=b[0],o[x+1]=b[1],o[x+2]=b[2]}else if(t.colorSpace===Av.LAB){var Z=[],Q=[];Va(m,Z),Va(v,Q);for(var $=[],J=0;J<3;J++)z=(1-y)*(Q[J]-Z[J]),$[J]=_*Z[J]+U*Q[J]+j*z+W*z;La($,b),o[x]=b[0],o[x+1]=b[1],o[x+2]=b[2]}else t.colorSpace===Av.DIVERGING?(Bv(E,m,v,b),o[x]=b[0],o[x+1]=b[1],o[x+2]=b[2]):Dv("ColorSpace set to invalid value.");for(var ee=0;ee<3;ee++)o[x+ee]=o[x+ee]<0?0:o[x+ee],o[x+ee]=o[x+ee]>1?1:o[x+ee]}}}},e.getUint8Table=function(n,r,a){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.getMTime()<=t.buildTime&&t.tableSize===a&&t.tableWithAlpha!==o)return t.table;if(0===t.nodes.length)return Dv("Attempting to lookup a value with no points in the function"),t.table;var i=o?4:3;t.tableSize===a&&t.tableWithAlpha===o||(t.table=new Uint8Array(a*i),t.tableSize=a,t.tableWithAlpha=o);var s=[];e.getTable(n,r,a,s);for(var l=0;l1&&(i=(r-n)/(a-1));for(var s=0;s=t.nodes.length?(Dv("Index out of range!"),-1):(n[0]=t.nodes[e].x,n[1]=t.nodes[e].r,n[2]=t.nodes[e].g,n[3]=t.nodes[e].b,n[4]=t.nodes[e].midpoint,n[5]=t.nodes[e].sharpness,1)},e.setNodeValue=function(n,r){if(n<0||n>=t.nodes.length)return Dv("Index out of range!"),-1;var a=t.nodes[n].x;return t.nodes[n].x=r[0],t.nodes[n].r=r[1],t.nodes[n].g=r[2],t.nodes[n].b=r[3],t.nodes[n].midpoint=r[4],t.nodes[n].sharpness=r[5],a!==r[0]?e.sortAndUpdateRange():e.modified(),1},e.getNumberOfAvailableColors=function(){return t.indexedLookup&&e.getSize()?e.getSize():t.tableSize?t.tableSize:16777216},e.getIndexedColor=function(t,n){var r=e.getSize();if(r>0&&t>=0){var a=[];e.getNodeValue(t%r,a);for(var o=0;o<3;++o)n[o]=a[o+1];n[3]=1}else e.getNanColor(n),n[3]=1},e.fillFromDataPointer=function(t,n){if(!(t<=0)&&n){e.removeAllPoints();for(var r=0;rn[1]?(e.getColor(n[1],a),e.addRGBPoint(n[1],a[0],a[1],a[2])):(e.getColor(r[1],a),e.addRGBPoint(n[1],a[0],a[1],a[2])),e.sortAndUpdateRange();for(var o=0;o=n[0]&&t.nodes[o].x<=n[1]?t.nodes.splice(o,1):++o;return 1},e.estimateMinNumberOfSamples=function(t,n){var r=e.findMinimumXDistance();return Math.ceil((n-t)/r)},e.findMinimumXDistance=function(){if(t.nodes.length<2)return-1;for(var e=Number.MAX_VALUE,n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Uv,n),ur.a.obj(e,t),t.nodes=[],ur.a.setGet(e,t,["allowDuplicateScalars","clamping"]),ur.a.setArray(e,t,["range"],2),ur.a.getArray(e,t,["range"]),function(e,t){t.classHierarchy.push("vtkPiecewiseFunction"),e.getSize=function(){return t.nodes.length},e.getType=function(){var e,n=0,r=0;t.nodes.length>0&&(n=t.nodes[0].y);for(var a=1;an)switch(r){case 0:case 1:r=1;break;default:case 2:r=3}else switch(r){case 0:case 2:r=2;break;default:case 1:r=3}if(n=e,3===r)break}switch(r){case 0:return"Constant";case 1:return"NonDecreasing";case 2:return"NonIncreasing";default:case 3:return"Varied"}},e.getDataPointer=function(){var e=t.nodes.length;if(t.function=null,e>0){t.function=[];for(var n=0;n0?t.nodes[n-1].x:t.clamping?-Number.MAX_VALUE:t.nodes[0].x},e.getNodeValue=function(e,n){var r=t.nodes.length;return e<0||e>=r?(_v("Index out of range!"),-1):(n[0]=t.nodes[e].x,n[1]=t.nodes[e].y,n[2]=t.nodes[e].midpoint,n[3]=t.nodes[e].sharpness,1)},e.setNodeValue=function(n,r){var a=t.nodes.length;if(n<0||n>=a)return _v("Index out of range!"),-1;var o=t.nodes[n].x;return t.nodes[n].x=r[0],t.nodes[n].y=r[1],t.nodes[n].midpoint=r[2],t.nodes[n].sharpness=r[3],o!==r[0]?e.sortAndUpdateRange():e.modified(),1},e.addPoint=function(t,n){return e.addPointLong(t,n,.5,0)},e.addPointLong=function(n,r,a,o){if(a<0||a>1)return _v("Midpoint outside range [0.0, 1.0]"),-1;if(o<0||o>1)return _v("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(n);var i,s={x:n,y:r,midpoint:a,sharpness:o};for(t.nodes.push(s),e.sortAndUpdateRange(),i=0;i=t.nodes.length)return-1;var a=r,o=!1;return t.nodes.splice(r,1),0!==r&&r!==t.nodes.length||(o=e.updateRange()),o||e.modified(),a},e.removeAllPoints=function(){t.nodes=[],e.sortAndUpdateRange()},e.addSegment=function(n,r,a,o){e.sortAndUpdateRange();for(var i=0;i=n&&t.nodes[i].x<=a?t.nodes.splice(i,1):i++;e.addPoint(n,r,.5,0),e.addPoint(a,o,.5,0)},e.getValue=function(t){var n=[];return e.getTable(t,t,1,n),n[0]},e.adjustRange=function(n){if(n.length<2)return 0;var r=e.getRange();r[0]n[1]?e.addPoint(n[1],e.getValue(n[1])):e.addPoint(n[1],e.getValue(r[1])),e.sortAndUpdateRange();for(var a=0;a=n[0]&&t.nodes[a].x<=n[1]?t.nodes.splice(a,1):++a;return e.sortAndUpdateRange(),1},e.estimateMinNumberOfSamples=function(t,n){var r=e.findMinimumXDistance();return Math.ceil((n-t)/r)},e.findMinimumXDistance=function(){var e=t.nodes.length;if(e<2)return-1;for(var n=t.nodes[1].x-t.nodes[0].x,r=0;r4&&void 0!==arguments[4]?arguments[4]:1,s=0,l=t.nodes.length,u=0;0!==l&&(u=t.nodes[l-1].y);var c=0,d=0,f=0,p=0,g=0,m=0,v=0;for(o=0;o1?e+o/(r-1)*(n-e):.5*(e+n);st.nodes[s].x;)++s.99999&&(m=.99999));if(s>=l)a[h]=t.clamping?u:0;else if(0===s)a[h]=t.clamping?t.nodes[0].y:0;else{var y=(c-d)/(f-d);if(y=y.99){if(y<.5){a[h]=p;continue}a[h]=g;continue}if(v<.01){a[h]=(1-y)*p+y*g;continue}y<.5?y=.5*Math.pow(2*y,1+10*v):y>.5&&(y=1-.5*Math.pow(2*(1-y),1+10*v));var b=y*y,T=b*y,C=2*T-3*b+1,S=-2*T+3*b,P=T-2*b+y,w=T-b,x=(1-v)*(g-p);a[h]=C*p+S*g+P*x+w*x;var O=pg?p:g;a[h]=a[h]M?M:a[h]}}}}(e,t)}var Wv={newInstance:ur.a.newInstance(jv,"vtkPiecewiseFunction"),extend:jv},zv={DEFAULT:0,GEOMETRY:1,SLICE:2,VOLUME:3,YZ_PLANE:4,XZ_PLANE:5,XY_PLANE:6},Hv={PICKING_BUFFER:0,FRONT_BUFFER:1},Kv={ViewTypes:zv,RenderingTypes:Hv,CaptureOn:{MOUSE_MOVE:0,MOUSE_RELEASE:1}},Xv=.5;var qv={contextVisibility:!0,handleVisibility:!0,hasFocus:!1};function Yv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,qv,n),uv.extend(e,t,n),Wg.extend(e,t,n),ur.a.setGet(e,t,["contextVisibility","handleVisibility","widgetManager"]),ur.a.get(e,t,["representations","widgetState"]),ur.a.event(e,t,"ActivateHandle"),function(e,t){t.classHierarchy.push("vtkAbstractWidget"),t.actorToRepresentationMap=new WeakMap,e.getBounds=t.widgetState.getBounds,e.getNestedProps=function(){return t.representations},e.activateHandle=function(n){var r=n.selectedState,a=n.representation;t.widgetState.activateOnly(r),t.activeState=r,r&&r.updateManipulator&&r.updateManipulator(),e.invokeActivateHandle({selectedState:r,representation:a}),e.updateCursor&&e.updateCursor()},e.deactivateAllHandles=function(){t.widgetState.deactivate()},e.hasActor=function(e){return t.actorToRepresentationMap.has(e)},e.grabFocus=function(){t.hasFocus=!0},e.loseFocus=function(){t.hasFocus=!1},e.hasFocus=function(){return t.hasFocus},e.placeWidget=function(e){return t.widgetState.placeWidget(e)},e.getPlaceFactor=function(){return t.widgetState.getPlaceFactor()},e.setPlaceFactor=function(e){return t.widgetState.setPlaceFactor(e)},e.getRepresentationFromActor=function(e){return t.actorToRepresentationMap.get(e)},e.updateRepresentationForRender=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hv.FRONT_BUFFER,n=0;n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qv,n),dd.extend(e,t,n),ur.a.setGet(e,t,["callback","useZValues"]),function(e,t){t.classHierarchy.push("vtkPixelSpaceCallbackMapper"),t.callback||(t.callback=function(){}),e.invokeCallback=function(e,n,r,a,s){if(t.callback){var l=n.getCompositeProjectionMatrix(r,-1,1);o.transpose(l,l);for(var u=e.getPoints(),c=new Float64Array(3),d=a.usize,f=a.vsize,p=d/2,g=f/2,m=[],v=0;ve.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ih,n),uv.extend(e,t,n),ur.a.algo(e,t,1,1),ur.a.get(e,t,["labels","coincidentTopologyParameters"]),ur.a.set(e,t,["displayScaleParams"]),ur.a.setGet(e,t,["scaleInPixels"]),function(e,t){t.classHierarchy.push("vtkWidgetRepresentation");var n={mtimes:{},states:[]};function r(e,t){e&&e.setResolveCoincidentTopologyToPolygonOffset&&(e.setResolveCoincidentTopologyToPolygonOffset(),Yc.forEach(function(n){if(t[n]){var r="setRelativeCoincidentTopology".concat(n,"OffsetParameters");if(e[r]){var a=t[n],o=a.factor,i=a.offset;e[r](o,i)}}}))}e.getActors=function(){return t.actors},e.getNestedProps=e.getActors,e.setLabels=function(){for(var n=arguments.length,r=new Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:t.inputData[0];return n.mtimes.representation===e.getMTime()&&n.mtimes.input===r.getMTime()?n.states:(n.mtimes.representation=e.getMTime(),n.mtimes.input=r.getMTime(),n.states=[],t.labels.forEach(function(e){n.states=n.states.concat(r.getStatesWithLabel(e)||[])}),n.states)},e.getSelectedState=function(t,n){var r=e.getRepresentationStates();return n0&&void 0!==arguments[0]?arguments[0]:Hv.FRONT_BUFFER,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!0;switch(t.behavior){case eh.HANDLE:o=e===Hv.PICKING_BUFFER||a;break;case eh.CONTEXT:o=e===Hv.FRONT_BUFFER&&r;break;default:o=!0}for(var i=n&&o,s=0;s1?t-1:0),r=1;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n=i;f--)d(f)}return n}function hh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ah,n),ur.a.obj(e,t),ur.a.setGet(e,t,["captureOn",{type:"enum",name:"viewType",enum:bh}]),ur.a.get(e,t,["selections","widgets","viewId","pickingEnabled","useSvgLayer"]),Mh(e,t)}var Rh={newInstance:ur.a.newInstance(Ih,"vtkWidgetManager"),extend:Ih,Constants:Kv};function Eh(e){return function(e){if(Array.isArray(e))return Dh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Dh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dh(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2];ur.a.obj(e,t),ur.a.get(e,t,["widgetState"]),ur.a.event(e,t,"WidgetChange"),function(e,t){t.classHierarchy.push("vtkAbstractWidgetFactory");var n={};e.getWidgetForView=function(r){var a=r.viewId,o=r.renderer,i=r.viewType,s=r.initialValues;if(!n[a]){if(!o)return null;var l=Oh(o),u=l.interactor,c=l.apiSpecificRenderWindow,d=l.camera,f={},p={onWidgetChange:e.onWidgetChange};Object.assign(f,t,{viewType:i,renderer:o,camera:d,apiSpecificRenderWindow:c,factory:e}),ur.a.safeArrays(f),Zv.extend(p,f,s);var g=s;f.representations=e.getRepresentationsForViewType(i).map(function(e){var t=e.builder,n=e.labels,r=e.initialValues;return t.newInstance(Lh(Lh({labels:n},r),g))}),f.representations.forEach(function(e){e.setInputData(f.widgetState),e.getActors().forEach(function(t){f.actorToRepresentationMap.set(t,e)})}),t.behavior(p,f),["coincidentTopologyParameters"].concat(Eh(t.methodsToLink||[])).forEach(function(e){var t,n="set".concat(ur.a.capitalize(e)),r="get".concat(ur.a.capitalize(e)),a=(Nh(t={},e,[]),Nh(t,n,[]),Nh(t,r,[]),t);f.representations.forEach(function(t){t[e]&&a[e].push(t[e]),t[n]&&a[n].push(t[n]),t[r]&&a[r].push(t[r])}),Object.keys(a).forEach(function(e){var t=a[e];1===t.length?p[e]=t[0]:t.length>1&&(p[e]=ur.a.chain.apply(ur.a,Eh(t)))})}),p.delete=ur.a.chain(function(){delete n[a]},p.delete),p.setInteractor(u);var m=Object.freeze(p);return n[a]=m,m}return n[a]},e.getViewIds=function(){return Object.keys(n)},e.setVisibility=function(e){for(var t=Object.keys(n),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_h,n),ur.a.obj(e,t),ur.a.setGetArray(e,t,["normal","origin"],3),function(e,t){t.classHierarchy.push("vtkPlaneManipulator"),e.handleEvent=function(e,n){return Gh(e.position.x,e.position.y,t.origin,t.normal,e.pokedRenderer,n)}}(e,t)}var jh={intersectDisplayWithPlane:Gh,extend:Uh,newInstance:ur.a.newInstance(Uh,"vtkPlaneManipulator")};function Wh(e,t,n,r,a,o){var i=o.displayToWorld(e,t,0,a),s=[0,0,0];Qr(o.displayToWorld(e,t,1,a),i,s);var l=[0,0,0];ta(r,s,l),ta(l,s,l);var u=ea([i[0]-n[0],i[1]-n[1],i[2]-n[2]],l),c=ea(l,r),d=r.slice();return $r(d,u/c),Zr(n,d,d),d}var zh={origin:[0,0,0],normal:[0,0,1]};function Hh(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zh,n),ur.a.obj(e,t),ur.a.setGetArray(e,t,["origin","normal"],3),function(e,t){t.classHierarchy.push("vtkLineManipulator"),e.handleEvent=function(e,n){return Wh(e.position.x,e.position.y,t.origin,t.normal,e.pokedRenderer,n)}}(e,t)}var Kh={projectDisplayToLine:Wh,extend:Hh,newInstance:ur.a.newInstance(Hh,"vtkLineManipulator")},Xh={OrientationModes:{DIRECTION:0,ROTATION:1,MATRIX:2},ScaleModes:{SCALE_BY_CONSTANT:0,SCALE_BY_MAGNITUDE:1,SCALE_BY_COMPONENTS:2}};function qh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Yh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zh(e){return function(e){if(Array.isArray(e))return Qh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Qh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qh(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ty,n),dd.extend(e,t,n),ur.a.algo(e,t,2,0),t.buildTime={},ur.a.obj(t.buildTime,{mtime:0}),t.boundsTime={},ur.a.obj(t.boundsTime,{mtime:0}),ur.a.setGet(e,t,["orient","orientationMode","orientationArray","scaleArray","scaleFactor","scaleMode","scaling"]),ur.a.get(e,t,["colorArray","matrixArray","normalArray","buildTime"]),function(e,t){t.classHierarchy.push("vtkGlyph3DMapper"),e.getOrientationModeAsString=function(){return ur.a.enumToString($h,t.orientationMode)},e.setOrientationModeToDirection=function(){return e.setOrientationMode($h.DIRECTION)},e.setOrientationModeToRotation=function(){return e.setOrientationMode($h.ROTATION)},e.setOrientationModeToMatrix=function(){return e.setOrientationMode($h.MATRIX)},e.getOrientationArrayData=function(){var n=e.getInputData(0);return n&&n.getPointData()?t.orientationArray?n.getPointData().getArray(t.orientationArray):n.getPointData().getVectors():null},e.getScaleModeAsString=function(){return ur.a.enumToString(Jh,t.scaleMode)},e.setScaleModeToScaleByMagnitude=function(){return e.setScaleMode(Jh.SCALE_BY_MAGNITUDE)},e.setScaleModeToScaleByComponents=function(){return e.setScaleMode(Jh.SCALE_BY_COMPONENTS)},e.setScaleModeToScaleByConstant=function(){return e.setScaleMode(Jh.SCALE_BY_CONSTANT)},e.getScaleArrayData=function(){var n=e.getInputData(0);return n&&n.getPointData()?t.scaleArray?n.getPointData().getArray(t.scaleArray):n.getPointData().getScalars():null},e.getBounds=function(){var n=e.getInputData(0),r=e.getInputData(1);return n&&r?(e.buildArrays(),t.bounds):Ka()},e.buildArrays=function(){var n=e.getInputData(0),r=e.getInputData(1);if(t.buildTime.getMTime()t.bounds[1]&&(t.bounds[1]=p[0]),p[1]>t.bounds[3]&&(t.bounds[3]=p[1]),p[2]>t.bounds[5]&&(t.bounds[5]=p[2]);var E=new Float32Array(T,36*S,9);a.fromMat4(E,P),a.invert(E,E),a.transpose(E,E)}var D=e.getAbstractScalars(n,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]),t.colorArray=null;var V=e.getLookupTable();V&&D&&(V.build(),t.colorArray=V.mapScalars(D,t.colorMode,0)),t.buildTime.modified()}},e.getPrimitiveCount=function(){var t=e.getInputData(1),n=e.getInputData().getPoints().getNumberOfValues()/3;return{points:n*t.getPoints().getNumberOfValues()/3,verts:n*(t.getVerts().getNumberOfValues()-t.getVerts().getNumberOfCells()),lines:n*(t.getLines().getNumberOfValues()-2*t.getLines().getNumberOfCells()),triangles:n*(t.getPolys().getNumberOfValues()-3*t.getLines().getNumberOfCells())}}}(e,t)}var ry=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},r=oy(oy({},sy),n);sh.extend(e,t,r),ur.a.setGet(e,t,["activeScaleFactor","activeColor","useActiveColor"]),function(e,t){t.classHierarchy.push("vtkHandleRepresentation")}(0,t)}};var uy={radius:.5,latLongTessellation:!1,thetaResolution:8,startTheta:0,endTheta:360,phiResolution:8,startPhi:0,endPhi:180,center:[0,0,0],pointType:"Float32Array"};function cy(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uy,n),ur.a.obj(e,t),ur.a.setGet(e,t,["radius","latLongTessellation","thetaResolution","startTheta","endTheta","phiResolution","startPhi","endPhi"]),ur.a.setGetArray(e,t,["center"],3),ur.a.algo(e,t,0,1),function(e,t){t.classHierarchy.push("vtkSphereSource"),e.requestData=function(e,n){if(!t.deleted){var r=n[0],a=r?r.getPoints().getDataType():"Float32Array";r=ov.newInstance();var o=0,i=t.thetaResolution,s=t.startThetat.startTheta?t.endTheta:t.startTheta;l*=Math.PI/180;var u=t.startPhit.startPhi?t.endPhi:t.startPhi;c*=Math.PI/180,Math.abs(s-l)<2*Math.PI&&++i;var d=(l-s)/t.thetaResolution,f=t.startPhi<=0?1:0,p=t.phiResolution+(t.endPhi>=180?-1:0),g=t.phiResolution*i+2,m=2*t.phiResolution*t.thetaResolution,v=0,h=ur.a.newTypedArray(a,3*g),y=new Float32Array(3*g),b=0,T=new Uint32Array(5*m);t.startPhi<=0&&(h[3*v+0]=t.center[0],h[3*v+1]=t.center[1],h[3*v+2]=t.center[2]+t.radius,y[3*v+0]=0,y[3*v+1]=0,y[3*v+2]=1,v++,o++),t.endPhi>=180&&(h[3*v+0]=t.center[0],h[3*v+1]=t.center[1],h[3*v+2]=t.center[2]-t.radius,y[3*v+0]=0,y[3*v+1]=0,y[3*v+2]=-1,v++,o++);for(var C=t.phiResolution-o,S=(c-u)/(t.phiResolution-1),P=0;P=180)for(var E=C-1+o,D=0;D2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fy,n),ly.extend(e,t,n),ur.a.get(e,t,["glyph","mapper","actor"]),function(e,t){function n(n){if(t.displayCallback){for(var r=[],a=e.getRepresentationStates(),o=0;o2&&void 0!==arguments[2]?arguments[2]:{},r=vy(vy({},yy),n);sh.extend(e,t,r),function(e,t){t.classHierarchy.push("vtkContextRepresentation")}(0,t)}};function Ty(e){return function(e){if(Array.isArray(e))return Cy(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Cy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cy(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,wy,n),by.extend(e,t,n),ur.a.setGetArray(e,t,["edgeColor"],3),ur.a.get(e,t,["mapper","actor"]),function(e,t){var n;t.classHierarchy.push("vtkCroppingOutlineRepresentation"),t.internalPolyData=ov.newInstance({mtime:0}),t.points=new Float32Array(24),t.internalPolyData.getPoints().setData(t.points,3),t.internalPolyData.getLines().setData(Uint16Array.from(Py)),t.mapper=dd.newInstance({scalarVisibility:!1}),t.actor=bv.newInstance(),(n=t.actor.getProperty()).setEdgeColor.apply(n,Ty(t.edgeColor)),t.mapper.setInputConnection(e.getOutputPort()),t.actor.setMapper(t.mapper),e.addActor(t.actor),e.requestData=function(n,r){var a=e.getRepresentationStates(n[0]);if(8===a.length){for(var o=0,i=0;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ky,n),ur.a.obj(e,t),ur.a.setGet(e,t,["active"]),function(e,t){t.classHierarchy.push("vtkWidgetState");var n=[];t.labels={},t.nestedStates=[],e.bindState=function(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Ny];if(t.nestedStates.push(r),n.push(r.onModified(e.modified)),Array.isArray(a)&&a.length)for(var o=0;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Uy,n),ur.a.setGetArray(e,t,["bounds"],6),ur.a.get(e,t,["placeFactor"]),ur.a.event(e,t,"BoundsChange"),t.bounds=t.bounds.slice(),function(e,t){var n=[],r=Gy(_u.INIT_BOUNDS);e.containsPoint=function(e,t,n){return Array.isArray(e)?_u.containsPoint(r,e[0],e[1],e[2]):_u.containsPoint(r,e,t,n)},e.placeWidget=function(a){t.bounds=[];for(var o=[(a[0]+a[1])/2,(a[2]+a[3])/2,(a[4]+a[5])/2],i=0;i<6;i++){var s=o[Math.floor(i/2)];n[i]=a[i],t.bounds[i]=(a[i]-s)*t.placeFactor+s}_u.setBounds(r,t.bounds),e.invokeBoundsChange(t.bounds),e.modified()},e.setPlaceFactor=function(a){if(t.placeFactor!==a){t.placeFactor=a,t.bounds=[];for(var o=[(n[0]+n[1])/2,(n[2]+n[3])/2,(n[4]+n[5])/2],i=0;i<6;i++){var s=o[Math.floor(i/2)];t.bounds[i]=(n[i]-s)*t.placeFactor+s}_u.setBounds(r,t.bounds),e.invokeBoundsChange(t.bounds),e.modified()}}}(e,t)}},Wy={color:.5};var zy={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Wy,n),ur.a.setGet(e,t,["color"])}};function Hy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ky(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ky(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ky(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Xy,n),ur.a.setGetArray(e,t,["corner"],3),function(e,t){e.translate=function(t,n,r){var a=Hy(e.getCornerByReference(),3),o=a[0],i=a[1],s=a[2];e.setCorner(o+t,i+n,s+r)}}(e)}};function Yy(e){return function(e){if(Array.isArray(e))return Zy(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Zy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zy(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]&&arguments[0];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.matrix=o.identity(new Float64Array(16)),this.tmp=new Float64Array(3),this.angleConv=t?r.toRadian:$y}return function(e,t,n){t&&Qy(e.prototype,t),n&&Qy(e,n)}(e,[{key:"rotateFromDirections",value:function(e,t){var n=new Float64Array(3),r=new Float64Array(3),a=new Float64Array(16);i.set(n,e[0],e[1],e[2]),i.set(r,t[0],t[1],t[2]),i.normalize(n,n),i.normalize(r,r);var s=i.dot(n,r);return s>=1?this:(i.cross(this.tmp,n,r),i.length(this.tmp)<1e-6&&(i.cross(this.tmp,[1,0,0],e),i.length(this.tmp)<1e-6&&i.cross(this.tmp,[0,1,0],e)),o.fromRotation(a,Math.acos(s),this.tmp),o.multiply(this.matrix,this.matrix,a),this)}},{key:"rotate",value:function(e,t){return i.set.apply(i,[this.tmp].concat(Yy(t))),i.normalize(this.tmp,this.tmp),o.rotate(this.matrix,this.matrix,this.angleConv(e),this.tmp),this}},{key:"rotateX",value:function(e){return o.rotateX(this.matrix,this.matrix,this.angleConv(e)),this}},{key:"rotateY",value:function(e){return o.rotateY(this.matrix,this.matrix,this.angleConv(e)),this}},{key:"rotateZ",value:function(e){return o.rotateZ(this.matrix,this.matrix,this.angleConv(e)),this}},{key:"translate",value:function(e,t,n){return i.set(this.tmp,e,t,n),o.translate(this.matrix,this.matrix,this.tmp),this}},{key:"scale",value:function(e,t,n){return i.set(this.tmp,e,t,n),o.scale(this.matrix,this.matrix,this.tmp),this}},{key:"multiply",value:function(e){return o.multiply(this.matrix,this.matrix,e),this}},{key:"identity",value:function(){return o.identity(this.matrix),this}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(ma(Jy,this.matrix))return this;for(var r=-1===n?e.length:t+3*n,a=t;a2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,nb,n),ur.a.setGetArray(e,t,["direction"],3),function(e,t){var n="degree"===t.angleUnit?tb.buildFromDegree():tb.buildFromRadian();e.rotateFromDirections=function(r,a){n.identity().rotateFromDirections(r,a).apply(t.direction),e.modified()},e.rotate=function(e,r){n.identity().rotate(e,r).apply(t.direction)},e.rotateX=function(e){n.identity().rotateX(e).apply(t.direction)},e.rotateY=function(e){n.identity().rotateY(e).apply(t.direction)},e.rotateZ=function(e){n.identity().rotateZ(e).apply(t.direction)}}(e,t)}};var ab={manipulator:null};var ob={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ab,n),ur.a.setGet(e,t,["manipulator"]),function(e,t){e.updateManipulator=function(){if(t.manipulator){var e=t.origin,n=t.normal,r=t.direction,a=t.manipulator,o=a.setOrigin,i=a.setCenter,s=a.setNormal,l=a.setDirection;e&&o?o(e):e&&i&&i(e),r&&l?l(r):r&&!n&&s?s(r):n&&l&&l(n)}}}(e,t)}},ib={name:""};var sb={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ib,n),ur.a.setGet(e,t,["name"])}};function lb(e,t){return 3===e.length&&3===t.length&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function ub(e,t){var n={o:[],p1:[],p2:[]};e.normalize=function(){ra(t.up),ra(t.right),ra(t.direction),e.modified()},e.updateFromOriginRightUp=function(r,a,o){(function(e,t,n,r){return lb(e,r.o)&&lb(t,r.p1)&&lb(n,r.p2)})(r,a,o,n)||(n.o=r.slice(),n.p1=a.slice(),n.p2=o.slice(),t.up=[o[0]-r[0],o[1]-r[1],o[2]-r[2]],t.right=[a[0]-r[0],a[1]-r[1],a[2]-r[2]],ta(t.up,t.right,t.direction),ta(t.direction,t.up,t.right),e.normalize(),e.modified())}}var cb={up:[0,1,0],right:[1,0,0],direction:[0,0,1]};var db={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,cb,n),ur.a.setGetArray(e,t,["up","right","direction"],3),ub(e,t)}};function fb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gb,n),ur.a.setGetArray(e,t,["origin"],3),function(e,t){e.translate=function(t,n,r){var a=fb(e.getOriginByReference(),3),o=a[0],i=a[1],s=a[2];e.setOrigin(o+t,i+n,s+r)}}(e)}},vb={scale1:.5};var hb={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vb,n),ur.a.setGet(e,t,["scale1"])}},yb={scale3:[1,1,1]};var bb={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yb,n),ur.a.setGetArray(e,t,["scale3"],3)}},Tb={text:"DefaultText"};var Cb={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tb,n),ur.a.setGet(e,t,["text"])}},Sb={visible:!0};var Pb={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Sb,n),ur.a.setGet(e,t,["visible"]),e.isVisible=e.getVisible}},wb={shape:""};var xb={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,wb,n),ur.a.setGet(e,t,["shape"])}};function Ob(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};arguments.length>4&&void 0!==arguments[4]&&arguments[4]||Fy.extend(n,r,t);for(var a=0;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zb,n),Fh.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkImageCroppingWidget");var n=null;function r(e,n){t.widgetState.getStatesWithLabel(e).forEach(function(e){e.setVisible(n)})}e.setFaceHandlesEnabled=function(e){return r("faces",e)},e.setEdgeHandlesEnabled=function(e){return r("edges",e)},e.setCornerHandlesEnabled=function(e){return r("corners",e)},e.copyImageDataDescription=function(n){var r,a;(r=t.widgetState).setIndexToWorldT.apply(r,Ub(n.getIndexToWorld())),(a=t.widgetState).setWorldToIndexT.apply(a,Ub(n.getWorldToIndex()));var o=n.getDimensions();t.widgetState.getCroppingPlanes().setPlanes([0,o[0],0,o[1],0,o[2]]),e.modified()},e.updateHandles=function(){for(var e=t.widgetState.getCroppingPlanes().getPlanes(),n=[(e[0]+e[1])/2,(e[2]+e[3])/2,(e[4]+e[5])/2],r=[e[0],n[0],e[1]],a=[e[2],n[1],e[3]],o=[e[4],n[2],e[5]],i=t.widgetState.getIndexToWorldT(),s=function(e){return Iy[e]},l=0;l<3;l++)for(var u=0;u<3;u++)for(var c=0;c<3;c++)if(1!==l||1!==u||1!==c){var d=[l,u,c].map(s).join(""),f=Ry([r[l],a[u],o[c]],i),p=_b(t.widgetState.getStatesWithLabel(d),1)[0];p.setOrigin.apply(p,Ub(f))}},e.delete=ur.a.chain(e.delete,function(){n&&n.unsubscribe()}),t.behavior=Ly,t.widgetState=Gb(),e.getRepresentationsForViewType=function(e){switch(e){case zv.DEFAULT:case zv.GEOMETRY:case zv.SLICE:case zv.VOLUME:default:return[{builder:gy,labels:["handles"]},{builder:Oy,labels:["corners"]}]}},n=t.widgetState.getCroppingPlanes().onModified(e.updateHandles);var a=jh.newInstance(),o=Kh.newInstance();t.widgetState.getStatesWithLabel("corners").forEach(function(e){return e.setManipulator(a)}),t.widgetState.getStatesWithLabel("edges").forEach(function(e){return e.setManipulator(a)}),t.widgetState.getStatesWithLabel("faces").forEach(function(e){return e.setManipulator(o)})}(e,t)}var Kb={newInstance:ur.a.newInstance(Hb,"vtkImageCroppingWidget"),extend:Hb};function Xb(e){return function(e){if(Array.isArray(e))return qb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return qb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qb(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zb,n),ur.a.obj(e,t),ur.a.algo(e,t,1,1),ur.a.setGetArray(e,t,["croppingPlanes"],6),function(e,t){t.classHierarchy.push("vtkImageCropFilter"),e.reset=function(){var t=e.getInputData();t&&e.setCroppingPlanes.apply(e,Xb(t.getExtent()))},e.requestData=function(e,n){var r=e[0];if(r){var a=r.getPointData().getScalars();if(a){var o=r.getExtent(),i=6===t.croppingPlanes.length?o.map(function(e,n){return n%2==0?Math.max(e,Math.round(t.croppingPlanes[n])):Math.min(e,Math.round(t.croppingPlanes[n]))}):o.slice();if(i[0]===o[0]&&i[1]===o[1]&&i[2]===o[2]&&i[3]===o[3]&&i[4]===o[4]&&i[5]===o[5]){var s=bc.newInstance();return s.shallowCopy(r),void(n[0]=s)}for(var l=0;l<3;++l)if(i[2*l]>i[2*l+1]){var u=[i[2*l+1],i[2*l]];i[2*l]=u[0],i[2*l+1]=u[1]}for(var c=0;c<6;c+=2)i[c]=Math.max(i[c],o[c]),i[c+1]=Math.min(i[c+1],o[c+1]);for(var d=a.getNumberOfComponents(),f=(i[1]-i[0]+1)*(i[3]-i[2]+1)*(i[5]-i[4]+1)*d,p=a.getData(),g=r.getDimensions(),m=d*g[0],v=d*g[0]*g[1],h=(i[0]-o[0])*d,y=(i[1]-i[0]+1)*d,b=new p.constructor(f),T=0,C=i[4];C<=i[5];++C)for(var S=i[2];S<=i[3];++S){var P=h+(S-o[2])*m+(C-o[4])*v,w=P+y,x=p.subarray(P,w);b.set(x,T),T+=x.length}var O=bc.newInstance({extent:i,origin:r.getOrigin(),direction:r.getDirection(),spacing:r.getSpacing()}),M=vo.newInstance({name:a.getName(),numberOfComponents:d,values:b});O.getPointData().setScalars(M),n[0]=O}else Yb("No scalars from input")}else Yb("Invalid or missing input")},e.isResetAvailable=function(){if(0===t.croppingPlanes.length)return!1;var n=e.getInputData();return!!n&&void 0!==n.getExtent().find(function(e,n){return Math.abs(t.croppingPlanes[n]-e)>Number.EPSILON})}}(e,t)}var $b={newInstance:ur.a.newInstance(Qb,"vtkImageCropFilter"),extend:Qb},Jb=n(12),eT=Object.create(null);Jb.filter(function(e){return e.RGBPoints}).filter(function(e){return"CIELAB"!==e.ColorSpace}).forEach(function(e){eT[e.Name]=e});var tT=Object.keys(eT);tT.sort();var nT={addPreset:function(e){e.RGBPoints&&"CIELAB"!==e.ColorSpace&&(eT[e.Name]||(tT.push(e.Name),tT.sort()),eT[e.Name]=e)},removePresetByName:function(e){var t=tT.indexOf(e);t>-1&&tT.splice(t,1),delete eT[e]},getPresetByName:function(e){return eT[e]},rgbPresetNames:tT},rT=n(13),aT=n.n(rT),oT=n(14),iT=n.n(oT);function sT(){return iT()('!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r1?t-1:0),o=1;o1?r-1:0),a=1;a3&&void 0!==arguments[3]?arguments[3]:[];r([l,e,t,n],o)},m=function(e,t,n){if(!t)throw new Error("eventName is required");if("string"!=typeof t)throw new Error("eventName should be string");r([c,e,t,n])};return self.addEventListener("message",function(e){var t=e.data;Array.isArray(t)?function(e,t,r){var n=function(t){t&&t instanceof b?d(e,p,t.payload,t.transferable):d(e,p,t)},o=function(t){d(e,s,{message:t.message,stack:t.stack})};try{var i=h(e,t,r);v(i)?i.then(n).catch(o):n(i)}catch(e){o(e)}}.apply(void 0,a(t)):t&&t.eventName&&i.emitLocally.apply(i,[t.eventName].concat(a(t.args)))}),i},e.exports.TransferableResponse=b},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n);o()(function(e,t){var r=e.array,n=e.min,i=e.max,a=e.component||0,u=e.numberOfComponents||1,f=e.numberOfBins,l=i-n,c=new Float32Array(f);c.fill(0);for(var s=r.length,p=a;p1?t-1:0),n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:256,n=[];n.lengtho+s||do+l?f===l?o:o+f/(f-l)*(d-o-l):-f===l?o:o-f/(f+l)*(d-o-l))-o)/f,g=Math.exp(-4*p*p),m=1-p*p,v=i*(u<1?u*m+(1-u)*g:(2-u)*m+1*(u-1));v>n[c]&&(n[c]=v)}}return n}function TT(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{lineWidth:1,strokeStyle:"#000"},a=t[3],o=t[2]/(n.length-1),i=!!r.fillStyle,s=a+t[1];e.lineWidth=r.lineWidth,e.strokeStyle=r.strokeStyle,e.beginPath(),e.moveTo(t[0],t[1]+t[3]);for(var l=0;l3&&void 0!==arguments[3]?arguments[3]:[0,1];return[r[0]+(e-n[0])/n[2]*(r[1]-r[0]),(t-n[1])/n[3]]}function ST(e,t){var n=t.map(function(t){return Math.abs(t.position-e)}),r=Math.min.apply(Math,fT(n));return n.indexOf(r)}function PT(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(n){var r=n.offsetX,a=n.offsetY;t&&n.preventDefault(),e(r,a)}}function wT(){hT.filter(function(e){return e.ready}).forEach(function(e){e.callbacks.forEach(function(t){t.touches===e.touches&&t.clicks===e.count&&t.action.apply(t,fT(e.singleTouche))}),e.ts=0,e.count=0,e.touches=0,e.ready=!1})}function xT(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return function(a){var o=a.target.getBoundingClientRect(),i=Array.prototype.map.call(a.touches,function(e){return[e.pageX-o.left,e.pageY-o.top]}).reduce(function(e,t){return[e[0]+t[0],e[1]+t[1]]},[0,0]).map(function(e){return e/a.touches.length});"touchstart"===a.type?(clearTimeout(hT[e].timeout),hT[e].ts=a.timeStamp,hT[e].singleTouche=i,hT[e].touches=a.touches.length):"touchmove"===a.type?(hT[e].ts=0,hT[e].count=0,hT[e].ready=!1):"touchend"===a.type&&(a.timeStamp-hT[e].ts1&&void 0!==arguments[1]?arguments[1]:{},a=r.numberOfBinToConsiders,o=void 0===a?1:a,i=r.numberOfBinsToSkip,s=void 0===i?1:i,l=r.numberOfComponents,u=void 0===l?1:l,c=r.component,d=void 0===c?0:c;t.histogram=null,t.histogramArray=n,t.dataRange=zr(n,d,u);var f=lT(t.dataRange,2),p=f[0],g=f[1],m=Math.floor(n.length/4)||1;m+=m%u;for(var v=0,h=[],y=[];vr;)a.shift();for(var l=a.reduce(function(e,t){return e+t},0)/r,u=0,c=t.histogram.length;u1){for(var s=t.style.iconSize+t.style.padding,l=s,u=0;r>l;)u+=1,l+=s;switch(u){case 0:var c=e.addGaussian(0,1,.1,0,0),d=t.gaussians[c],f=cT({},d),p=yT.adjustPosition;t.activeGaussian=c,t.selectedGaussian=c,ur.a.setImmediate(function(){e.onDown(n,r),t.dragAction={originalXY:[0,0],action:p,gaussian:d,originalGaussian:f}});break;case 1:-1!==t.selectedGaussian&&e.removeGaussian(t.selectedGaussian);break;default:t.selectedGaussian=-1,t.dragAction=null}}else if(o<0||o>1||i<0||i>1)t.selectedGaussian=-1,t.dragAction=null;else{var g=ST(o,t.gaussians);g!==t.selectedGaussian&&(t.selectedGaussian=g,e.modified())}return!0},e.onHover=function(n,r){var a=20/t.canvas.height,o=lT(CT(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),i=o[0],s=o[1],l=lT(CT(n,r,t.graphArea),1)[0],u=i<0?t.selectedGaussian:ST(i,t.gaussians);t.canvas.style.cursor="default";var c=t.gaussians[u];if(t.enableRangeZoom&&l>=0&&rt.rangeZoom[1]-d?t.canvas.style.cursor=vT.adjustZoom:t.canvas.style.cursor=vT.adjustPosition,t.dragAction={rangeZoom:t.rangeZoom,action:yT.adjustZoom}}else if(c&&l>=0){var f=1-s,p=null;p=f>c.height+a?"adjustPosition":f>c.height-a?Math.abs(i-c.position).5*c.height+a?"adjustPosition":f>.5*c.height-a?Math.abs(i-c.position)a?"adjustPosition":"adjustWidth",t.canvas.style.cursor=vT[p];var g=yT[p],m=cT({},c);t.dragAction={originalXY:[i,s],action:g,gaussian:c,originalGaussian:m}}return u!==t.activeGaussian&&(t.activeGaussian=u,e.modified()),!0},e.onDown=function(n,r){t.mouseIsDown||e.invokeAnimation(!0),t.mouseIsDown=!0;var a=CT(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],o=ST(a,t.gaussians);t.gaussianSide=0;var i=t.gaussians[o];return i&&(t.gaussianSide=i.position-a),o!==t.selectedGaussian&&a>0&&(t.selectedGaussian=o,e.modified()),!0},e.onDrag=function(n,r){if(t.dragAction){var a=lT(CT(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),o=a[0],i=a[1];(0,t.dragAction.action)(o,i,cT({gaussianSide:t.gaussianSide,model:t,publicAPI:e},t.dragAction))&&(t.opacities=bT(t.gaussians,t.piecewiseSize),e.invokeOpacityChange(e,!0)),e.modified()}return!0},e.onUp=function(n,r){return t.mouseIsDown&&e.invokeAnimation(!1),t.mouseIsDown=!1,!0},e.onLeave=function(n,r){return e.onUp(n,r),t.canvas.style.cursor="default",t.activeGaussian=-1,e.modified(),!0},e.onAddGaussian=function(n,r){var a=lT(CT(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null),2),o=a[0],i=a[1];return o>=0&&e.addGaussian(o,1-i,.1,0,0),!0},e.onRemoveGaussian=function(n,r){var a=CT(n,r,t.graphArea,t.enableRangeZoom?t.rangeZoom:null)[0],o=ST(a,t.gaussians);return a>=0&&-1!==o&&e.removeGaussian(o),!0},e.bindMouseListeners=function(){if(!t.listeners){var n=function(){return!!t.mouseIsDown},r=function(){for(var e=hT.length,t=arguments.length,n=new Array(t),r=0;r1){var l=Math.round(t.style.iconSize/2-t.style.strokeWidth),u=Math.round(l+o+t.style.strokeWidth);e.beginPath(),e.lineWidth=t.style.buttonStrokeWidth,e.strokeStyle=t.style.buttonStrokeColor,e.arc(u-o/2,u,l,0,2*Math.PI,!1),e.fillStyle=t.style.buttonFillColor,e.fill(),e.stroke(),e.moveTo(u-l+t.style.strokeWidth+2-o/2,u),e.lineTo(u+l-t.style.strokeWidth-2-o/2,u),e.stroke(),e.moveTo(u-o/2,u-l+t.style.strokeWidth+2),e.lineTo(u-o/2,u+l-t.style.strokeWidth-2),e.stroke(),-1===t.selectedGaussian?(e.fillStyle=t.style.buttonDisableFillColor,e.lineWidth=t.style.buttonDisableStrokeWidth,e.strokeStyle=t.style.buttonDisableStrokeColor):(e.fillStyle=t.style.buttonFillColor,e.lineWidth=t.style.buttonStrokeWidth,e.strokeStyle=t.style.buttonStrokeColor),e.beginPath(),e.arc(u-o/2,u+o/2+t.style.iconSize,l,0,2*Math.PI,!1),e.fill(),e.stroke(),e.moveTo(u-l+t.style.strokeWidth+2-o/2,u+o/2+t.style.iconSize),e.lineTo(u+l-t.style.strokeWidth-2-o/2,u+o/2+t.style.iconSize),e.stroke()}if(t.histogram&&TT(e,i,MT(t.histogram,t.rangeZoom),{lineWidth:1,strokeStyle:t.style.histogramColor,fillStyle:t.style.histogramColor}),TT(e,i,MT(t.opacities,t.enableRangeZoom&&t.rangeZoom),{lineWidth:t.style.strokeWidth,strokeStyle:t.style.strokeColor}),t.colorTransferFunction&&t.colorTransferFunction.getSize()){var c=t.dataRange||t.colorTransferFunction.getMappingRange();t.colorCanvas&&t.colorCanvasMTime===t.colorTransferFunction.getMTime()||(t.colorCanvasMTime=t.colorTransferFunction.getMTime(),t.colorCanvas=function(e,t,n,r){var a=r||document.createElement("canvas");a.setAttribute("width",t),a.setAttribute("height",256);for(var o=a.getContext("2d"),i=e.getUint8Table(n[0],n[1],t,4),s=o.getImageData(0,0,t,256),l=0;l<256;l++)s.data.set(i,4*l*t);for(var u=256*t*4,c=4*t,d=3;d0&&(a=Math.min(a,i)),t.opacities[i]>0&&(o=Math.max(o,i));return[n[0]+a*r,n[0]+o*r]};var n=e.setEnableRangeZoom;e.setEnableRangeZoom=function(e){var r=n(e);return r&&(t.colorCanvasMTime=0,t.rangeZoom=[0,1]),r};var r=e.setRangeZoom;e.setRangeZoom=function(){var e=r.apply(void 0,arguments);return e&&(t.colorCanvasMTime=0),e},e.onModified(function(){return e.render()}),e.setSize.apply(e,fT(t.size))}var RT={histogram:[],numberOfBins:256,histogramArray:null,dataRange:[0,1],gaussians:[],opacities:[],size:[600,300],piecewiseSize:256,colorCanvasMTime:0,gaussianMinimumHeight:.05,style:{backgroundColor:"rgba(255, 255, 255, 1)",histogramColor:"rgba(200, 200, 200, 0.5)",strokeColor:"rgb(0, 0, 0)",activeColor:"rgb(0, 0, 150)",buttonDisableFillColor:"rgba(255, 255, 255, 0.5)",buttonDisableStrokeColor:"rgba(0, 0, 0, 0.5)",buttonStrokeColor:"rgba(0, 0, 0, 1)",buttonFillColor:"rgba(255, 255, 255, 1)",handleColor:"rgb(0, 150, 0)",strokeWidth:2,activeStrokeWidth:3,buttonStrokeWidth:1.5,handleWidth:3,iconSize:20,padding:10,zoomControlHeight:10,zoomControlColor:"#999"},activeGaussian:-1,selectedGaussian:-1,enableRangeZoom:!0,rangeZoom:[0,1]};function ET(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,RT,n),ur.a.obj(e,t),ur.a.setGet(e,t,["piecewiseSize","numberOfBins","colorTransferFunction","backgroundImage","enableRangeZoom","gaussianMinimumHeight"]),ur.a.setGetArray(e,t,["rangeZoom"],2),ur.a.get(e,t,["size","canvas","gaussians"]),ur.a.event(e,t,"opacityChange"),ur.a.event(e,t,"animation"),ur.a.event(e,t,"zoomChange"),IT(e,t)}var DT=cT({newInstance:ur.a.newInstance(ET,"vtkPiecewiseGaussianWidget"),extend:ET},AT);var VT={center:[0,0,0],rotationFactor:1,displayCenter:[0,0]};var LT={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,VT,n),ur.a.setGet(e,t,["rotationFactor"]),ur.a.setGetArray(e,t,["displayCenter"],2),ur.a.setGetArray(e,t,["center"],3),function(e,t){t.classHierarchy.push("vtkCompositeCameraManipulator"),e.computeDisplayCenter=function(e,n){var r=e.computeWorldToDisplay(n,t.center[0],t.center[1],t.center[2]);t.displayCenter[0]=r[0],t.displayCenter[1]=r[1]}}(e,t)}};var NT={button:1,shift:!1,control:!1,alt:!1,dragEnabled:!0,scrollEnabled:!1};var BT={extend:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,NT,n),ur.a.setGet(e,t,["button","shift","control","alt"]),ur.a.set(e,t,["dragEnabled","scrollEnabled"]),function(e,t){t.classHierarchy.push("vtkCompositeMouseManipulator"),e.startInteraction=function(){},e.endInteraction=function(){},e.onButtonDown=function(e,t,n){},e.onButtonUp=function(e){},e.onMouseMove=function(e,t,n){},e.onStartScroll=function(e,t,n){},e.onScroll=function(e,t,n){},e.onEndScroll=function(e){},e.isDragEnabled=function(){return t.dragEnabled},e.isScrollEnabled=function(){return t.scrollEnabled}}(e,t)}};var kT={};function FT(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kT,n),ur.a.obj(e,t),BT.extend(e,t,n),LT.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkMouseCameraTrackballRotateManipulator");var n=new Float64Array(3),r=new Float64Array(3),a=new Float64Array(3),s=new Float64Array(16),l=new Float64Array(3),u=new Float64Array(3),c=new Float64Array(3);e.onButtonDown=function(e,n,r){t.previousPosition=r},e.onMouseMove=function(e,d,f){if(f){var p=d.getActiveCamera(),g=p.getPosition(),m=p.getFocalPoint();o.identity(s);var v=t.center,h=t.rotationFactor;o.translate(s,s,v);var y=t.previousPosition.x-f.x,b=t.previousPosition.y-f.y,T=e.getView().getSize(),C=p.getViewUp();o.rotate(s,s,kr(360*y/T[0]*h),C),ta(p.getDirectionOfProjection(),C,l),o.rotate(s,s,kr(-360*b/T[1]*h),l),u[0]=-v[0],u[1]=-v[1],u[2]=-v[2],o.translate(s,s,u),i.transformMat4(n,g,s),i.transformMat4(r,m,s),c[0]=C[0]+g[0],c[1]=C[1]+g[1],c[2]=C[2]+g[2],i.transformMat4(a,c,s),p.setPosition(n[0],n[1],n[2]),p.setFocalPoint(r[0],r[1],r[2]),p.setViewUp(a[0]-n[0],a[1]-n[1],a[2]-n[2]),p.orthogonalizeViewUp(),d.resetCameraClippingRange(),e.getLightFollowCamera()&&d.updateLightsGeometryToFollowCamera(),t.previousPosition=f}}}(e,t)}var GT={newInstance:ur.a.newInstance(FT,"vtkMouseCameraTrackballRotateManipulator"),extend:FT};var _T={};function UT(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_T,n),ur.a.obj(e,t),LT.extend(e,t,n),BT.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkMouseCameraTrackballPanManipulator"),e.onButtonDown=function(e,n,r){t.previousPosition=r},e.onMouseMove=function(e,n,r){if(r){var a=r,o=t.previousPosition;t.previousPosition=r;var i=n.getActiveCamera(),s=i.getPosition(),l=i.getFocalPoint();if(i.getParallelProjection()){i.orthogonalizeViewUp();var u=i.getViewUp(),c=[0,0,0];ta(i.getViewPlaneNormal(),u,c);var d=e.getView().getSize()[1],f=(a.x-o.x)/d,p=(o.y-a.y)/d,g=i.getParallelScale();p*=2*g;var m=c[0]*(f*=2*g)+u[0]*p;s[0]+=m,l[0]+=m,m=c[1]*f+u[1]*p,s[1]+=m,l[1]+=m,m=c[2]*f+u[2]*p,s[2]+=m,l[2]+=m,i.setPosition(s[0],s[1],s[2]),i.setFocalPoint(l[0],l[1],l[2])}else{var v=t.center,h=e.getInteractorStyle(),y=h.computeWorldToDisplay(n,v[0],v[1],v[2])[2],b=h.computeDisplayToWorld(n,a.x,a.y,y),T=h.computeDisplayToWorld(n,o.x,o.y,y),C=[s[0]+(T[0]-b[0]),s[1]+(T[1]-b[1]),s[2]+(T[2]-b[2])],S=[l[0]+(T[0]-b[0]),l[1]+(T[1]-b[1]),l[2]+(T[2]-b[2])];i.setPosition(C[0],C[1],C[2]),i.setFocalPoint(S[0],S[1],S[2])}n.resetCameraClippingRange(),e.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera()}}}(e,t)}var jT={newInstance:ur.a.newInstance(UT,"vtkMouseCameraTrackballPanManipulator"),extend:UT};var WT={zoomScale:0,flipDirection:!1};function zT(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,WT,n),ur.a.obj(e,t),BT.extend(e,t,n),LT.extend(e,t,n),ur.a.setGet(e,t,["flipDirection"]),function(e,t){t.classHierarchy.push("vtkMouseCameraTrackballZoomManipulator"),e.onButtonDown=function(e,n,r){t.previousPosition=r;var a=e.getView().getSize(),o=n.getActiveCamera(),i=t.flipDirection?-1:1;if(o.getParallelProjection())t.zoomScale=1.5/a[1]*i;else{var s=o.getClippingRange();t.zoomScale=s[1]/a[1]*1.5*i}},e.onMouseMove=function(e,n,r){if(r){var a=t.previousPosition.y-r.y,o=n.getActiveCamera();if(o.getParallelProjection()){var i=a*t.zoomScale;o.setParallelScale((1-i)*o.getParallelScale())}else{var s=o.getPosition(),l=o.getFocalPoint(),u=o.getDirectionOfProjection(),c=a*t.zoomScale,d=c*u[0];s[0]+=d,l[0]+=d,d=c*u[1],s[1]+=d,l[1]+=d,d=c*u[2],s[2]+=d,l[2]+=d,o.getFreezeFocalPoint()||o.setFocalPoint(l[0],l[1],l[2]),o.setPosition(s[0],s[1],s[2]),n.resetCameraClippingRange()}e.getLightFollowCamera()&&n.updateLightsGeometryToFollowCamera(),t.previousPosition=r}},e.onScroll=function(e,t,n){if(n){var r=t.getActiveCamera(),a=1-n/10;r.getParallelProjection()?r.setParallelScale(r.getParallelScale()/a):(r.dolly(a),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}}(e,t)}var HT={newInstance:ur.a.newInstance(zT,"vtkMouseCameraTrackballZoomManipulator"),extend:zT};var KT={horizontalListener:null,verticalListener:null,scrollListener:null};function XT(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,KT,n),ur.a.obj(e,t),BT.extend(e,t,n),function(e,t){t.classHierarchy.push("vtkMouseRangeManipulator");var n=new Map;function r(e,t){return t*((e.max-e.min)/(e.step+1))}function a(e,t){var r=e.getValue(),a=t*e.scale+n.get(e),o=r+a,i=o-e.min,s=Math.round(i/e.step);o=e.min+e.step*s,o=Math.max(o,e.min),(o=Math.min(o,e.max))!==r?(e.setValue(o),n.set(e,0)):o===e.min&&a<0||o===e.max&&a>0?n.set(e,0):n.set(e,a)}e.setHorizontalListener=function(r,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,u=Number.isFinite(i)?function(){return i}:i;t.horizontalListener={min:r,max:a,step:o,getValue:u,setValue:s,scale:l},n.set(t.horizontalListener,0),e.modified()},e.setVerticalListener=function(r,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,u=Number.isFinite(i)?function(){return i}:i;t.verticalListener={min:r,max:a,step:o,getValue:u,setValue:s,scale:l},n.set(t.verticalListener,0),e.modified()},e.setScrollListener=function(r,a,o,i,s){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,u=Number.isFinite(i)?function(){return i}:i;t.scrollListener={min:r,max:a,step:o,getValue:u,setValue:s,scale:l},n.set(t.scrollListener,0),e.modified()},e.removeHorizontalListener=function(){t.verticalListener&&(n.delete(t.verticalListener),delete t.verticalListener,e.modified())},e.removeVerticalListener=function(){t.horizontalListener&&(n.delete(t.horizontalListener),delete t.horizontalListener,e.modified())},e.removeScrollListener=function(){t.scrollListener&&(n.delete(t.scrollListener),delete t.scrollListener,e.modified())},e.removeAllListeners=function(){e.removeHorizontalListener(),e.removeVerticalListener(),e.removeScrollListener()},e.onButtonDown=function(e,n,r){t.previousPosition=r;var a=e.getView(),o=a.getContainerSize()[0]/a.getSize()[0],i=a.getViewportSize(n);t.containerSize=i.map(function(e){return e*o})},e.onMouseMove=function(e,n,o){if((t.verticalListener||t.horizontalListener)&&o){if(t.horizontalListener){var i=(o.x-t.previousPosition.x)/t.containerSize[0],s=r(t.horizontalListener,i);a(t.horizontalListener,s)}if(t.verticalListener){var l=(o.y-t.previousPosition.y)/t.containerSize[1],u=r(t.verticalListener,l);a(t.verticalListener,u)}t.previousPosition=o}},e.onScroll=function(e,n,r){t.scrollListener&&r&&a(t.scrollListener,r*t.scrollListener.step)},e.onStartScroll=e.onScroll}(e,t)}var qT={newInstance:ur.a.newInstance(XT,"vtkMouseRangeManipulator"),extend:XT};function YT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZT(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var QT=ur.a.vtkDebugMacro,$T=Qg.States,JT={type:"StartInteractionEvent"},eC={type:"InteractionEvent"},tC={type:"EndInteractionEvent"};function nC(e,t,n,r,a,o){var i=e.getActiveCamera(),s=i.getFocalPoint(),l=(s=t.getInteractorStyle().computeWorldToDisplay(e,s[0],s[1],s[2]))[2],u=t.getInteractorStyle().computeDisplayToWorld(e,n,r,l),c=t.getInteractorStyle().computeDisplayToWorld(e,a,o,l),d=[c[0]-u[0],c[1]-u[1],c[2]-u[2]];s=i.getFocalPoint();var f=i.getPosition();i.setFocalPoint(d[0]+s[0],d[1]+s[1],d[2]+s[2]),i.setPosition(d[0]+f[0],d[1]+f[1],d[2]+f[2])}var rC={dollyToPosition:function(e,t,n,r){var a=n.getActiveCamera();if(a.getParallelProjection()){var o=r.getView().getSize(),i=o[0]/2,s=o[1]/2,l=t.x,u=t.y;nC(n,r,i,s,l,u),a.setParallelScale(a.getParallelScale()/e),nC(n,r,l,u,i,s)}else{var c=a.getFocalPoint(),d=a.getViewPlaneNormal();c=r.getInteractorStyle().computeWorldToDisplay(n,c[0],c[1],c[2]);var f=r.getInteractorStyle().computeDisplayToWorld(n,t.x,t.y,c[2]);a.setFocalPoint(f[0],f[1],f[2]),a.dolly(e),n.resetCameraClippingRange();var p=a.getPosition();c=a.getFocalPoint();var g=[0,0,0],m=d[0]*(c[0]-p[0])+d[1]*(c[1]-p[1])+d[2]*(c[2]-p[2]);m/=Math.pow(d[0],2)+Math.pow(d[1],2)+Math.pow(d[2],2),g[0]=p[0]+d[0]*m,g[1]=p[1]+d[1]*m,g[2]=p[2]+d[2]*m,a.setFocalPoint(g[0],g[1],g[2]),n.resetCameraClippingRange()}},translateCamera:nC,dollyByFactor:function(e,t,n){if(!Number.isNaN(n)){var r=t.getActiveCamera();r.getParallelProjection()?r.setParallelScale(r.getParallelScale()/n):(r.dolly(n),t.resetCameraClippingRange()),e.getLightFollowCamera()&&t.updateLightsGeometryToFollowCamera()}}};var aC={cachedMousePosition:null,currentManipulator:null,currentWheelManipulator:null,centerOfRotation:[0,0,0],rotationFactor:1};function oC(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,aC,n),Qg.extend(e,t,n),ur.a.setGet(e,t,["rotationFactor"]),ur.a.get(e,t,["mouseManipulators","keyboardManipulators","vrManipulators","gestureManipulators"]),ur.a.setGetArray(e,t,["centerOfRotation"],3),function(e,t){t.classHierarchy.push("vtkInteractorStyleManipulator"),t.mouseManipulators=[],t.keyboardManipulators=[],t.vrManipulators=[],t.gestureManipulators=[],t.currentManipulator=null,t.currentWheelManipulator=null,t.centerOfRotation=[0,0,0],t.rotationFactor=1,e.removeAllManipulators=function(){e.removeAllMouseManipulators(),e.removeAllKeyboardManipulators(),e.removeAllVRManipulators(),e.removeAllGestureManipulators()},e.removeAllMouseManipulators=function(){t.mouseManipulators=[]},e.removeAllKeyboardManipulators=function(){t.keyboardManipulators=[]},e.removeAllVRManipulators=function(){t.vrManipulators=[]},e.removeAllGestureManipulators=function(){t.gestureManipulators=[]};var n=function(t,n){var r=n.indexOf(t);return-1!==r&&(n.splice(r,1),e.modified(),!0)};e.removeMouseManipulator=function(e){return n(e,t.mouseManipulators)},e.removeKeyboardManipulator=function(e){return n(e,t.keyboardManipulators)},e.removeVRManipulator=function(e){return n(e,t.vrManipulators)},e.removeGestureManipulator=function(e){return n(e,t.gestureManipulators)};var r=function(t,n){return-1===n.indexOf(t)&&(n.push(t),e.modified(),!0)};e.addMouseManipulator=function(e){return r(e,t.mouseManipulators)},e.addKeyboardManipulator=function(e){return r(e,t.keyboardManipulators)},e.addVRManipulator=function(e){return r(e,t.vrManipulators)},e.addGestureManipulator=function(e){return r(e,t.gestureManipulators)},e.getNumberOfMouseManipulators=function(){return t.mouseManipulators.length},e.getNumberOfKeyboardManipulators=function(){return t.keyboardManipulators.length},e.getNumberOfVRManipulators=function(){return t.vrManipulators.length},e.getNumberOfGestureManipulators=function(){return t.gestureManipulators.length},e.resetCurrentManipulator=function(){t.currentManipulator=null,t.currentWheelManipulator=null},e.handleLeftButtonPress=function(n){t.previousPosition=n.position,e.onButtonDown(1,n)},e.handleMiddleButtonPress=function(n){t.previousPosition=n.position,e.onButtonDown(2,n)},e.handleRightButtonPress=function(n){t.previousPosition=n.position,e.onButtonDown(3,n)},e.handleButton3D=function(n){n&&(t.currentManipulator=e.findVRManipulator(n.device,n.input,n.pressed),t.currentManipulator?(t.currentManipulator.onButton3D(e,n.pokedRenderer,t.state,n.device,n.input,n.pressed),n.pressed?e.startCameraPose():e.endCameraPose()):QT("No manipulator found"))},e.handleMove3D=function(n){t.currentManipulator&&t.state===$T.IS_CAMERA_POSE&&t.currentManipulator.onMove3D(e,n.pokedRenderer,t.state,n)},e.onButtonDown=function(n,r){t.currentManipulator||(t.currentManipulator=e.findMouseManipulator(n,r.shiftKey,r.controlKey,r.altKey),t.currentManipulator?(t.currentManipulator.setCenter&&t.currentManipulator.setCenter(t.centerOfRotation),t.currentManipulator.setRotationFactor&&t.currentManipulator.setRotationFactor(t.rotationFactor),t.currentManipulator.startInteraction(),t.currentManipulator.onButtonDown(t.interactor,r.pokedRenderer,r.position),t.interactor.requestAnimation(e.onButtonDown),e.invokeStartInteractionEvent(JT)):QT("No manipulator found"))},e.findMouseManipulator=function(e,n,r,a){for(var o=null,i=t.mouseManipulators.length;i--;){var s=t.mouseManipulators[i];s&&s.getButton()===e&&s.getShift()===n&&s.getControl()===r&&s.getAlt()===a&&s.isDragEnabled()&&(o=s)}return o},e.findVRManipulator=function(e,n){for(var r=null,a=t.vrManipulators.length;a--;){var o=t.vrManipulators[a];o&&o.getDevice()===e&&o.getInput()===n&&(r=o)}return r},e.handleLeftButtonRelease=function(){e.onButtonUp(1)},e.handleMiddleButtonRelease=function(){e.onButtonUp(2)},e.handleRightButtonRelease=function(){e.onButtonUp(3)},e.onButtonUp=function(n){t.currentManipulator&&t.currentManipulator.getButton&&t.currentManipulator.getButton()===n&&(t.currentManipulator.onButtonUp(t.interactor),t.currentManipulator.endInteraction(),t.currentManipulator=null,t.interactor.cancelAnimation(e.onButtonDown),e.invokeEndInteractionEvent(tC))},e.handleStartMouseWheel=function(n){if(!t.currentWheelManipulator){for(var r=null,a=t.mouseManipulators.length;a--;){var o=t.mouseManipulators[a];o&&o.isScrollEnabled()&&o.getShift()===n.shiftKey&&o.getControl()===n.controlKey&&o.getAlt()===n.altKey&&(r=o)}r?(t.currentWheelManipulator=r,t.currentWheelManipulator.onStartScroll(t.interactor,n.pokedRenderer,n.spinY),t.currentWheelManipulator.startInteraction(),t.interactor.requestAnimation(e.handleStartMouseWheel),e.invokeStartInteractionEvent(JT)):QT("No manipulator found")}},e.handleEndMouseWheel=function(){t.currentWheelManipulator&&t.currentWheelManipulator.onEndScroll&&(t.currentWheelManipulator.onEndScroll(t.interactor),t.currentWheelManipulator.endInteraction(),t.currentWheelManipulator=null,t.interactor.cancelAnimation(e.handleStartMouseWheel),e.invokeEndInteractionEvent(tC))},e.handleMouseWheel=function(n){t.currentWheelManipulator&&t.currentWheelManipulator.onScroll&&(t.currentWheelManipulator.onScroll(t.interactor,n.pokedRenderer,n.spinY,t.cachedMousePosition),e.invokeInteractionEvent(eC))},e.handleMouseMove=function(n){t.cachedMousePosition=n.position,t.currentManipulator&&t.currentManipulator.onMouseMove&&(t.currentManipulator.onMouseMove(t.interactor,n.pokedRenderer,n.position),e.invokeInteractionEvent(eC))},e.handleKeyPress=function(n){t.keyboardManipulators.filter(function(e){return e.onKeyPress}).forEach(function(r){r.onKeyPress(t.interactor,n.pokedRenderer,n.key),e.invokeInteractionEvent(eC)})},e.handleKeyDown=function(n){t.keyboardManipulators.filter(function(e){return e.onKeyDown}).forEach(function(r){r.onKeyDown(t.interactor,n.pokedRenderer,n.key),e.invokeInteractionEvent(eC)})},e.handleKeyUp=function(n){t.keyboardManipulators.filter(function(e){return e.onKeyUp}).forEach(function(r){r.onKeyUp(t.interactor,n.pokedRenderer,n.key),e.invokeInteractionEvent(eC)})},e.handleStartPinch=function(n){e.startDolly();for(var r=t.gestureManipulators.length;r--;){var a=t.gestureManipulators[r];a&&a.isPinchEnabled()&&(a.onStartPinch(t.interactor,n.scale),a.startInteraction())}t.interactor.requestAnimation(e.handleStartPinch),e.invokeStartInteractionEvent(JT)},e.handleEndPinch=function(){e.endDolly();for(var n=t.gestureManipulators.length;n--;){var r=t.gestureManipulators[n];r&&r.isPinchEnabled()&&(r.onEndPinch(t.interactor),r.endInteraction())}t.interactor.cancelAnimation(e.handleStartPinch),e.invokeEndInteractionEvent(tC)},e.handleStartRotate=function(n){e.startRotate();for(var r=t.gestureManipulators.length;r--;){var a=t.gestureManipulators[r];a&&a.isRotateEnabled()&&(a.onStartRotate(t.interactor,n.rotation),a.startInteraction())}t.interactor.requestAnimation(e.handleStartRotate),e.invokeStartInteractionEvent(JT)},e.handleEndRotate=function(){e.endRotate();for(var n=t.gestureManipulators.length;n--;){var r=t.gestureManipulators[n];r&&r.isRotateEnabled()&&(r.onEndRotate(t.interactor),r.endInteraction())}t.interactor.cancelAnimation(e.handleStartRotate),e.invokeEndInteractionEvent(tC)},e.handleStartPan=function(n){e.startPan();for(var r=t.gestureManipulators.length;r--;){var a=t.gestureManipulators[r];a&&a.isPanEnabled()&&(a.onStartPan(t.interactor,n.translation),a.startInteraction())}t.interactor.requestAnimation(e.handleStartPan),e.invokeStartInteractionEvent(JT)},e.handleEndPan=function(){e.endPan();for(var n=t.gestureManipulators.length;n--;){var r=t.gestureManipulators[n];r&&r.isPanEnabled()&&(r.onEndPan(t.interactor),r.endInteraction())}t.interactor.cancelAnimation(e.handleStartPan),e.invokeEndInteractionEvent(tC)},e.handlePinch=function(n){for(var r=t.gestureManipulators.length,a=0;r--;){var o=t.gestureManipulators[r];o&&o.isPinchEnabled()&&(o.onPinch(t.interactor,n.pokedRenderer,n.scale),a++)}a&&e.invokeInteractionEvent(eC)},e.handlePan=function(n){for(var r=t.gestureManipulators.length,a=0;r--;){var o=t.gestureManipulators[r];o&&o.isPanEnabled()&&(o.onPan(t.interactor,n.pokedRenderer,n.translation),a++)}a&&e.invokeInteractionEvent(eC)},e.handleRotate=function(n){for(var r=t.gestureManipulators.length,a=0;r--;){var o=t.gestureManipulators[r];o&&o.isRotateEnabled()&&(o.onRotate(t.interactor,n.pokedRenderer,n.rotation),a++)}a&&e.invokeInteractionEvent(eC)}}(e,t)}var iC=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sC,n),ur.a.obj(e,t),ur.a.get(e,t,["renderer"]),ur.a.getArray(e,t,["selectionPoint","pickPosition"]),ur.a.setGet(e,t,["pickFromList","pickList"]),function(e,t){t.classHierarchy.push("vtkAbstractPicker"),e.initialize=function(){t.renderer=null,t.selectionPoint[0]=0,t.selectionPoint[1]=0,t.selectionPoint[2]=0,t.pickPosition[0]=0,t.pickPosition[1]=0,t.pickPosition[2]=0},e.initializePickList=function(){t.pickList=[]},e.addPickList=function(e){t.pickList.push(e)},e.deletePickList=function(e){var n=t.pickList.indexOf(e);-1!==n&&t.pickList.splice(n,1)}}(e,t)}var uC={newInstance:ur.a.newInstance(lC,"vtkAbstractPicker"),extend:lC};function cC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var fC=ur.a.vtkErrorMacro,pC=ur.a.vtkWarningMacro;function gC(e,t){t.classHierarchy.push("vtkPicker");var n=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mC,n),uC.extend(e,t,n),ur.a.setGet(e,t,["tolerance"]),ur.a.setGetArray(e,t,["mapperPosition"],3),ur.a.get(e,t,["mapper","dataSet","actors","pickedPositions"]),ur.a.event(e,t,"pickChange"),gC(e,t)}var hC={newInstance:ur.a.newInstance(vC,"vtkPicker"),extend:vC},yC=ur.a.vtkErrorMacro;var bC={pointId:-1,pointIJK:[],useCells:!1};function TC(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bC,n),hC.extend(e,t,n),ur.a.getArray(e,t,["pointIJK"]),ur.a.get(e,t,["pointId"]),ur.a.setGet(e,t,["useCells"]),function(e,t){t.classHierarchy.push("vtkPointPicker"),e.intersectWithLine=function(n,r,a,o){var i=Number.MAX_VALUE;if(o.isA("vtkImageMapper")){var s=o.intersectWithLineForPointPicking(n,r);s&&(i=s.t,t.pointIJK=s.ijk)}else o.isA("vtkMapper")&&(i=e.intersectActorWithLine(n,r,a,o));return i},e.intersectActorWithLine=function(e,n,r,a){var o=a.getInputData(),i=0,s=o.getPoints().getNumberOfPoints();if(s<=i)return 2;for(var l=[],u=0;u<3;u++)l[u]=n[u]-e[u];var c,d=ea(l,l);if(0===d)return yC("Cannot process points"),2;var f=-1,p=Number.MAX_VALUE,g=Number.MAX_VALUE,m=[],v=[],h=[],y=o.getPoints();if(t.useCells)for(var b=o.getPolys().getData(),T=b[0],C=o.getPolys().getNumberOfCells(),S=0;S=0&&c<=1&&c<=p+t.tolerance){for(var M=0,A=0;A<3;A++){m[A]=e[A]+c*l[A];var I=Math.abs(h[A]-m[A]);I>M&&(M=I)}M<=r&&M=0&&c<=1&&c<=p+t.tolerance){for(var R=0,E=0;E<3;E++){m[E]=e[E]+c*l[E];var D=Math.abs(h[E]-m[E]);D>R&&(R=D)}R<=r&&Re.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,OC,n),t.normal=[0,0,1],t.center=[0,0,0],ur.a.obj(e,t),ur.a.setGet(e,t,["xResolution","yResolution"]),ur.a.setGetArray(e,t,["origin"],3),ur.a.getArray(e,t,["point1","point2","normal","center"],3),ur.a.algo(e,t,0,1),function(e,t){t.classHierarchy.push("vtkPlaneSource"),e.requestData=function(n,r){if(!t.deleted){var a=r[0],o=a?a.getPoints().getDataType():"Float32Array",i=ov.newInstance(),s=new Float32Array(3),l=new Float32Array(3);if(Qr(t.point1,t.origin,s),Qr(t.point2,t.origin,l),e.updatePlane(s,l)){var u=t.xResolution,c=t.yResolution,d=(u+1)*(c+1),f=u*c,p=ur.a.newTypedArray(o,3*d);i.getPoints().setData(p,3);var g=new Uint32Array(5*f);i.getPolys().setData(g,1);var m=new Float32Array(3*d),v=vo.newInstance({numberOfComponents:3,values:m,name:"Normals"});i.getPointData().setNormals(v);var h=new Float32Array(2*d),y=vo.newInstance({numberOfComponents:2,values:h,name:"TextureCoordinates"});i.getPointData().setTCoords(y);for(var b=new Float32Array(2),T=0,C=0;C2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,LC,n),ur.a.obj(e,t),ur.a.set(e,t,["property"]),ur.a.get(e,t,["value"]),ur.a.setGet(e,t,["coordinateSystem","referenceCoordinate","renderer"]),ur.a.getArray(e,t,["value"],3),function(e,t){t.classHierarchy.push("vtkCoordinate"),e.setValue=function(){if(t.deleted)return VC("instance deleted - cannot call any method"),!1;for(var n=arguments.length,r=new Array(n),a=0;a2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,WC,n),ur.a.obj(e,t),!t.componentData){t.componentData=[];for(var r=0;r(e=t.componentData[r].grayTransferFunction.getMTime())?n:e):3===t.componentData[r].colorChannels&&t.componentData[r].rGBTransferFunction&&(n=n>(e=t.componentData[r].rGBTransferFunction.getMTime())?n:e),t.componentData[r].scalarOpacity&&(n=n>(e=t.componentData[r].scalarOpacity.getMTime())?n:e),t.componentData[r].gradientOpacity&&(t.componentData[r].disableGradientOpacity||(n=n>(e=t.componentData[r].gradientOpacity.getMTime())?n:e));return n},e.getColorChannels=function(e){return e<0||e>3?(UC("Bad index - must be between 0 and 3"),0):t.componentData[e].colorChannels},e.setGrayTransferFunction=function(n,r){var a=!1;return t.componentData[n].grayTransferFunction!==r&&(t.componentData[n].grayTransferFunction=r,a=!0),1!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=1,a=!0),a&&e.modified(),a},e.getGrayTransferFunction=function(n){return null===t.componentData[n].grayTransferFunction&&(t.componentData[n].grayTransferFunction=Wv.newInstance(),t.componentData[n].grayTransferFunction.addPoint(0,0),t.componentData[n].grayTransferFunction.addPoint(1024,1),1!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=1),e.modified()),t.componentData[n].grayTransferFunction},e.setRGBTransferFunction=function(n,r){var a=!1;return t.componentData[n].rGBTransferFunction!==r&&(t.componentData[n].rGBTransferFunction=r,a=!0),3!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=3,a=!0),a&&e.modified(),a},e.getRGBTransferFunction=function(n){return null===t.componentData[n].rGBTransferFunction&&(t.componentData[n].rGBTransferFunction=Gv.newInstance(),t.componentData[n].rGBTransferFunction.addRGBPoint(0,0,0,0),t.componentData[n].rGBTransferFunction.addRGBPoint(1024,1,1,1),3!==t.componentData[n].colorChannels&&(t.componentData[n].colorChannels=3),e.modified()),t.componentData[n].rGBTransferFunction},e.setScalarOpacity=function(n,r){return t.componentData[n].scalarOpacity!==r&&(t.componentData[n].scalarOpacity=r,e.modified(),!0)},e.getScalarOpacity=function(n){return null===t.componentData[n].scalarOpacity&&(t.componentData[n].scalarOpacity=Wv.newInstance(),t.componentData[n].scalarOpacity.addPoint(0,1),t.componentData[n].scalarOpacity.addPoint(1024,1),e.modified()),t.componentData[n].scalarOpacity},e.setComponentWeight=function(n,r){if(n<0||n>=jC)return UC("Invalid index"),!1;var a=Math.min(1,Math.max(0,r));return t.componentData[n].componentWeight!==a&&(t.componentData[n].componentWeight=a,e.modified(),!0)},e.getComponentWeight=function(e){return e<0||e>=jC?(UC("Invalid index"),0):t.componentData[e].componentWeight},e.setInterpolationTypeToNearest=function(){return e.setInterpolationType(GC.NEAREST)},e.setInterpolationTypeToLinear=function(){return e.setInterpolationType(GC.LINEAR)},e.setInterpolationTypeToFastLinear=function(){return e.setInterpolationType(GC.FAST_LINEAR)},e.getInterpolationTypeAsString=function(){return ur.a.enumToString(GC,t.interpolationType)},["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach(function(n){var r=ur.a.capitalize(n);e["set".concat(r)]=function(r,a){return t.componentData[r]["".concat(n)]!==a&&(t.componentData[r]["".concat(n)]=a,e.modified(),!0)}}),["useGradientOpacity","scalarOpacityUnitDistance","gradientOpacityMinimumValue","gradientOpacityMinimumOpacity","gradientOpacityMaximumValue","gradientOpacityMaximumOpacity","opacityMode"].forEach(function(n){var r=ur.a.capitalize(n);e["get".concat(r)]=function(e){return t.componentData[e]["".concat(n)]}})}(e,t)}var HC=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,XC,n),fv.extend(e,t,n),t.boundsMTime={},ur.a.obj(t.boundsMTime),ur.a.set(e,t,["property"]),ur.a.setGet(e,t,["mapper"]),ur.a.getArray(e,t,["bounds"],6),function(e,t){t.classHierarchy.push("vtkVolume"),e.getVolumes=function(){return e},e.makeProperty=HC.newInstance,e.getProperty=function(){return null===t.property&&(t.property=e.makeProperty()),t.property},e.getBounds=function(){if(null===t.mapper)return t.bounds;var n=t.mapper.getBounds();if(!n||6!==n.length)return n;if(n[0]>n[1])return t.mapperBounds=n.concat(),t.bounds=[1,-1,1,-1,1,-1],t.boundsMTime.modified(),n;if(!t.mapperBounds||!function(e){return e[0].map(function(t,n){return e.map(function(e){return e[n]})})}([n,t.mapperBounds]).reduce(function(e,t){return e&&t[0]===t[1]},!0)||e.getMTime()>t.boundsMTime.getMTime()){KC("Recomputing bounds..."),t.mapperBounds=n.map(function(e){return e});var r=[];_u.getCorners(n,r),e.computeMatrix();var a=new Float64Array(16);o.transpose(a,t.matrix),r.forEach(function(e){return i.transformMat4(e,e,a)}),t.bounds[0]=t.bounds[2]=t.bounds[4]=Number.MAX_VALUE,t.bounds[1]=t.bounds[3]=t.bounds[5]=-Number.MAX_VALUE,t.bounds=t.bounds.map(function(e,t){return t%2==0?r.reduce(function(e,n){return e>n[t/2]?n[t/2]:e},e):r.reduce(function(e,n){return ee?n:e}return e},e.getRedrawMTime=function(){var e=t.mtime;if(null!==t.mapper){var n=t.mapper.getMTime();e=n>e?n:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),e=(n=t.mapper.getInput().getMTime())>e?n:e)}return e}}(e,t)}var YC={newInstance:ur.a.newInstance(qC,"vtkVolume"),extend:qC},ZC=Li.BlendMode;var QC={bounds:[1,-1,1,-1,1,-1],sampleDistance:1,imageSampleDistance:1,maximumSamplesPerRay:1e3,autoAdjustSampleDistances:!0,blendMode:ZC.COMPOSITE_BLEND,averageIPScalarRange:[-1e6,1e6]};function $C(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,QC,n),Bl.extend(e,t,n),ur.a.obj(e,t),ur.a.algo(e,t,1,0),ur.a.setGet(e,t,["sampleDistance","imageSampleDistance","maximumSamplesPerRay","autoAdjustSampleDistances","blendMode"]),ur.a.setGetArray(e,t,["averageIPScalarRange"],2),ur.a.event(e,t,"lightingActivated"),function(e,t){t.classHierarchy.push("vtkVolumeMapper"),e.getBounds=function(){var n=e.getInputData();return n?(t.static||e.update(),t.bounds=n.getBounds()):t.bounds=Ka(),t.bounds},e.update=function(){e.getInputData()},e.setBlendModeToComposite=function(){e.setBlendMode(ZC.COMPOSITE_BLEND)},e.setBlendModeToMaximumIntensity=function(){e.setBlendMode(ZC.MAXIMUM_INTENSITY_BLEND)},e.setBlendModeToMinimumIntensity=function(){e.setBlendMode(ZC.MINIMUM_INTENSITY_BLEND)},e.setBlendModeToAverageIntensity=function(){e.setBlendMode(ZC.AVERAGE_INTENSITY_BLEND)},e.getBlendModeAsString=function(){return ur.a.enumToString(ZC,t.blendMode)}}(e,t)}var JC={newInstance:ur.a.newInstance($C,"vtkVolumeMapper"),extend:$C};function eS(e,t){const n=[e.volume.cols,e.volume.rows,e.volume.imageIds.length];if(n[0]*n[1]*n[2]<1||n[1]<2||n[1]<2||n[2]<2)return;const r=bc.newInstance(),a=e.volume.imagePosition,o=e.volume.pixelSpacing.concat(e.volume.sliceThickness);r.setDimensions(n),r.setOrigin(a),r.setSpacing(o);const i=vo.newInstance({name:"Scalars",values:t,numberOfComponents:1});return r.getPointData().setScalars(i),r.modified(),r}let tS=!1;function nS(e,t,n){let r=[],a=0,o=function(){let t="knee"==e?24:364,n=[];for(let r=1;r{t.resetImageParsing(),t.readFiles(r,function(e,r){let a=e[_.keys(e)[0]];t.renderImage(a,"viewer"),n&&setTimeout(n,3e3,a)})})})}function rS(e){return e*Math.PI/180}const aS=(e,t,n)=>{try{let r=Jl.intersectWithPlane(e.position,e.normal,t.position,t.normal);if(r.intersection){const{l0:e,l1:t}=r,a=Jl.intersectWithLine(e,t,n.position,n.normal);if(a.intersection)return a.x}}catch(e){console.log("some issue calculating the plane intersection",e)}return NaN};function oS(e){const t=YC.newInstance(),n=JC.newInstance();n.setSampleDistance(1),t.setMapper(n),n.setInputData(e);const r=e.getPointData().getScalars().getRange();return t.getProperty().getRGBTransferFunction(0).setMappingRange(r[0],r[1]),t}const iS={Length:function(e,t,n){if(e.p1[0]&&e.p2[0]?(e.p1=t,e.p1_world=n,e.p2=[void 0,void 0],e.p2_world=[void 0,void 0],e.label=void 0):e.p1[0]?(e.p2=t,e.p2_world=n):(e.p1=t,e.p1_world=n),e.p1[0]&&e.p2[0]){let t=oa(e.p1_world,e.p2_world),n=Math.sqrt(t).toFixed(1);e.label=`${n} mm`}else e.label=""},Angle:function(e,t,n){if(e.p1[0]&&e.p2[0]&&e.p3[0]?(e.p1=t,e.p1_world=n,e.p2=e.p3=[void 0,void 0],e.p2_world=e.p3_world=[void 0,void 0],e.label=void 0):e.p1[0]&&e.p2[0]?(e.p3=t,e.p3_world=n):e.p1[0]?(e.p2=t,e.p2_world=n):(e.p1=t,e.p1_world=n),e.p1[0]&&e.p2[0]&&e.p3[0]){let t=new Array(3),n=new Array(3);Qr(e.p2_world,e.p3_world,t),Qr(e.p2_world,e.p1_world,n);let r=Fr(ia(t,n)).toFixed(1);e.label=`${r}°`}else e.label=""}};class sS{constructor(e){this.VERBOSE=!1,this.element=e,this.renderer=null,this.renderWindow=null,this._genericRenderWindow=null,this.actor=null,this._raysDistance=2.5,this._blurOnInteraction=null,this._rescaleLUT=!1,this.PGwidgetElement=null,this.PGwidget=null,this.gaussians=null,this._PGwidgetLoaded=!1,this._cropWidget=null,this.ww=.25,this.wl=.3,this.wwwl=[0,0],this._measurementState=null,this.initVR()}set wwwl(e){if(!this.actor)return;const t=this.actor.getMapper().getInputData().getPointData().getScalars().getRange();let n=e[0]/(t[1]-t[0]),r=(e[1]-t[0])/t[1];this.wl=r,this.ww=n,this.PGwidget&&this.updateWidget()}get wwwl(){const e=this.actor.getMapper().getInputData().getPointData().getScalars().getRange();return[rel_ww*(e[1]-e[0]),rel_wl*e[1]+e[0]]}set resolution(e){this._raysDistance=5/e,this.actor.getMapper().setSampleDistance(this._raysDistance),this.renderWindow.render()}get resolution(){return Math.round(5*this._raysDistance)}get presetsList(){return nT.rgbPresetNames}set widgetElement(e){this.PGwidgetElement=e;let t=e.offsetHeight?e.offsetHeight-5:100,n=e.offsetWidth?e.offsetWidth-5:300;this.PGwidget.setSize(n,t),this.PGwidget.setContainer(this.PGwidgetElement),this.PGwidget.render()}set rescaleLUT(e){let t;this._rescaleLUT=e,t=this._rescaleLUT&&this.PGwidget?this.PGwidget.getOpacityRange():this.actor.getMapper().getInputData().getPointData().getScalars().getRange(),this.ctfun.setMappingRange(...t),this.ctfun.updateRange()}set cropWidget(e){this._cropWidget||this.setupCropWidget(),this._cropWidget.setVisibility(e),this._widgetManager.renderWidgets(),this.renderWindow.render()}set lut(e){const t=Gv.newInstance();let n;t.applyColorMap(nT.getPresetByName(e)),n=this._rescaleLUT&&this._PGwidgetLoaded?this.PGwidget.getOpacityRange():this.actor.getMapper().getInputData().getPointData().getScalars().getRange(),t.setMappingRange(...n),t.updateRange(),this.actor.getProperty().setRGBTransferFunction(0,t);const r=Wv.newInstance();this.actor.getProperty().setScalarOpacity(0,r),this.ctfun=t,this.ofun=r,this.updateWidget()}initVR(){const e=wv.newInstance();e.setContainer(this.element),e.setBackground([0,0,0]),e.onResize(()=>{let t=[e.getContainer().getBoundingClientRect().width,e.getContainer().getBoundingClientRect().height];e.getRenderWindow().getViews()[0].setSize(t),this.VERBOSE&&console.log("resize",t)}),window.addEventListener("resize",t=>{e.resize()}),e.resize(),this.renderer=e.getRenderer(),this.renderWindow=e.getRenderWindow(),this._genericRenderWindow=e,this.setupPGwidget()}setImage(e){this.renderer.removeAllVolumes();let t=oS(e);this.actor=t,this.lut="Grayscale",this.renderer.addVolume(t),this.setCamera(t.getCenter()),this.PGwidget&&(this.updateWidget(),this.setWidgetCallbacks()),this.setupInteractor(),this.blurOnInteraction=!0,this._genericRenderWindow.resize(),this.renderer.resetCamera(),this.renderWindow.render()}setCamera(e){this.renderer.resetCamera(),this.renderer.getActiveCamera().zoom(1.5),this.renderer.getActiveCamera().elevation(70),this.renderer.getActiveCamera().setViewUp(0,0,1),this.renderer.getActiveCamera().setFocalPoint(e[0],e[1],e[2]),this.renderer.getActiveCamera().setPosition(e[0],e[1]-2e3,e[2]),this.renderer.getActiveCamera().setThickness(1e4),this.renderer.getActiveCamera().setParallelProjection(!0)}getLutList(){return nT.rgbPresetNames}setActorProperties(){this.actor.getProperty().setScalarOpacityUnitDistance(0,30),this.actor.getProperty().setInterpolationTypeToLinear(),this.actor.getProperty().setUseGradientOpacity(0,!0),this.actor.getProperty().setGradientOpacityMinimumValue(0,2),this.actor.getProperty().setGradientOpacityMinimumOpacity(0,0),this.actor.getProperty().setGradientOpacityMaximumValue(0,20),this.actor.getProperty().setGradientOpacityMaximumOpacity(0,2),this.actor.getProperty().setShade(!0),this.actor.getProperty().setAmbient(state.ambient),this.actor.getProperty().setDiffuse(state.diffuse),this.actor.getProperty().setSpecular(state.specular),this.actor.getProperty().setSpecularPower(state.specularPower)}setupCropWidget(){const e=Rh.newInstance();e.setRenderer(this.renderer);const t=Kb.newInstance(),n=(e.addWidget(t),$b.newInstance()),r=t.getWidgetState().getCroppingPlanes();r.onModified(()=>{n.setCroppingPlanes(r.getPlanes())});let a=this.actor.getMapper(),o=a.getInputData();n.setCroppingPlanes(...o.getExtent()),t.copyImageDataDescription(o),t.set({faceHandlesEnabled:!0,edgeHandlesEnabled:!0,cornerHandlesEnabled:!0}),n.setInputData(o),a.setInputConnection(n.getOutputPort()),e.enablePicking(),this._widgetManager=e,this._cropWidget=t,this.renderWindow.render()}setupPGwidget(){let e=this.PGwidgetElement?this.PGwidgetElement.offsetWidth-5:300,t=this.PGwidgetElement?this.PGwidgetElement.offsetHeight-5:100;const n=DT.newInstance({numberOfBins:256,size:[e,t]});n.updateStyle({backgroundColor:"rgba(255, 255, 255, 0.6)",histogramColor:"rgba(50, 50, 50, 0.8)",strokeColor:"rgb(0, 0, 0)",activeColor:"rgb(255, 255, 255)",handleColor:"rgb(50, 150, 50)",buttonDisableFillColor:"rgba(255, 255, 255, 0.5)",buttonDisableStrokeColor:"rgba(0, 0, 0, 0.5)",buttonStrokeColor:"rgba(0, 0, 0, 1)",buttonFillColor:"rgba(255, 255, 255, 1)",strokeWidth:1,activeStrokeWidth:1.5,buttonStrokeWidth:1,handleWidth:1,iconSize:0,padding:1}),n.setContainer(this.PGwidgetElement),window.addEventListener("resize",e=>{n.setSize(this.PGwidgetElement.offsetWidth-5,this.PGwidgetElement.offsetHeight-5),n.render()}),this.PGwidget=n}updateWidget(){const e=this.actor.getMapper().getInputData().getPointData().getScalars();this.PGwidget.setDataArray(e.getData());let t=this.PGwidget.getGaussians();if(t.length>0){let e=t[0];e.position=this.wl,e.width=this.ww,this.PGwidget.setGaussians([e])}else{const e=1,t=0,n=0;this.PGwidget.addGaussian(this.wl,e,this.ww,n,t)}this.PGwidget.applyOpacity(this.ofun),this.PGwidget.setColorTransferFunction(this.ctfun),this.ctfun.onModified(()=>{this.PGwidget.render(),this.renderWindow.render()}),this._PGwidgetLoaded=!0}setWidgetCallbacks(){this.PGwidget.bindMouseListeners(),this.PGwidget.onAnimation(e=>{e?this.renderWindow.getInteractor().requestAnimation(this.PGwidget):this.renderWindow.getInteractor().cancelAnimation(this.PGwidget)}),this.PGwidget.onOpacityChange(e=>{if(this.PGwidget=e,this.gaussians=e.getGaussians().slice(),this.PGwidget.applyOpacity(this.ofun),this.renderWindow.getInteractor().isAnimating()||this.renderWindow.render(),this._rescaleLUT&&this.PGwidget){const e=this.PGwidget.getOpacityRange();this.ctfun.setMappingRange(...e),this.ctfun.updateRange()}})}setSampleDistance(e){this.actor.getMapper().setSampleDistance(e)}set blurOnInteraction(e){this._blurOnInteraction=e;let t=this.renderWindow.getInteractor(),n=this.actor.getMapper();e?(t.onLeftButtonPress(()=>{n.setSampleDistance(5*this._raysDistance)}),t.onLeftButtonRelease(()=>{n.setSampleDistance(this._raysDistance);let e=this.renderer.getActiveCamera();this._pickingPlane&&this._pickingPlane.setNormal(e.getDirectionOfProjection()),this.renderWindow.render()})):(t.onLeftButtonPress(()=>{n.setSampleDistance(this._raysDistance)}),t.onLeftButtonRelease(()=>{n.setSampleDistance(this._raysDistance);let e=this.renderer.getActiveCamera();this._pickingPlane&&this._pickingPlane.setNormal(e.getDirectionOfProjection()),this.renderWindow.render()}))}setupInteractor(){const e=GT.newInstance({button:1}),t=jT.newInstance({button:3,control:!0}),n=HT.newInstance({button:3,scrollEnabled:!0}),r=qT.newInstance({button:1,shift:!0});let a=this;r.setVerticalListener(-1,1,.001,function(){return a.wl},function(e){let t=a.wl+(e-a.wl)/25;a.wl=t;let n=a.PGwidget.getGaussians().slice();n[0].position=a.wl,a.PGwidget.setGaussians(n)}),r.setHorizontalListener(.1,2.1,.001,function(){return a.ww},function(e){let t=a.ww+(e-a.ww)/5;a.ww=t;let n=a.PGwidget.getGaussians().slice();n[0].width=a.ww,a.PGwidget.setGaussians(n)});const o=iC.newInstance();o.addMouseManipulator(r),o.addMouseManipulator(e),o.addMouseManipulator(t),o.addMouseManipulator(n),o.setCenterOfRotation(this.actor.getCenter()),this.renderWindow.getInteractor().setInteractorStyle(o),this.renderWindow.getInteractor().onMouseWheel(()=>this.resetMeasurementState()),this.renderWindow.getInteractor().onRightButtonPress(()=>this.resetMeasurementState())}resetMeasurementState(e){this._measurementState?(this._measurementState.p1=new Array(2),this._measurementState.p2=new Array(2),this._measurementState.p3=new Array(2),this._measurementState.p1_world=new Array(2),this._measurementState.p2_world=new Array(2),this._measurementState.p3_world=new Array(2),this._measurementState.label=null):e&&(e.p1=new Array(2),e.p2=new Array(2),e.p3=new Array(2),e.p1_world=new Array(2),e.p2_world=new Array(2),e.p3_world=new Array(2),e.label=null)}setTool(e,t,n){switch(this._leftButtonCb&&this._leftButtonCb.unsubscribe(),e){case"Length":case"Angle":this._initPicker(n,e);break;case"Rotation":this.resetMeasurementState(n),this.setupInteractor();break;default:console.warn("No tool found for",e)}}_initPicker(e,t){this.blurOnInteraction=!1;let n=this.renderWindow.getInteractor().getInteractorStyle().getMouseManipulators().filter(e=>"vtkMouseCameraTrackballRotateManipulator"==e.getClassName()).pop();this.renderWindow.getInteractor().getInteractorStyle().removeMouseManipulator(n);const r=CC.newInstance();if(r.setPickFromList(1),r.initializePickList(),!this._pickingPlane){const e=AC.newInstance({xResolution:1e3,yResolution:1e3});let t=this.renderer.getActiveCamera();e.setPoint1(0,0,1e3),e.setPoint2(1e3,0,0),e.setCenter(this.actor.getCenter()),e.setNormal(t.getDirectionOfProjection());const n=dd.newInstance();n.setInputConnection(e.getOutputPort());const r=bv.newInstance();r.setMapper(n),r.getProperty().setOpacity(.01),this.renderer.addActor(r),this._pickingPlane=e,this._planeActor=r}r.addPickList(this._planeActor),this._leftButtonCb=this.renderWindow.getInteractor().onLeftButtonPress(n=>{if(this.renderer!==n.pokedRenderer)return;const a=n.position,o=[a.x,a.y,0];if(r.pick(o,this.renderer),0===r.getActors().length){const e=r.getPickPosition();this.VERBOSE&&console.log(`No point picked, default: ${e}`)}else{const n=r.getPickedPositions()[0];this.VERBOSE&&console.log(`Picked: ${n}`);const a=BC.newInstance();a.setCoordinateSystemToWorld(),a.setValue(...n);const o=a.getComputedDisplayValue(this.renderer);!function(e,t,n,r){iS[r](e,t,n)}(e,o,n,t),this.VERBOSE&&console.log(e),this._measurementState=e}this.renderWindow.render()})}resetView(){let e=this.actor.getCenter();console.log(e),this.setCamera(e),this.renderWindow.render()}resize(){this._genericRenderWindow.resize()}destroy(){this.element=null,this._genericRenderWindow.delete(),this._genericRenderWindow=null,this.actor.getMapper().delete(),this.actor.delete(),this.actor=null,this._planeActor&&(this._planeActor.getMapper().delete(),this._planeActor.delete(),this._planeActor=null),this.PGwidgetElement&&(this.PGwidgetElement=null,this.PGwidget.delete(),this.PGwidget=null,this.gaussians=null),this._cropWidget&&(this._cropWidget.delete(),this._cropWidget=null)}}function lS(e,t){t.classHierarchy.push("vtkInteractorStyleMPRSlice"),t.trackballManipulator=GT.newInstance({button:1}),t.panManipulator=jT.newInstance({button:1,shift:!0}),t.zoomManipulator=HT.newInstance({button:3}),t.scrollManipulator=qT.newInstance({scrollEnabled:!0,dragEnabled:!1});const n={sliceNormal:[0,0,0],sliceRange:[0,0],slicePosition:[0,0,0]};function r(){const n=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(n[0],n[1],1,e.getSlice,e.setSlice)}let a=null,o=null;const i=e.setInteractor;e.setInteractor=(n=>{if(i(n),a&&(a.unsubscribe(),a=null),o&&(o.unsubscribe(),o=null),n){const i=n.getCurrentRenderer().getActiveCamera();a=i.onModified(()=>{r(),e.modified()}),o=n.onAnimation(()=>{const{slabThickness:e}=t,n=i.getDistance(),r=n-e/2,a=n+e/2;i.setClippingRange(r,a)})}}),e.handleMouseMove=ur.a.chain(e.handleMouseMove,()=>{const e=t.interactor.getCurrentRenderer(),{slabThickness:n}=t,r=e.getActiveCamera(),a=r.getDistance(),o=a-n/2,i=a+n/2;r.setClippingRange(o,i)});const s=e.setVolumeMapper;e.setVolumeMapper=(e=>{if(s(e)){const n=t.interactor.getCurrentRenderer().getActiveCamera();e?n.setFreezeFocalPoint(!0):n.setFreezeFocalPoint(!1)}}),e.getSlice=(()=>{const n=t.interactor.getCurrentRenderer().getActiveCamera(),r=e.getSliceNormal(),a=tb.buildFromDegree().identity().rotateFromDirections(r,[1,0,0]),o=n.getFocalPoint();return a.apply(o),o[0]}),e.setSlice=(n=>{const r=t.interactor.getCurrentRenderer().getActiveCamera();if(t.volumeMapper){const a=e.getSliceRange(),o=t.volumeMapper.getBounds(),i=function(e,t,n){return en?n:e}(n,...a),s=[(o[0]+o[1])/2,(o[2]+o[3])/2,(o[4]+o[5])/2],l=r.getDistance(),u=r.getDirectionOfProjection();Ya.normalize(u);const c=(a[1]+a[0])/2,d=[s[0]-u[0]*c,s[1]-u[1]*c,s[2]-u[2]*c],f=[d[0]+u[0]*i,d[1]+u[1]*i,d[2]+u[2]*i],p=[f[0]-u[0]*l,f[1]-u[1]*l,f[2]-u[2]*l];r.setPosition(...p),r.setFocalPoint(...f);const g=e.getOnScroll();g&&g(f)}}),e.getSliceRange=(()=>{if(t.volumeMapper){const r=e.getSliceNormal();if(r[0]===n.sliceNormal[0]&&r[1]===n.sliceNormal[1]&&r[2]===n.sliceNormal[2])return n.sliceRange;const a=function(e){return[[e[0],e[2],e[4]],[e[0],e[2],e[5]],[e[0],e[3],e[4]],[e[0],e[3],e[5]],[e[1],e[2],e[4]],[e[1],e[2],e[5]],[e[1],e[3],e[4]],[e[1],e[3],e[5]]]}(t.volumeMapper.getBounds()),o=tb.buildFromDegree().identity().rotateFromDirections(r,[1,0,0]);a.forEach(e=>o.apply(e));let i=1/0,s=-1/0;for(let e=0;e<8;e++){const t=a[e][0];t>s&&(s=t),t{if(t.volumeMapper&&t.interactor){return t.interactor.getCurrentRenderer().getActiveCamera().getDirectionOfProjection()}return[0,0,0]}),e.setSliceNormal=((n,r=[0,1,0])=>{const a=t.interactor.getCurrentRenderer().getActiveCamera();t.sliceNormal=[...n],t.viewUp=[...r];const o=[...n],i=[...r];if(t.volumeMapper){Ya.normalize(o);let n=t.volumeMapper;!t.volumeMapper.getInputData&&t.volumeMapper.getMapper&&(n=t.volumeMapper.getMapper());let r=function(e){if(9!==e.length)throw Error("Array not length 9");return[[e[0],e[1],e[2]],[e[3],e[4],e[5]],[e[6],e[7],e[8]]]}(n.getInputData().getDirection());Ya.transpose3x3(r,r),Ya.multiply3x3_vect3(r,o,o);let s=a.getFocalPoint(),l=a.getDistance(),u=a.getViewAngle();if(Number.isNaN(l)||void 0===l){const e=t.volumeMapper.getBounds(),n=Math.sqrt(Ya.distance2BetweenPoints([e[0],e[2],e[4]],[e[1],e[3],e[5]]));s=[(e[0]+e[1])/2,(e[2]+e[3])/2,(e[4]+e[5])/2],u=90,l=n/(2*Math.tan(u/360*Math.PI))}const c=[s[0]-o[0]*l,s[1]-o[1]*l,s[2]-o[2]*l];Ya.multiply3x3_vect3(r,i,i);const{slabThickness:d}=t;a.setPosition(...c),a.setDistance(l),a.setDirectionOfProjection(...o),a.setViewUp(...i),a.setViewAngle(u),a.setClippingRange(l-d/2,l+d/2),e.setCenterOfRotation(s)}}),e.setSlabThickness=(e=>{t.slabThickness=e;const n=t.interactor.getCurrentRenderer().getActiveCamera(),r=n.getDistance();n.setClippingRange(r-e/2,r+e/2)}),e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulator),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),r()}const uS={slabThickness:.1};function cS(e,t,n={}){Object.assign(t,uS,n),iC.extend(e,t,n),ur.a.setGet(e,t,["volumeMapper","onScroll"]),ur.a.get(e,t,["slabThickness","viewUp"]),lS(e,t)}const dS=ur.a.newInstance(cS,"vtkInteractorStyleMPRSlice");var fS=Object.assign({newInstance:dS,extend:cS});const{States:pS}=zg;function gS(e,t){t.classHierarchy.push("vtkInteractorStyleMPRWindowLevel"),t.trackballManipulator=GT.newInstance({button:1}),t.panManipulatorShift=jT.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=jT.newInstance({button:3,control:!0}),t.zoomManipulator=HT.newInstance({button:3}),t.scrollManipulator=qT.newInstance({scrollEnabled:!0,dragEnabled:!1});const n=e.handleMouseMove;e.handleMouseMove=(r=>{const a=[r.position.x,r.position.y];t.state===pS.IS_WINDOW_LEVEL&&(e.windowLevelFromMouse(a),e.invokeInteractionEvent({type:"InteractionEvent"})),n&&n(r)});const r=e.setVolumeMapper;e.setVolumeMapper=(e=>{if(r(e)){const n=t.interactor.getCurrentRenderer().getActiveCamera();e?n.setFreezeFocalPoint(!0):n.setFreezeFocalPoint(!1)}}),e.windowLevelFromMouse=(([n,r])=>{const a=t.volumeMapper.getMapper().getInputData().getPointData().getScalars().getRange(),o=(a[1]-a[0])/1024*t.levelScale,i=(n-t.wlStartPos[0])*o,s=(r-t.wlStartPos[1])*o*.5;let{windowWidth:l,windowCenter:u}=e.getWindowLevel();l=Math.max(1,Math.round(l+i)),u=Math.round(u+s),e.setWindowLevel(l,u),t.wlStartPos=[n,r];const c=e.getOnLevelsChanged();c&&c({windowCenter:u,windowWidth:l})}),e.getWindowLevel=(()=>{return function(e,t){const n=Math.abs(e-t);return{windowWidth:n,windowCenter:e+n/2}}(...t.volumeMapper.getProperty().getRGBTransferFunction(0).getMappingRange().slice())}),e.setWindowLevel=((e,n)=>{const r=function(e,t){return{lower:t-e/2,upper:t+e/2}}(e,n);t.volumeMapper.getProperty().getRGBTransferFunction(0).setMappingRange(r.lower,r.upper)});const a=e.handleLeftButtonPress;e.handleLeftButtonPress=(n=>{t.wlStartPos=[n.position.x,n.position.y],n.shiftKey||n.controlKey?a&&a(n):e.startWindowLevel()}),e.superHandleLeftButtonRelease=e.handleLeftButtonRelease,e.handleLeftButtonRelease=(()=>{switch(t.state){case pS.IS_WINDOW_LEVEL:e.endWindowLevel();break;default:e.superHandleLeftButtonRelease()}}),e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),function(){const n=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(n[0],n[1],1,e.getSlice,e.setSlice)}()}const mS={wlStartPos:[0,0],levelScale:1};function vS(e,t,n={}){Object.assign(t,mS,n),fS.extend(e,t,n),ur.a.setGet(e,t,["volumeMapper","onLevelsChanged","levelScale"]),gS(e,t)}const hS=ur.a.newInstance(vS,"vtkInteractorStyleMPRWindowLevel");var yS=Object.assign({newInstance:hS,extend:vS});const{States:bS}=zg;function TS(e,t){function n(t){const n=[t.position.x,t.position.y],r=t.pokedRenderer,a=e.getOnClickCallback(),o=BC.newInstance();o.setCoordinateSystemToDisplay(),o.setValue(n[0],n[1],0);const i=o.getComputedWorldValue(r);i.length&&a({worldPos:i,displayPos:n}),e.invokeInteractionEvent({type:"InteractionEvent"})}t.classHierarchy.push("vtkInteractorStyleMPRCrosshairs"),t.trackballManipulator=GT.newInstance({button:1}),t.panManipulatorShift=jT.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=jT.newInstance({button:3,control:!0}),t.zoomManipulator=HT.newInstance({button:3}),t.scrollManipulator=qT.newInstance({scrollEnabled:!0,dragEnabled:!1});const r=e.handleMouseMove;e.handleMouseMove=(e=>{t.state===bS.IS_SLICE&&n(e),r&&r(e)});const a=e.handleLeftButtonPress;e.handleLeftButtonPress=(r=>{r.shiftKey||r.controlKey?a&&a(r):t.volumeMapper&&(n(r),e.startSlice())});const o=e.setVolumeMapper;e.setVolumeMapper=(e=>{if(o(e)){const n=t.interactor.getCurrentRenderer().getActiveCamera();e?n.setFreezeFocalPoint(!0):n.setFreezeFocalPoint(!1)}}),e.superHandleLeftButtonRelease=e.handleLeftButtonRelease,e.handleLeftButtonRelease=(()=>{switch(t.state){case bS.IS_SLICE:e.endSlice();break;default:e.superHandleLeftButtonRelease()}}),e.removeAllMouseManipulators(),e.addMouseManipulator(t.trackballManipulator),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),function(){const n=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(n[0],n[1],1,e.getSlice,e.setSlice)}()}const CS={};function SS(e,t,n={}){Object.assign(t,CS,n),fS.extend(e,t,n),ur.a.setGet(e,t,["volumeMapper","onClickCallback"]),TS(e,t)}const PS=ur.a.newInstance(SS,"vtkInteractorStyleMPRCrosshairs");var wS=Object.assign({newInstance:PS,extend:SS});const{States:xS}=zg;function OS(e,t){function n(){e.removeAllMouseManipulators(),e.addMouseManipulator(t.panManipulatorShift),e.addMouseManipulator(t.panManipulatorCtrl),e.addMouseManipulator(t.zoomManipulator),e.addMouseManipulator(t.scrollManipulator),e.addMouseManipulator(t.leftManipulator),function(){const n=e.getSliceRange();t.scrollManipulator.removeScrollListener(),t.scrollManipulator.setScrollListener(n[0],n[1],1,e.getSlice,e.setSlice)}()}t.classHierarchy.push("vtkInteractorStyleMPRPanZoom"),t.panManipulatorShift=jT.newInstance({button:3,shift:!0}),t.panManipulatorCtrl=jT.newInstance({button:3,control:!0}),t.zoomManipulator=HT.newInstance({button:3}),t.scrollManipulator=qT.newInstance({scrollEnabled:!0,dragEnabled:!1}),e.setLeftButton=(e=>{"zoom"==e?t.leftManipulator=HT.newInstance({button:1}):"pan"==e?t.leftManipulator=jT.newInstance({button:1}):console.error("No tool found for",e),n()}),t.leftButtonTool||(t.leftButtonTool="pan"),e.setLeftButton(t.leftButtonTool),n();const r=e.setInteractor;e.setInteractor=(n=>{if(r(n),null===n)return;let a="pan"==t.leftButtonTool?e.getOnPanChanged():e.getOnZoomChanged();n.onAnimation(a)})}const MS={wlStartPos:[0,0],levelScale:1};function AS(e,t,n={}){Object.assign(t,MS,n),fS.extend(e,t,n),ur.a.setGet(e,t,["volumeMapper","onPanChanged","onZoomChanged","levelScale"]),OS(e,t)}const IS=ur.a.newInstance(AS,"vtkInteractorStyleMPRPanZoom");var RS=Object.assign({newInstance:IS,extend:AS});const ES=[[0,0,1],[-1,0,0],[0,1,0]],DS=[[0,-1,0],[0,0,1],[0,0,1]];class VS{constructor(e,t,n){this.VERBOSE=!1,this._key=e,this._element=n,this._volume=null,this._renderer=null,this._parallel=!0,this.slicePlaneNormal=ES[t],this.sliceViewUp=DS[t],this.slicePlaneXRotation=0,this.slicePlaneYRotation=0,this.viewRotation=0,this._sliceThickness=.1,this._blendMode="MIP",this.window={width:0,center:0},this._cachedSlicePlane=[...this.slicePlaneNormal],this._cachedSliceViewUp=[...this.sliceViewUp],this._genericRenderWindow=wv.newInstance({background:[0,0,0]}),this._genericRenderWindow.setContainer(n),this._renderWindow=this._genericRenderWindow.getRenderWindow(),this._renderer=this._genericRenderWindow.getRenderer(),this._parallel&&this._renderer.getActiveCamera().setParallelProjection(!0),this._genericRenderWindow.getOpenGLRenderWindow().buildPass(!0),this.onResize()}set blendMode(e){this._blendMode=e,this.updateBlendMode(this._sliceThickness,this._blendMode)}set sliceThickness(e){this._sliceThickness=e;const t=this._renderWindow.getInteractor().getInteractorStyle();t.setSlabThickness&&t.setSlabThickness(this._sliceThickness),this.updateBlendMode(this._sliceThickness,this._blendMode)}set wwwl([e,t]){this.window.center=t,this.window.width=e,this._genericRenderWindow.getRenderWindow().render()}get camera(){return this._genericRenderWindow.getRenderer().getActiveCamera()}initView(e,t,n,r){this._volume=e;const a=fS.newInstance();a.setOnScroll(n),this._renderWindow.getInteractor().setInteractorStyle(a),this.VERBOSE&&console.log(this._volumes);const o=this._volume.getMapper();a.setVolumeMapper(o);const i=a.getSliceRange();a.setSlice((i[0]+i[1])/2),this.updateVolumesForRendering(),this.VERBOSE&&console.log("view data",this._key,t.views[this.key]),this.updateSlicePlane(t.views[this._key]),this.fill2DView(this._genericRenderWindow,this._key),r()}updateVolumesForRendering(){this._renderer.removeAllVolumes(),this._volume&&(this._volume.isA("vtkVolume")?this._renderer.addVolume(this._volume):console.warn("Data to is not vtkVolume data")),this._renderWindow.render()}updateSlicePlane(e){let t=this._cachedSlicePlane,n=this._cachedSliceViewUp;this.VERBOSE&&console.log(e);let r=[];i.cross(r,e.sliceViewUp,e.slicePlaneNormal),i.normalize(r,r);let a=e.sliceViewUp;const s=o.create();o.rotate(s,s,rS(e.slicePlaneYRotation),a),o.rotate(s,s,rS(e.slicePlaneXRotation),r),this.VERBOSE&&console.log(t,e.slicePlaneNormal,s),i.transformMat4(t,e.slicePlaneNormal,s);const u=l.create();l.setAxisAngle(u,t,rS(-e.viewRotation)),l.normalize(u,u);const c=l.create();l.setAxisAngle(c,r,rS(e.slicePlaneXRotation)),l.normalize(c,c);const d=l.create();l.add(d,c,u),i.transformQuat(n,e.sliceViewUp,u);const f=this._genericRenderWindow.getRenderWindow(),p=f.getInteractor().getInteractorStyle();p&&p.setSliceNormal&&p.setSliceNormal(t,n),f.render()}fill2DView(){const e=this._renderer.computeVisiblePropBounds(),t=[(e[1]-e[0])/2,(e[3]-e[2])/2,(e[5]-e[4])/2],n=this._genericRenderWindow.getContainer().clientWidth/this._genericRenderWindow.getContainer().clientHeight;let r,a;"left"===this._key?(r=t[1],a=t[2]):"front"===this._key?(r=t[0],a=t[2]):"top"===this._key&&(r=t[0],a=t[1]),n>=r/a?this._renderer.getActiveCamera().setParallelScale(a+1):this._renderer.getActiveCamera().setParallelScale(r/n+1),this.onResize()}onResize(){this._genericRenderWindow.resize()}updateBlendMode(e,t){if(e>=1)switch(t){case"MIP":this._volume.getMapper().setBlendModeToMaximumIntensity();break;case"MINIP":this._volume.getMapper().setBlendModeToMinimumIntensity();break;case"AVG":this._volume.getMapper().setBlendModeToAverageIntensity();break;case"none":default:this._volume.getMapper().setBlendModeToComposite()}else this._volume.getMapper().setBlendModeToComposite();this._renderWindow.render()}setInteractor(e){const t=this._genericRenderWindow.getRenderWindow(),n=t.getInteractor().getInteractorStyle();t.getInteractor().setInteractorStyle(e),e.setInteractor(t.getInteractor()),t.getInteractor().setInteractorStyle(e),e.setSliceNormal&&n.getSliceNormal()&&e.setSliceNormal(n.getSliceNormal(),n.getViewUp()),e.setSlabThickness&&n.getSlabThickness()&&e.setSlabThickness(n.getSlabThickness()),e.setVolumeMapper(this._volume)}destroy(){this.VERBOSE&&console.log("DESTROY",this._key),this.VERBOSE=null,this._key=null,this._element=null,this._volume.getMapper()&&this._volume.getMapper().delete(),this._volume.delete(),this._volume=null,this._renderer.delete(),this._renderer=null,this._parallel=null,this.slicePlaneNormal=null,this.sliceViewUp=null,this.slicePlaneXRotation=null,this.slicePlaneYRotation=null,this.viewRotation=null,this._sliceThickness=null,this._blendMode=null,this.window=null,this._cachedSlicePlane=null,this._cachedSliceViewUp=null,this._genericRenderWindow.delete()}}class LS{constructor(e){this.VERBOSE=!1,this.syncWindowLevels=!0,this._activeTool=null,this.elements=e,this.volume=null,this.sliceIntersection=[0,0,0],this.mprViews={},this.initMPR()}set wwwl([e,t]){const n=t-e/2,r=t+e/2;this.volume.getProperty().getRGBTransferFunction(0).setMappingRange(n,r),Object.keys(this.elements).forEach((n,r)=>{this.mprViews[n].wwwl=[e,t]})}initMPR(){Object.keys(this.elements).forEach((e,t)=>{try{this.mprViews[e]=new VS(e,t,this.elements[e].element)}catch(t){console.error("Error creating MPRView",e),console.error(t)}}),this.VERBOSE&&console.log("initialized")}getInitialState(){let e=Object.keys(this.mprViews).reduce((e,t)=>{let{slicePlaneNormal:n,sliceViewUp:r,slicePlaneXRotation:a,slicePlaneYRotation:o,viewRotation:i,_sliceThickness:s,_blendMode:l,window:u}=e[t];return e[t]={slicePlaneNormal:n,sliceViewUp:r,slicePlaneXRotation:a,slicePlaneYRotation:o,viewRotation:i,sliceThickness:s,blendMode:l,window:u},e},Object.assign({},this.mprViews));return{interactorCenters:Object.keys(this.elements).reduce((e,t)=>({...e,[t]:[0,0]}),{}),sliceIntersection:[...this.sliceIntersection],views:e}}setImage(e,t){let n=oS(t);this.volume=n,this.sliceIntersection=function(e){const t=e.getBounds();return[(t[0]+t[1])/2,(t[2]+t[3])/2,(t[4]+t[5])/2]}(n.getMapper()),e.sliceIntersection=[...this.sliceIntersection],Object.keys(this.elements).forEach(t=>{this.mprViews[t].initView(n,e,()=>{this.onScrolled.call(this,e)},()=>{this.onScrolled.call(this,e)})}),this._activeTool&&this.setTool(this._activeTool,e)}setTool(e,t){switch(e){case"level":this.setLevelTool(t);break;case"crosshair":this.setCrosshairTool(t);break;case"zoom":this.setZoomTool(t);break;case"pan":this.setPanTool(t)}}setPanTool(e){Object.entries(e.views).forEach(([t])=>{const n=RS.newInstance({leftButtonTool:"pan"});n.setOnScroll(()=>{this.onScrolled(e)}),n.setOnPanChanged(()=>{this.updateInteractorCenters(e)}),this.mprViews[t].setInteractor(n)}),this._activeTool="pan"}setZoomTool(e){Object.entries(e.views).forEach(([t])=>{const n=RS.newInstance({leftButtonTool:"zoom"});n.setOnScroll(()=>{this.onScrolled(e)}),n.setOnZoomChanged(()=>{this.updateInteractorCenters(e)}),this.mprViews[t].setInteractor(n)}),this._activeTool="zoom"}setLevelTool(e){Object.entries(e.views).forEach(([t])=>{const n=yS.newInstance();n.setOnScroll(()=>{this.onScrolled(e)}),n.setOnLevelsChanged(n=>{this.updateLevels({...n,srcKey:t},e)}),this.mprViews[t].setInteractor(n)}),this._activeTool="level"}setCrosshairTool(e){let t=this;Object.entries(e.views).forEach(([n])=>{const r=wS.newInstance();r.setOnScroll(()=>{t.onScrolled(e)}),r.setOnClickCallback(({worldPos:r})=>{t.onCrosshairPointSelected({worldPos:r,srcKey:n},e)}),this.mprViews[n].setInteractor(r)}),this._activeTool="crosshair"}onCrosshairPointSelected({srcKey:e,worldPos:t},n){Object.keys(this.elements).forEach(r=>{if(r!==e){const e=this.mprViews[r]._genericRenderWindow.getRenderWindow(),n=e.getInteractor().getInteractorStyle(),a=n.getSliceNormal(),o=tb.buildFromDegree().identity().rotateFromDirections(a,[1,0,0]),i=t.slice();o.apply(i);const s=i[0];n.setSlice(s),e.render()}this.updateInteractorCenters(n)}),this.sliceIntersection=[...t],n.sliceIntersection=[...t]}updateLevels({windowCenter:e,windowWidth:t,srcKey:n},r){r.views[n].window.center=e,r.views[n].window.width=t,this.syncWindowLevels&&Object.keys(this.elements).filter(e=>e!==n).forEach(n=>{this.mprViews[n].wwwl=[t,e]})}onScrolled(e){let t=[];Object.keys(this.elements).forEach(e=>{const n=this.mprViews[e].camera;t.push({position:n.getFocalPoint(),normal:n.getDirectionOfProjection()})});const n=aS(...t);return Number.isNaN(n)||n.some(e=>Number.isNaN(e))||(this.sliceIntersection=[...n],e.sliceIntersection=[...n],this.VERBOSE&&console.log("updating slice intersection",n)),this.updateInteractorCenters(e),n}onRotate(e,t,n,r){switch(e){case"top":"x"===t?r.views.front.slicePlaneYRotation=n:"y"===t&&(r.views.left.slicePlaneYRotation=n);break;case"left":"x"===t?r.views.top.slicePlaneXRotation=n:"y"===t&&(r.views.front.slicePlaneXRotation=n);break;case"front":"x"===t?r.views.top.slicePlaneYRotation=n:"y"===t&&(r.views.left.slicePlaneXRotation=n)}Object.keys(this.elements).filter(t=>t!==e).forEach(e=>{this.mprViews[e].updateSlicePlane(r.views[e])}),this.VERBOSE&&console.log("afterOnRotate",r)}onThickness(e,t,n,r){const a=n>1;let o;switch(e){case"top":"x"===t?o="front":"y"===t&&(o="left");break;case"left":"x"===t?o="top":"y"===t&&(o="front");break;case"front":"x"===t?o="top":"y"===t&&(o="left")}a&&"none"===this.mprViews[o].blendMode&&(this.mprViews[o].blendMode="MIP",r.mprViews[o].blendMode="MIP"),this.mprViews[o].sliceThickness=n,r.views[o].sliceThickness=n}updateInteractorCenters(e){Object.keys(this.elements).forEach(t=>{const n=this.mprViews[t]._genericRenderWindow.getRenderer(),r=BC.newInstance();r.setCoordinateSystemToWorld(),r.setValue(...this.sliceIntersection);const a=r.getComputedDisplayValue(n);this.VERBOSE&&console.log("interactor center",t,a),e.interactorCenters[t]=a})}resize(e,t){t?this.mprViews[t].onResize():Object.values(this.mprViews).forEach(e=>{e.onResize()}),this.updateInteractorCenters(e)}destroy(){Object.keys(this.elements).forEach(e=>{this.mprViews[e].destroy()})}}n.d(t,"MPRManager",function(){return LS}),n.d(t,"VRView",function(){return sS}),n.d(t,"loadDemoSerieWithLarvitar",function(){return nS}),n.d(t,"buildVtkVolume",function(){return eS})}])}); \ No newline at end of file